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 for respawning ai

Author Topic: script for respawning ai (5 messages, Page 1 of 1)
Moderators: Dennis

sargejohnson
Joined: Apr 20, 2009

Shall we play a game?


Posted: Oct 1, 2009 03:29 AM    Msg. 1 of 5       
does anyone know how to make a script that checks if a particular encounter's squad is dead, then respawns all of the AI in that particular squad at the same time 2 secs after the death of the entire squad?

I don't know much about scripting, and doing it in sapien just makes it look odd, as each AI is respawned as soon as it gets killed.

thx.


sargejohnson
Joined: Apr 20, 2009

Shall we play a game?


Posted: Oct 2, 2009 09:50 PM    Msg. 2 of 5       
Quote: --- Original message by: DDT_Ghost

make it an own encounter and use

(script startup respawnai

(sleep_until ( = (ai_living_count ::encountername::) 0))
(begin
(ai_place ::encountername::)
::something that loops to line 3, dunno right now::
)
)

Edited by DDT_Ghost on Oct 1, 2009 at 09:12 AM




i saw your code, and i was thinking that instead of script type being "startup", it is continuous instead.
would this script work instead?


(script continuous respawnai
(if
(= (ai_living_count ::encountername::) 0)
(begin
(ai_place ::encountername::)
)
)
)

is my script missing parentheses, or is it completely wrong?


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Oct 2, 2009 10:04 PM    Msg. 3 of 5       
Use this for your 2 second delay. And at first, I thought you were missing a parentheses due to your formatting, but after rechecking it, it's all good :]


(script continuous respawn
(if
(= (ai_living_count [AI]) 0)
(begin
(sleep 60)
(ai_place [AI])
)
)
)


sargejohnson
Joined: Apr 20, 2009

Shall we play a game?


Posted: Oct 2, 2009 10:13 PM    Msg. 4 of 5       
Quote: --- Original message by: Gamma927
Use this for your 2 second delay. And at first, I thought you were missing a parentheses due to your formatting, but after rechecking it, it's all good :]


(script continuous respawn
(if
(= (ai_living_count [AI]) 0)
(begin
(sleep 60)
(ai_place [AI])
)
)
)


does this happen to be the 2 second delay you are talking about?
just asking, so that i can edit it if required.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Oct 2, 2009 10:58 PM    Msg. 5 of 5       
Yea. I also used tab formatting, to make it easier for you to see how everything is organized. People don't format much anymore >:(

 

 
Previous Older Thread    Next newer Thread







Time: Thu January 19, 2023 10:11 PM 125 ms.
A Halo Maps Website