Community Forum

Load effect in LUA scrip

Forum Overview >> Scripting

CategoryScripting
Created22.02.2020 17:50


Kenny Je (kenny456) 22.02.2020 17:50
Hi, i want to load levelerEffect in my lua script to object in i3d file, which i loaded to the script. I tried "g_effectManager:loadFromNode(node, parent)"
But what is those two attributes? I set first attribute to "I3DUtil.indexToObject(spec.heap, '0|1')" and second attribute to "self", but game log says "LinkNode is nil in node attribute 'mesh'" probably from function "Effect:loadEffectAttributes" on line 119.

Bilbo Beutlin (BBeutlin) 22.02.2020 18:31
Instead "self" use "self.rootNode".

Kenny Je (kenny456) 22.02.2020 19:18
I tried that, but something is wrong:
Error: Running LUA method 'loadSharedI3DFileFinished'.
dataS/scripts/effects/EffectManager.lua(77) : attempt to index local 'parent' (a number value)


Kenny Je (kenny456) 23.02.2020 12:39
Solved. I did it with function "g_effectManager:loadEffect" with my own created xml file.
Thread can be closed.


Note: Log in to post. Create a new account here.