player.force update bug when using custom force ?

Place to get help with not working mods / modding interface.
Gregzenegair
Manual Inserter
Manual Inserter
Posts: 2
Joined: Tue Mar 19, 2019 8:16 pm
Contact:

player.force update bug when using custom force ?

Post by Gregzenegair »

Hello,

I am currently modding the game, and I am playing with the player.force values as string.

When you set for the first time player.force = "force_1" it correctly sets the player's force from "player" to "force_1". The problem I noticed is when you want to update the force from "force_1" to "force_2" it does not work.

Could someone investigate on this ?
Koub
Global Moderator
Global Moderator
Posts: 7955
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: player.force update bug when using custom force ?

Post by Koub »

[Koub] Moved to Modding help
Koub - Please consider English is not my native language.
Gregzenegair
Manual Inserter
Manual Inserter
Posts: 2
Joined: Tue Mar 19, 2019 8:16 pm
Contact:

Re: player.force update bug when using custom force ?

Post by Gregzenegair »

Hello,

Ok, I have found out the problem's origin. It is more a bug report than an ask for help, but well ...

So I noticed that if after calling player.set_controller({type = defines.controllers.ghost}) which detach the player's character, the call to player.force = "team_of_my_choice" won't work and won't change the player's team.

Somehow the player's character may hold a part of player's force data and you may not be able to change a player force without a character, still this his a strange behavior not documented.

Have a nice day.
Post Reply

Return to “Modding help”