[V] IdolNinja
Volition Staff
Sure, I think it's likely that it could be implemented. I was just waiting on BadMadScientist to field this, since he has been working with driver/passenger scripts lately.
My memory is a bit fuzzy, but I do remember attempting to add weather changing. It didn't work and just bombed out the threads, if memory serves.
Yay, I overlooked that one. I'm not sure if I understood you right but have a look at the code below. Copy-paste it to some unused keybind.Regarding the follower passenger mode, is it also theoretically possible to adapt something like this for co-op human players? Something like a direct keyboard shortcut (at least for the host) either for jumping directly into a passenger's seat (even if the driver's seat is empty), or for changing or switching seats without getting out of the car? Or stuff like this wouldn't work well in multiplayer? The default entry mechanic where you had to either wait for the driver to take his seat before jumping in as a passenger or spend 15 seconds on getting out from the car and trying again was a thing that probably annoyed me the most in co-op, so I'd appreciate any insight on this.
local ride_local = get_char_vehicle_name(LOCAL_PLAYER)
local ride_remote = get_char_vehicle_name(REMOTE_PLAYER)
local driver_local = vehicle_get_driver(ride_local)
local driver_remote = vehicle_get_driver(ride_remote)
if COOP_COMMANDS and coop_is_active() then
if character_is_in_vehicle(LOCAL_PLAYER) and not character_is_in_vehicle(REMOTE_PLAYER) and driver_local == "LOCAL_PLAYER" then
vehicle_exit_teleport(REMOTE_PLAYER)
vehicle_enter_teleport(REMOTE_PLAYER, ride_local, 1)
sandboxplus_message("Remote player teleported to local player's car.")
elseif character_is_in_vehicle(REMOTE_PLAYER) and not character_is_in_vehicle(LOCAL_PLAYER) and driver_remote == "REMOTE_PLAYER" then
vehicle_exit_teleport(LOCAL_PLAYER)
vehicle_enter_teleport(LOCAL_PLAYER, ride_remote, 1)
sandboxplus_message("Local player teleported to remote player's car.")
elseif character_is_in_vehicle(REMOTE_PLAYER) and character_is_in_vehicle(LOCAL_PLAYER) and driver_remote == "REMOTE_PLAYER" then
vehicle_exit_teleport(LOCAL_PLAYER)
vehicle_exit_teleport(REMOTE_PLAYER)
vehicle_enter_teleport(LOCAL_PLAYER, ride_local, 0)
vehicle_enter_teleport(REMOTE_PLAYER, ride_local, 1)
sandboxplus_message("Players swapped their seats - local player is driving now.")
elseif character_is_in_vehicle(REMOTE_PLAYER) and character_is_in_vehicle(LOCAL_PLAYER) and driver_local == "LOCAL_PLAYER" then
vehicle_exit_teleport(LOCAL_PLAYER)
vehicle_exit_teleport(REMOTE_PLAYER)
vehicle_enter_teleport(LOCAL_PLAYER, ride_local, 1)
vehicle_enter_teleport(REMOTE_PLAYER, ride_local, 0)
sandboxplus_message("Players swapped their seats - remote player is driving now.")
else
sandboxplus_message("Failed.")
end
else
sandboxplus_message("You have to play in coop to use this function.")
end
did anybody test this out yet? I have high hopes for it making the ToD cycle better!People who are interested in fully dynamic day-night cycles may want to look into this once again to be 100% certain. I was working with weather today (tweaking for realistic-looking rain, etc), and I realized that since weather changes are dynamic and that weather_time_of_day.xtbl contains specific lighting conditions for each weather type for each time of day, it could be possible use them as a workaround for dynamic night-day changes.
That is, if scripted weather changing turned out to be possible after all, we could try setting the same lighting conditions for a weather type for two adjusting times of day (say, night overcast and sunrise overcast) and then forcing this weather type right before the TOD change and possibly right after. Alternatively, we could also use some (new?) weather type to "prepare" its TOD for the upcoming transition: like forcing a sunrise-bright weather change right before the sunset, and so on. I'll try to do some preliminary testing for this when I get back (lock a modified weather type at 100% probability and see what happens), but theoretically, it would result in much smoother TOD transitions.
Just in case any of you may find this useful.
Does this mod allow you to open the character customization menu at any moment without having to go to a surgeon?
Really have no idea what's preventing this thing from working. It should at least teleport the remote player out of the car. As for now, maybe try changing remote_player to "#PLAYER2#" (for example: vehicle_exit_teleport("#PLAYER2#"), except the second line? This might be a blind shot* but my absolute lack of experience in coop doesn't pay offEDIT: Just spent some time testing this, and sadly it doesn't seem to work at all. I reset the keybinds several times, and the rest of the keybinds work, but nothing happened with this one and we didn't even get any of the sandboxplus messages. Then I tried removing all the IF conditions and testing some parts of the code manually, but I still couldn't make it to work as intended. For example, if both players are in a car (regardless of who's driving), the "Players swapped their seats - remote player is driving now" code only teleports the local player out of the car and produces the popup message.
It's hardcored. As for now, there's no way to affect cars that aren't driven by players or followers (to affect by Sandbox+, of course).Is there perhaps a function that can simply seat the player on the closest car's the passenger's seat regardless of the driver's seat's occupied/empty status? Or stuff like this is all hardcoded?