Difference between revisions of "HPL3/Amnesia: Rebirth/Developer Commands"

From Frictional Wiki
Jump to navigation Jump to search
(Updated description for -mod argument and added Steam Workshop example.)
(Made platform agnostic and some clearer formatting.)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
{{ShortPageTitle}}
 
{{ShortPageTitle}}
When launching a game or a mod via a Command Prompt (CMD .bat file), you can pass optional arguments which will affect the way the mod is loaded by the game. It can be useful for mods which require custom assets and scripts, or if you want to customize it further than that.
+
When launching a game or a mod via the command line, you can pass optional arguments which will affect the way the game is loaded. It can be useful for mods which require custom assets and scripts, or if you want to customize it further than that.
 +
 
 +
An example of useful arguments to use in a Windows .bat file, to start a mod in developer mode:
 +
AmnesiaRebirth.exe -user Dev -cfg config/main_init_dev.cfg -mod local:MyMod
  
 
==Command Line Arguments==
 
==Command Line Arguments==
{{Note|You can add multiple arguments and combine them when launching the game. It doesn't have to be only one argument.}}
+
{{Note|You can add multiple arguments and combine them when launching the game.}}
 
{| class="wikitable"
 
{| class="wikitable"
|+
 
 
!Argument
 
!Argument
 +
!Default Value
 
!Description
 
!Description
!Default Value
 
 
!Example
 
!Example
 
|-
 
|-
|user
+
|<code>-user</code>
 +
|<code>Default</code>
 
|Starts the game with a different user name.  
 
|Starts the game with a different user name.  
  
 
This is useful for starting a game / mod with a different set of save files, as they are saved per-user.
 
This is useful for starting a game / mod with a different set of save files, as they are saved per-user.
|<code>Default</code>
+
|<code>-user Default_dev</code>
|<code>AmnesiaRebirth.exe -user Default_dev</code>
 
 
|-
 
|-
|cfg
+
|<code>-cfg</code>
 +
|<code>config/main_init.cfg</code>
 
|Changes the main config file that is used when starting the mod.
 
|Changes the main config file that is used when starting the mod.
  
 
This is useful if the relative path of the config file inside your mod folder is different and you want to point to your file.
 
This is useful if the relative path of the config file inside your mod folder is different and you want to point to your file.
|<code>config/main_init.cfg</code>
+
|<code>-cfg config/main_init_dev.cfg</code>
|<code>AmnesiaRebirth.exe -cfg config/main_init_dev.cfg</code>
 
 
|-
 
|-
|mod
+
|<code>-mod</code>
 +
|''No default value.''
 
|Launches a mod instead of the main game. Use this if you want to run your mod in dev mode.
 
|Launches a mod instead of the main game. Use this if you want to run your mod in dev mode.
 
This argument begins with either <code>local:</code> or <code>steamworkshop:</code> depending on where the mod is sourced from. In most cases you want to use <code>local:</code>, since this is mostly for mod developers. After this first keyword immediately follows the name of the mod folder or the Steam Workshop ID of the mod.
 
This argument begins with either <code>local:</code> or <code>steamworkshop:</code> depending on where the mod is sourced from. In most cases you want to use <code>local:</code>, since this is mostly for mod developers. After this first keyword immediately follows the name of the mod folder or the Steam Workshop ID of the mod.
|''No default value.''
+
|<code>-mod local:MyMod</code><br><code>-mod steamworkshop:42069</code>
|<code>AmnesiaRebirth.exe -mod local:myMod</code><code>AmnesiaRebirth.exe -mod steamworkshop:42069</code>
 
 
|-
 
|-
|map
+
|<code>-map</code>
 +
|Stated at <code>StartMap->File</code> in <code>main_init.cfg</code>.
 
|The game loads a specific map after startup.
 
|The game loads a specific map after startup.
  
 
This is useful if you want to load a specific map quickly or if you want to skip the "load map" option in the debug menu.
 
This is useful if you want to load a specific map quickly or if you want to skip the "load map" option in the debug menu.
|Stated at <code>StartMap->File</code> in <code>main_init.cfg</code>.
+
|<code>-map "mods/myMod/maps/myMap.hpm"</code>
|<code>AmnesiaRebirth.exe -map "mods/myMod/maps/myMap.hpm"</code>
 
 
|-
 
|-
|mapfolder
+
|<code>-mapfolder</code>
 +
|Stated at <code>StartMap->Folder</code> in <code>main_init.cfg</code>.
 
|Starts the game with a specific map folder.
 
|Starts the game with a specific map folder.
|Stated at StartMap->Folder in <code>main_init.cfg</code>.
+
|<code>-mapfolder "mods/myMod/maps"</code>
|<code>AmnesiaRebirth.exe -mapfolder "mods/myMod/maps"</code>
 
 
|-
 
|-
|mappos
+
|<code>-mappos</code>
 +
|Stated at <code>StartMap->Pos</code> in <code>main_init.cfg.</code>
 
|Sets a specific start position to be used in a map.
 
|Sets a specific start position to be used in a map.
  
 
This is useful if you want to test your map from a specific position or if you want to skip the "jump to start pos" option in the debug menu.
 
This is useful if you want to test your map from a specific position or if you want to skip the "jump to start pos" option in the debug menu.
|Stated at <code>StartMap->Pos</code> in <code>main_init.cfg.</code>
+
|<code>-map "PathToMap/myMap.hpm" -mappos "MyPos"</code>
|<code>AmnesiaRebirth.exe -map "PathToMap/myMap.hpm" -mappos "MyPos"</code>
 
 
|-
 
|-
|workdir
+
|<code>-workdir</code>
 +
|''No default value.''
 
|Which directory the game exe is located. Can be used to change between engine and main redist.  
 
|Which directory the game exe is located. Can be used to change between engine and main redist.  
 
'''This command line argument is useful for the engine developers only!'''
 
'''This command line argument is useful for the engine developers only!'''
|''No default value.''
 
 
|''No default value.''
 
|''No default value.''
 
|}
 
|}

Latest revision as of 04:24, 10 November 2020

When launching a game or a mod via the command line, you can pass optional arguments which will affect the way the game is loaded. It can be useful for mods which require custom assets and scripts, or if you want to customize it further than that.

An example of useful arguments to use in a Windows .bat file, to start a mod in developer mode:

AmnesiaRebirth.exe -user Dev -cfg config/main_init_dev.cfg -mod local:MyMod

Command Line Arguments

Note icon.png You can add multiple arguments and combine them when launching the game.
Argument Default Value Description Example
-user Default Starts the game with a different user name.

This is useful for starting a game / mod with a different set of save files, as they are saved per-user.

-user Default_dev
-cfg config/main_init.cfg Changes the main config file that is used when starting the mod.

This is useful if the relative path of the config file inside your mod folder is different and you want to point to your file.

-cfg config/main_init_dev.cfg
-mod No default value. Launches a mod instead of the main game. Use this if you want to run your mod in dev mode.

This argument begins with either local: or steamworkshop: depending on where the mod is sourced from. In most cases you want to use local:, since this is mostly for mod developers. After this first keyword immediately follows the name of the mod folder or the Steam Workshop ID of the mod.

-mod local:MyMod
-mod steamworkshop:42069
-map Stated at StartMap->File in main_init.cfg. The game loads a specific map after startup.

This is useful if you want to load a specific map quickly or if you want to skip the "load map" option in the debug menu.

-map "mods/myMod/maps/myMap.hpm"
-mapfolder Stated at StartMap->Folder in main_init.cfg. Starts the game with a specific map folder. -mapfolder "mods/myMod/maps"
-mappos Stated at StartMap->Pos in main_init.cfg. Sets a specific start position to be used in a map.

This is useful if you want to test your map from a specific position or if you want to skip the "jump to start pos" option in the debug menu.

-map "PathToMap/myMap.hpm" -mappos "MyPos"
-workdir No default value. Which directory the game exe is located. Can be used to change between engine and main redist.

This command line argument is useful for the engine developers only!

No default value.