How to play sandbox with character and unlimited crafting?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
7h3w1z4rd
Inserter
Inserter
Posts: 31
Joined: Fri Feb 26, 2016 9:48 am
Contact:

How to play sandbox with character and unlimited crafting?

Post by 7h3w1z4rd »

So you wanna play sandbox but with character and unlimited crafting u say? Ok, this is what you gotta do...

First you need to create a character:

Code: Select all

/c game.player.character = game.player.surface.create_entity{name="player", position = {0,0}, force = game.forces.player}
Now you have a character, now you just need to enable cheat mode:

Code: Select all

/c game.player.cheat_mode=true
And if you want to enable peaceful too:

Code: Select all

/c game.player.surface.peaceful_mode = true
Now you can play sandbox with unlimited crafting and peaceful aliens :D

Optional!

Eternal day:

Code: Select all

/c game.surfaces[1].always_day=true
remove ore: (replace number with the amount of blocks/2 you wanna remove)

Code: Select all

/c for _, entity in ipairs(game.player.surface.find_entities_filtered{
        area={{game.player.position.x-BLOCKS, game.player.position.y-BLOCKS},
            {game.player.position.x+BLOCKS, game.player.position.y+BLOCKS}},
            type="resource"})
do
    entity.destroy()
end

amz3
Burner Inserter
Burner Inserter
Posts: 8
Joined: Fri Aug 05, 2016 11:22 am
Contact:

Re: How to play sandbox with character and unlimited crafting?

Post by amz3 »

thanks!

amz3
Burner Inserter
Burner Inserter
Posts: 8
Joined: Fri Aug 05, 2016 11:22 am
Contact:

Re: How to play sandbox with character and unlimited crafting?

Post by amz3 »

Is it possible to play sandbox without character? :?:

amz3
Burner Inserter
Burner Inserter
Posts: 8
Joined: Fri Aug 05, 2016 11:22 am
Contact:

Re: How to play sandbox with character and unlimited crafting?

Post by amz3 »

I was looking for the sandbox scenario :o

7h3w1z4rd
Inserter
Inserter
Posts: 31
Joined: Fri Feb 26, 2016 9:48 am
Contact:

Re: How to play sandbox with character and unlimited crafting?

Post by 7h3w1z4rd »

amz3 wrote:I was looking for the sandbox scenario :o
Just use the custom scenario, and click sandbox and you have it :D

uselessscat
Manual Inserter
Manual Inserter
Posts: 1
Joined: Wed Nov 06, 2019 9:07 pm
Contact:

Re: How to play sandbox with character and unlimited crafting?

Post by uselessscat »

Now the code has changed to this i think:

Code: Select all

/c game.player.character = game.player.surface.create_entity{name="character", position = {0,0}, force = game.forces.player}

romainl972
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sat Mar 28, 2020 4:13 am
Contact:

Re: How to play sandbox with character and unlimited crafting?

Post by romainl972 »

amz3 wrote:
Fri Aug 05, 2016 12:12 pm
Is it possible to play sandbox without character? :?:
You can do

Code: Select all

/c game.player.character.destroy()
which will make your character disappear.

User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 694
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: How to play sandbox with character and unlimited crafting?

Post by disentius »

Or alternatively, use the /editor command in any game.

Post Reply

Return to “Gameplay Help”