Global Properties

Global properties are available everywhere. They give information on the game as whole. Basically, there are four groups:

Many things are derived from your score, and will be wrong if the host uses a score blanker (a program which prevents that you see your enemy's score).

Global properties can optionally be prefixed with `Global.', when their name would otherwise be shadowed by another variable.

See also Variables.

Chart.X, Chart.Y

These contain the current X/Y location in the starchart. Unlike `UI.X' and `UI.Y', `Chart.X' and `Chart.Y' are also accessible when the starchart is not currently displayed.

These properties can be assigned to. You can assign any value, even values outside the valid range, this is corrected the next time the starchart is drawn. To force redraw if needed, you can use `UI.Update' (only if the starchart is currently visible, that is).

My.Bases

The number of bases you own (from your score record)

My.InMsgs

The number of messages you received this turn

My.OutMsgs

The number of messages you sent this turn. This does not include command messages sent by PCC; messages to many players count as one

My.PBPs

The number of Priority Build Points / PAL Points you have

My.Planets

The number of planets you own (from your score record)

My.Race

The short name (20 characters) of your race

My.Race$

Your player number

My.Race.Adj

The adjective (12 characters) of your race

My.Race.Full

The full name (30 characters) of your race

My.Race.Id

The race you play. Usually, this will be the same as `My.Race$', but in SRace games or in PHost with the `PlayerRace' option set, this may differ. E.g., if you play a Lizard race, this will be 2

My.Race.Mission

The race-specific mission you can use. Usually, this will be the same as `My.Race.Id' (and `My.Race$'), but it can differ in PHost 4.x games with the `PlayerSpecialMission' option set. For example, when this value is 4, your special mission will be Pillage.

My.Score

Your current score, according to the standard scoring system

My.Ships

The number of ships you own (from your score record)

My.Ships.Capital

The number of capital (armed) ships you own (from your score record)

My.Ships.Freighters

The number of freighters you own (from you score record)

My.Team

The number of your team (1 to 11)

My.VCRs

The number of Visual Combat Recordings you received this turn (same as the number displayed on the race screen: will be zero if PCC is unable to play them)

Selection.Layer

Current selection layer, numeric. This is a number between 0 and 7, where 0 is layer A and 7 is layer H. You can assign to this property to change the current selection layer.

See also: SelectionLayer (command)

Ships.Capital

Total number of capital ships in game (from score table)

Ships.Freighters

Total number of freighters in game (from score table)

Ships.Total

Total number of ships in game (from score table)

System.Err

The previous error message. This is the value of the argument to Abort and can be used in the `Else' part of a Try block

System.GameDirectory

The game directory. This value is ready to tack a file name at the end, so

  System.GameDirectory & "init.tmp"

names the `init.tmp' file in the game directory.

See also: System.RootDirectory

System.GameType

Either "Shareware" or "Registered"

System.GameType$

`True' if you're playing shareware, `False' else. The setting of PHost's `AllowRegisteredFunctions' option is taken into account, so this also yields `True' if you're registered but registered functions are disabled at the host

System.GUI

`True' if the graphical user interface is available, `False' if not. Scripts can run outside the GUI when PCC is invoked with `cc /r'.

System.Host

The host you're using, one of "Host", "SRace" and "PHost"

System.Host$

The host you're using:

  • 0 for the standard Host;
  • 1 for SRace;
  • 2 for PHost

There's no way to detect Host999. Really not.

System.HostVersion

Host version, if known. The version is encoded into an integer, intended to be easily comparable. For example, Host version 3.22.040 yields 322040 here (i.e. 100000*major version, 1000*minor version, plus patchlevel). Some versions use letters instead of numeric patchlevels, there 'a' = 1 etc. Examples:

  • Host 3.22.040 = 322040
  • Host 3.2 = 320000 (3.2 means 3.20 for THost)
  • PHost 2.13 = 213000
  • PHost 3.2e = 302005 (5 because e is the fifth letter)

If the version is not known, this value is zero.

System.Local

The local data file format, one of "DOS", "Windows" or "PCC" (the PCC file format is currently not defined)

System.Program

The program your script runs on.

  • "PCC" if normal PCC;
  • "PCC (Standalone Interpreter)" if CCS;
  • possibly something else.

See also: System.Version

System.RandomSeed

The current seed for the random number generator (function `Random'). Using the same seed, you can reproduce the same random number sequence. The seed is a full signed 32-bit value.

The underlying random number generator is undocumented as of now, and has nothing to do with the random number generators used in VCR/PVCR.

System.RegStr1

First line of your registration information (25 characters)

System.RegStr2

Second line of your registration information (25 characters)

System.Remote

The remote data file format (TRN file format): either "DOS" or "Windows"

System.RootDirectory

The root directory, that is, the directory you installed PCC in. Files not in System.GameDirectory are looked up here. This value is ready to tack a file name at the end, so

  System.RootDirectory & "nextturn.q"

names the `nextturn' sample script.

See also: System.GameDirectory

System.Sim

`True' if you're in the simulator, `False' otherwise. This property can be used to tell if the VCRs currently printed are real or simulated

System.Version

The version of PCC, in the format "v1.0.8".

See also: System.Program

System.Version$

The version of PCC, encoded like the host version (100000*major plus 1000*minor plus patchlevel). For example, v1.0.14 has 100014 here; version 2.1.99 would have 201099.

Turn

Turn number. When the game directory is empty, this value is zero.

Turn.Date

The date of the last host run, in the format "mm-dd-yyyy". What is commonly called the `turn timestamp' can be obtained with

  Turn.Date & Turn.Time

When the game directory doesn't contain game files, this is the empty string.

Turn.IsNew

True if this turn is a new one. This variable is set to one if and only if the turn that is currently open in PCC is newer than the one you looked at in the previous session.

Turn.Time

The time of the last host run, in the format "hh:mm:ss"

UI.Screen

Contains the current screen PCC displays. Screen numbers equal the function keys used to invoke them:

1Ship screen
2Planet screen
3Starbase screen
4Starchart
6Ship History
10Fleet screen
11Ship auto-task screen
12Planet auto-task screen
13Starbase auto-task screen

When you're not currently in one of these screens, the value is zero.

Note that this currently is a global property that changes as the user uses PCC.

UI.X, UI.Y

These contain the current X/Y location in the user interface:

  • when the user is in the starcharts, they contain the starchart position;
  • in a control screen, they contain the scanner target;
  • otherwise they are EMPTY.

Note that these are currently global properties that change as the user uses PCC; do not assume that they remain the same during the run of your script when the script suspends.


[ << Previous | Up | Next >> ]

Stefan Reuther <Streu@gmx.de>