Startup Parameters Config File: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Text replacement - "Eden" to "Eden")
 
(30 intermediate revisions by 11 users not shown)
Line 1: Line 1:
The config file can be used to put startup parameters in, instead of specifying them at a shortcut/commandline.
{{TOC|side}}
The startup parameters config file can be used to put startup parameters in, instead of specifying them in a shortcut/commandline.


== Location ==
{{Feature|important|Low level parameters are NOT supported:<br>
.par file does not (and will not) support some low level parameters, namely:
* -cpuCount
* -malloc
* -exthreads
* -maxMem
* -profiles (confirmed on {{arma3}} version 1.66.139586, options does not work from parameter file)
* -debug
The reason is those need to be initialized before any file operations are done.
}}


Inside game folder (unverified)


Depending on Game:
== Usage ==
* ArmA2.par
* ArmA2OA.par
* TakeOnH.par


== Format ==
'''-par''' [[Arma 3 Startup Parameters|startup parameter]] allows to specify the file.
Whether using {{Link|#Plain Text Format}} or {{Link|#.par Format}}, '''the file is preprocessed before parsing''', allowing C++ style comments and {{hl|#define}}s to be used.
{{Feature|informative|Before {{arma2oa}} v1.60.86060, only the {{hl|[[#.par Format|.par]]}} format was supported.}}


startupParameter="-startupParameter"
=== Windows ===
startupParameter2="-startupParameter2=value1;value2"
 
'''-par''' won't work being passed by cmd as variable to quotes; a specific format must be applied:
<syntaxhighlight lang="bat">
setlocal enableDelayedExpansion enableExtensions
 
set v=!v! "-profiles=!cd!\acc"
set v=!v! "-par=D:\par\startupParameters.txt"
 
start "" "D:\arma3\arma3.exe" !v! &rem need "start" for closing cmd window;
timeout /t 1 &rem need for keeping game window (starting from logo) foreground after cmd window close;
</syntaxhighlight>
 
 
== Plain Text Format ==
 
* The file extension must be anything '''but''' {{hl|.par}}, otherwise  the {{Link|#.par Format}} syntax will be assumed.
* The file can be located either inside or outside of the game folder for organizational purposes.
* The file must have one command line option per line.
 
=== Location ===
 
Location can be defined with -par=parameterFileName startup parameter.
 
=== Format ===
 
Whitespace is ignored.
<syntaxhighlight lang="cpp">
-startupParameter
-startupParameter2=value1;value2
MissionFileToOpenInTheEditor
</syntaxhighlight>
 
=== Examples ===
==== Simple Example ====
<syntaxhighlight lang="cpp">
-nosplash
-skipIntro
-world=none
-mod=Expansion;Expansion\beta;Expansion\beta\Expansion;@cwr2
"C:\arma2\Users\USERNAME\missions\MissionName.Desert_E\mission.sqm"
</syntaxhighlight>
 
==== Host and Client ====
The following example allows you to launch two instances of the game with common startup parameters. One for hosting from [[:Category:Eden Editor|Eden]] and another one as a client to test for [[Multiplayer_Scripting|locality]] issues.
 
'''base.txt'''
<syntaxhighlight lang="cpp">
-mod="!Workshop\@Mod1;!Workshop\@Mod2"
-skipIntro
-noSplash
-filePatching
-noSound
-noLand
</syntaxhighlight>
 
'''host.txt'''
<syntaxhighlight lang="cpp">
#include "base.txt"
"C:\Users\USERNAME\Documents\Arma 3\missions\BIKI.VR"
</syntaxhighlight>
 
'''client.txt'''
<syntaxhighlight lang="cpp">
#include "base.txt"
-name=ClientTest
</syntaxhighlight>
 
== .par Format ==
 
{{Feature|warning|The {{hl|.PAR}} file extension is apparently no longer read correctly on a dedicated server.}}
 
=== Location ===
 
At game directory's root.
 
=== Naming ===
 
{| class="wikitable" style="text-align: center"
! {{arma2}} !! {{arma2oa}} !! {{tkoh}}
|-
| {{hl|ArmA2.par}} || {{hl|ArmA2OA.par}} || {{hl|TakeOnH.par}}
|}
 
=== Format ===
 
<syntaxhighlight lang="cpp">
class Arg
{
startupParameter="-startupParameter"
startupParameter2="-startupParameter2=value1;value2"
};
</syntaxhighlight>


=== Example ===
=== Example ===
<pre>nosplash="-nosplash";
 
skipIntro="-skipIntro";
<syntaxhighlight lang="cpp">
world="-world=none";
class Arg
mod="-mod=Expansion;Expansion\beta;Expansion\beta\Expansion;@cwr2";</pre>
{
nosplash="-nosplash";
skipIntro="-skipIntro";
world="-world=none";
mod="-mod=Expansion;Expansion\beta;Expansion\beta\Expansion;@cwr2";
};
</syntaxhighlight>
 
 
== External links ==
 
* {{Link|link= https://web.archive.org/web/20151114132158/http://dev.withsix.com/issues/26103|text= Feature is discussed here by Suma}}




[[Category:Startup_Parameters]]
[[Category:Startup Parameters]]

Latest revision as of 14:22, 9 July 2023

The startup parameters config file can be used to put startup parameters in, instead of specifying them in a shortcut/commandline.

Low level parameters are NOT supported:

.par file does not (and will not) support some low level parameters, namely:

  • -cpuCount
  • -malloc
  • -exthreads
  • -maxMem
  • -profiles (confirmed on Arma 3 version 1.66.139586, options does not work from parameter file)
  • -debug
The reason is those need to be initialized before any file operations are done.


Usage

-par startup parameter allows to specify the file. Whether using Plain Text Format or .par Format, the file is preprocessed before parsing, allowing C++ style comments and #defines to be used.

Before Arma 2: Operation Arrowhead v1.60.86060, only the .par format was supported.

Windows

-par won't work being passed by cmd as variable to quotes; a specific format must be applied:

setlocal enableDelayedExpansion enableExtensions

set v=!v! "-profiles=!cd!\acc"
set v=!v! "-par=D:\par\startupParameters.txt"

start "" "D:\arma3\arma3.exe" !v!	&rem need "start" for closing cmd window;
timeout /t 1						&rem need for keeping game window (starting from logo) foreground after cmd window close;


Plain Text Format

  • The file extension must be anything but .par, otherwise the .par Format syntax will be assumed.
  • The file can be located either inside or outside of the game folder for organizational purposes.
  • The file must have one command line option per line.

Location

Location can be defined with -par=parameterFileName startup parameter.

Format

Whitespace is ignored.

-startupParameter
-startupParameter2=value1;value2
MissionFileToOpenInTheEditor

Examples

Simple Example

-nosplash
-skipIntro
-world=none
-mod=Expansion;Expansion\beta;Expansion\beta\Expansion;@cwr2
"C:\arma2\Users\USERNAME\missions\MissionName.Desert_E\mission.sqm"

Host and Client

The following example allows you to launch two instances of the game with common startup parameters. One for hosting from Eden and another one as a client to test for locality issues.

base.txt

-mod="!Workshop\@Mod1;!Workshop\@Mod2"
-skipIntro
-noSplash
-filePatching
-noSound
-noLand

host.txt

#include "base.txt"
"C:\Users\USERNAME\Documents\Arma 3\missions\BIKI.VR"

client.txt

#include "base.txt"
-name=ClientTest

.par Format

The .PAR file extension is apparently no longer read correctly on a dedicated server.

Location

At game directory's root.

Naming

Arma 2 Arma 2: Operation Arrowhead Take On Helicopters
ArmA2.par ArmA2OA.par TakeOnH.par

Format

class Arg
{
	startupParameter="-startupParameter"
	startupParameter2="-startupParameter2=value1;value2"
};

Example

class Arg
{
	nosplash="-nosplash";
	skipIntro="-skipIntro";
	world="-world=none";
	mod="-mod=Expansion;Expansion\beta;Expansion\beta\Expansion;@cwr2";
};


External links