Page 1 of 1

How to play sandbox with character and unlimited crafting?

Posted: Thu Jul 28, 2016 11:34 am
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

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

Posted: Fri Aug 05, 2016 11:54 am
by amz3
thanks!

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

Posted: Fri Aug 05, 2016 12:12 pm
by amz3
Is it possible to play sandbox without character? :?:

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

Posted: Fri Aug 05, 2016 11:27 pm
by amz3
I was looking for the sandbox scenario :o

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

Posted: Wed Aug 10, 2016 11:23 am
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

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

Posted: Wed Nov 06, 2019 9:08 pm
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}

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

Posted: Sat Mar 28, 2020 4:15 am
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.

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

Posted: Sat Mar 28, 2020 11:33 am
by disentius
Or alternatively, use the /editor command in any game.