I'm trying to use force commands so my friends and I can do a PvP game.
The Multiplayer wiki page has a list of force commands that you can use to do this.
https://wiki.factorio.com/index.php?tit ... yer#Forces
I was able to run the first command and create a force with no problem, but can't figure out how to add players to the force.
The command I'm using in game: (I did call the force "force 1", and my name is set to "silverlava" in the options menu)
/c game.get_player('silverlava').force = game.forces['force 1']
This is the error it returns when I press enter:
Cannot execute command. Error: LuaGameScripts doesn't contain key get_player. stack traceback: [string "(the command I used)"]:1: in main chunk
This happened both in singleplayer and multiplayer.
I'm not quite sure what the error means, but my best guess is the command has changed from get_player to something else, and the wiki wasn't updated. Does anyone if there's a different command, or if not what I'm doing wrong?
[0.13.19] Forces command not working
-
- Manual Inserter
- Posts: 2
- Joined: Wed Sep 14, 2016 10:34 pm
- Contact:
Re: [0.13.19] Forces command not working
/c game.players['silverlava'].force = game.forces['force 1']
-
- Manual Inserter
- Posts: 2
- Joined: Wed Sep 14, 2016 10:34 pm
- Contact:
Re: [0.13.19] Forces command not working
Thank you! This command worked.DaveMcW wrote:/c game.players['silverlava'].force = game.forces['force 1']
Re: [0.13.19] Forces command not working
Hi, just a note: up-to-date documentation to Factorio API is here: http://lua-api.factorio.com/