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 »need help with scripts

Author Topic: need help with scripts (3 messages, Page 1 of 1)
Moderators: Dennis

OrangeJuice
Joined: Jan 29, 2009

Documentation and debug.txt


Posted: Aug 12, 2009 09:44 PM    Msg. 1 of 3       
I'm trying to make it so that when you start the game: a nav-point appears over a certain warthog, and when you get into that warthog, the navpoint disappears and reappears on the other warthog so you can follow it.

The scripts that I wrote don't do ANYTHING :(

Script for when the map starts:

(script startup game
(begin
(ai_attach s1pass1 marines/team)
(ai_attach s1pass2 marines/team)
(ai_attach s1gunner1 marines/team)
(ai_attach s1gunner2 marines/team)
(ai_attach s1driver1 marines/team)
(ai_allegiance human player)
(unit_enter_vehicle s1pass1 squad1_hog "w-passenger")
(unit_enter_vehicle s1pass2 player_hog "w-passenger")
(unit_enter_vehicle s1gunner1 squad1_hog "w-gunner")
(unit_enter_vehicle s1gunner2 player_hog "w-gunner")
(unit_enter_vehicle s1driver1 squad1_hog "w-driver")
(activate_nav_point_object "default" (unit (list_get (players) 0)) "player_hog" 0.6)
(sound_looping_start sound\music\save\save music 1)
)
)



Script for warthog

(script startup follow_squad1
(begin
(if (= (vehicle_test_seat "player_hog" "w-driver" (unit (list_get (players) 0))) true)
(deactivate_nav_point_object (unit (list_get (players) 0)) "player_hog")
(activate_nav_point_object "default" (unit (list_get (players) 0)) "squad1_hog" 0.6)
(sound_looping_stop sound\music\save\save)
)
)
)



When scripts are compiled and go in game, the music starts, but doesn't stop when the code to stop it is run :(
Edited by OrangeJuice on Aug 12, 2009 at 09:45 PM


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Aug 12, 2009 09:47 PM    Msg. 2 of 3       
Instead of using unit_enter_vehicle, just use an AI encounter.

(vehicle_load_magic [VEHICLE] [SEAT] (ai_actors [AI ENCOUNTER]))

And apparently, you did a startup script with an if loop. It checks at the very beginning of the map that if you're in the vehicle, then it'll do that. If you aren't in the vehicle when the map begins, then it won't execute.


kirby_422
Joined: Jan 22, 2006

Apparently public enemy number 1?


Posted: Aug 12, 2009 09:51 PM    Msg. 3 of 3       
Quote: --- Original message by: OrangeJuice
Script for warthog

(script startup follow_squad1
(begin
(if (= (vehicle_test_seat "player_hog" "w-driver" (unit (list_get (players) 0))) true)
(deactivate_nav_point_object (unit (list_get (players) 0)) "player_hog")
(activate_nav_point_object "default" (unit (list_get (players) 0)) "squad1_hog" 0.6)
(sound_looping_stop sound\music\save\save)
)
)
)



When scripts are compiled and go in game, the music starts, but doesn't stop when the code to stop it is run :(

your begin is in the wrong place, you dont need a begin at the start, but you would after an if (also, thats a startup script.. an if is useless, it will check one single time, then stop)
change the (if to (sleep_until and move one of your ) to after the true) (and just remove that begin at the start, your only slowing down your script with that)

 

 
Previous Older Thread    Next newer Thread







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