Player can still manipulate enemy entities after changing forces

Things that we don't consider worth fixing at this moment.
Post Reply
Pi-C
Smart Inserter
Smart Inserter
Posts: 1648
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Player can still manipulate enemy entities after changing forces

Post by Pi-C »

Usually, when you click on an entity that belongs to another force that is an enemy of your own force, you'll see a flying text "Cannot open enemy structure". Also, if you try to enter a vehicle belonging to an enemy force, you'll usually get "Cannot enter enemy vehicles". But there is an edge case where it doesn't work as expected:

To reproduce, make sure you belong to force "player", put down a spidertron, arm it with some rockets, enter it, and open its GUI. Use

Code: Select all

/c game.player.force = 'enemy'
to change your force, then
  • try to rename the spidertron;
  • try to insert/remove something into/from the spidertrons inventory;
  • move around in the spidertron;
  • attack something with the spidertron.
All of the above will still work although the spidertron doesn't belong to you anymore. You'll get back the expected behavior after you've left the spidertron and closed its GUI.

In my WIP version of GCKI, I already set player.vehicle = nil in response to defines.events.on_player_ changed _force. Closing player.opened if that refers to an entity shouldn't be too hard either. Still, I feel this should be taken care of by the game as the issue is somewhat obscure and many modders (myself included -- I only found out about the GUI stuff today) won't handle this because they simply aren't aware of it.
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

Rseding91
Factorio Staff
Factorio Staff
Posts: 13204
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Player can still manipulate enemy entities after changing forces

Post by Rseding91 »

Thanks for the report however I don't consider this worth changing. If a mod changes the force of something it can eject the player; or change the players vehicle force as well.
If you want to get ahold of me I'm almost always on Discord.

Pi-C
Smart Inserter
Smart Inserter
Posts: 1648
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: Player can still manipulate enemy entities after changing forces

Post by Pi-C »

Rseding91 wrote:
Sat Aug 13, 2022 1:37 pm
Thanks for the report however I don't consider this worth changing. If a mod changes the force of something it can eject the player; or change the players vehicle force as well.
Thanks for the reply! Actually, I've already made a map setting for that: When players change forces, they will either be ejected from the vehicle they're riding in, or their vehicles will change forces as well. :-)
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

Post Reply

Return to “Won't fix.”