Hello All,
I'm looking for a way to spawn multiple objects without using fixed object numbers in scripts, so I know of
Spawn(100)
Spawn(101) etc
But I need to get the entity number and spawn it like
Spawn(object)
The trouble I'm having is identifying another object entityid's from a single script, like a tree falling and spawning a log multiple times over a map
I tried to call a script eg log.lua which only had Spawn(e) as the main function but either the script call didn't work or the function didn't and I couldn't work out which. So this was attached to the object that needed spawning...
-- LUA Script - precede every function and global member with lowercase name of script + '_main'
function log_init(e)
Include ("\\pickup.lua")
end
function log_main(e)
Spawn(e)
SwitchScript ( e,"pickup" )
end
I'm calling this script in the same way but once the tree has fallen, health=0 but nothing happens, is there a better way to achieve this ? - I have checked the directory paths and any typos for the include and switch scripts.
Thanks