Properties

PCC makes most information from the game available to your expressions and scripts via properties. Each expression is evaluated in a particular context, which decides which properties are available. For example, if you call the console from the ship screen, all properties of that ship will be available. Or, the search function will iterate through all objects on your starcharts and evaluate the query in each context.

You can refer to different contexts using the context functions. For example, to access ship #1's torpedo type, use

  Ship(1).Torp

and to access that torpedo type's kill value, use

  Torpedo(Ship(1).Torp$).Kill

All properties are listed by object in the Property Reference, or alphabetically in the Index.

 Property Names

In the above examples, `Torp', `Torp$' and `Kill' are property names. These names are made up using some rather simple rules:

As a rule of thumb, the shortest form of a property (`Torp') always yields a value that is good for printing; the names were assigned when PCC got its printing function. When writing scripts, you'll often refer to the "technical" form of a property, with an appended dollar sign (`Torp$').

Note that the dot is a regular part of the property name. You can not split property names at dots: because

  With Ship(1) Do ...

is possible, you can write `Ship(1).xxx'. But you can not write

  With Torp Do ...

just because there are some `Torp.xxx' properties.

 Assigning to Properties

A few properties can be assigned to. For example, to change the name of a ship, you can do

  Name := 'USS Escalator'

or call the equivalent command

  SetName 'USS Escalator'

Only the "raw numbers" can be assigned. That is, `Mission$ := 1' works, `Mission := "Explore"' does not.

You should prefer the command if you can.


[ << Previous | Up | Next >> ]

Stefan Reuther <Streu@gmx.de>