So this is something I'm just drawing up now; syntax may be off but meh;
Quote:
(global long status_byte 0)
(global short current_bot 0)
(global AI activebot NONE)
(script stub AI bots activebot)
(script continuous status_magick
(if (< 0 (unit_get_health (unit (list_get (ai_actors (bots)) current_bot))))(set status_byte (bit_toggle status_byte current_bot 1) (set status_byte (bit_toggle status_byte current_bot 0)
(if (>= (ai_living_count (bots)) current_bot)(set current_bot 0)(set current_bot (+ 1 current_bot))
)
Minus any syntax or verbiage errors (I'm not at home, don't have a debugger handy) That script should go through every AI in the encounter that I set to be "activebot", and flip a bit in the global "status_byte" to true if the AI is alive, or false if the AI is dead.
However bit_toggle doesn't toggle anything. Even using the command manually, ingame or through sapien, it returns a 0 and no change is made to the global "status_byte".
Any idea why this would happen? Do the commands function as described, are there any known issues with them? I recall having used the functions properly on a separate mapfile but can't be certain now that it was working proper.
Edited by DeadHamster on Mar 1, 2017 at 04:49 PM