Using OnAIUpdate with a device that takes time to recharge

A place to discuss mods in development and concepts for new mods.
JohnBWatson
Fleet Officer
Fleet Officer
Posts: 1452
Joined: Tue Aug 19, 2014 10:17 pm

So there's no need to check for Nil on object variables(like Target)?
NMS
Militia Captain
Militia Captain
Posts: 569
Joined: Tue Mar 05, 2013 8:26 am

If (objGetTarget gSource) returns nil, then (setq target (objGetTarget gSource)) also returns nil, so (and ... (setq target (objGetTarget gSource)) ...) returns nil and nothing happens.


Also:
JohnBWatson wrote:In addition, does anyone know what powerToActivate is, exactly? It would be immensely helpful if I had a formula that could convert that value to an integer to be used by our makeshift timer.
I believe powerToActivate is the amount of energy required to activate the device or fully charge the capacitor in real fuel units (1 He3 fuel rod = 2500). It won't affect the AI because the game doesn't track nonplayer objects' fuel and energy use.
Post Reply