A Community discussion forum for Halo Custom Edition, Halo 2 Vista, Portal and Halo Machinima

Home  Search Register  Login Member ListRecent Posts
  
 
»Forums Index »Halo Custom Edition (Bungie/Gearbox) »Halo CE General Discussion »OpenSauce Scripts "bit_toggle" and "bit_test"

Author Topic: OpenSauce Scripts "bit_toggle" and "bit_test" (2 messages, Page 1 of 1)
Moderators: Dennis

DeadHamster
Joined: Jun 8, 2014

https://discord.gg/Neu4EJM


Posted: Mar 1, 2017 04:38 PM    Msg. 1 of 2       
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


Super Flanker
Joined: Oct 5, 2012

The length of your life depends on my aim.


Posted: Mar 1, 2017 05:23 PM    Msg. 2 of 2       
Quote: --- Original message by: DeadHamster


(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))
)


Sorry my OCD couldn't resist.

 

 
Previous Older Thread    Next newer Thread







Time: Thu January 19, 2023 8:33 AM 140 ms.
A Halo Maps Website