Using OnAIUpdate with a device that takes time to recharge

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

Re: Using OnAIUpdate with a device that takes time to rechar

Post by JohnBWatson » Fri Jul 01, 2016 1:48 am

So there's no need to check for Nil on object variables(like Target)?

NMS
Militia Commander
Militia Commander
Posts: 345
Joined: Tue Mar 05, 2013 8:26 am

Re: Using OnAIUpdate with a device that takes time to rechar

Post by NMS » Fri Jul 01, 2016 2:15 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

Who is online

Users browsing this forum: No registered users and 1 guest