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 »[Release] Squads script

Author Topic: [Release] Squads script (18 messages, Page 1 of 1)
Moderators: Dennis

Dwood
Joined: Oct 23, 2007

Judge Ye Therefore


Posted: Jan 2, 2010 05:28 PM    Msg. 1 of 18       
Want to make your own squad-based gameplay-map?

About 2 weeks ago I made this script over a 2-day period.

I have only lightly tested it but you can find some demonstrations of it working on xfire: http://www.xfire.com/video/1bebaa/

http://www.xfire.com/video/1beb6e/

http://www.xfire.com/video/1be987/

The script still needs major modifications. In fact, there are probably some stray globals running around... Since I'm on vacation I provide no support for the script as it is... only the assurance that it should compile.

If you run this unmodified it will require: Hud messages, and stuff.

;;Any phrases you don't recognize (ie ;;stt, ;;end etc) are made for notepad++ use
;;If you don't feel like defining your own language for notepad++, setting language to LISP works just fine.
;;stt
(global boolean part_1 1)
(global boolean has_been_a1 1)
(global boolean has_been_a2 0)
(global boolean has_been_a3 0)
(global boolean has_been_a4 0)
(global boolean has_been_a5 0)

(global boolean followb 0)
(global boolean stayb 0)
(global boolean advanceb 0)
(global boolean retreatb 0)
(global boolean flankb 0)

(global short sleep_shorty 5)
(global short sleep_longer 35)
(global short sleep_ninety 90)

(global boolean cmd_mode 1)
(global boolean air_modes 0)
(global boolean debug 0) ;;test
(global boolean safe_to_go 1)

(global boolean alliez_r_at1 1)
(global boolean alliez_r_at2 0)
(global boolean alliez_r_at3 0)
(global boolean alliez_r_at4 0)
(global boolean alliez_r_at5 0)

(global short test_ais 1) ;; 1-5 only current possible
;;end

(script static void ai_migrate_a1_a2
(ai_command_list Alliez/Allies_1 Ai_go_2)
(ai_migrate Alliez/Allies_1 Alliez/Allies_2)
(set test_ais 2)
)

(script static void ai_migrate_a1_a3
(ai_command_list Alliez/Allies_1 Ai_go_3)
(ai_migrate Alliez/Allies_1 Alliez/Allies_3)
;;(hud_set_help_text shouldmove3)
(set test_ais 3)
)

(script static void ai_migrate_a1_a4
(ai_command_list Alliez/Allies_1 Ai_go_4)
(ai_migrate Alliez/Allies_1 Alliez/Allies_4)
;;(hud_set_help_text shouldmove4)
(set test_ais 4)
)

(script static void ai_migrate_a2_a1
(ai_command_list Alliez/Allies_2 Ai_go_1)
(ai_migrate Alliez/Allies_2 Alliez/Allies_1)
(set test_ais 1)
)

(script static void ai_migrate_a2_a3
(ai_command_list Alliez/Allies_2 Ai_go_3)
(ai_migrate Alliez/Allies_2 Alliez/Allies_3)
(set test_ais 3)
)

(script static void ai_migrate_a2_a4
(ai_command_list Alliez/Allies_2 Ai_go_4)
(ai_migrate Alliez/Allies_2 Alliez/Allies_4)
(set test_ais 4)
)

(script static void ai_migrate_a3_a1
(ai_command_list Alliez/Allies_3 Ai_go_1)
(ai_migrate Alliez/Allies_3 Alliez/Allies_1)
(set test_ais 1)
)

(script static void ai_migrate_a3_a2
(ai_command_list Alliez/Allies_3 Ai_go_2)
(ai_migrate Alliez/Allies_3 Alliez/Allies_2)
(set test_ais 2)
)

(script static void ai_migrate_a3_a4
(ai_command_list Alliez/Allies_4 Ai_go_3)
(ai_migrate Alliez/Allies_4 Alliez/Allies_3)
(set test_ais 4)
)

(script static void ai_migrate_a4_a1
(ai_command_list Alliez/Allies_4 Ai_go_1)
(ai_migrate Alliez/Allies_4 Alliez/Allies_1)
(set test_ais 1)
)

(script static void ai_migrate_a4_a2
(ai_command_list Alliez/Allies_4 Ai_go_2)
(ai_migrate Alliez/Allies_4 Alliez/Allies_2)
(set test_ais 2)
)

(script static void ai_migrate_a4_a3
(ai_command_list Alliez/Allies_4 Ai_go_3)
(ai_migrate Alliez/Allies_4 Alliez/Allies_3)
;;(hud_set_help_text shouldmove3)
(set test_ais 3)
)

(script static void ai_migrate_a4_a5
;; (ai_command_list Alliez/Allies_5 Ai_go_4)
;; (ai_migrate Alliez/Allies_5 Alliez/Allies_4)
(set test_ais 5)
)

(script static void ai_migrate_a5_a4
;; (ai_command_list Alliez/Allies_5 Ai_go_4)
;; (ai_migrate Alliez/Allies_5 Alliez/Allies_4)
(set test_ais 4)
)

(script static void ai_migrate_a5_a3
;;(ai_command_list Alliez/Allies_5 Ai_go_3)
;;(ai_migrate Alliez/Allies_5 Alliez/Allies_3)
;;(hud_set_help_text shouldmove3)
(set test_ais 3)
)

(script static void ai_migrate_a5_a2
;; (ai_command_list Alliez/Allies_5 Ai_go_2)
;; (ai_migrate Alliez/Allies_5 Alliez/Allies_2)
(set test_ais 2)
)

(script static void ai_migrate_a5_a1
;; (ai_command_list Alliez/Allies_5 Ai_go_1)
;; (ai_migrate Alliez/Allies_5 Alliez/Allies_1)
(set test_ais 1)
)
;;ai_commands
;;stt
;;stt compaction
;;stt statics for stay_s
;;end

(script static void stay_s
(set stayb 0)
)

;;stt Statics for follow_s
;;stt
(script static void area_One_test
(if (= test_ais 5)
(begin
(ai_migrate_a5_a1)
)
(if (= test_ais 4)
(begin
(ai_migrate_a4_a1)
)
(if (= test_ais 3)
(begin
(ai_migrate_a3_a1)
)
(if (= test_ais 2)
(begin
(ai_migrate_a2_a1)
)
)
)
)
)
)
;; (hud_set_help_text shouldmove1)
)
;;end
;;stt
(script static void area_Two_test
(if (= test_ais 1)
(begin
(ai_migrate_a1_a2)
)
(if (= test_ais 3)
(begin
(ai_migrate_a3_a2)
)
(if (= test_ais 4)
(begin
(ai_migrate_a4_a2)
)
(if (= test_ais 5)
(ai_migrate_a5_a2)
)
)
)
)
)
;;end
;;stt
(script static void area_Three_test
(if (= test_ais 5)
(begin
(ai_migrate_a5_a3)
)
(if (= test_ais 4)
(begin
(ai_migrate_a4_a3)
)
(if (= test_ais 2)
(begin
(ai_migrate_a2_a3)
)
(if (= test_ais 1)
(begin
(ai_migrate_a1_a3)
)
)
)
)
)
)
;;end
;;stt
(script static void area_Four_test
(if (= test_ais 5)
(begin
(ai_migrate_a5_a4)
)
(if (= test_ais 3)
(begin
(ai_migrate_a3_a4)
)
(if (= test_ais 2)
(begin
(ai_migrate_a2_a4)
)
(if (= test_ais 1)
(begin
(ai_migrate_a1_a4)
)
)
)
)
)
;; (ai_command_list Alliez/Allies_5 Ai_go_4)
;; (ai_migrate Alliez/Allies_5 Alliez/Allies_4)
(set alliez_r_at5 1)
(set alliez_r_at4 0)

(ai_command_list Alliez/Allies_3 Ai_go_4)
(ai_migrate Alliez/Allies_3 Alliez/Allies_4)
(set alliez_r_at3 1)
(set alliez_r_at4 0)
)
;;end
;;end
;;stt
(script static void follow_s
(if (= has_been_a1 1)
(area_One_test)
(if (= has_been_a2 1)
(area_Two_test)
(if (= has_been_a3 1)
(area_Three_test)
(if (= has_been_a4 1)
(area_Four_test)
)
)
)
)
)
;;end
;;just because
;;stt Statics for advance_s
;;stt
;;end
(script static void advance_s
(if (= test_ais 1)
(ai_migrate_a1_a2)
(if (= test_ais 2)
(ai_migrate_a2_a3)
(if (= test_ais 3)
(ai_migrate_a3_a4)
(if (= test_ais 4)
(ai_migrate_a4_a5)
)
)
)
)
(set advanceb 0)
)
;;end
;;end
;;Statics for retreat_s
;;stt
;;retreat a1
;;stt
(script static void retreat_1
(if (= test_ais 2)
(ai_migrate_a2_a1)
(if (= test_ais 3)
(ai_migrate_a3_a2)
(if (= test_ais 4)
(ai_migrate_a4_a3)
(if (= test_ais 5)
(ai_migrate_a5_a4)
)
)
)
)
)
;;end
;;end
(script static void retreat_s
(retreat_1)
(set retreatb 0)
)
;;Statics for flank_s
;;stt
;;(script static void flank_1
;;)
;;end
(script static void flank_s
(set flankb 0) )
;;end
;;has_beens, this is complete unless something needs to be added.
;;stt
(script static void set_has_beens
(if (= part_1 1)
(if (and (volume_test_objects area_1 (players)) (= has_been_a1 0))
(begin
(set has_been_a2 0)
(set has_been_a1 1) ;;then
)
(if (and (volume_test_objects area_2 (players)) (= has_been_a2 0))
(begin
(set has_been_a1 0)
(set has_been_a3 0)
(set has_been_a2 1) ;;then
)
(if (and (volume_test_objects area_3 (players)) (= has_been_a3 0))
(begin
(set has_been_a2 0)
(set has_been_a4 0)
(set has_been_a3 1) ;;then
)
(if (and (volume_test_objects area_4 (players)) (= has_been_a4 0))
(begin
(set has_been_a5 0)
(set has_been_a4 0)
(set has_been_a3 1) ;;then
)
)
)
)
)
;;if part 2, place here
)
)
;;end
;;stt ai_call_cmd, should add voice overs from other games here lol
(script static void ai_call_cmd
(if (= cmd_mode true)
(if (= stayb true)
(begin
(stay_s)
)
(if (= advanceb true)
(begin
(advance_s)
)
(if (= retreatb true)
(begin
(retreat_s)
)
;;(if (= flankb true)
;; (begin
;; (flank_s)
;; )
;;)
)
)
)
(if (= air_modes 1)
(begin
(show_hud_help_text 1)
(hud_set_help_text air)
(sleep sleep_ninety)
(show_hud_help_text 0)
))
)
)
;;end
;;stt
(script static void test_has_beens
(if (and (= has_been_a1 1) (= has_been_a2 1))
(begin
(sleep sleep_longer)
(if (and (= has_been_a1 1) (= has_been_a3 1))
(begin
(show_hud_help_text 1)
(hud_set_help_text wrong1and2)
(sleep sleep_ninety)
(show_hud_help_text 0)
)
)
)
)
(if (and (= has_been_a1 1) (= has_been_a3 1))
(begin
(sleep sleep_longer)
(if (and (= has_been_a1 1) (= has_been_a3 1))
(begin
(show_hud_help_text 1)
(hud_set_help_text wrong1and3)
(sleep sleep_ninety)
(show_hud_help_text 0)
)
)
)
)
(if (and (= has_been_a1 1) (= has_been_a4 1))
(begin
(show_hud_help_text 1)
(hud_set_help_text wrong1and4)
(sleep sleep_ninety)
(show_hud_help_text 0)
)
)
(if (and (= has_been_a1 1) (= has_been_a5 1))
(begin
(show_hud_help_text 1)
(hud_set_help_text wrong1and5)
(sleep sleep_ninety)
(show_hud_help_text 0)
)
)
(if (and (= has_been_a2 1) (= has_been_a3 1))
(begin
(show_hud_help_text 1)
(hud_set_help_text wrong2and3)
(sleep sleep_ninety)
(show_hud_help_text 0)
)
)
(if (and (= has_been_a2 1) (= has_been_a4 1))
(begin
(show_hud_help_text 1)
(hud_set_help_text wrong2and4)
(sleep sleep_ninety)
(show_hud_help_text 0)
)
)
(if (and (= has_been_a2 1) (= has_been_a5 1))
(begin
(show_hud_help_text 1)
(hud_set_help_text wrong2and5)
(sleep sleep_ninety)
(show_hud_help_text 0)
)
)
(if (and (= has_been_a3 1) (= has_been_a4 1))
(begin
(show_hud_help_text 1)
(hud_set_help_text wrong3and4)
(sleep sleep_ninety)
(show_hud_help_text 0)
)
)
(if (and (= has_been_a3 1) (= has_been_a5 1))
(begin
(show_hud_help_text 1)
(hud_set_help_text wrong3and5)
(sleep sleep_ninety)
(show_hud_help_text 0)
)
)
(if (and (= has_been_a4 1) (= has_been_a5 1))
(begin
(show_hud_help_text 1)
(hud_set_help_text wrong4and5)
(sleep sleep_ninety)
(show_hud_help_text 0)
)
)
)
;;end
;;misc. static scripts
(script static unit player_0
(unit (list_get (players) 0))
)
;;STARTUP
;;stt
(script startup blah
(ai_allegiance player human)
)
;;end
;; END OF STARTUP
;;stt
(script continuous flashlight_check
(if (= (unit_get_current_flashlight_state (player_0)) 1)
(if (= safe_to_go 1)
(begin
(show_hud_help_text 1)
(hud_set_help_text stay)
(sleep sleep_shorty)
(unit_set_desired_flashlight_state (player_0) false)
(sleep sleep_longer)
(if (= (unit_get_current_flashlight_state (player_0)) 1)
(begin
(hud_set_help_text follow)
;; (turn on hud messages)
(sleep sleep_shorty)
(unit_set_desired_flashlight_state (player_0) false)
(sleep sleep_longer)
(if (= (unit_get_current_flashlight_state (player_0)) 1)
(begin
(hud_set_help_text advance)
(sleep sleep_shorty)
(unit_set_desired_flashlight_state (player_0) false)
(sleep sleep_longer)

(if (= (unit_get_current_flashlight_state (player_0)) 1)
(begin
(hud_set_help_text retreat)
(sleep sleep_shorty)
(unit_set_desired_flashlight_state (player_0) false)
(sleep sleep_longer)
(if (= (unit_get_current_flashlight_state (player_0)) 1)
(begin
(hud_set_help_text flank)
(sleep sleep_shorty)
(unit_set_desired_flashlight_state (player_0) false)
(sleep sleep_longer)
(if (not (unit_get_current_flashlight_state (player_0)))
(begin
;;(set flankb 1) ;;call flank
(set followb 0)
)
)
)
(begin
(set retreatb 1) ;;call retreat
(set followb 0)
)
)
)
(begin
(set advanceb 1)
(set followb 0)
)
)

)
(begin (set followb 1))
)
)
(begin
(set stayb 1) ;;if flashlight off set true
(set followb 0)
)
)
)
(begin
(hud_set_help_text unsafe)
(sleep sleep_longer)
(hud_set_help_text return)
(sleep sleep_longer)
(if (= (unit_get_current_flashlight_state (player_0)) 1)
(begin
(hud_set_help_text returning)
(follow_s)
(sleep sleep_longer)
)
)
)
)
)
)
;;end
;;stt debug
(script continuous debug
(if (= debug 1)
(begin
(test_has_beens)
)
)
)
;;end

(script continuous container
(set_has_beens)
(if (= followb 1)
(begin
(follow_s)
(sleep sleep_ninety)
)
(begin
(ai_call_cmd)
)
)
)


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Jan 2, 2010 05:32 PM    Msg. 2 of 18       
If this is what made you so amazing at nested ifs, you do realize most of your nested ifs, if not all, weren't necessary? You could have stated them as separate if statements instead of nested ifs.


Dwood
Joined: Oct 23, 2007

Judge Ye Therefore


Posted: Jan 2, 2010 05:48 PM    Msg. 3 of 18       
Quote: --- Original message by: Gamma927
If this is what made you so amazing at nested ifs, you do realize most of your nested ifs, if not all, weren't necessary? You could have stated them as separate if statements instead of nested ifs.


Perhaps they weren't all necessary but I found the nested ifs extremely convenient.
Edited by Dwood on Jan 2, 2010 at 05:48 PM


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Jan 2, 2010 05:53 PM    Msg. 4 of 18       
I wouldn't necessarily find them convenient, especially with the way you format it, but I can't argue, because it's all a manner of preference.


CorruptedHalo
Joined: May 18, 2009


Posted: Jan 2, 2010 06:17 PM    Msg. 5 of 18       
If this checks your flashlight state to make the AI fall back, follow, etc. wouldn't it get frustrating pushing Q until you got them to do what you wanted them to do?


Dwood
Joined: Oct 23, 2007

Judge Ye Therefore


Posted: Jan 2, 2010 06:24 PM    Msg. 6 of 18       
Quote: --- Original message by: CorruptedHalo
If this checks your flashlight state to make the AI fall back, follow, etc. wouldn't it get frustrating pushing Q until you got them to do what you wanted them to do?


It's no different than, say, tabbing through a list to find what you need. And if anyone has a better way of doing this, please let me know. (getting what the player wants the ai to do)
Edited by Dwood on Jan 2, 2010 at 06:25 PM


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Jan 2, 2010 06:41 PM    Msg. 7 of 18       
Pause menu >.>


SwordMa5ster
Joined: Jul 13, 2009

Come get some!!!


Posted: Jan 2, 2010 06:45 PM    Msg. 8 of 18       
not a bad idea gamma but then you would have to constantly pause the game to change commands. That could get kinda annoying.


Dwood
Joined: Oct 23, 2007

Judge Ye Therefore


Posted: Jan 2, 2010 06:45 PM    Msg. 9 of 18       
Quote: --- Original message by: Gamma927
Pause menu >.>


Interrupting gameplay :ewww: -Would be more annoying than the flashlight imho.
Edited by Dwood on Jan 2, 2010 at 06:46 PM


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Jan 2, 2010 06:51 PM    Msg. 10 of 18       
Pros: Easier to select which you want.

Cons: Pauses the game and allows you to grab a soda while making your long decision.


pwner5889
Joined: Jun 13, 2008


Posted: Jan 2, 2010 07:18 PM    Msg. 11 of 18       
Nice. I might play around with this. Thanks. I needed something to get me started on scripting.


UnevenElefant5
Joined: May 3, 2008

its been fun yall, i'll never forget this site :')


Posted: Jan 2, 2010 07:46 PM    Msg. 12 of 18       
If you want to "get started" with scripting I would suggest trying something a lot easier than this, try doing simple stuff, like sleep until the player is in a trigger volume then place an encounter.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Jan 2, 2010 07:51 PM    Msg. 13 of 18       
Don't discourage people from learning from a unoptimized script using lots of nested ifs.


Dwood
Joined: Oct 23, 2007

Judge Ye Therefore


Posted: Jan 2, 2010 07:51 PM    Msg. 14 of 18       
Quote: --- Original message by: UnevenElefant5
If you want to "get started" with scripting I would suggest trying something a lot easier than this, try doing simple stuff, like sleep until the player is in a trigger volume then place an encounter.


Yeah. This isn't something I would recommend to beginners.


Donut
Joined: Sep 30, 2006

I swear I'm not actually dead


Posted: Jan 2, 2010 08:21 PM    Msg. 15 of 18       
if you have never had any experience with programming before, you might want to look up a glossary of what things like if statements do. theyre pretty much universal between every language... now that i think about it though, the if statement is pretty much the only thing halo script has that other mainstream languages have too.

regardless, if youre going to learn programming, look at the structure first. once you see how things are laid out and understand how conditionals and things like that work, THEN you can start worrying about what individual commands do.


Dwood
Joined: Oct 23, 2007

Judge Ye Therefore


Posted: Jan 4, 2010 05:14 PM    Msg. 16 of 18       
Quote: --- Original message by: Donut
if you have never had any experience with programming before, you might want to look up a glossary of what things like if statements do. theyre pretty much universal between every language... now that i think about it though, the if statement is pretty much the only thing halo script has that other mainstream languages have too.

regardless, if youre going to learn programming, look at the structure first. once you see how things are laid out and understand how conditionals and things like that work, THEN you can start worrying about what individual commands do.


Halo script's syntax is almost the exact same as LISP. I don't really care much for the LISP-type programming languages but I do have respect for people who can program effectively in it. (Other than Java, thanks to Haloscript, I can read Lisp)
Edited by Dwood on Jan 4, 2010 at 05:14 PM


Dwood
Joined: Oct 23, 2007

Judge Ye Therefore


Posted: Jan 5, 2010 06:45 PM    Msg. 17 of 18       
Just sitting on my hard drive and decided someone might have more use for it than me.


;;stt
(global boolean gamestarted 0) ;; Level One

;;stt
(global boolean playerisarea1 0) ;; 1
(global boolean playerisarea2 0)
(global boolean playerisarea3 0)
(global boolean playerisarea4 0)
(global boolean playerisarea5 0)
(global boolean playerismicro1 0)
(global boolean playerin_sniper_box 0)
(global boolean playerissst 0)
;;end

;;stt
(global boolean level2 0) ;;done
(global boolean level3 0) ;;working on now
(global boolean level4 0) ;;doesn't do anything yet?
;;end

;;stt rocks
(global boolean level1poprock false) ;;Leven One starts in Level 4
(global boolean level2poprock false) ;;will, in the future activate level 3 poprocks.


;;stt
(global boolean run false) ;; used in the timer script
(global short ticks 0) ;; used in timer
(global short seconds 0)
(global short minutes 0) ;; used in rimer
;;end

(global short sleeps 90)
;;end

;;Level Check and Set, static + void
;;stt
(script static "void" levelz
(sleep 900)
(sleep_until (= seconds 30))
(begin
(show_hud_help_text 1)
(hud_set_help_text levels2)
(sleep sleeps)
(show_hud_help_text 0)
(set level2 true)
)

(sleep_until (and (= minutes 2) (= seconds 1)))
(begin
(show_hud_help_text 1)
(hud_set_help_text levels3)
(sleep sleeps)
(show_hud_help_text 0)
(set level3 true)
(object_create shotty)
)

(sleep_until (and (= minutes 4)(= seconds 1)))
(begin
(show_hud_help_text 1)
(hud_set_help_text levels4)
(sleep 90)
(show_hud_help_text 0)
(hud_show_motion_sensor 0)
(set level4 true)
(object_create shot1)
)
)
;;end

;;STARTUP

;;stt
(script startup main_script
(show_hud_help_text 1)
(hud_set_timer_position 0 0 bottom_right)
(pause_hud_timer true)
(show_hud_timer true)
(hud_set_help_text start)
(sleep 50)
(hud_set_help_text start1)
(sleep 50)
(hud_set_help_text start2)
(set run true)
(sleep 50)
(hud_set_help_text start2)
(sleep 30)
(hud_set_help_text levels1)
(sleep 30)
(set gamestarted 1)
(show_hud_help_text 0)
(sleep 300)
(levelz)
)
;;end
;; END OF STARTUP

;;GARBAAAAAGE
;;stt
(script continuous garbagecollect
(garbage_collect_now)
(sleep 210)
;;I'm just adding this next part to be annoying
(ai_magically_see_players level1area1)
(ai_magically_see_players level2area1)
(ai_magically_see_players level3area1)
(ai_magically_see_players level1area2)
(ai_magically_see_players level2area2)
(ai_magically_see_players level3area2)
(ai_magically_see_players level1area3)
(ai_magically_see_players level2area3)
(ai_magically_see_players level3area3)
(ai_magically_see_players level1area4)
(ai_magically_see_players level2area4)
(ai_magically_see_players level3area4)
(ai_magically_see_players level1area5)
(ai_magically_see_players level2area5)
(ai_magically_see_players level3area5)
(ai_magically_see_players level1_micro1_super)
(ai_magically_see_players superspawn1)
(ai_magically_see_players superspawn2)
(ai_magically_see_players superspawn3)
)
;;end


;;AREATEST ROCKETSSSS- Yes, I did name/call them snipers.
;;stt
(script continuous areatestSnipers
(if (= gamestarted 1)
(begin
(if
(or
(volume_test_objects sniper_box (players))
(volume_test_objects sniper_box2 (players))
(volume_test_objects sniper_box3 (players))
(volume_test_objects sniper_box4 (players))
)
(begin
(set playerin_sniper_box 1)
)
(set playerin_sniper_box 0)
)
)
)
)

(script continuous playerSnipers
(if (= playerin_sniper_box 1)
(begin
(ai_set_respawn snipers 1)
)
(ai_set_respawn snipers 0)
)
)


;;end

;;AREATESTS MICRO
;;stt
(script continuous areatestmicroOne
(if (= gamestarted 1)
(begin
(if (or (volume_test_objects micro1 (players)) (volume_test_objects micro1a (players)))
(begin
(sleep 60)
(if (or (volume_test_objects micro1 (players)) (volume_test_objects micro1a (players)))
(set playerismicro1 1)
)
)
(set playerismicro1 0)
)
)
)
)

(script continuous playermicroareaOne
(if (= playerismicro1 1)
(begin
(ai_set_respawn level1_micro1_super 1)
)
(ai_set_respawn level1_micro1_super 0)
)
)

;;end

;;AREATESTS NORMAL
;;stt
;;AREATEST 1 STARTS HERE
;;stt
(script continuous areatestuno
(if (= gamestarted 1)
(begin
(if (volume_test_objects AREATEST1 (players))
(begin
(set playerisarea1 1)
)
(set playerisarea1 0)
)
)
)
)

;; LEVEL 1 AREA 1

(script continuous playerlevel1area1
(if (= playerisarea1 1)
(begin
(ai_set_respawn level1area1 1)
)
(ai_set_respawn level1area1 0)
)
)
;; LEVEL 2 AREA 1

(script continuous playerlevel2area1
(if (= level2 1)
(begin
(if (= playerisarea1 1)
(begin
(ai_set_respawn level2area1 1)
)
(ai_set_respawn level2area1 0)
)
)
)
)

;;LEVEL 3 AREA 1
(script continuous playerlevel3area1
(if (= level3 1)
(begin
(if (= playerisarea1 1)
(begin
(ai_set_respawn level3area1 1)
)
(ai_set_respawn level3area1 0)
)
)
)
)
;;end

;;AREA 2 STARTS HERE

;;stt
(script continuous areatestdos
(if (= gamestarted 1)
(begin
(if
(volume_test_objects AREATEST2 (players))
(begin
(set playerisarea2 1)
)
(set playerisarea2 0)
)
)
)
)

;; LEVEL 1 AREA 2

(script continuous playerlevel1area2
(if (= playerisarea2 1)
(begin
(ai_set_respawn level1area2 1)
)
(ai_set_respawn level1area2 0)
)
)

;;LEVEL 2 AREA 2

(script continuous playerlevel2area2
(if (= level2 1)
(begin
(if (= playerisarea2 1)
(begin
(ai_set_respawn level2area2 1)
)
(ai_set_respawn level2area2 0)
)
)
)
)


;;LEVEL 3 AREA 2

(script continuous playerlevel3area2
(if (= level3 1)
(begin
(if (= playerisarea2 1)
(begin
(ai_set_respawn level3area2 1)
)
(ai_set_respawn level3area2 0)
)
)
)
)

;;end

;;AREATEST 3 STARTS HERE

;;stt
(script continuous areatesttres
(if (= gamestarted 1)
(begin
(if (volume_test_objects AREATEST3 (players))
(begin
(set playerisarea3 1)
)
(set playerisarea3 0)
)
)
)
)

;;LEVEL 1 AREA 3

(script continuous playerlevel1area3
(if (= playerisarea3 1)
(begin
(ai_set_respawn level1area3 1)
)
(ai_set_respawn level1area3 0)
)
)

;;LEVEL 2 AREA 3 HERE

(script continuous playerlevel2area3
(if (= level2 1)
(begin
(if (= playerisarea3 1)
(begin
(ai_set_respawn level2area3 1)
)
(ai_set_respawn level2area3 0)
)
)
)
)

;;LEVEL 3 AREA 3 HERE

(script continuous playerlevel3area3
(if (= level3 1)
(begin
(if (= playerisarea3 1)
(begin
(ai_set_respawn level3area3 1)
)
(ai_set_respawn level3area3 0)
)
)
)
)
;;end

;;AREATEST 4 STARTS HERE

;;stt
(script continuous areatestquatro
(if (= gamestarted 1)
(begin
(if (volume_test_objects AREATEST4 (players))
(begin
(set playerisarea4 1)
)
(set playerisarea4 0)
)
)
)
)

;;LEVEL 1 AREA 4

(script continuous playerlevel1area4
(if (= playerisarea4 1)
(begin
(ai_set_respawn level1area4 1)
)
(ai_set_respawn level1area4 0)
)
)
;;LEVEL 2 AREA 4

(script continuous playerlevel2area4
(if (= level2 1)
(begin
(if
(= playerisarea4 1)
(begin
(ai_set_respawn level2area4 1)
)
(ai_set_respawn level2area4 0)
)
)
)
)

;;LEVEL 3 AREA 4

(script continuous playerlevel3area4
(if (= level3 1)
(begin
(if
(= playerisarea4 1)
(begin
(ai_set_respawn level3area4 1)
)
(ai_set_respawn level3area4 0)
)
)
)
)

;;end

;;AREATEST 5 STARTS HERE

;;stt
(script continuous areatestcinco
(if (= gamestarted 1)
(begin
(if (volume_test_objects AREATEST5 (players))
(begin
(set playerisarea5 1)
)
(set playerisarea5 0)
)
)
)
)

;;LEVEL 1 AREA 5

(script continuous playerlvl1area5
(if (= playerisarea5 1)
(begin
(ai_set_respawn level1area5 1)
(ai_set_respawn superspawn1 0)
(ai_set_respawn superspawn3 1)
)
(begin
(ai_set_respawn level1area5 0)
(ai_set_respawn superspawn1 1)
(ai_set_respawn superspawn3 0)
)
)
)

;;SUPER SPAWN TEST
;;stt
(script continuous superspawnareatest
(if (= gamestarted 1)
(begin
(if (volume_test_objects superspawntest1 (players))
(begin
(set playerissst 1)
)
(set playerissst 0)
)
)
)
)
;;end

(script continuous playerslevel1ss
(if (= playerissst 1)
(begin
(ai_set_respawn superspawn2 1)
)
(ai_set_respawn superspawn2 0)
)
)

;;LEVEL 2 AREA 5

(script continuous playerlevel2area5
(if (= level2 1)
(begin
(if
(= playerisarea5 1)
(begin
(ai_set_respawn level2area5 1) ;;then
)
(ai_set_respawn level2area5 0) ;;else
)
)
)
)

;;LEVEL 3 AREA 5

(script continuous playerlevel3area5
(if (= level3 1)
(begin
(if
(= playerisarea5 1)
(begin
(ai_set_respawn level3area5 1) ;;then
)
(ai_set_respawn level3area5 0) ;;else
)
)
)
)
;;end
;;end
;;TIMER

;;stt
(script continuous manage_ticks
(if
(= run true)
(begin
(set ticks (+ ticks 1))
(if
(>= ticks 30)
(begin
(set seconds (+ seconds 1))
(set ticks 0)
)
)
(if
(>= seconds 60)
(begin
(set minutes (+ minutes 1))
(set seconds 0)
)
)
(hud_set_timer_time minutes seconds)
(pause_hud_timer true)
)
)
)
;;end



Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Jan 5, 2010 11:51 PM    Msg. 18 of 18       
Again, wouldn't it be easier to use (and instead of a nested if for every single one?

 

 
Previous Older Thread    Next newer Thread







Time: Thu January 19, 2023 1:52 PM 156 ms.
A Halo Maps Website