OpenMW Lua

1560 Members
https://openmw.org/ || Rules: https://rentry.co/omw_rules || Other rooms related to OpenMW: #openmw-space:matrix.org6 Servers

Load older messages

30 Nov 2023
@_discord_414058251299192832:t2bot.iowazabear e.g. you can freely spawn meshes in the world and control their scale, position, etc... for a spark effect or blood splatter 23:37:55
@_discord_414058251299192832:t2bot.iowazabear or get a reference to the players base node and attach a mesh to a bone 23:38:18
@_discord_477907627318312991:t2bot.iomaxyari thats pre cool, what about read-only browsing of nodes atleast? I imagine this can be very usefull 23:38:44
@_discord_477907627318312991:t2bot.iomaxyari even if parenting is only to named nodes, one can just manually parent to anything if one can read nodes position every frame 23:39:08
@_discord_414058251299192832:t2bot.iowazabear I want it but there is too much pushback. I don't want to write essays and argue, it's not something I enjoy. 23:39:29
@_discord_477907627318312991:t2bot.iomaxyari yea, haha, I can feel that 23:39:55
@_discord_414058251299192832:t2bot.iowazabear This will be a good stepping stone at least, and doesn't shoehorn the API into any corners. 23:40:12
@_discord_477907627318312991:t2bot.iomaxyari dont enjoy it either 23:40:12
@_discord_477907627318312991:t2bot.iomaxyari well, sounds quite exciting honestly 23:40:43
@_discord_477907627318312991:t2bot.iomaxyari attaching things to bones sounds pretty handy especially 23:41:41
1 Dec 2023
@_discord_237712957604102144:t2bot.iojohnnyhostile I seem to be consistently getting points in the water when I do this:
nearby.findRandomPointAroundCircle(position, radius, {includeFlags = nearby.NAVIGATOR_FLAGS.Walk})

nearby.findNearestNavMeshPosition() does it too. Am I doing something wrong?
@_discord_127678330722844672:t2bot.iozackhasacat Deep or shallow water? 00:17:16
@_discord_237712957604102144:t2bot.iojohnnyhostile Both; for example when I choose points in Seyda Neen I'll always get some in the shallows but every now and then I'll get one in the deep by the silt strider. Vivec City I'd say the majority of points I get are in the water. 00:18:00
Download screenshot285.png
@_discord_549835822111916036:t2bot.ioe1sid I made a mod which spawns pillows at coordinates generated by findRandomPointAroundCircle and it seems to work as expected:

local world = require('openmw.world')

local function onFindRandomPointAroundCircle(position)
    pillow = world.createObject('misc_uni_pillow_01', 1)
    pillow:teleport('', position)

return {
    eventHandlers = {
        findRandomPointAroundCircle = onFindRandomPointAroundCircle,

local core = require('openmw.core')
local nearby = require('openmw.nearby')
local self = require('openmw.self')

local function onUpdate()
    local radius = 4096
    local options = {includeFlags = nearby.NAVIGATOR_FLAGS.Walk}
    local position = nearby.findNearestNavMeshPosition(self.position, options)
    local result = nearby.findRandomPointAroundCircle(position, radius, options)
    core.sendGlobalEvent('findRandomPointAroundCircle', result)

return {
    engineHandlers = {
        onUpdate = onUpdate,
@_discord_549835822111916036:t2bot.ioe1sid The thing is navmesh covers a surface so underwater ground has one. There is a small strip at the shore where there is none. 01:29:32
@_discord_549835822111916036:t2bot.ioe1sid Probably we could define underwater ground and above the water as different type of areas. 01:30:28
@_discord_549835822111916036:t2bot.ioe1sid Still there is always small part of the shallow water covered by Walk navmesh area. 01:31:19
@_discord_127678330722844672:t2bot.iozackhasacat You could just keep going until you get a point above 0 zpos 01:31:36
@_discord_127678330722844672:t2bot.iozackhasacat Or if there was a function to get the cell water level 01:31:45
Download screenshot286.png
@_discord_549835822111916036:t2bot.ioe1sid There might be a problem with this. findNearestNavMeshPosition selects a point on the nearest navmesh but findRandomPointAroundCircle chooses one only on the same component (https://en.wikipedia.org/wiki/Component_(graph_theory)). For example if I stay too close to a house roof, I start to get pillows only there. The same is with underwater/above water since those are different navmesh components. 01:38:44
@_discord_127678330722844672:t2bot.iozackhasacat Yes, you wouldn't wan to try again forever 01:39:17
@_discord_127678330722844672:t2bot.iozackhasacat Sadly, navmesh is also generated underneath buildings 01:39:51
@_discord_127678330722844672:t2bot.iozackhasacat sometimes at least 01:39:55
@_discord_127678330722844672:t2bot.iozackhasacat so you can''t just pick a random huge area. You might also want to check if you can path to it 01:40:10
@_discord_549835822111916036:t2bot.ioe1sid Yeah, it would be nice to have some heuristics to avoid generating navmesh for some of the surfaces. 01:42:30
@_discord_237712957604102144:t2bot.iojohnnyhostile Thank you, I think this was the key to understanding what I was doing wrong. I thought I could use 0 for z when calculating a cell's center, then find the point from there but this explains why I got underwater points in Vivec City. Now when I use the player's z I get much more sensible points. 02:09:11
@_discord_237712957604102144:t2bot.iojohnnyhostile .. I do seem to still get deep underwater points but I think I can weed those results out. 02:18:12
@_discord_127678330722844672:t2bot.iozackhasacat changed their profile picture.20:51:20

There are no newer messages yet.

Back to Room ListRoom Version: 6