Whenever i load up a Custom Scenario i have made, it starts me in god mode. i have not found a way to be able to play me scenarios as a player.
I remember in really old versios you could literally just place a character to play as.
In some of the newer versions, but still a while ago, you could put in lua code "/c game.players[1].character = game.createentity({name="player", position = {0,0}, force = game.forces.player})" to be able to spawn yourself in. but whenever i use it now it says theres no such thing as "createentity", so i put "create_entity" and it still wont work. if there's any other way to fix the lua code please comment.
Neither of those options exist any more. is there anyway to spawn a player any more? or is there only god mode, because that defeats the purpose completely.
Custom Scenario No Spawning
Re: Custom Scenario No Spawning
Since support for different surfaces was added you now need to run something like
Code: Select all
/c game.local_player.character = game.local_player.surface.create_entity{name="player", position = {0,0}, force = game.forces.player}
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
Re: Custom Scenario No Spawning
Thanks or the code, ill start playing right away, but i still dont get why you have to use code to spawn in. why dont they just reintroduce the "player" entity while creating a map or something. it just creates hassle for the player.
-
- Manual Inserter
- Posts: 1
- Joined: Sun Mar 27, 2016 7:35 pm
- Contact:
Re: Custom Scenario No Spawning
Ok I used this code to test out what it does, but it spawned me a new character, anyway to switch back to my old one and delete the new one?
Re: Custom Scenario No Spawning
First you have to enter god mode again:Hans Felix wrote:Ok I used this code to test out what it does, but it spawned me a new character, anyway to switch back to my old one and delete the new one?
Code: Select all
/c game.local_player.character = nil
(Make sure you don't have anything left in the inventory, it will be lost!)
Code: Select all
/c game.local_player.selected.destroy()
(Also make sure you don't have anything left in the god-mode inventory, it will also be lost!)
Code: Select all
/c game.local_player.character = game.local_player.selected