In other languages: Deutsch 日本語 한국어 Русский 简体中文

Console: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(was removed in 0.13.9)
(→‎Reset any modifiers to default, unresearch all technologies: readded unresearch all tech, detailed what reset() does)
(32 intermediate revisions by 14 users not shown)
Line 2: Line 2:


== Overview ==
== Overview ==
The '''Console''' is Factorio's command-line interface.
The in-game console is used for:
The in-game console is used for:


Line 17: Line 19:
The console display can be toggled with the {{keybinding|/}} (slash) or {{keybinding|~}} (tilde) keys.
The console display can be toggled with the {{keybinding|/}} (slash) or {{keybinding|~}} (tilde) keys.


You can customize the keys via '''Options Menu -> Keyboard -> Toggle Lua console'''. When the console is open, you'll see a blinking cursor at the bottom of the screen; type your message or command and hit '''Return''' to send it (this will also close the console). Documentation about message and command prefixes can be found further down this page.
You can customize the keys via '''Options Menu -> Keyboard -> Toggle Lua console'''.
When the console is open, you'll see a blinking cursor at the bottom of the screen; type your message or command and hit '''Return''' to send it (this will also close the console).
Documentation about message and command prefixes can be found further down this page.


When console is closed, only the most recent messages/commands will be displayed, but they will gradually fade away (opening the console will immediately re-display all recent messages). Note that by default, all executed commands are made visible to all users. You can set the fade out time via '''Options Menu -> Other Settings -> Message Delay'''.
When console is closed, only the most recent messages/commands will be displayed, but they will gradually fade away (opening the console will immediately re-display all recent messages).
Note that by default, all executed commands are made visible to all users. You can set the fade out time via '''Options Menu -> Other Settings -> Message Delay'''.


If you want to immediately hide the console, open the console and then press '''Escape''' key (or press '''Return''' without entering any message/command). This not only closes the console, but it also hides all the recent messages/commands. In [https://forums.factorio.com/viewtopic.php?f=3&t=32389 Factorio 0.14.5 and later], you can clear the console with the '''/clear''' command.
If you want to immediately hide the console, open the console and then press '''Escape''' key (or press '''Return''' without entering any message/command).
This not only closes the console, but it also hides all the recent messages/commands.
The console can be cleared with the '''/clear''' command.


Note that the console can also accept raw Lua code as well as game commands.
Note that the console can also accept raw Lua code as well as game commands.
Line 33: Line 40:
Use the {{keybinding|←}} and {{keybinding|→}} keys to cursor through the currently displayed message or command, which you can edit (delete, insert, etc.) and resend (by pressing '''Return''').
Use the {{keybinding|←}} and {{keybinding|→}} keys to cursor through the currently displayed message or command, which you can edit (delete, insert, etc.) and resend (by pressing '''Return''').


In [https://forums.factorio.com/viewtopic.php?f=3&t=32389 Factorio 0.14.5 and later], the '''Tab''' key will auto-complete commands and player ids.
The {{keybinding|Tab}} key will auto-complete commands and player ids.


== Multiplayer Chat ==
== Multiplayer Chat ==


Send private message to specific player with '''/whisper''' (or '''/w'''):
Send private message to specific player with '''/whisper''' (or '''/w'''):
 
<syntaxhighlight lang="lua">
/whisper <playerId> <message>
/whisper <playerId> <message>
</syntaxhighlight>


Reply to the most recently received private message with '''/reply''' (or '''/r'''):
Reply to the most recently received private message with '''/reply''' (or '''/r'''):
<syntaxhighlight lang="lua">
/reply <message>
</syntaxhighlight>


/reply <message>
Group chat works like this:
 
<syntaxhighlight lang="lua">
In [https://forums.factorio.com/viewtopic.php?f=3&t=32248 Factorio 0.14.4 and later], group chat works like this:
hello my team!
 
</syntaxhighlight>
hello my team!
<syntaxhighlight lang="lua">
 
/s hello all players!
/s hello all players!
/shout same as /s
/shout same as /s
</syntaxhighlight>
 
In Factorio 0.14.3 and earlier, group chat worked like this:
 
hello all players!
 
/team hello my team!


These are just the main chat features - there are also options for banning, ignoring and muting players; see the console '''/help''' for a full list.
These are just the main chat features - there are also options for banning, ignoring and muting players; see the console '''/help''' for a full list.
Line 62: Line 67:


== Commands ==
== Commands ==
To see a list of all available commands, enter '''/help''' (or '''/h''') in to the console. The available commands will depend on Factorio version and game setup.
To see a list of all available commands, enter '''/help''' (or '''/h''') in to the console.
 
The available commands will depend on Factorio version and game setup.
/help
<syntaxhighlight lang="lua">
/help
</syntaxhighlight>


In [https://forums.factorio.com/viewtopic.php?f=3&t=32248 Factorio 0.14.4 and later], the '''/help''' command will just display a list of commands - to get full details for a command add the command name (without slash) after '''/help''' (or '''/h'''), for example if you want help on the '''/evolution''' command, you'd type:
In [https://forums.factorio.com/viewtopic.php?f=3&t=32248 Factorio 0.14.4 and later], the '''/help''' command will just display a list of commands - to get full details for a command add the command name (without slash) after '''/help''' (or '''/h'''), for example if you want help on the '''/evolution''' command, you'd type:
 
<syntaxhighlight lang="lua">
/h evolution
/h evolution
</syntaxhighlight>


=== Scripting and cheat commands ===
=== Scripting and cheat commands ===
You can run Lua script commands via the console. It works similarly to any command line interface or the JavaScript console for your browser.
You can run Lua script commands via the console.
It works similarly to any command line interface or the JavaScript console for your browser.


This is a very powerful feature, which also allows cheating, and as such <span style="color:#FF0000">achievements will be permanently disabled for the save</span> as soon as you use a script command.
This is a very powerful feature, which also allows cheating, and as such <span style="color:#FF0000">achievements will be permanently disabled for the save</span> as soon as you use a script command.


To run a script, prefix it with '''/command''' (or '''/c'''), for example:
To run a script, prefix it with '''/command''' (or '''/c'''), for example:
<syntaxhighlight lang="lua">
/c game.player.print 'hello me!'
</syntaxhighlight>


/c game.player.print 'hello me!'
In a multiplayer game, only admins are able to use commands, and the command will be echoed to all other players.


If you're in a multiplayer game, the command will be echoed to all other players (so they can see if you're cheating).
Multiplayer server admins can use '''/silent-command''' (only via RCON/server console) instead of '''/c''' to avoid the command being echoed to all players.
<syntaxhighlight lang="lua">
/silent-command game.player.print 'only admins can use (and see) silent commands'
</syntaxhighlight>


In [https://forums.factorio.com/viewtopic.php?p=203991#p203991 Factorio 0.14.5 and later], multiplayer server admins can use '''/silent-command''' (only via RCON/server console) instead of '''/c''' to avoid the command being echoed to all players.
Mod developers can also take advantage of the special '''/measured-command''' which is like '''/c''' but will time how long the command takes to run.
This is very useful for performance tuning scripts.
<syntaxhighlight lang="lua">
/measured-command game.player.print 'how much time does this take to run?'
</syntaxhighlight>


/silent-command game.player.print 'only admins can use (and see) silent commands'
The game ignores newlines when pasting "scriptlets" in the console.
This means they can be written in a human readable form in an editor and copy/pasted into the console, making understanding and editing a bit easier.


Mod developers can also take advantage of the special '''/measured-command''' which is like '''/c''' but will time how long the command takes to run. This is very useful for performance tuning your scripts.
== Basic Command Examples ==
 
/measured-command game.player.print 'how much time does this take to run?'
 
The game ignores newlines when pasting "scriptlets" in the console. This means they can be written in a human readable form in an editor and copy/pasted into the console, making understanding and editing a bit easier.
 
You can essentially fire any Lua command here, just as you would from a Lua program - Factorio [[Mods]] are merely Lua commands. Therefore you don't necessarily need "cheats" active per-se, as the console allows you full access to the game's internals. You only need a familiarity with the commands and types, as shown in the below examples and the [[Modding]] section.
 
 
==Basic Command Examples==


=== Large Screenshots ===
=== Large Screenshots ===


This is how you would take a large HD screenshot. As usual, replace the X and Y with the values you wish.
This is how you would take a large HD screenshot.
 
The file is put into a folder called "script-output", which is located in the same location as the mods folder. These pictures can be quite large.


/c game.take_screenshot{<parameters>}
The file is put into a folder called "script-output", which is located in the same location as the mods folder, the [[application directory]].
These pictures can be quite large.
<syntaxhighlight lang="lua">
/c game.take_screenshot{<parameter>=<value>,...}
</syntaxhighlight>


The command takes the following parameters, separated by commas:
The command takes the following parameters:


* showgui - Boolean value, true or false. True if GUIs should be included in the screenshot.
* showgui - Boolean value, true or false. True if GUIs should be included in the screenshot.
* resolution - Takes an x and y, in the form {x = XPOS, y = YPOS}
* resolution - Takes an x and y, in the form {x = ''<x-size>'', y = ''<y-size>''}.
* show_entity_info - Boolean value, true if alt info should be shown in the screenshot.
* show_entity_info - Boolean value, true if alt info should be shown in the screenshot.
* zoom - A value to take the screenshot from a certain zoom.
* zoom - The zoom level. 1 is normal, 2 is zoomed in to half the area, 0.5 is zoomed out to twice the area, etc.
 
Example, this takes a 1000x1000 screenshot with alt-mode on, but without the gui, at zoom level 2:
<syntaxhighlight lang="lua">
/c game.take_screenshot{resolution = {x = 1000, y = 1000}, zoom = 2, show_entity_info = true}
</syntaxhighlight>


=== Use it as calculator ===
=== Use it as calculator ===
 
<syntaxhighlight lang="lua">
/c game.player.print(1234 * 5678)
/c game.player.print(1234*5678)
</syntaxhighlight>


=== Mine faster ===
=== Mine faster ===
 
<syntaxhighlight lang="lua">
/c game.player.force.manual_mining_speed_modifier=1000
/c game.player.force.manual_mining_speed_modifier=1000
</syntaxhighlight>


=== Craft faster ===
=== Craft faster ===
 
<syntaxhighlight lang="lua">
/c game.player.force.manual_crafting_speed_modifier=1000
/c game.player.force.manual_crafting_speed_modifier=1000
</syntaxhighlight>


=== Unlock and Research all Technology ===
=== Unlock and Research all Technology ===
<syntaxhighlight lang="lua">
/c game.player.force.research_all_technologies()
</syntaxhighlight>


/c game.player.force.research_all_technologies()
Undo this with the command in the next section.


Undo this with:
=== Unresearch all technologies ==
 
This does not reset manually applied bonuses
/c for _, tech in pairs(game.player.force.technologies) do tech.researched=false end
<syntaxhighlight lang="lua">
 
/c for _, tech in pairs(game.player.force.technologies) do  
=== Reset any modifiers to default ===
tech.researched=false
This includes Tech and speed alterations.
game.player.force.set_saved_technology_progress(tech, 0)
 
end
/c game.player.force.reset()
</syntaxhighlight>
=== Reset your force ===
This resets all data for your force, including kill and production statistics, technologies, bonuses and charting status.
<syntaxhighlight lang="lua">
/c game.player.force.reset()
</syntaxhighlight>


=== Zoom beyond normal bounds ===
=== Zoom beyond normal bounds ===
Note that zooming too far out can cause performance hits. Be careful.
Note that zooming too far out can cause performance hits. Be careful.
 
<syntaxhighlight lang="lua">
/c game.player.zoom = 0.1
/c game.player.zoom=0.1
</syntaxhighlight>




Line 146: Line 176:
=== Refill resources (refill oil, iron etc.) ===
=== Refill resources (refill oil, iron etc.) ===
While holding the cursor over a resource tile in-game
While holding the cursor over a resource tile in-game
/c game.player.selected.amount=7500
<syntaxhighlight lang="lua">
/c game.player.selected.amount=7500
</syntaxhighlight>


=== Add items to the player's inventory ===
=== Add items to the player's inventory ===
Replace iron-plate with the internal name of the item desired.
Replace iron-plate with the internal name of the item desired.
<syntaxhighlight lang="lua">
/c game.player.insert{name="iron-plate", count=100}
</syntaxhighlight>


/c game.player.insert{name="iron-plate", count=100}
For instance, here's a god-mode energy system interface:
<syntaxhighlight lang="lua">
/c game.player.insert{name="electric-energy-interface"}
</syntaxhighlight>
 
Add a powerful armor with equipment:
<syntaxhighlight lang="lua">
/c local player = game.player
player.insert{name="power-armor-mk2", count = 1}
local p_armor = player.get_inventory(5)[1].grid
p_armor.put({name = "fusion-reactor-equipment"})
p_armor.put({name = "fusion-reactor-equipment"})
p_armor.put({name = "fusion-reactor-equipment"})
p_armor.put({name = "exoskeleton-equipment"})
p_armor.put({name = "exoskeleton-equipment"})
p_armor.put({name = "exoskeleton-equipment"})
p_armor.put({name = "exoskeleton-equipment"})
p_armor.put({name = "energy-shield-mk2-equipment"})
p_armor.put({name = "energy-shield-mk2-equipment"})
p_armor.put({name = "personal-roboport-mk2-equipment"})
p_armor.put({name = "night-vision-equipment"})
p_armor.put({name = "battery-mk2-equipment"})
p_armor.put({name = "battery-mk2-equipment"})
</syntaxhighlight>


=== Cheat mode ===
=== Cheat mode ===
Allows for infinite free crafting. Disable by replacing true with false.
Allows for infinite free crafting. Disable by replacing true with false.
 
<syntaxhighlight lang="lua">
/c game.player.cheat_mode=true
/c game.player.cheat_mode=true
 
</syntaxhighlight>


== World Manipulation ==
== World Manipulation ==
Line 164: Line 222:


Reveals the map around the player, similar to a [[radar]].
Reveals the map around the player, similar to a [[radar]].
 
<syntaxhighlight lang="lua">
  /c local radius = 150; game.player.force.chart(game.player.surface, {{game.player.position.x - radius, game.player.position.y - radius}, {game.player.position.x + radius, game.player.position.y + radius}})
/c local radius=150
 
game.player.force.chart(game.player.surface, {{game.player.position.x-radius, game.player.position.y-radius}, {game.player.position.x+radius, game.player.position.y+radius}})
</syntaxhighlight>
or from start position
<syntaxhighlight lang="lua">
/c game.forces.player.chart(game.player.surface, {{x = -2000, y = -2000}, {x = 2000, y = 2000}})
</syntaxhighlight>
Change 150 to the desired radius, higher values take longer.
Change 150 to the desired radius, higher values take longer.


=== Turn off night ===
=== Turn off night ===
Enables eternal day.
Enables eternal day.
/c game.surfaces[1].always_day=true
<syntaxhighlight lang="lua">
/c game.player.surface.always_day=true
</syntaxhighlight>


=== Change game speed ===
=== Change game speed ===
0.5 is half speed, 1 is default, 2 is double speed, etc. This can be used for a lot of things like when you know you will have to wait for long periods of time for something to complete. Increasing will decrease performance, be careful.
0.5 is half speed, 1 is default, 2 is double speed, etc. Minimum is 0.01. This can be used for a lot of things like when you know you will have to wait for long periods of time for something to complete. Increasing will decrease performance, be careful.
<syntaxhighlight lang="lua">
/c game.speed=X
</syntaxhighlight>


/c game.speed = X
=== Expensive (marathon) or normal mode ===
To change from normal to expensive mode preset (this changes the research cost and intermediate product cost):
<syntaxhighlight lang="lua">
/c game.difficulty_settings.recipe_difficulty=1
game.difficulty_settings.technology_difficulty=1
game.difficulty_settings.technology_price_multiplier=4
</syntaxhighlight>
 
To change back to normal:
<syntaxhighlight lang="lua">
/c game.difficulty_settings.recipe_difficulty=0
game.difficulty_settings.technology_difficulty=0
game.difficulty_settings.technology_price_multiplier=1
</syntaxhighlight>


=== Freeze Time Passage ===
=== Freeze Time Passage ===
Stops the advancement of the time if true is passed, or unfreezes it if false is passed.
Stops the advancement of the time if you replace "BOOL" with "true" or unfreezes it if you replace it with "false".
<syntaxhighlight lang="lua">
/c game.player.surface.freeze_daytime=BOOL
</syntaxhighlight>


/c game.player.surface.freeze_daytime(BOOL)
=== Remove all pollution ===
<syntaxhighlight lang="lua">
/c game.player.surface.clear_pollution()
</syntaxhighlight>


=== Remove all pollution ===
=== Add new resource patch ===
This creates a new 11x11 patch of resources, centered on the player character.
The patch it creates is perfectly square but it randomizes the amount similar to natural generation, with fewer ore at the edges and more ore in the center.
The default numbers result in a patch with 2500-3000 ore.


/c local surface = game.player.surface;
If you want a larger patch, change "local size = 5" to a larger number.
for coord in surface.get_chunks() do
A larger patch will have exponentially more ore.
  surface.pollute({coord.x * 32, coord.y * 32}, -10000000)
Entering a number above 30 is not recommended.
end


=== Add new resource patch ===
If you want a richer patch, change "local density = 10" to a larger number.
This creates a new 5x5 patch of resources, centered on the player character. For resources other than stone, just change "stone" to "iron-ore", "copper-ore", or "coal"
Entering a very large number shouldn't hurt anything but you probably don't need to go above 100.


/c local surface = game.player.surface;
To choose which resource is spawned, change "stone" near the bottom to "iron-ore", "copper-ore", "coal", or "uranium-ore".
for y=-2,2 do
<syntaxhighlight lang="lua">
  for x=-2,2 do
/c local surface=game.player.surface
  surface.create_entity({name="stone", amount=5000, position={game.player.position.x+x, game.player.position.y+y}})
local ore=nil
  end
local size=5
end
local density=10
for y=-size, size do
for x=-size, size do
a=(size+1-math.abs(x))*10
b=(size+1-math.abs(y))*10
if a<b then
ore=math.random(a*density-a*(density-8), a*density+a*(density-8))
end
if b<a then
ore=math.random(b*density-b*(density-8), b*density+b*(density-8))
end
surface.create_entity({name="stone", amount=ore, position={game.player.position.x+x, game.player.position.y+y}})
end
end
</syntaxhighlight>


=== Add new oil patch ===
=== Add new oil patch ===
This creates 9 crude oil patches in a 3x3 square.
This creates 9 crude oil patches in a 3x3 square.
 
<syntaxhighlight lang="lua">
/c for y=0,2 do
/c for y=0,2 do
  for x=0,2 do
for x=0,2 do
    game.player.surface.create_entity({name="crude-oil", amount=5000, position={game.player.position.x+x*7-7, game.player.position.y+y*7-7}})
game.player.surface.create_entity({name="crude-oil", amount=5000, position={game.player.position.x+x*7-7, game.player.position.y+y*7-7}})
  end
end
  end
end
</syntaxhighlight>


or randomly without any collision:
or randomly without any collision:
 
<syntaxhighlight lang="lua">
/c local position = nil
/c local position=nil
for i=1,9 do
for i=1,9 do
position = game.player.surface.find_non_colliding_position("crude-oil", game.player.position, 0, i/2+1.5)
position=game.player.surface.find_non_colliding_position("crude-oil", game.player.position, 0, i/2+1.5)
if position then  
if position then  
game.player.surface.create_entity({name="crude-oil", amount=5000, position=position})
game.player.surface.create_entity({name="crude-oil", amount=5000, position=position})
end
end
end
end
</syntaxhighlight>


=== Count entities ===
=== Count entities ===
Counts all entities whose name includes the string in local entity.
Counts all entities whose name includes the string in local entity.
<syntaxhighlight lang="lua">
/c local entity="belt"
local surface=game.player.surface
local count=0
for c in surface.get_chunks() do
for key, ent in pairs(surface.find_entities_filtered({area={{c.x*32, c.y*32}, {c.x*32+32, c.y*32+32}}, force=game.player.force})) do
if string.find(ent.name,entity) then
count=count+1
end
end
end
game.player.print(count)
</syntaxhighlight>


/c
=== Emptying all pipes and underground pipes ===
local entity = "belt"
It can be helpful when your friend has connected all pipes together.
<syntaxhighlight lang="lua">
local surface = game.player.surface
/c local surface = game.surfaces[1]
local count = 0
local deleted=0
for c in surface.get_chunks() do
for c in surface.get_chunks() do
  for key, ent in pairs(surface.find_entities_filtered({area={{c.x * 32, c.y * 32}, {c.x * 32 + 32, c.y * 32 + 32}}, force= game.player.force})) do
for key, entity in pairs(surface.find_entities_filtered({area={{c.x*32, c.y*32}, {c.x*32+32, c.y*32+32}}, force=game.player.force})) do
    if string.find(ent.name,entity) then
if string.find(entity.name, "pipe") then
      count = count + 1
for i=1,#entity.fluidbox do
    end
deleted = deleted + 1
  end
entity.fluidbox[i] = nil;
end
end
game.player.print(count)
end
end
end
game.player.print("deleted: "..deleted)
</syntaxhighlight>


== Enemy/Evolution ==
== Enemy/Evolution ==
=== Check how far the biters have evolved ===
=== Check how far the biters have evolved ===
Note that commands that do not start with "/c" do not disable achievements.
Note that commands that do not start with "/c" do not disable achievements.
/evolution
<syntaxhighlight lang="lua">
/evolution
</syntaxhighlight>


=== Set evolution factor ===
=== Set evolution factor ===
Ranges from 0 (new game) to 1.
Ranges from 0 (new game) to 1.
 
<syntaxhighlight lang="lua">
/c game.evolution_factor=X
/c game.forces["enemy"].evolution_factor=X
</syntaxhighlight>


=== Disable time-based evolution & increases pollution-based evolution ===
=== Disable time-based evolution & increases pollution-based evolution ===
/c game.map_settings.enemy_evolution.time_factor = 0
<syntaxhighlight lang="lua">
/c game.map_settings.enemy_evolution.pollution_factor = game.map_settings.enemy_evolution.pollution_factor * 2
/c game.map_settings.enemy_evolution.time_factor=0
/c game.map_settings.enemy_evolution.pollution_factor=game.map_settings.enemy_evolution.pollution_factor*2
</syntaxhighlight>


The "2" at the end of the last command will double the default pollution factor. You can substitute another number to increase (or decrease) the pollution factor further.
The "2" at the end of the last command will double the default pollution factor. You can substitute another number to increase (or decrease) the pollution factor further.
Line 254: Line 381:
=== Kill all biters on the "enemy" force ===
=== Kill all biters on the "enemy" force ===
Note that this will kill only mobile units and worms, spawners will not be killed.
Note that this will kill only mobile units and worms, spawners will not be killed.
/c game.forces["enemy"].kill_all_units()
<syntaxhighlight lang="lua">
/c game.forces["enemy"].kill_all_units()
</syntaxhighlight>


=== Kill all enemies ===
=== Kill all enemies ===
This will kill all biters, bases and worms. Anything that is an enemy will be completely destroyed. This only affects enemies in the explored world, so any unexplored parts of the map which still need to be generated will still have enemies.
This will kill all biters, bases and worms. Anything that is an enemy will be completely destroyed. This only affects enemies in the explored world, so any unexplored parts of the map which still need to be generated will still have enemies.
 
<syntaxhighlight lang="lua">
/c local surface = game.player.surface
/c local surface=game.player.surface
for c in surface.get_chunks() do
for key, entity in pairs(surface.find_entities_filtered({force="enemy"})) do
    for key, entity in pairs(surface.find_entities_filtered({area={{c.x * 32, c.y * 32}, {c.x * 32 + 32, c.y * 32 + 32}}, force= "enemy"})) do
entity.destroy()
        entity.destroy()
end
    end
</syntaxhighlight>
  end


=== Enable peaceful mode ===
=== Enable peaceful mode ===
Peaceful mode prevents biter attacks until provoked. Substitute false for true to disable.
Peaceful mode prevents biter attacks until provoked. Substitute false for true to disable.
/c game.player.surface.peaceful_mode = true
<syntaxhighlight lang="lua">
/c game.player.surface.peaceful_mode=true
</syntaxhighlight>


=== Disable biter expansion ===
=== Disable biter expansion ===
This prevents biters from creating new spawners.
This prevents biters from creating new spawners.
/c game.map_settings.enemy_expansion.enabled = false
<syntaxhighlight lang="lua">
/c game.map_settings.enemy_expansion.enabled=false
</syntaxhighlight>


== Player Character ==
== Player Character ==
Line 278: Line 410:
=== Get Player Position ===
=== Get Player Position ===
Prints coordinates of your current position.
Prints coordinates of your current position.
 
<syntaxhighlight lang="lua">
/c game.player.print({"", "(", game.player.position.x, ", ", game.player.position.y, ")"})
/c game.player.print(game.player.position.x .. ", " .. game.player.position.y)
</syntaxhighlight>


=== Teleport player ===
=== Teleport player ===
Moves the player to the specified location. You should be able to teleport to a specific player if you obtain their coordinates via them executing the previous command and giving them to you.
Moves the player to the specified location. You should be able to teleport to a specific player if you obtain their coordinates via them executing the previous command and giving them to you.
 
<syntaxhighlight lang="lua">
/c game.player.teleport({X, Y})
/c game.player.teleport({X, Y})
</syntaxhighlight>


To teleport to the world's origin, use 0,0.
To teleport to the world's origin, use 0,0.
=== Spawn a player character ===
This is useful for escaping god mode. (see [[Console#Enable_god_mode]].) This will spawn a new player at the spawn point of the world, and connect your controls to it.
/c game.player.character = game.player.surface.create_entity{name="player", position = {0,0}, force = game.forces.player}


=== Change Player color ===
=== Change Player color ===
Note that commands that do not start with "/c" do not disable achievements. Replace COLOR with the name of a color.
Note that commands that do not start with "/c" do not disable achievements. Replace COLOR with the name of a color. Available names are: Black, blue, brown, cyan, gray, green, orange, pink, purple, red, white, and yellow. The color can also be set to an [[:Wikipedia:RGBA_color_space|RGBA value]].
/color COLOR
<syntaxhighlight lang="lua">
/color COLOR
/color r g b a
</syntaxhighlight>


=== Enable god mode ===
=== Enable god mode ===
Line 301: Line 433:


Disassociate your controls from the player:
Disassociate your controls from the player:
 
<syntaxhighlight lang="lua">
/c game.player.character = nil
/c game.player.character=nil
</syntaxhighlight>


Then, hover the mouse over the useless player and destroy it by typing:
Then, hover the mouse over the useless player and destroy it by typing:
<syntaxhighlight lang="lua">
/c game.player.selected.destroy()
</syntaxhighlight>


/c game.player.selected.destroy()
To undo, spawn a player character. This will spawn a new player at the spawn point of the world, and connect your controls to it.
 
<syntaxhighlight lang="lua">
To undo
/c game.player.create_character()
 
</syntaxhighlight>
/c game.player.create_character()


== Research ==
== Research ==
=== Enable faster research ===
=== Enable faster research ===
/c game.player.force.laboratory_speed_modifier = 1
<syntaxhighlight lang="lua">
/c game.player.force.laboratory_speed_modifier=1
</syntaxhighlight>
1 is normal speed, 2 is double speed 3 is triple etc. I think it goes up to 100.
1 is normal speed, 2 is double speed 3 is triple etc. I think it goes up to 100.


=== Enabling specific technologies ===
=== Enabling specific technologies ===
[http://www.factorioforums.com/forum/viewtopic.php?f=18&t=6633 Enabling technologies] (forums)
The internal technology names can be found in the infoboxes on their respective pages, click on the little arrow to show them.
/c game.player.force.technologies['electric-energy-distribution-1'].researched=true
<syntaxhighlight lang="lua">
/c game.player.force.technologies['steel-processing'].researched=true
/c game.player.force.technologies['electric-energy-distribution-1'].researched=true
/c game.player.force.technologies['steel-processing'].researched=true
</syntaxhighlight>


=== Enabling specific recipes ===
=== Enabling specific recipes ===
/c game.player.force.recipes["electric-energy-interface"].enabled = true
The internal recipe/item names can be found in the infoboxes on their respective pages, click on the little arrow to show them.
/c game.player.force.recipes["rocket-silo"].enabled = true
<syntaxhighlight lang="lua">
/c game.player.force.recipes["electric-energy-interface"].enabled=true
/c game.player.force.recipes["rocket-silo"].enabled=true
/c game.player.force.recipes.loader.enabled=true
</syntaxhighlight>


=== Finish research immediately ===
=== Finish research immediately ===
/c for name,technology in pairs(game.player.force.technologies) do technology.researched=technology.enabled end
<syntaxhighlight lang="lua">
/c for name,technology in pairs(game.player.force.technologies) do technology.researched=technology.enabled end
</syntaxhighlight>


== Command Line Parameters ==
== Command Line Parameters ==
'''As of Game Version 0.14.21'''
'''As of Game Version 0.15.13'''


Command line parameters can be used to set settings in the command line before the game launches, this is useful mainly for advanced users or server hosts.
Command line parameters can be used to set settings in the command line before the game launches, this is useful mainly for advanced users or server hosts.
Line 341: Line 486:
   --no-log-rotation                  don't rotate log file
   --no-log-rotation                  don't rotate log file
   --mod-directory PATH              Mod directory to use
   --mod-directory PATH              Mod directory to use
  --check-unused-prototype-data      Print a warning for all prototype values that were not accessed


Running options:
Running options:
Line 347: Line 493:
   --apply-update arg                immediately apply update package
   --apply-update arg                immediately apply update package
   --create FILE                      create a new map
   --create FILE                      create a new map
   --map-gen-settings FILE            Map generation settings for use with
   --map-gen-settings FILE            Map generation settings for use with --create. See data/map-gen-settings.example.json
                                    --create. See data/map-gen-settings.exampl
  --map-settings FILE                Map settings for use with --create. See data/base/prototypes/map-settings.lua
                                    e.json
  --preset arg                      Name of the map generation preset to be used.
  --generate-map-preview FILE        Generate preview images of the map
  --map-preview-size SCALE (=1,024)  Size (in pixels) of map preview
  --map-preview-scale SCALE (=1)    Scale (meters per pixel) of map preview
  --map-preview-offset X,Y (=0,0)    Offset of the center of the map, in meters
   --start-server FILE                start a multiplayer server
   --start-server FILE                start a multiplayer server
   --start-server-load-scenario FILE  start a multiplayer server and load the
   --start-server-load-scenario FILE  start a multiplayer server and load the specified scenario
                                    specified scenario
   --start-server-load-latest        start a multiplayer server and load the latest available save
   --start-server-load-latest        start a multiplayer server and load the
                                    latest available save
   --until-tick TICK                  run a save until given map tick
   --until-tick TICK                  run a save until given map tick
   --mp-connect ADDRESS              start factorio and connect to address
   --mp-connect ADDRESS              start factorio and connect to address
   --load-game FILE                  start Factorio and load a game in
   --load-game FILE                  start Factorio and load a game in singleplayer
                                    singleplayer
   --benchmark FILE                  load save and run benchmark
   --benchmark FILE                  load save and run benchmark
   --benchmark-ticks N (=1,000)      number of ticks for benchmarking. Default
   --benchmark-ticks N (=1,000)      number of ticks for benchmarking. Default is 1000
                                    is 1000
   --force-opengl                    use OpenGL for rendering
   --force-opengl                    use OpenGL for rendering
   --force-d3d                        use Direct3D for rendering
   --force-d3d                        use Direct3D for rendering
  --fullscreen BOOL                  start game in windowed mode (saved to configuration)
  --max-texture-size N              maximal size of texture that the game can use (saved to configuration). Should be power of two greater than 2048
  --graphics-quality arg            accepted values: normal, low, very-low
  --video-memory-usage arg          accepted values: all, high, medium, low
  --gfx-safe-mode                    resets some graphics settings to values that should work on most configurations
  --shader arg                      enable/disable shader postprocessing (saved to configuration)
  --disable-audio                    Disable audio. Mainly for faster startup during development.


Server options:
Server options:
   --port N                          network port to use
   --port N                          network port to use
   --bind ADDRESS[:PORT]              IP address (and optionally port) to bind
   --bind ADDRESS[:PORT]              IP address (and optionally port) to bind to
                                    to
   --rcon-port N                      Port to use for RCON
   --rcon-port N                      Port to use for RCON
   --rcon-password PASSWORD          Password for RCON
   --rcon-password PASSWORD          Password for RCON
   --server-settings FILE            Path to file with server settings. See
   --server-settings FILE            Path to file with server settings. See data/server-settings.example.json
                                    data/server-settings.example.json
  --server-whitelist FILE            Path to file with server whitelist.
  --server-banlist FILE              Path to file with server banlist.
  --console-log FILE                Path to file where a copy of the server's log will be stored
  --server-id FILE                  Path where server ID will be stored or read from


=== Multiplayer ===
=== Multiplayer ===
Line 390: Line 545:


   --map2scenario SAVE
   --map2scenario SAVE
Converts a save game to a User Scenario, allows saved game state to be loaded into map editor. Assuming that save game name is "foo.zip", executing './factorio --map2scenario s1' will result in Factorio loading, opening the save file, and saving the scenario into the scenario folder.
Converts a save game to a User Scenario, allows saved game state to be loaded into map editor.
Assuming that save game name is "foo.zip", executing './factorio --map2scenario s1' will result in Factorio loading, opening the save file, and saving the scenario into the scenario folder.


== See also ==
== See also ==


* http://lua-api.factorio.com/latest/ - Factorio API reference for latest version
* http://lua-api.factorio.com/latest/ - Factorio API reference for latest version
* http://lua-api.factorio.com/ - links to specific versions of API reference
[[Category:Console]]

Revision as of 23:45, 5 December 2017


Overview

The Console is Factorio's command-line interface.

The in-game console is used for:

  • Chatting with other players
  • Running commands / scripts / cheats
  • Occasional status updates

There are three types of command:

  • Multiplayer - message filtering, banning users, etc.
  • Information - display various information about the game
  • Scripting/Cheating - run small Lua scripts (but they disable achievements for the save game)

Using the console

The console display can be toggled with the / (slash) or ~ (tilde) keys.

You can customize the keys via Options Menu -> Keyboard -> Toggle Lua console. When the console is open, you'll see a blinking cursor at the bottom of the screen; type your message or command and hit Return to send it (this will also close the console). Documentation about message and command prefixes can be found further down this page.

When console is closed, only the most recent messages/commands will be displayed, but they will gradually fade away (opening the console will immediately re-display all recent messages). Note that by default, all executed commands are made visible to all users. You can set the fade out time via Options Menu -> Other Settings -> Message Delay.

If you want to immediately hide the console, open the console and then press Escape key (or press Return without entering any message/command). This not only closes the console, but it also hides all the recent messages/commands. The console can be cleared with the /clear command.

Note that the console can also accept raw Lua code as well as game commands.

Console history

The console has an inbuilt history; it's a bit like a text editor where only one line of text is displayed at a time.

Use the and keys to scroll through the console history.

Use the and keys to cursor through the currently displayed message or command, which you can edit (delete, insert, etc.) and resend (by pressing Return).

The Tab key will auto-complete commands and player ids.

Multiplayer Chat

Send private message to specific player with /whisper (or /w):

/whisper <playerId> <message>

Reply to the most recently received private message with /reply (or /r):

/reply <message>

Group chat works like this:

hello my team!
/s hello all players!
/shout same as /s

These are just the main chat features - there are also options for banning, ignoring and muting players; see the console /help for a full list.


Commands

To see a list of all available commands, enter /help (or /h) in to the console. The available commands will depend on Factorio version and game setup.

/help

In Factorio 0.14.4 and later, the /help command will just display a list of commands - to get full details for a command add the command name (without slash) after /help (or /h), for example if you want help on the /evolution command, you'd type:

/h evolution

Scripting and cheat commands

You can run Lua script commands via the console. It works similarly to any command line interface or the JavaScript console for your browser.

This is a very powerful feature, which also allows cheating, and as such achievements will be permanently disabled for the save as soon as you use a script command.

To run a script, prefix it with /command (or /c), for example:

/c game.player.print 'hello me!'

In a multiplayer game, only admins are able to use commands, and the command will be echoed to all other players.

Multiplayer server admins can use /silent-command (only via RCON/server console) instead of /c to avoid the command being echoed to all players.

/silent-command game.player.print 'only admins can use (and see) silent commands'

Mod developers can also take advantage of the special /measured-command which is like /c but will time how long the command takes to run. This is very useful for performance tuning scripts.

/measured-command game.player.print 'how much time does this take to run?'

The game ignores newlines when pasting "scriptlets" in the console. This means they can be written in a human readable form in an editor and copy/pasted into the console, making understanding and editing a bit easier.

Basic Command Examples

Large Screenshots

This is how you would take a large HD screenshot.

The file is put into a folder called "script-output", which is located in the same location as the mods folder, the application directory. These pictures can be quite large.

/c game.take_screenshot{<parameter>=<value>,...}

The command takes the following parameters:

  • showgui - Boolean value, true or false. True if GUIs should be included in the screenshot.
  • resolution - Takes an x and y, in the form {x = <x-size>, y = <y-size>}.
  • show_entity_info - Boolean value, true if alt info should be shown in the screenshot.
  • zoom - The zoom level. 1 is normal, 2 is zoomed in to half the area, 0.5 is zoomed out to twice the area, etc.

Example, this takes a 1000x1000 screenshot with alt-mode on, but without the gui, at zoom level 2:

/c game.take_screenshot{resolution = {x = 1000, y = 1000}, zoom = 2, show_entity_info = true}

Use it as calculator

/c game.player.print(1234*5678)

Mine faster

/c game.player.force.manual_mining_speed_modifier=1000

Craft faster

/c game.player.force.manual_crafting_speed_modifier=1000

Unlock and Research all Technology

/c game.player.force.research_all_technologies()

Undo this with the command in the next section.

= Unresearch all technologies

This does not reset manually applied bonuses

/c for _, tech in pairs(game.player.force.technologies) do 
	tech.researched=false
	game.player.force.set_saved_technology_progress(tech, 0)
end

Reset your force

This resets all data for your force, including kill and production statistics, technologies, bonuses and charting status.

/c game.player.force.reset()

Zoom beyond normal bounds

Note that zooming too far out can cause performance hits. Be careful.

/c game.player.zoom=0.1


Inventory Manipulation

Refill resources (refill oil, iron etc.)

While holding the cursor over a resource tile in-game

/c game.player.selected.amount=7500

Add items to the player's inventory

Replace iron-plate with the internal name of the item desired.

/c game.player.insert{name="iron-plate", count=100}

For instance, here's a god-mode energy system interface:

/c game.player.insert{name="electric-energy-interface"}

Add a powerful armor with equipment:

/c	local player = game.player
player.insert{name="power-armor-mk2", count = 1}
local p_armor = player.get_inventory(5)[1].grid
	p_armor.put({name = "fusion-reactor-equipment"})
	p_armor.put({name = "fusion-reactor-equipment"})
	p_armor.put({name = "fusion-reactor-equipment"})
	p_armor.put({name = "exoskeleton-equipment"})
	p_armor.put({name = "exoskeleton-equipment"})
	p_armor.put({name = "exoskeleton-equipment"})
	p_armor.put({name = "exoskeleton-equipment"})
	p_armor.put({name = "energy-shield-mk2-equipment"})
	p_armor.put({name = "energy-shield-mk2-equipment"})
	p_armor.put({name = "personal-roboport-mk2-equipment"})
	p_armor.put({name = "night-vision-equipment"})
	p_armor.put({name = "battery-mk2-equipment"})
	p_armor.put({name = "battery-mk2-equipment"})

Cheat mode

Allows for infinite free crafting. Disable by replacing true with false.

/c game.player.cheat_mode=true

World Manipulation

Reveal the map around the player

Reveals the map around the player, similar to a radar.

/c local radius=150
game.player.force.chart(game.player.surface, {{game.player.position.x-radius, game.player.position.y-radius}, {game.player.position.x+radius, game.player.position.y+radius}})

or from start position

/c game.forces.player.chart(game.player.surface, {{x = -2000, y = -2000}, {x = 2000, y = 2000}})

Change 150 to the desired radius, higher values take longer.

Turn off night

Enables eternal day.

/c game.player.surface.always_day=true

Change game speed

0.5 is half speed, 1 is default, 2 is double speed, etc. Minimum is 0.01. This can be used for a lot of things like when you know you will have to wait for long periods of time for something to complete. Increasing will decrease performance, be careful.

/c game.speed=X

Expensive (marathon) or normal mode

To change from normal to expensive mode preset (this changes the research cost and intermediate product cost):

/c game.difficulty_settings.recipe_difficulty=1
game.difficulty_settings.technology_difficulty=1
game.difficulty_settings.technology_price_multiplier=4

To change back to normal:

/c game.difficulty_settings.recipe_difficulty=0
game.difficulty_settings.technology_difficulty=0
game.difficulty_settings.technology_price_multiplier=1

Freeze Time Passage

Stops the advancement of the time if you replace "BOOL" with "true" or unfreezes it if you replace it with "false".

/c game.player.surface.freeze_daytime=BOOL

Remove all pollution

/c game.player.surface.clear_pollution()

Add new resource patch

This creates a new 11x11 patch of resources, centered on the player character. The patch it creates is perfectly square but it randomizes the amount similar to natural generation, with fewer ore at the edges and more ore in the center. The default numbers result in a patch with 2500-3000 ore.

If you want a larger patch, change "local size = 5" to a larger number. A larger patch will have exponentially more ore. Entering a number above 30 is not recommended.

If you want a richer patch, change "local density = 10" to a larger number. Entering a very large number shouldn't hurt anything but you probably don't need to go above 100.

To choose which resource is spawned, change "stone" near the bottom to "iron-ore", "copper-ore", "coal", or "uranium-ore".

/c local surface=game.player.surface
local ore=nil
local size=5
local density=10
for y=-size, size do
	for x=-size, size do
		a=(size+1-math.abs(x))*10
		b=(size+1-math.abs(y))*10
		if a<b then
			ore=math.random(a*density-a*(density-8), a*density+a*(density-8))
		end
		if b<a then
			ore=math.random(b*density-b*(density-8), b*density+b*(density-8))
		end
		surface.create_entity({name="stone", amount=ore, position={game.player.position.x+x, game.player.position.y+y}})
	end
end

Add new oil patch

This creates 9 crude oil patches in a 3x3 square.

/c for y=0,2 do
	for x=0,2 do
		game.player.surface.create_entity({name="crude-oil", amount=5000, position={game.player.position.x+x*7-7, game.player.position.y+y*7-7}})
	end
end

or randomly without any collision:

/c local position=nil
for i=1,9 do
	position=game.player.surface.find_non_colliding_position("crude-oil", game.player.position, 0, i/2+1.5)
	if position then 
		game.player.surface.create_entity({name="crude-oil", amount=5000, position=position})
	end
end

Count entities

Counts all entities whose name includes the string in local entity.

/c local entity="belt"
local surface=game.player.surface
local count=0
for c in surface.get_chunks() do
	for key, ent in pairs(surface.find_entities_filtered({area={{c.x*32, c.y*32}, {c.x*32+32, c.y*32+32}}, force=game.player.force})) do
		if string.find(ent.name,entity) then
			count=count+1
		end
	end
end
game.player.print(count)

Emptying all pipes and underground pipes

It can be helpful when your friend has connected all pipes together.

/c local surface = game.surfaces[1]
local deleted=0
for c in surface.get_chunks() do
	for key, entity in pairs(surface.find_entities_filtered({area={{c.x*32, c.y*32}, {c.x*32+32, c.y*32+32}}, force=game.player.force})) do
		if string.find(entity.name, "pipe") then
			for i=1,#entity.fluidbox do
				deleted = deleted + 1
				entity.fluidbox[i] = nil;
			end
		end
	end
end
game.player.print("deleted: "..deleted)

Enemy/Evolution

Check how far the biters have evolved

Note that commands that do not start with "/c" do not disable achievements.

/evolution

Set evolution factor

Ranges from 0 (new game) to 1.

/c game.forces["enemy"].evolution_factor=X

Disable time-based evolution & increases pollution-based evolution

/c game.map_settings.enemy_evolution.time_factor=0
/c game.map_settings.enemy_evolution.pollution_factor=game.map_settings.enemy_evolution.pollution_factor*2

The "2" at the end of the last command will double the default pollution factor. You can substitute another number to increase (or decrease) the pollution factor further.

Kill all biters on the "enemy" force

Note that this will kill only mobile units and worms, spawners will not be killed.

/c game.forces["enemy"].kill_all_units()

Kill all enemies

This will kill all biters, bases and worms. Anything that is an enemy will be completely destroyed. This only affects enemies in the explored world, so any unexplored parts of the map which still need to be generated will still have enemies.

/c local surface=game.player.surface
for key, entity in pairs(surface.find_entities_filtered({force="enemy"})) do
	entity.destroy()
end

Enable peaceful mode

Peaceful mode prevents biter attacks until provoked. Substitute false for true to disable.

/c game.player.surface.peaceful_mode=true

Disable biter expansion

This prevents biters from creating new spawners.

/c game.map_settings.enemy_expansion.enabled=false

Player Character

Commands concerning the player directly.

Get Player Position

Prints coordinates of your current position.

/c game.player.print(game.player.position.x .. ", " .. game.player.position.y)

Teleport player

Moves the player to the specified location. You should be able to teleport to a specific player if you obtain their coordinates via them executing the previous command and giving them to you.

/c game.player.teleport({X, Y})

To teleport to the world's origin, use 0,0.

Change Player color

Note that commands that do not start with "/c" do not disable achievements. Replace COLOR with the name of a color. Available names are: Black, blue, brown, cyan, gray, green, orange, pink, purple, red, white, and yellow. The color can also be set to an RGBA value.

/color COLOR
/color r g b a

Enable god mode

God mode removes your player character allowing you to fly over obstacles and take no damage.

Disassociate your controls from the player:

/c game.player.character=nil

Then, hover the mouse over the useless player and destroy it by typing:

/c game.player.selected.destroy()

To undo, spawn a player character. This will spawn a new player at the spawn point of the world, and connect your controls to it.

/c game.player.create_character()

Research

Enable faster research

/c game.player.force.laboratory_speed_modifier=1

1 is normal speed, 2 is double speed 3 is triple etc. I think it goes up to 100.

Enabling specific technologies

The internal technology names can be found in the infoboxes on their respective pages, click on the little arrow to show them.

/c game.player.force.technologies['electric-energy-distribution-1'].researched=true
/c game.player.force.technologies['steel-processing'].researched=true

Enabling specific recipes

The internal recipe/item names can be found in the infoboxes on their respective pages, click on the little arrow to show them.

/c game.player.force.recipes["electric-energy-interface"].enabled=true
/c game.player.force.recipes["rocket-silo"].enabled=true
/c game.player.force.recipes.loader.enabled=true

Finish research immediately

/c for name,technology in pairs(game.player.force.technologies) do technology.researched=technology.enabled end

Command Line Parameters

As of Game Version 0.15.13

Command line parameters can be used to set settings in the command line before the game launches, this is useful mainly for advanced users or server hosts.

General options:

 -h [ --help ]                      display help
 --version                          show version information
 -v [ --verbose ]                   enable verbose logging
 -c [ --config ] PATH               config file to use
 --no-log-rotation                  don't rotate log file
 --mod-directory PATH               Mod directory to use
 --check-unused-prototype-data      Print a warning for all prototype values that were not accessed

Running options:

 -s [ --map2scenario ] arg          map to scenario conversion
 -m [ --scenario2map ] arg          scenario to map conversion
 --apply-update arg                 immediately apply update package
 --create FILE                      create a new map
 --map-gen-settings FILE            Map generation settings for use with --create. See data/map-gen-settings.example.json
 --map-settings FILE                Map settings for use with --create. See data/base/prototypes/map-settings.lua
 --preset arg                       Name of the map generation preset to be used.
 --generate-map-preview FILE        Generate preview images of the map
 --map-preview-size SCALE (=1,024)  Size (in pixels) of map preview
 --map-preview-scale SCALE (=1)     Scale (meters per pixel) of map preview
 --map-preview-offset X,Y (=0,0)    Offset of the center of the map, in meters
 --start-server FILE                start a multiplayer server
 --start-server-load-scenario FILE  start a multiplayer server and load the specified scenario
 --start-server-load-latest         start a multiplayer server and load the latest available save
 --until-tick TICK                  run a save until given map tick
 --mp-connect ADDRESS               start factorio and connect to address
 --load-game FILE                   start Factorio and load a game in singleplayer
 --benchmark FILE                   load save and run benchmark
 --benchmark-ticks N (=1,000)       number of ticks for benchmarking. Default is 1000
 --force-opengl                     use OpenGL for rendering
 --force-d3d                        use Direct3D for rendering
 --fullscreen BOOL                  start game in windowed mode (saved to configuration)
 --max-texture-size N               maximal size of texture that the game can use (saved to configuration). Should be power of two greater than 2048
 --graphics-quality arg             accepted values: normal, low, very-low
 --video-memory-usage arg           accepted values: all, high, medium, low
 --gfx-safe-mode                    resets some graphics settings to values that should work on most configurations
 --shader arg                       enable/disable shader postprocessing (saved to configuration)
 --disable-audio                    Disable audio. Mainly for faster startup during development.

Server options:

 --port N                           network port to use
 --bind ADDRESS[:PORT]              IP address (and optionally port) to bind to
 --rcon-port N                      Port to use for RCON
 --rcon-password PASSWORD           Password for RCON
 --server-settings FILE             Path to file with server settings. See data/server-settings.example.json
 --server-whitelist FILE            Path to file with server whitelist.
 --server-banlist FILE              Path to file with server banlist.
 --console-log FILE                 Path to file where a copy of the server's log will be stored
 --server-id FILE                   Path where server ID will be stored or read from

Multiplayer

 --start-server SAVE

Will start a Headless (Dedicated) server, with no GUI.

 --mp-connect ADDRESS

ADDRESS is the IP:port of the remote host. Port is optional. Examples:

 ./factorio --mp-connect 192.168.1.101
 ./factorio --mp-connect 192.168.1.101:2345

As above, port can be specified by placing the port number after a colon in the address.

 --map2scenario SAVE

Converts a save game to a User Scenario, allows saved game state to be loaded into map editor. Assuming that save game name is "foo.zip", executing './factorio --map2scenario s1' will result in Factorio loading, opening the save file, and saving the scenario into the scenario folder.

See also