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 »Script

Author Topic: Script (3 messages, Page 1 of 1)
Moderators: Dennis

Glitcherguy
Joined: Jan 28, 2008

I should really put a clever quote here...


Posted: Aug 23, 2010 12:26 PM    Msg. 1 of 3       
Ok. I was wondering what exactly is wrong with this script? Nothing continues after this part of my map.


(script dormant flood_drop
(if
(and
(< 4 (ai_living_count flood_begin/flood_begin ))
(< 3 (ai_living_count flood_begin/flood_begin_2 )))
(ai_place flood_begin/flood_begin_3)
(wake flood_respawn)
)
)

They compile fine.


Glitcherguy
Joined: Jan 28, 2008

I should really put a clever quote here...


Posted: Aug 23, 2010 12:55 PM    Msg. 2 of 3       
YES!!!

(script continuous flood_sector_one_respawn
(sleep_until
(volume_test_objects flood_respawn_one (players)))
(sleep 5000)
(ai_place flood_begin/flood_inside_1)
(ai_place flood_begin/flood_inside_2)
(ai_set_respawn flood_begin/flood_inside_1 true)
(ai_set_respawn flood_begin/flood_inside_2 true)
)


(script dormant move_inside
(sleep_until (= 0 (ai_living_count flood_begin/flood_begin )))
(sleep_until (= 0 (ai_living_count flood_begin/flood_begin_2 )))
(ai_migrate humans/marine_one humans/inside_squad_start)
(ai_migrate humans/marine_two humans/inside_squad_start)
(ai_migrate humans/marine_three humans/inside_squad_start)
(ai_migrate humans/jhonson humans/inside_squad_start)
(ai_place flood_begin/flood_inside_first)
(wake flood_sector_one_respawn)
)

(script dormant flood_respawn
(sleep_until (= 0 (ai_living_count flood_begin/flood_begin_3 )))
(ai_place flood_begin/flood_begin)
(ai_place flood_begin/flood_begin_2)
(wake move_inside)
)

(script dormant flood_drop
(if
(and
(= 0 (ai_living_count flood_begin/flood_begin ))
(= 0 (ai_living_count flood_begin/flood_begin_2 )))
(ai_place flood_begin/flood_begin_3 ))
(wake flood_respawn)
)

(script dormant beginning_flood
(sleep_until (volume_test_objects flood_door_begin (players )) 15)
(ai_place flood_begin/flood_begin)
(ai_place flood_begin/flood_begin_2)
(wake flood_drop)
)

(script startup beginning
(begin
(game_difficulty_set impossible)
(ai_allegiance covenant player)
(ai_allegiance covenant human)
(ai_allegiance human player)
(ai_place covenant/elite_insert_needler)
(ai_place covenant/commander_insert)
(ai_place humans)
(wake beginning_flood)
)
)


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Aug 23, 2010 05:03 PM    Msg. 3 of 3       
This seems to be more of a lexical error than a syntactical one.
What's strange about:
(script dormant flood_drop
(if
(and
(< 4 (ai_living_count flood_begin/flood_begin ))
(< 3 (ai_living_count flood_begin/flood_begin_2 )))
(ai_place flood_begin/flood_begin_3)
(wake flood_respawn)
)
)

is that you're saying:

if 4 is less than the ai living count of flood_begin and 3 is less than the ai living count of flood_begin_2, then place the encounter and wake flood_respawn. What this translates to is:

If the AI living count is greater than 4 and 3, then do the statements listed. If this is what you want, then read below, but judging from the name of the encounter, flood_respawn, I'm assuming you want to spawn more AI when the amount of AI is less than the provided numbers.

The command (< [param 1] [param 2]) checks whether [param 1] < [param2], not the other way around. If you wanted to restructure that, you'd say:

(script dormant flood_drop
(if
(and
(< (ai_living_count flood_begin/flood_begin ) 4)
(< (ai_living_count flood_begin/flood_begin_2 ) 3)
)
(begin
(ai_place flood_begin/flood_begin_3)
(wake flood_respawn)
)
)
)


Now, if that wasn't what you wanted, and you looked at the script above, you'd notice that I added a (begin block. The problem with your script, is that if the conditions are true, it'll place the AI, but the script won't wake flood_respawn unless the statements are FALSE. The reason for this, is the syntax for an if statement is:

(if
(condition)
(do this)
(else do this)
)

Since you didn't group your statements in a (begin block, they're counted separately, with the ai_place added as a (do this), and the wake command added as the (else do this). Again, the script I posted above should fix this.
Edited by Gamma927 on Aug 23, 2010 at 05:04 PM

 

 
Previous Older Thread    Next newer Thread







Time: Fri January 20, 2023 5:07 PM 172 ms.
A Halo Maps Website