Quote: --- Original message by: Headhunter09
(game_save)
(sleep_until (= (vehicle_gunner (unit (list_get (players) 0)) 1) 15)
(ai_command_list cine_driver drive)
)
)
There's the problem. I understand why you think vehicle_gunner does that, but that's not how vehicle_gunner is used.
Just for future reference, vehicle_gunner returns the gunner biped of any vehicle specified as either an "object" or a "unit", which is what the "unit" in vehicle_gunner is for, not for bipeds. For example:
(unit_kill (vehicle_gunner g_warthog))
Would kill the gunner of g_warthog. It's a pretty useful command, but it's not what you want here.
What you do want here is "vehicle_test_seat" or "vehicle_test_seat_list":
(vehicle_test_seat_list "vehicle" "string" "object_list")
tests whether the named seat has an object in the object list
(vehicle_test_seat "vehicle" "string" "unit")
tests whether the named seat has a specified unit in it
For the "list" one, you could use "(players)" for "object_list" since it's an SP map with only one player and there would be less to type, but if you want to refer to player 0 specifically then you use the non-list one. So, here's that line of code fixed:
(sleep_until (= (vehicle_test_seat "vehicle name" "seat label" (unit (list_get (players) 0))) 1) 15)
Just fill in "vehicle name" and "seat label" because I don't know what vehicle you meant to test for.