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 ?
player.force update bug when using custom force ?
-
Gregzenegair
- Manual Inserter

- Posts: 2
- Joined: Tue Mar 19, 2019 8:16 pm
- Contact:
Re: player.force update bug when using custom force ?
[Koub] Moved to Modding help
Koub - Please consider English is not my native language.
-
Gregzenegair
- Manual Inserter

- Posts: 2
- Joined: Tue Mar 19, 2019 8:16 pm
- Contact:
Re: player.force update bug when using custom force ?
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.
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.
