(Reward offered) Console command to change from Sandbox

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
seewhymit
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Mar 13, 2016 3:09 am
Contact:

(Reward offered) Console command to change from Sandbox

Post 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!

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5151
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: (Reward offered) Console command to change from Sandbox

Post 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

seewhymit
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Mar 13, 2016 3:09 am
Contact:

Re: (Reward offered) Console command to change from Sandbox

Post 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!

Image

salkinxd
Burner Inserter
Burner Inserter
Posts: 5
Joined: Thu Mar 10, 2016 11:34 am
Contact:

Re: (Reward offered) Console command to change from Sandbox

Post 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!

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: (Reward offered) Console command to change from Sandbox

Post 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)
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

salkinxd
Burner Inserter
Burner Inserter
Posts: 5
Joined: Thu Mar 10, 2016 11:34 am
Contact:

Re: (Reward offered) Console command to change from Sandbox

Post by salkinxd »

Thanks VERY much! Appricate it!

bazulis
Manual Inserter
Manual Inserter
Posts: 4
Joined: Wed Oct 19, 2016 8:20 am
Contact:

Re: (Reward offered) Console command to change from Sandbox

Post by bazulis »

Hello :)

I've tried this command to change game mode from sandbox to normal, but I am getting this error:
Image

Is this because there is another command or I can't convert the game mode when it was started as sandbox?
Thank you.

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: (Reward offered) Console command to change from Sandbox

Post by prg »

It's just "player" instead of "local_player" nowadays.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

bazulis
Manual Inserter
Manual Inserter
Posts: 4
Joined: Wed Oct 19, 2016 8:20 am
Contact:

Re: (Reward offered) Console command to change from Sandbox

Post by bazulis »

prg wrote:It's just "player" instead of "local_player" nowadays.
Omg, it works! Tkank you very much :)

Post Reply

Return to “Gameplay Help”