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 »Ai ambush scripting help

Author Topic: Ai ambush scripting help (4 messages, Page 1 of 1)
Moderators: Dennis

Killeryoshi
Joined: Jan 22, 2009

Captain Yoshi on duty!


Posted: Aug 22, 2014 06:31 PM    Msg. 1 of 4       
I am trying to make a spot where the player walks by an area, and will later walk by that area again and the 2nd time it triggers ai to spawn. I've tried to script this, but so far I've only gotten it to work when both of the triggers were together and the player is standing on both of them.
here is the script I've done so far.
Quote: (script static unit player
(unit (list_get (players) 0))
)

(script startup 1
(fade_in 0 0 0 200)
)

(script dormant 4
(ai_place ambush)
)

(script dormant 3
(sleep_until (volume_test_objects test2 (player)) 5)
(wake 4)
)

(script startup 2
(sleep_until (volume_test_objects test (player)) 5)
(game_save)
(wake 3)
)

I want to make it so that the 2nd trigger volume is activated by the 1st one and the 2nd trigger then spawns an ai.


BTone
Joined: Aug 1, 2014

Reality over fear.


Posted: Aug 22, 2014 09:42 PM    Msg. 2 of 4       
Firstly, (volume_test_objects tests a trigger volume against a list of objects. In fact, i'm surprised the script compiles with just a single object but idk, haven't scripted anything in a while. You'd want to use (volume_test_object, which is just more efficient.

Here's a script that should work. Im writing freehand so bear with me:

(script static unit player
(unit (list_get (players) 0))
)

(script dormant LaunchAmbush
(ai_place ambush)
)

(script dormant EnableAmbush
(sleep_until (volume_test_object "AmbushEnableTrigger" (player)))
(game_save)
(sleep_until (volume_test_object "AmbushTrigger" (player)))
(wake LaunchAmbush)
)

(script startup Start
(fade_in 0 0 0 200)
(wake EnableAmbush)
)


Let me know if it works.
Edited by BTone on Sep 2, 2014 at 08:55 AM


sparky
Joined: Jun 27, 2009

Dismissal of Truth leaves one to believe lies


Posted: Sep 1, 2014 08:32 PM    Msg. 3 of 4       

Edited by sparky on Aug 20, 2015 at 03:57 PM


BTone
Joined: Aug 1, 2014

Reality over fear.


Posted: Sep 2, 2014 08:54 AM    Msg. 4 of 4       
Quote: --- Original message by: sparky
You can just set a variable and check to see what value it is.


You could, but it actually ends up being close to the same amount of code and doesnt really buy you anything except being able to determine if the ambush was already launched or not, which may be useful depending on the circumstance. Because the ambush is a one time occurence, I think it is nicer to execute it and forget about it, but it all comes down to preference.

(print "Swag inbound")

 

 
Previous Older Thread    Next newer Thread







Time: Wed August 21, 2019 6:45 AM 235 ms.
A Halo Maps Website