Here's something I'd like to share with you all. I've been tying to find a game's engine names for free-roaming NPCs so we can have even more fun with Sandbox+. By executing this two snippets of code:
player_force_vehicle_seat(LOCAL_PLAYER, 1)
local myride = get_char_vehicle_name(LOCAL_PLAYER)
local driver = vehicle_get_driver(myride)
sandboxplus_message("Your driver is "..driver..".")
I found out that:
1) NPCs that drive "your" car during missions are called the same way as they're called in LUA (no surprise)
2) Nyte Blayde homie is called "02_saints_male_nightblade000" (no typo there; I don't know if collecting other homie's names will turn out useful but who knows!)
3) Pedestrians that drive their cars around Steelport are still unknown: function doesn't return any output and breaks further Sandbox+ usage.
4) Recruitable homies ("Customizable gang" ones) are called "#FOLLOWER#" (it's a singular form but it seems to bind all of your current followers) and yes, you can "affect" them with functions, just not every of them.
For example, this is a very WIP code of function that turns your homie into
a personal chauffeur so you can enjoy the ride (and shoot other things):
Code:
-- VEEEERY ALPHA!
elseif player_action_is_pressed(B_DELETE) and not SEVEN_PUSHED then
player_force_vehicle_seat(LOCAL_PLAYER, 1) --This one need to be activated in a first place. It makes your character to take a passanger's seat.
sandboxplus_message("You are a passenger. Tap SEVEN and END when you and your follower will be in a car.")
SEVEN_PUSHED = true
elseif player_action_is_pressed(B_END) and not SEVEN_PUSHED then
local myride = get_char_vehicle_name(LOCAL_PLAYER)
local driver = vehicle_get_driver(myride)
set_team(driver, "Civilian") -- That and following lines are responsible for making sure that your driver won't escape the car when you get some heat on
ai_set_personality(driver, "civilian cowardly")
vehicle_max_speed(myride, 30.0) --This one sets maximum speed of your car. It does that for 2 reasons: it prevents driver from
--cannon-sheilding and makes the targeting actually possible.
sandboxplus_message("Ride with a style.")
SEVEN_PUSHED = true
elseif player_action_is_pressed(B_PGDWN) and not SEVEN_PUSHED then
local myride = get_char_vehicle_name(LOCAL_PLAYER)
local driver = vehicle_get_driver(myride)
sandboxplus_message("Your driver is "..driver..".") --Please, tap this function keybind every time you end up driving as a passenger with
--some "other" drivers. Maybe you'' find some other NPC names!
SEVEN_PUSHED = true
Here's the quick how-to:
1) Get ONE follower (recuritable homie, ones that keep spawning on streets)
2) Find a two-door car
3) Press 7 and DELETE
3) Enter chosen car from passenger's side
4) Wait for your homie to take driver's seat - he will start to drive shortly after
5) Press 7 and END to set him to a person who won't actually run away when police/other gangs will start shooting at him. He'll still drive like a madman but I got some VERY fun time with that set.
Things like rolling with more homies, driving in fourdoors, operating mounted guns, looking for more usefull functions (follower_remain_in_car() perhaps?) still need to be examined. Of course I'll be working on that but sadly, my time will be very limited. I'm posting this alpha version to give you 1) a quick look 2) encourage to do your own stuff 3) maybe tweak it further? Maybe someday we will drive with Mayor Reynolds, shoot Morningstar and listen to "You're the best around" at the same time?