Page 1 of 1
(Reward offered) Console command to change from Sandbox
Posted: Sun Mar 13, 2016 3:20 am
by seewhymit
Hi,
I have tried researching this myself and struggled to find the answer I am looking for, so I thought posting here would be a good idea. I have a map that I have built out quite nicely in Sandbox mode, however I would now like to switch it to Freeplay mode (with a character). I have found a couple mentions of how to do it via Console/Lua commands, however they didn't work for me.
I am prepared to paypal gift $5USD to the first person to give me the correct console commands to do it.
I am running Factorio on OSX (although I doubt that matters).
The map was started as a Sandbox mode map, and has never been anything but.
Thanks!
Re: (Reward offered) Console command to change from Sandbox
Posted: Sun Mar 13, 2016 4:50 am
by Klonan
seewhymit wrote:Hi,
I have tried researching this myself and struggled to find the answer I am looking for, so I thought posting here would be a good idea. I have a map that I have built out quite nicely in Sandbox mode, however I would now like to switch it to Freeplay mode (with a character). I have found a couple mentions of how to do it via Console/Lua commands, however they didn't work for me.
I am prepared to paypal gift $5USD to the first person to give me the correct console commands to do it.
I am running Factorio on OSX (although I doubt that matters).
The map was started as a Sandbox mode map, and has never been anything but.
Thanks!
This command should do what you're asking
Code: Select all
/c game.local_player.character = game.local_player.surface.create_entity{name = "player", position = {0,0}, force = game.local_player.force}
No reward needed, but if you'd like you can donate to the dev team
https://www.factorio.com/donations
Re: (Reward offered) Console command to change from Sandbox
Posted: Sun Mar 13, 2016 4:58 am
by seewhymit
Klonan wrote:seewhymit wrote:Hi,
I have tried researching this myself and struggled to find the answer I am looking for, so I thought posting here would be a good idea. I have a map that I have built out quite nicely in Sandbox mode, however I would now like to switch it to Freeplay mode (with a character). I have found a couple mentions of how to do it via Console/Lua commands, however they didn't work for me.
I am prepared to paypal gift $5USD to the first person to give me the correct console commands to do it.
I am running Factorio on OSX (although I doubt that matters).
The map was started as a Sandbox mode map, and has never been anything but.
Thanks!
This command should do what you're asking
Code: Select all
/c game.local_player.character = game.local_player.surface.create_entity{name = "player", position = {0,0}, force = game.local_player.force}
No reward needed, but if you'd like you can donate to the dev team
https://www.factorio.com/donations
Perfect! Thankyou! Donated!
Re: (Reward offered) Console command to change from Sandbox
Posted: Tue Apr 19, 2016 9:12 pm
by salkinxd
Hello guys! I'm asking, if there is a way to to the exact different, go from a character to the sandbox mode.
I wanted to change my already built map from normal mode to sandbox (So basically kill the player).
A console command would be awesome!
If there isn't any commands for that, maybe a way to change it in the files or something.
Thanks for any response!
Re: (Reward offered) Console command to change from Sandbox
Posted: Tue Apr 19, 2016 9:25 pm
by prg
Detach from character:
Code: Select all
/c game.local_player.character=nil
To re-attach to it, point at it with the mouse and
Code: Select all
/c game.local_player.character=game.local_player.selected
If you're sure you don't need it anymore, point at it again while detached and
Code: Select all
/c game.local_player.selected.destroy()
(put your equipment in a chest first)
Re: (Reward offered) Console command to change from Sandbox
Posted: Tue Apr 19, 2016 10:03 pm
by salkinxd
Thanks VERY much! Appricate it!
Re: (Reward offered) Console command to change from Sandbox
Posted: Wed Oct 19, 2016 8:28 am
by bazulis
Hello
I've tried this command to change game mode from sandbox to normal, but I am getting this error:
Is this because there is another command or I can't convert the game mode when it was started as sandbox?
Thank you.
Re: (Reward offered) Console command to change from Sandbox
Posted: Wed Oct 19, 2016 9:10 am
by prg
It's just "player" instead of "local_player" nowadays.
Re: (Reward offered) Console command to change from Sandbox
Posted: Wed Oct 19, 2016 3:34 pm
by bazulis
prg wrote:It's just "player" instead of "local_player" nowadays.
Omg, it works! Tkank you very much