;another behavior script ;------------------------------------------------GLOBALLZ (global short behavior 0) ;------------------------------------------------COMMAND scripts (script command_script go_around (cs_set_pathfinding_radius 15) (cs_go_to behaviors/p1) (cs_go_to behaviors/p2) (cs_go_to behaviors/p3) (cs_go_to behaviors/p4) ) ;------------------------------------------------STATIC scripts ;*(script static void engage (ai_set_orders elite behavior/engage) (cs_run_command_script elite gather) )*; ;------------------------------------------------DORMANT scripts (script static test (print "test") (sleep -1) ) ;------------------------------------------------CONTINUOUS scripts ;ref: ;(vehicle_test_seat ) ;(unit_enter_vehicle ) ;(vehicle_riders ) ;(vehicle_driver ) ;(vehicle_gunner ) ;(unit_exit_vehicle ) ;(ai_go_to_vehicle ) ;(unit_enter_vehicle (unit (list_get (ai_actors marine) 0)) warthog1 "W-driver") (script continuous hog_check ;if the player gets in the gunner or passenger seat and the marine isn't in the driver seat, make him drive (if (and (not (vehicle_test_seat_list warthog1 "W-driver" (ai_actors marine))) (or (vehicle_test_seat_list warthog1 "W-passenger" (players)) (vehicle_test_seat_list warthog1 "W-gunner" (players)))) (begin ;the set orders doesn't seem to work well, the ai eventually seems to not do anything...? ;(ai_set_orders marine behaviors/vehicle) ;(print "Shut up and drive!") (ai_go_to_vehicle marine warthog1 "W-driver") ;for some reason this doesn't work when I continuously order the marine to drive, he just stands there. Sleeping for a bit seems to help... (sleep 30) ) ) ;if the player gets out of the hog and a marine is in it make the marine get out and fight (if (and (vehicle_test_seat_list warthog1 "" (ai_actors marine))(not (vehicle_test_seat_list warthog1 "" (players)))) (begin (unit_exit_vehicle (vehicle_driver warthog1)) ;the set orders doesn't seem to work well, the ai eventually seems to not do anything...? ;(ai_set_orders marine behaviors/engage) ;(print "no drive") ) ) ;if the player wants to drive, put the marine in the gunner seat (if (vehicle_test_seat_list warthog1 "W-driver" (players)) (begin (ai_go_to_vehicle marine warthog1 "W-gunner") (sleep 30) ;(ai_set_orders marine behaviors/engage) ) ) (if (not (vehicle_test_seat_list warthog1 "W-driver" (players))) (wake test) ) ) (script continuous marine_spawner ;if the marine dies, make a new one (sleep_until (= 0 (ai_living_count marine))) (ai_place marine) (wake test) ) (script continuous elite_spawner ;if the elite dies and the player is in the hog, make a new elite (sleep_until (and (vehicle_test_seat_list warthog1 "" (players)) (> 1 (ai_living_count elite)))) (sleep 300) (ai_place elite) ) ;------------------------------------------------STARTUP scripts (script startup begin (ai_allegiance player human) ;(ai_allegiance player covenant) (ai_vehicle_enterable_team warthog1 human) )