Good evening dear ladies and gentil men,
i come to you in great distress. Namely beeing that i seem to have shot the ability of gadgets to retrieve a environment.
https://github.com/PicassoCT/Journeywar ... s.lua#L669
Many of the more complex units in my game rely on this ability and are thuse useless.
It also seems that all the Unitscript tables are missing from the environment.
These are tables such as COB, SFX etc.
My unit_script.lua is very close to the Zero-k one in setup. I shall compare it next to the spring default unitscript.lua.
https://github.com/PicassoCT/Journeywar ... script.lua
If you have any advice or direction - i would be gratefull.
Regards and have a nice evening
Lua Script Environment Problem
Moderator: Moderators
Re: Lua Script Environment Problem
Are you sure attackerID is not nil?
Re: Lua Script Environment Problem
I do get a number, it is not the attackerID though.
I investigated further- seems that the arguments with which my UnitDamaged is called, do not include the projectile ID.
And solved it:
Here is what happened, i had old code in my gadgets.lua
which had commented out callins for
gadget:UnitDamaged
gadget:PreUnitDamaged
The old code had been re-formatted by a formation tool, which added a space betwee the uncomment mark
Reactivating the dead code- let this be a warning to future generations. Delete old code.
I investigated further- seems that the arguments with which my UnitDamaged is called, do not include the projectile ID.
And solved it:
Here is what happened, i had old code in my gadgets.lua
which had commented out callins for
gadget:UnitDamaged
gadget:PreUnitDamaged
Code: Select all
--[[ Old
Here be old Code
--]]
Code: Select all
-- [[