Page 1 of 1

Lua Script Environment Problem

Posted: 15 Feb 2018, 00:16
by PicassoCT
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

Re: Lua Script Environment Problem

Posted: 15 Feb 2018, 03:56
by gajop
Are you sure attackerID is not nil?

Re: Lua Script Environment Problem

Posted: 15 Feb 2018, 12:23
by PicassoCT
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

Code: Select all

--[[ Old
Here be old Code

--]]
The old code had been re-formatted by a formation tool, which added a space betwee the uncomment mark

Code: Select all

-- [[

Reactivating the dead code- let this be a warning to future generations. Delete old code.