User Tools

Site Tools


pf:rpldocs:readme
readme.txt
1: Create this directory: "c:\Users\YOURUSER\Documents\My Games\particlefleet\prpldocs" 
(This location varies on different OSs.  Basically you need to make a prpldocs subdir under your particlefleet directory).

2: In that directory there should be an index file called "prpldocindex.txt" and then a file for each section of the PRPL docs.

3: With files in place, run the game and while on the main menu press "LeftAlt-D".  That will create a "PRPLDocs.html" file in your prpldocs directory.  This is a self contained html file that has all of the docs.

Now, the magic is all in the prpldocindex.txt file and the individual section.txt files.  The prpldocindex.txt file just contains the names of the sections, one per line.  The name on each line must match the name of a section file, minus the ".txt" extension.  This name will also appear in the section index of the resulting html file.

Each section file contains blocks that represent each command. Here's an example:

=CMD
=COMMAND RotateShip (int float)
=DESC 
int ARG1: Ship UID<br/>
float ARG2: Angle in radians to rotate ship to.<p/>
Issues a rotate order to a ship to rotate to a angle in radians.
=ENDDESC
=EX 
RotateShip(<-ship PI div(2))
=ENDEX
=ENDCMD

The block consists of "=CMD" and "=ENDCMD" lines.  In the =CMD block are =COMMAND, =DESC/=ENDDESC, =EX/=ENDEX sections.
=COMMAND is a single line where whatever follows the "=COMMAND" part of the line is the name of the command.
=DESC and =EX (and their end commands) must be on lines by themselves.  What is in their body is the PRPL command description and an example.  There can be multiple =EX/=ENDEX sections if desired.

The DESC section can contain html tags for anything.  The EX section will get jammed into an html <code> section that will maintain white space and such.  So new lines and tabs matter.

By convention I have chosen this format for the COMMAND line.
=COMMAND PRPL_COMMAND (INPUT_ARGS) OUTPUT
  PRPL_COMMAND: The name of the command
  INPUT_ARGS: Surrounded by parens.  One or more items popped from the stack by the command.
  OUTPUT: One or more items pushed to the stack by the command.

The potential items items that can be used for INPUT_ARGS and OUTPUT are just types (not names).  Valid types are:
string, int, float, bool, list, number, value
The "number" type is used whenever the data can be either int for float.
The "value" type is used when the data can be anything.

For the DESC section, if the command warrants it, describe each input argument on a separate line. For that specify:
TYPE ARG#: Argument description.
ARG# is just ARG1, ARG2, ARG3, etc.
pf/rpldocs/readme.txt · Last modified: 2016/10/16 17:29 by Karsten75