Cannot save map. There is no player - how to deal with it?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
TOMII
Burner Inserter
Burner Inserter
Posts: 9
Joined: Wed Oct 23, 2013 6:40 am
Contact:

Cannot save map. There is no player - how to deal with it?

Post by TOMII »

Hello

Like i mentioned in the topic name, I have a problem with creating a map for sandbox play.
I cant save it unless I place a player but then its not a free sandbox anymore ;/
Is there a way to go around it?

Thanks!

User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: Cannot save map. There is no player - how to deal with i

Post by FreeER »

add a player, then create a control.lua file manually within the scenario folder and add

Code: Select all

game.oninit(function()
  local character = game.player.character
  if character then character.destroy() end
  game.player.setcontroller{type=defines.controllers.god}
end)
that should place you in god mode (in fact it's the same code that the devs used in the sandbox control.lua).

TOMII
Burner Inserter
Burner Inserter
Posts: 9
Joined: Wed Oct 23, 2013 6:40 am
Contact:

Re: Cannot save map. There is no player - how to deal with i

Post by TOMII »

It worked!
Thank you :)

Post Reply

Return to “Gameplay Help”