Startup parameters: Difference between revisions

From PZwiki
No edit summary
(Added the new -udpport parameter which changes the Direct Connection port.)
(18 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{languages}}
{{languages}}
{{header|Community|Modding|version=Version 40|incver=43}}
<div style="float:right;"> __TOC__ </div>
<div style="float:right;"> __TOC__ </div>
Project Zomboid has customisable '''startup parameters''', as either JVM arguments or game arguments. This can be used to override "vmArgs" in the .json file. JVM arguments must end with a <code>--</code>, even if there are no game arguments.


;Create shortcut:
# Navigate to the game folder
# Create a shortcut of the executable file (ProjectZomboid32.exe/ProjectZomboid64.exe)
# Add the appropriate Jvm arguments in the "Target:" line<br>Example: <code>C:\ProjectZomboid64.exe -Xmx1024m -Xms1024m -- -nosteam</code>


ProjectZomboid64/32 accept JVM arguments in addition to game arguments. This can be used to override vmArgs in the .json file. JVM arguments must end with a --, even if there are no game arguments.  
;Steam application:
# Choose the game shortcut in Steam Library
# Right-click the game
# Select "Properties"
# Hit "Set launch options..."




These parameters can be configured by creating a new shortcut on your desktop and then adding the appropriate option in the target line.
==Game arguments==
 
 
;Example: <tt>ProjectZomboid64.exe -Xmx1024m -Xms1024m -- -nosteam</tt>
 
For Steam version:
# Choose the game shortcut in Library
# Right click on the game
# Select properties
# Hit "Set launch options"
 
 
 
 
 
 
=Game Arguments=


===Client & Server===
===Client & Server===
 
{| class="pztable-com"  
{| class="wikitable"  
 
|-
|-
!style="background-color:#ffaaaa;"| Arg
! Arguments
!style="background-color:#aaffaa;"| Description
! width="50%" | Description
! Example
|-
|-
 
| <code>-nosteam</code>
| -nosteam
| Disables Steam integration on client/server.
| Disables Steam integration on client/server.
|
|-
| <code>-cachedir=<path></code>
| Sets the path for the game data cache dir.
| <code>-cachedir="C:\Zomboid</code>"
|-
|-
 
| <code>-modfolders</code>
| -modfolders
| Option to control where mods are loaded from. Any of the 3 keywords may be left out and may appear in any order.
| option to control where mods are loaded from. "-modfolders workshop,steam,mods" is the default. Any of the 3 keywords may be left out and may appear in any order.
| <code>-modfolders workshop,steam,mods</code>
|-
|-
| <code>[[Debug mode|-debug]]</code>
| Launches the game in debug mode.
|
|}
|}


===Client===
===Client===
 
{| class="pztable-com"
{| class="wikitable"
|-
 
! Arguments
! width="50%" | Description
! Example
|-
|-
!style="background-color:#ffaaaa;"| Arg
| <code>+connect <ip:port></code>
!style="background-color:#aaffaa;"| Description
| Server address to connect, when joining a server using Steam.
| <code>+connect 127.0.0.1:16261</code>
|-
|-
 
| <code>+password <password></code>
| +password
| Server password to connect, when joining a server using Steam.  
| Server password to connect to, when joining a server using Steam's server browser.
| <code>+password ServersPassword</code>
|-
|-
 
| <code>-debugtranslation</code>
| -debugtranslation
| Writes possible translation issues to homedir "/Zomboid/translationProblems.txt"
| writes possible translation issues to homedir "/Zomboid/translationProblems.txt"  
|
|-
|-
 
| <code>-safemode</code>
| -safemode
| Launches the game with reduced resolution and disables some graphical effects to reduce strain on lower-end graphics cards.
| safe mode ?? 
|  
|-
|-
 
| <code>-nosound</code>
 
| Disables the game audio
|
|}
|}


===Server===
===Server===
 
{| class="pztable-com"
{| class="wikitable"
|-
 
! Arguments
! width="50%" | Description
! Example
|-
|-
!style="background-color:#ffaaaa;"| Arg
| <code>-adminpassword</code>
!style="background-color:#aaffaa;"| Description
| Option to bypasses the enter-a-password prompt when creating a server.
| <code>-adminpassword YourPasswdXYZ</code>
|-
|-
 
| <code>-servername</code>
| -adminpassword
| You can choose a different servername by using this option when starting the server.  
| option to bypasses the enter-a-password prompt when creating a server. Example: -adminpassword YourPasswdXYZ
| <code>-servername MySecondServer</code>
|-
|-
 
| <code>-ip <ip></code>
| -servername
| Option to handle multiple network cards. Example:  
| You can choose a different servername by using this option when starting the server. Example: -servername MySecondServer
| <code>-ip 127.0.0.1</code>
|-
|-
 
| <code>-port <port></code>
| -ip
| Option which overrides the .ini option "DefaultPort".  
| option to handle multiple network cards. Example: -ip 127.0.0.1
| <code>-port 16261</code>
|-
|-
 
| <code>-udpport <port></code>
| -port
| Option which overrides the .ini option "UDPPort".  
| option which overrides the .ini option "DefaultPort". Example: -port 16261
| <code>-port 16262</code>
|-
|-
 
| <code>-steamvac <true/false></code>
 
| Option to enable/disable VAC on Steam servers. On the server command-line use -steamvac true/false. In the server's INI file, use SteamVAC=true/false.
| -steamvac
|
| option to enable/disable VAC on Steam servers. On the server command-line use -steamvac true/false. In the server's INI file, use SteamVAC=true/false.
|-
|-
 
| <code>-steamport1 <port></code> <br> <code>-steamport2 <port></code>
| -steamport1 <br> -steamport2
| Steam servers require two additional ports to function (I'm guessing they are both UDP ports, but you may need TCP as well). These are in addition to the DefaultPort= setting. These can be specified in two ways: In the server's INI file as SteamPort1= and SteamPort2=. Using command-line options -steamport1 and -steamport2.
| Steam servers require two additional ports to function (I'm guessing they are both UDP ports, but you may need TCP as well). These are in addition to the DefaultPort= setting. These can be specified in two ways: In the server's INI file as SteamPort1= and SteamPort2=. Using command-line options -steamport1 and -steamport2.
|
|-
|-
|}
|}


=JVM Arguments=
==JVM arguments==


===Client & Server===
===Client & Server===
 
{| class="pztable-com"
{| class="wikitable"
|-
 
! Arguments
! width="50%" | Description
! Example
|-
|-
!style="background-color:#ffaaaa;"| Arg
| <code>-Xmx</code>
!style="background-color:#aaffaa;"| Description
| Maximum amount of Memory. <br>(1024m=1Gig, 2048m=2Gig, 4096m=4Gig)
| <code>-Xmx1024m</code>
|-
|-
 
| <code>-Xms</code>
| -Xmx
| Initial/Minimum Memory allocation. <br>(1024m=1Gig, 2048m=2Gig, 4096m=4Gig)
| Maximum amount of Memory. Example: -Xmx1024m ( 1024m=1Gig , 2048m=2Gig , 4096m=4Gig )
| <code>-Xms1024m</code>
|-
|-
 
| <code>-Dzomboid.steam=<boolean></code>
| -Xms
| Disables/enables Steam integration on client/server.<br>(0=disabled, 1=enabled)
| Initial/Minimum Memory allocation. Example: -Xms1024m ( 1024m=1Gig , 2048m=2Gig , 4096m=4Gig )
| <code>-Dzomboid.steam=1</code>
|-
|-
 
| <code>-Duser.home=<path></code>
| -Duser.home=<path>
| overwrites the "/Zomboid" homedir to whatever path you want.  
| overwrites the "/Zomboid" homedir to whatever path you want. "-Duser.home=C:\Zomboid"
| <code>-Duser.home=C:\Zomboid</code>
|-
|-
 
| <code>-Dsoftreset</code>
| -Dsoftreset
| option to perform a Soft Reset
| option to perform a Soft Reset
|
|-
|-
 
| <code>-Ddebug</code>
| -Ddebug
| enables debugging
| enables debugging
|
|-
|-
|}
|}


===Server===
===Server===
 
{| class="pztable-com"
{| class="wikitable"
 
|-
|-
!style="background-color:#ffaaaa;"| Arg
! Arguments
!style="background-color:#aaffaa;"| Description
! width="50%" | Description
! Example
|-
|-
 
| <code>-Dorg.sqlite.lib.path=<path></code>
| -Dorg.sqlite.lib.path=<path>  
| '''Windows users:''' When the Server starts, a temporary sqlite file will be created in "TEMP", however it will not be deleted after stopping the Server. A way to avoid this is by adding a JVM option <code>-Dorg.sqlite.lib.path=natives</code> and put a copy of the .dll called sqlitejdbc.dll in the server's natives/ directory. It will then use that one instead of extracting the .dll from the .jar file every time.
| visit: [http://theindiestone.com/forums/index.php/tracker/issue-2131-sqlite-spam/issue: WINDOWS SQLITE TEMPFOLDER SPAM]
| <code>-Dorg.sqlite.lib.path=natives</code>
|-
|-
|}


|}
[[Category:Multiplayer]]

Revision as of 11:08, 21 November 2022

CommunityModdingStartup parameters

Project Zomboid has customisable startup parameters, as either JVM arguments or game arguments. This can be used to override "vmArgs" in the .json file. JVM arguments must end with a --, even if there are no game arguments.

Create shortcut
  1. Navigate to the game folder
  2. Create a shortcut of the executable file (ProjectZomboid32.exe/ProjectZomboid64.exe)
  3. Add the appropriate Jvm arguments in the "Target:" line
    Example: C:\ProjectZomboid64.exe -Xmx1024m -Xms1024m -- -nosteam
Steam application
  1. Choose the game shortcut in Steam Library
  2. Right-click the game
  3. Select "Properties"
  4. Hit "Set launch options..."


Game arguments

Client & Server

Arguments Description Example
-nosteam Disables Steam integration on client/server.
-cachedir=<path> Sets the path for the game data cache dir. -cachedir="C:\Zomboid"
-modfolders Option to control where mods are loaded from. Any of the 3 keywords may be left out and may appear in any order. -modfolders workshop,steam,mods
-debug Launches the game in debug mode.

Client

Arguments Description Example
+connect <ip:port> Server address to connect, when joining a server using Steam. +connect 127.0.0.1:16261
+password <password> Server password to connect, when joining a server using Steam. +password ServersPassword
-debugtranslation Writes possible translation issues to homedir "/Zomboid/translationProblems.txt"
-safemode Launches the game with reduced resolution and disables some graphical effects to reduce strain on lower-end graphics cards.
-nosound Disables the game audio

Server

Arguments Description Example
-adminpassword Option to bypasses the enter-a-password prompt when creating a server. -adminpassword YourPasswdXYZ
-servername You can choose a different servername by using this option when starting the server. -servername MySecondServer
-ip <ip> Option to handle multiple network cards. Example: -ip 127.0.0.1
-port <port> Option which overrides the .ini option "DefaultPort". -port 16261
-udpport <port> Option which overrides the .ini option "UDPPort". -port 16262
-steamvac <true/false> Option to enable/disable VAC on Steam servers. On the server command-line use -steamvac true/false. In the server's INI file, use SteamVAC=true/false.
-steamport1 <port>
-steamport2 <port>
Steam servers require two additional ports to function (I'm guessing they are both UDP ports, but you may need TCP as well). These are in addition to the DefaultPort= setting. These can be specified in two ways: In the server's INI file as SteamPort1= and SteamPort2=. Using command-line options -steamport1 and -steamport2.

JVM arguments

Client & Server

Arguments Description Example
-Xmx Maximum amount of Memory.
(1024m=1Gig, 2048m=2Gig, 4096m=4Gig)
-Xmx1024m
-Xms Initial/Minimum Memory allocation.
(1024m=1Gig, 2048m=2Gig, 4096m=4Gig)
-Xms1024m
-Dzomboid.steam=<boolean> Disables/enables Steam integration on client/server.
(0=disabled, 1=enabled)
-Dzomboid.steam=1
-Duser.home=<path> overwrites the "/Zomboid" homedir to whatever path you want. -Duser.home=C:\Zomboid
-Dsoftreset option to perform a Soft Reset
-Ddebug enables debugging

Server

Arguments Description Example
-Dorg.sqlite.lib.path=<path> Windows users: When the Server starts, a temporary sqlite file will be created in "TEMP", however it will not be deleted after stopping the Server. A way to avoid this is by adding a JVM option -Dorg.sqlite.lib.path=natives and put a copy of the .dll called sqlitejdbc.dll in the server's natives/ directory. It will then use that one instead of extracting the .dll from the .jar file every time. -Dorg.sqlite.lib.path=natives