As mentioned above, there are two ways to specify commands to execute. You can place them in an .ini file, one per line, or you can specify them directly in pconfig.src.

Commands are handed to the operating system's command shell (i.e. command.com or cmd.exe under Microsoft operating systems, /bin/sh on Unix), one by one. Therefore, fancy things such as multi-line commands or goto are not permitted.

The following symbols are handled specially:

  • %section
  • ► In an .ini file, specifies a section boundary. If a section was specified in pconfig.src, execution starts or ends here.
  • # anything
  • ► In an .ini file, lines starting with a number sign are comments and are ignored.
  • %d
  • ► 

    (4.0k) In a command, this symbol is replaced by the game directory name (first directory parameter specified in PHost invocation). For example, Combat = Replace *flak-server %d will run the add-on flak-server with the current game directory as a parameter. PHost automatically suppresses duplicate directory delimiters if you use this to construct file names. Note that, in an .ini file, this symbol cannot be first in a command, to avoid confusing it with a section delimiter.

  • %r
  • ► 

    (4.0k) In a command, this symbol is replaced by the root directory name (second directory parameter specified in PHost invocation). Everything said for %d applies here, too.

  • %s
  • ► 

    (4.1e) In a command, this symbol is replaced by the current random number seed. If the add-on supports initializing its random number generator using the command line, you can make the add-on invocation repeatable: this value is derived from (but not identical to) the value given using the -S or -s command line option, so when you invoke PHost again with the same seed and the same input data, it will pass the same seed to the add-on. As a convenience, PHost will also pass the same value through the environment, in a variable PHOST_RANDSEED.

  • %%
  • ► 

    (4.0k) Produces a literal percent sign.