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 General Discussion »AI Vehicle Hijacking

Author Topic: AI Vehicle Hijacking (3 messages, Page 1 of 1)
Moderators: Dennis

EcoSurge
Joined: Apr 1, 2019

Moved to JadeUndead


Posted: Apr 4, 2019 02:46 AM    Msg. 1 of 3       
We create a seat that only exists when the driver exists with the "not valid without driver" bitmask, we tell the ai to go to this seat when the driver exists and is the player.

(= (vehicle_test_seat g0 "G-driver" (player0)) 1)

We duplicate the driver seat and change the label to "boarded", uncheck the driver bitmask from this seat. We have another seat called "boarder" with the right markers and animations to board the vehicle, this seat also needs the driver bitmask checked for this to work. We have two drivers when the player is being boarded. The first driver (player) is loaded into the "boarded" seat and is no longer the driver, thus the "boarder" becomes the real driver, and we can manipulate the driver like before with (g0_driver) to load that boarder into the normal driver seat. The unit in the "boarded" seat has an exit animation that ejects them.

Thank CMT for the tags related. I will post updates in this thread.



(global short IndexMarinesHijack 0)

(script startup startstuff
(set developer_mode 127)
(sleep 60)
(set playerman0 (unit (list_get (players) 0)))
(object_create g0)
(object_create g0b)
)


(script static unit g0_driver (vehicle_driver g0))
(script static unit g0b_driver (vehicle_driver g0b))

(script continuous hijack_player
(sleep 15)
(if (and (= (vehicle_test_seat g0 "G-driver" (player0)) 1)
(< (objects_distance_to_object (g0_driver) (unit (list_get (ai_actors cyborgs) IndexMarinesHijack))) 4)
(!= (ai_status cyborgs) 1)
(!= (ai_status cyborgs) 2)
)
(begin
(ai_go_to_vehicle_override cyborgs g0 "ghost-board-side")
)
)

(if (and (= (vehicle_test_seat g0 "G-driver" (player0)) 1)
(= (vehicle_test_seat_list g0 "ghost-board-side" (ai_actors cyborgs)) 1)
(!= (ai_status cyborgs) 1)
(!= (ai_status cyborgs) 2)
)
(begin
(sleep 15)
(vehicle_load_magic g0 "G-driver-boarded" (player0))
(unit_exit_vehicle (player0))
(vehicle_load_magic g0 "driver" (g0_driver))
)
)

(set IndexMarinesHijack (+ IndexMarinesHijack 1))
(if (< 4 IndexMarinesHijack)
(set IndexMarinesHijack 0)
)

)


Test map:
https://mega.nz/#!RbolWC6B!3oU7DakTKS9vxRXTzCu15rg4BNnaXxSGKYNSuD2u44A

Vid:
https://youtu.be/-h87tfd4SfQ
Edited by EcoSurge on Apr 4, 2019 at 03:10 AM


Spartan314
Joined: Aug 21, 2010

Former biped rigger & FP animator


Posted: Apr 4, 2019 07:15 AM    Msg. 2 of 3       
Mmmmm this is some real tasty stuff


Erutypus
Joined: Jan 1, 2018


Posted: Apr 11, 2019 05:54 AM    Msg. 3 of 3       

Edited by Erutypus on Jun 25, 2019 at 02:36 AM

 

 
Previous Older Thread    Next newer Thread







Time: Fri August 23, 2019 12:55 PM 188 ms.
A Halo Maps Website