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 Technical / Map Design »If and Else Scripts

Author Topic: If and Else Scripts (4 messages, Page 1 of 1)
Moderators: Dennis

1337
Joined: Dec 2, 2011

Don't be daft. wrap your shaft


Posted: Jun 14, 2012 02:28 AM    Msg. 1 of 4       
So hi guys, I was just wondering how I am meant to use if and else in halo scripts. mostly the else part, because I can't seem to find any documentation on how its used

Thanks


ally
Joined: Jun 23, 2010

Aye Ready


Posted: Jun 14, 2012 02:56 AM    Msg. 2 of 4       
IF [not this status] <then run this> <another command>
IF [this status] <then run this> <another command>

that's as plain as i can make it.

else is calling for a resort to the expected command basically.

also check out kornman00's script bible http://www.modacity.net/docs/bslbible/
you could learn more from that.
Edited by ally on Jun 14, 2012 at 02:58 AM


1337
Joined: Dec 2, 2011

Don't be daft. wrap your shaft


Posted: Jun 14, 2012 03:05 AM    Msg. 3 of 4       
So something like
(script continuous blabla
(if flashlight_is_on
(unit_set_seat (player0) ready
)
(unit_set_seat (player0) crouch)
)

would this be the way I should use it?


Muscl3r
Joined: May 22, 2010

dont pray 4 easy lives...pray to be STRONGER MEN


Posted: Jun 20, 2012 01:07 AM    Msg. 4 of 4       
Not sure what you are asking but here is a valid if command:

(if (= (player_action_test_jump) true) (wake mission1))

so:

(if (= (condition) true or false) (do this))

I think what you're trying to do in your post is if the flash light is on, put the the player in this seat, if not put the player in that seat. To do that you'd use this script:

(if (= (unit_get_current_flashlight_state player0) true) (unit_set_seat player0 "driver")
(if (= (unit_get_current_flashlight_state player0) false) (unit_set_seat player0 "gunner")

or if you were doing two seperate mission paths where the player is gunning or driving you'd do this:

(script dormant driving
(unit_set_seat player0 "driver")
blah
)

(script dormant gunning
(unit_set_seat player0 "gunner")
blah
)

(script startup decide
(sleep_until (or (= (player_action_test_action) true) (= (player_action_test_jump) true)) 15)
(if (= (player_action_test_action) true) (wake driving))
(if (= (player_action_test_jump) true) (wake gunning))
)

So that^ decide script waits until the player presses E or Space bar then takes which ever path the player has chosen. It would need to be communicated through hud messages what your choosing.

 

 
Previous Older Thread    Next newer Thread







Time: Thu January 19, 2023 12:37 AM 94 ms.
A Halo Maps Website