ai respawn script question

Discuss Halo 2 modding, progress on figuring things out, mapfiles...you know the drill. Cheating discussion not allowed.
Post Reply
User avatar
snakejknight




Trickster Wave Pyre Wordewatician 500

Posts: 693
Joined: Sun Jun 04, 2006 1:00 pm
Location: North Hollywood California

ai respawn script question

Post by snakejknight »

ok, so i know the ai respawn script and decided to use it in my newish mod

when i compiled it, the ai spawned perfectly... but then they kept spawnin... over and over... forever

i even use the script generator app... compiled that script and the same problem occurred

why is this happening?

Code: Select all

   (sleep_until (<= (ai_living_count S_E_P) 5) 5) 
   (ai_place S_E_P) 
User avatar
neodos
Readers Club




Artisan Miner

Posts: 1394
Joined: Thu Aug 12, 2004 11:57 am

Post by neodos »

What script type are you using?

Continuous ?

Try this:

Code: Select all

(sleep_until (<= (ai_living_count S_E_P) 5) 5)
(ai_place S_E_P)
(sleep_forever)
Choking Victim





Posts: 552
Joined: Thu May 12, 2005 4:12 am

Post by Choking Victim »

neodos wrote:What script type are you using?

Continuous ?

Try this:

Code: Select all

(sleep_until (<= (ai_living_count S_E_P) 5) 5)
(ai_place S_E_P)
(sleep_forever)
couldn't you just use the startup script type?
User avatar
neodos
Readers Club




Artisan Miner

Posts: 1394
Joined: Thu Aug 12, 2004 11:57 am

Post by neodos »

No because his script is waiting until something happens ( sleep_until) so it needs to be continous, but the sleep forever should fix that.
User avatar
snakejknight




Trickster Wave Pyre Wordewatician 500

Posts: 693
Joined: Sun Jun 04, 2006 1:00 pm
Location: North Hollywood California

Post by snakejknight »

so the sleep forever will reset the script?

howecome this is in none of the tutorials?? haha

thanks... i'm gonna try that
User avatar
neodos
Readers Club




Artisan Miner

Posts: 1394
Joined: Thu Aug 12, 2004 11:57 am

Post by neodos »

:? you want it to restart?

Well i don't know what exactly does your script as i have never worked with Ai, i guess it's waiting to count if there is 5 ai alive it will place S_E_P, yes,no?

Sleep forever will stop the script.
User avatar
snakejknight




Trickster Wave Pyre Wordewatician 500

Posts: 693
Joined: Sun Jun 04, 2006 1:00 pm
Location: North Hollywood California

Post by snakejknight »

thats what i thought it would do, and it did

i've had a similar problem before with a gravity script

Code: Select all

(script continuous gravity_button
(begin
(physics_set_gravity 1)
(if(player_action_test_melee)
(physics_set_gravity 0)
(player_action_test_reset))
)
)
this script was supposed to be 0 gravity while holding "B" but all it did was set gravity to 0 and kept it at 0, what happened was my "if" statement did not contain a "then" statement within the same brackets. To fix that i changed the brackets

Code: Select all

(script continuous gravity_button
(begin
(physics_set_gravity 1)
(if(player_action_test_melee)
(physics_set_gravity 0))
(player_action_test_reset)
)
)
a sleep statement is more than likely different in that it has no if/then attitude, rather it is a command..

Code: Select all

(script continuous ai_respawner_maybe
(begin
(sleep_until (<=(ai_living_count pop)5)150) -- this has 3 opening brackets, and three closing brackets
(ai_place pop)-- separate command
)
)
i think what is happening is that the script stays dormant "Until" the ai living count is under 5, then the script activates and is read after the "sleep" void command

i'm not sure this is the case, but it is the best thing i can come up with

i think i'm going to try to use an if statement instead of a sleep untill...
sound good?
Post Reply