In other languages:

User:Fried biter/workspace: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
Line 381: Line 381:
</syntaxhighlight>
</syntaxhighlight>


== Enemy/Evolution ==
== /進化 ==
=== Check how far the biters have evolved ===
=== バイターがどのくらい進化したか確認 ===
Note that commands that do not start with "/c" do not disable achievements.
"/c"で始まらないコマンドは実績を無効化しないことに気をつけよう。
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
/evolution
/evolution
</syntaxhighlight>
</syntaxhighlight>


=== Set evolution factor ===
=== 進化ファクター(evolution factor)をセット ===
Ranges from 0 (new game) to 1.
範囲は0(ゲーム開始時)から1。
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
/c game.forces["enemy"].evolution_factor=X
/c game.forces["enemy"].evolution_factor=X
</syntaxhighlight>
</syntaxhighlight>


=== Disable time-based evolution & increases pollution-based evolution ===
=== 時間に依る進化を無効化しつつ汚染に依る進化を加速 ===
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
/c game.map_settings.enemy_evolution.time_factor=0
/c game.map_settings.enemy_evolution.time_factor=0
Line 400: Line 400:
</syntaxhighlight>
</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.
最後の「2」はデフォルト汚染ファクターの倍加。他の数字に変えれば汚染ファクターをもっと大きく(小さく)できる。


=== Kill all biters on the "enemy" force ===
=== 「敵」軍バイターを全滅させる ===
Note that this will kill only mobile units and worms, spawners will not be killed.
機動部隊とワームだけを殺し、巣は殺されないことに注意。
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
/c game.forces["enemy"].kill_all_units()
/c game.forces["enemy"].kill_all_units()
</syntaxhighlight>
</syntaxhighlight>


=== 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.
バイター、ワーム、基地すべてを殺す。敵であるものすべてが完全に殲滅される。探査済みの世界に存在する敵にのみ影響し、マップの未探索で生成されていない部分にはまだ敵がいる。
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
/c local surface=game.player.surface
/c local surface=game.player.surface
Line 417: Line 417:
</syntaxhighlight>
</syntaxhighlight>


=== Enable peaceful mode ===
=== ピースフルモード有効化 ===
Peaceful mode prevents biter attacks until provoked. Substitute false for true to disable.
ピースフルモード(Peaceful mode)ではバイターが自発的に攻撃しない。falseをtrueにすれば無効化。
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
/c game.player.surface.peaceful_mode=true
/c game.player.surface.peaceful_mode=true
</syntaxhighlight>
</syntaxhighlight>


=== Disable biter expansion ===
=== バイターの戦線拡大を無効化 ===
This prevents biters from creating new spawners.
バイターが新たな巣を作らなくなる。
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
/c game.map_settings.enemy_expansion.enabled=false
/c game.map_settings.enemy_expansion.enabled=false

Revision as of 06:30, 20 March 2018

作業場/workspace 日本語話者の方、マサカリ投げてくださると助かります


概要

コンソール(Console)はFactorioのコマンドラインインターフェース。

ゲーム内コンソール(in-game console)は以下に用いられる。

  • 他プレイヤーとのチャット
  • コマンド/スクリプト/チートの実行
  • ときどきステータス更新

以下の3種のコマンドがある。

  • マルチプレイヤー(Multiplayer) - メッセージフィルタリング、ユーザBAN、などなど
  • 情報(Information) - ゲームに関する様々な情報を表示
  • スクリプト/チート(Scripting/Cheating) - Luaスクリプト片を実行 (そのセーブで実績が無効になる)

コンソールの利用

コンソール窓は/(スラッシュ)か~(チルダ)キーで切り替えられる。

キー設定はOptions Menu -> Keyboard -> Toggle Lua consoleから設定可能。 コンソールが開いている間、スクリーン下部でカーソルが点滅する。メッセージやコマンドを入力してReturnを押すと送信(してコンソールも閉じる)。 メッセージやコマンドプレフィックスに関するドキュメントはこのページの更に下にある。

コンソールを閉じると最後のメッセージ/コマンドだけが表示されるが、徐々に消えていく(コンソールを開き直すと即座に直近のメッセージすべてが再表示される)。 デフォルトでは、全ての実行されたコマンドは全ユーザに見える。消える時間はOptions Menu -> Other Settings -> Message Delayから設定可能。

コンソールを即座に隠したい場合、コンソールを開いてEscape キーを押す(か、メッセージやコマンドを入力しないままReturn)。 これはコンソールを隠すだけでなく、直近のメッセージ/コマンドすべてを隠す。 コンソールは/clearコマンドでクリアできる。

コンソールはゲームコマンド(game command)同様、生Luaコードも受け付けることを覚えておこう。

コンソール履歴

コンソールは備え付けの履歴を持つ。ややテキストエディタっぽく、一度に1行のテキストしか表示されない。

キーで履歴内を移動。

キーで現在表示している編集(削除、挿入など)対象のメッセージやコマンド内でカーソルを移動、ならびに再送信(Returnを押す)。

TabキーはコマンドやプレイヤーIDをオートコンプリートする。

マルチプレイヤーチャット

特定のプレイヤーにプライベートメッセージを送るには/whisper (または/w):

/whisper <playerId> <message>

最後にプライベートメッセージを受け取ったプレイヤーに返信するには/reply (または/r):

/reply <message>

グループチャットは以下のように機能する:

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

これらはメインのチャット機能にすぎない。プレイヤーのBAN、無視、ミュートなどのオプションもある。完全なリストはコンソールで/help

コマンド

利用可能なコマンドのリストを見るには、コンソールで/help (または/h)を入力。 利用可能なコマンドはFactorioのバージョンとゲームセットアップに依る。

/help

Factorio 0.14.4以降では、/helpコマンドは単にコマンドのリストを表示するだけである。コマンドの完全な詳細を得るにはコマンド名(スラッシュを除く)を/help (または/h)の後に加える。例えば、 /evolutionコマンドのヘルプは:

/h evolution

スクリプト/チートコマンド

コンソールからLuaスクリプトを実行できる。 任意のコマンドラインインターフェースやブラウザのJavaScriptコンソールに類似した挙動をする。

これは非常に強力な機能で、チートもでき、なのでスクリプトコマンドを使用した瞬間実績はそのセーブに対して永続的に無効化される

スクリプトを実行するには、/command (または/c)を前置する。例えば:

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

マルチプレイヤーゲームでは、adminのみがコマンドを利用可能で、コマンドは他の全プレイヤーにechoする。

マルチプレイヤーのserver adminは(RCON/server consoleからのみ)/cの代わりに/silent-command を用いることで、他のプレイヤーにechoされるのを防ぐことができる。

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

Mod製作者もまた、特別なコマンド/measured-commandを利用可能。これは/cに似ているが、実行時間を測定する。 スクリプトのパフォーマンスチューニングにとても便利。

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

「スクリプトレット(scriptlets)」をコンソールにペーストする際、改行は無視される。 つまり、エディタではヒューマンリーダブルな形式で書いておいてコンソールにコピペできるので、理解と編集がちょっと楽になる。

基本的なコマンドと例

大きいスクリーンショット

HD画質のスクリーンショットを取る方法は以下。

ファイルはmodsフォルダ同様、application directory/jaの「script-output」と呼ばれるフォルダに置かれる。 画像はとても巨大になりうる。

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

このコマンドは以下のパラメータを取る。

  • showgui - Boolean値、 trueかfalse。 TrueならGUIがスクリーンショットに含まれる。
  • resolution - xとyを{x = <x-size>, y = <y-size>}の形式で取る。
  • show_entity_info - Boolean値、 Trueならalt infoがスクリーンショットに含まれる。
  • zoom - ズームレベル。1は通常、2はエリアの半分にズームイン、0.5は倍のエリアにズームアウト、など。

例として、以下は1000x1000のスクリーンショットをalt-modeをONにして、でもGUIは表示せず、ズームレベル2で撮る。

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

計算機として使う

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

高速に掘削

/c game.player.force.manual_mining_speed_modifier=1000

高速に製作

/c game.player.force.manual_crafting_speed_modifier=1000

全研究をアンロックし研究済みに

/c game.player.force.research_all_technologies()

次節のコマンドでUndo。

全研究を未研究に

手動で適用されたボーナスはリセットされない。

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

強さリセット

キル数、生産統計、技術、ボーナス、マップ状況を含む強さを全リセットする。

/c game.player.force.reset()

通常よりズームアウトする

ズームアウトしすぎるとパフォーマンスに問題を起こしかねないので注意。

/c game.player.zoom=0.1

プレイ時間

何時間何分何秒プレイしたか教えてくれる。

/time

インベントリ操作

資源の補充(油、鉄など)

ゲーム内の資源タイルにマウスオーバーした状態で

/c game.player.selected.amount=7500

プレイヤーのインベントリにアイテム追加

iron-plateの部分を欲しいアイテムの内部名称に置換して使うべし。

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

例えば、エネルギーシステムのgod-modeインタフェースは以下。

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

装備品付きで強力アーマーゲットだぜ。

/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"})

チートモード

無限・無料製作。trueをfalseにすれば無効化。

/c game.player.cheat_mode=true

ワールド操作

プレイヤー周辺のマップを確認

レーダー風にプレイヤー周辺のマップを確認。

/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 game.forces.player.chart(game.player.surface, {{x = -2000, y = -2000}, {x = 2000, y = 2000}})

150は好きな半径に変更して構わない。大きくすればするほど時間食うけど。

確認されたマップが大きくなるとセーブファイルのサイズも増える。以下のコマンドで現在キューされているチャンク生成をすべてキャンセルし 0,0 周辺の半径32チャンク以外を除去する。 当該チャンク内のプレイヤーのものも除去される事に注意。

/c local surface = game.player.surface;
game.player.force.cancel_charting(surface); 
local chunk_radius = 32;
for chunk in surface.get_chunks() do
  if (chunk.x < -chunk_radius or chunk.x > chunk_radius or chunk.y < -chunk_radius or chunk.y > chunk_radius) then
    surface.delete_chunk(chunk)
  end
end

夜をオフ

沈まない太陽。

/c game.player.surface.always_day=true

ゲーム速度変更

0.5で速度半分、1でデフォルト、2で倍速、など。最小は0.01。完了に長い期間待たなければならない場合など、様々なことに利用できる。大きくするとパフォーマンスが落ちるので注意せよ。

/c game.speed=X

高コスト(マラソン)かノーマルモードか

ノーマルから高コストモードプリセットに切り替える(研究コストと中間生成物の製作コストを変更)。

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

ノーマルに戻す。

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

凍れる時間の秘法

「BOOL」を「true」にすれば時間の進行が止まる。凍結解除には「false」にする。

/c game.player.surface.freeze_daytime=BOOL

汚染を全除去

/c game.player.surface.clear_pollution()

友軍へのフレンドリーファイアを無効化

/c game.player.force.friendly_fire = false

新たな資源パッチを追加

プレイヤーキャラクターを中心に11x11の新たな資源パッチを生成。 パッチは完全な正方形だが、埋蔵量は自然生成と同様にランダムで中心部は多くの資源がある。 デフォルトでは2500-3000鉱石となる。

より大きなパッチが欲しいなら、「local size = 5」をより大きな数字に変更。 大きなパッチは指数的に多くの鉱石を含む。 30以上の数字は推奨できない。

より潤沢なパッチが欲しいなら、「local density = 10」をより大きな数字に変更。 大きすぎる数字を入れても害はないが、100以上が必要なことはまずないだろう。

生成される資源を選ぶには、下の方の「stone」を「iron-ore」「copper-ore」「coal」「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

油パッチを追加

3x3の9原油パッチを生成。

/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

もしくは、干渉が生じないようにランダムにするには

/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

エンティティをカウント

local entityに格納されたstringを名前に含むエンティティ全てを数える。

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

全パイプ・地下パイプを空にする

パイプに入ってほしくない流体が入ってしまったとき便利。

/c local surface = game.player.surface
local deleted=0
for key, entity in pairs(surface.find_entities_filtered({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
game.player.print("Pipes emptied: "..deleted)

敵/進化

バイターがどのくらい進化したか確認

"/c"で始まらないコマンドは実績を無効化しないことに気をつけよう。

/evolution

進化ファクター(evolution factor)をセット

範囲は0(ゲーム開始時)から1。

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

時間に依る進化を無効化しつつ汚染に依る進化を加速

/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

最後の「2」はデフォルト汚染ファクターの倍加。他の数字に変えれば汚染ファクターをもっと大きく(小さく)できる。

「敵」軍バイターを全滅させる

機動部隊とワームだけを殺し、巣は殺されないことに注意。

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

敵を鏖殺

バイター、ワーム、基地すべてを殺す。敵であるものすべてが完全に殲滅される。探査済みの世界に存在する敵にのみ影響し、マップの未探索で生成されていない部分にはまだ敵がいる。

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

ピースフルモード有効化

ピースフルモード(Peaceful mode)ではバイターが自発的に攻撃しない。falseをtrueにすれば無効化。

/c game.player.surface.peaceful_mode=true

バイターの戦線拡大を無効化

バイターが新たな巣を作らなくなる。

/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, acid 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.

Researching 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

Unresearching 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=false; game.player.force.set_saved_technology_progress('electric-energy-distribution-1', 0)
/c game.player.force.technologies['steel-processing'].researched=false; game.player.force.set_saved_technology_progress('steel-processing', 0)

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

Enable all recipes

/c for name, recipe in pairs(game.player.force.recipes) do recipe.enabled = true end

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.

Modding tools

A list of the internal names of most things in the vanilla game can also be found on data.raw.

Write all researched technologies to file

/c local list = {}
for _, tech in pairs(game.player.force.technologies) do 
	if tech.researched then
    list[#list+1] = tech.name
  end
end
game.write_file("techs.lua", serpent.block(list) .. "\n", true)

Write all enabled recipes to file

/c local list = {}
for _, recipe in pairs(game.player.force.recipes) do 
	if recipe.enabled then
    list[#list+1] = recipe.name
  end
end
game.write_file("recipes.lua", serpent.block(list) .. "\n", true)

See also