Adding features to animation.addVfx and world.vfx.spawn
I've been experimenting with these two API calls in a few mods I released recently, and wanted to ask some questions about whether it's feasible for certain enhancements to be added to them, and how difficult it would be to do so.
-
Certain actions like passing game time in the Rest or Training menus, will wipe all attached VFX created by
addVfxorworld.vfx.spawn. Is it possible to have some sort of event broadcast througheventHandlerswhen all VFX is cleared, so my script knows it has to re-attach it's VFX objects? -
It would be helpful to have
removeVfxandremoveAllVfxadded as handled events inanimationcontroller.lua, asaddVfxcurrently is. Apart from allowing global scripts to remove VFX from an actor, it also allows a common way for different mods to notify each other when they're about to wipe an actor's VFX. -
Adding a
loopkey to the options table forworld.vfx.spawn, so the VFX can be force looped. Also, the ability to specify a rotation for the VFX in addition to a position, though I don't know if the engine actually supports that for VFX models. -
I mentioned in !8198 about
addVfxusing a forced lighting 'hack' to set the emissive properties of VFX models to 100%, with currently no option to skip that. -
I've also found that using a model path with
addVfxadds that path to a list of meshes that the raycasting system will permanently ignore. While I expect this happens for a good reason, it can have unintended consequences. If you use something like a potion model withaddVfx, you will then be unable to pick up or interact with any game object that uses that same model. Adding an option in theaddVfxcall to bypass the ignore list would be great, but I don't know if this creates bugs in the rendering system further down the line. -
Would the engine support spawned VFX being turned into an object that can be controlled by lua script? Something like
local vfx = world.spawn.vfx(<variables>), and then usingvfx:teleport()or similar command to allow animating the VFX in the game world.
This ended up as a bit of a long list, but thanks to anyone who looks through it.