Add a method of getting the vehicle a character entity is in while the player is remotely driving

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
asher_sky
Long Handed Inserter
Long Handed Inserter
Posts: 58
Joined: Sun Oct 18, 2020 7:13 pm
Contact:

Add a method of getting the vehicle a character entity is in while the player is remotely driving

Post by asher_sky »

I would love to have some way of knowing what vehicle the player character entity is in. When in remote view and remotely driving a vehicle, both player.vehicle and player.character.vehicle return the remotely driven vehicle, even if the character is in a different vehicle. It would be nice if player.vehicle returned the "active" (i.e., remotely driven) vehicle and character.vehicle returned the one the character entity is actually inside of.

Another option could be adding something like player.remote_vehicle and/or player.character_vehicle.

Thanks for considering :)
asher_sky
Long Handed Inserter
Long Handed Inserter
Posts: 58
Joined: Sun Oct 18, 2020 7:13 pm
Contact:

Re: Add a method of getting the vehicle a character entity is in while the player is remotely driving

Post by asher_sky »

...

I have just learned that despite the docs indicating that player.physical_vehicle is a MapPosition, it is in fact the vehicle entity that I want. doh
curiosity
Filter Inserter
Filter Inserter
Posts: 470
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Add a method of getting the vehicle a character entity is in while the player is remotely driving

Post by curiosity »

There was also a bug that caused the character's vehicle to read wrong.
asher_sky
Long Handed Inserter
Long Handed Inserter
Posts: 58
Joined: Sun Oct 18, 2020 7:13 pm
Contact:

Re: Add a method of getting the vehicle a character entity is in while the player is remotely driving

Post by asher_sky »

Great! This one can get moved to "Already Exists" :)
Post Reply

Return to “Modding interface requests”