Scripting
From PlanetsWiki
Contents |
[edit] Overview
VGA Planets 4 allows you to create games yourself using the Master application.
In addition to the "standard" settings available in it, you can also write your own scripts that allow
for all kind of special setups.
The easiest way to do this, is by using a graphical user interface as Scriptz0r, but you can also edit the script files directly using a text editor, if you want to add/change stuff.
[edit] Script Format
The script is a plain text file that has a filename extension of ".vps".
All objects are scripted as formatted text like this:
Begin NameOfObject attribute1 = value1 attribute2 = value2 End
[edit] Object
Each object starts with
Begin NameOfObject
and ends with
End
[edit] Attributes
- Attributes always have to be "inside" an object.
- Some attributes are required, while others may be optional.
Attributes are always a pair of
attribute = value
There are also numbered attributes
attribute(x) = value
[edit] Objects
The following paragraphs show how to script all kind of objects.
- For each object there will be an example.
- For each attribute of an object,
- If objects have numbered attributes, these will be shown as "attribute(1..x)"
[edit] Races
The races are a special "virtual" object that has to be included in every script exactly 1 time.
| Attribute | Values | Required | Comment |
| Playercount | 1-30 | | The number of players in the game. |
| Player(1..30) | Race Number | | 1 Entry for each player (defined by "playercount"). Values are the Race Numbers. |
[edit] Example
Begin Races
Playercount = 2
Player(1) = 109
Player(2) = 805
End
[edit] Tech
The Tech Levels are a special "virtual" object that has to be included in every script exactly 1 time.
| Attribute | Values | Required | Comment |
| TechPlanet | ?-? | ? | |
| TechHuge | ?-? | ? | |
| TechLarge | ?-? | ? | |
| TechSmall | ?-? | ? | |
| TechPD | ?-? | ? | |
| TechGen | ?-? | ? | |
| TechEngine | ?-? | ? | |
| TechHull | ?-? | ? | |
| TechHyp | ?-? | ? | |
| TechShield | ?-? | ? |
[edit] Example
Begin Tech
TechPlanet = 1
TechHuge = 0
TechLarge = 0
TechSmall = 1
TechPD = 0
TechGen = 1
TechEngine = 6
TechHull = 1
TechHyp = 1
TechShield = 1
End
[edit] Exotic Tech
[edit] Planet
[edit] Base
[edit] Ship
AttackEnemy = 1 SWITCHWEAPONS = 0 ATTACKPLAN = 44 STANDOFFRANGE = 0 ATTACKVECTOR = 0 Speed = 0
[edit] AttackEnemy
also known as combat mode from the ship screen overview, relating to the two attack switches flee from enemy ships and attack all enemy ships. Attackenemy must appear in the script even if the value = 0.
- AttackEnemy = see chart for value 0 thru 3
| ATTACKENEMY | Attack All Enemy Ships | Flee From Enemy Ships |
|---|---|---|
| 0 | OFF | OFF |
| 1 | ON | OFF |
| 2 | OFF | ON |
| 3 | ON | ON |
- note that AttackEnemy = 3 is both attack and flee = on, how this works in combat is purely speculative at this point in my knowledge. however if you look at the ship overview screen - combat mode, it indicates flee.
[edit] SWITCHWEAPONS
switchweapons is a combination of values pertaining to sandcasters, ion cannons and superweapons.if SWITCHWEAPONS = 0 it does not need to appear in the script.
- SWITCHWEAPONS = see chart for values from 0 thru 15
| SWITCHWEAPONS | Ion Cannons Fire On Ships | Sandcasters Fire at Ships | Sandcasters Fire At Wings | SuperWeapon |
|---|---|---|---|---|
| 0 | OFF | OFF | OFF | OFF |
| 1 | ON | OFF | OFF | OFF |
| 2 | OFF | ON | OFF | OFF |
| 3 | ON | ON | OFF | OFF |
| 4 | OFF | OFF | ON | OFF |
| 5 | ON | OFF | ON | OFF |
| 6 | OFF | ON | ON | OFF |
| 7 | ON | ON | ON | OFF |
| 8 | OFF | OFF | OFF | ON |
| 9 | ON | OFF | OFF | ON |
| 10 | OFF | ON | OFF | ON |
| 11 | ON | ON | OFF | ON |
| 12 | OFF | OFF | ON | ON |
| 13 | ON | OFF | ON | ON |
| 14 | OFF | ON | ON | ON |
| 15 | ON | ON | ON | ON |
[edit] ATTACKPLAN
attackplan is the value to determine the configuration of the switches in the chart below. if attackplan does not appear in the script the value is automatically zero. if attackplan = 0 it does not need to appear in the script.
- ATTACKPLAN = see chart for values from 0 thru 1007
| Attack Plan | Stay at Standoff Range | Hold the Line | Target Soft | Target Dangerous | Strike through | Ram | Delay Ship | Fire at Ground Targets | Do Not Fire at Disabled | Avoid Ground Base |
|---|---|---|---|---|---|---|---|---|---|---|
| 0 | OFF | OFF | OFF | OFF | OFF | OFF | OFF | OFF | OFF | OFF |
| 1 | ON | OFF | OFF | OFF | OFF | OFF | OFF | OFF | OFF | OFF |
| 2 | OFF | ON | OFF | OFF | OFF | OFF | OFF | OFF | OFF | OFF |
| 3 | ON | ON | OFF | OFF | OFF | OFF | OFF | OFF | OFF | OFF |
| 4 | OFF | OFF | ON | OFF | OFF | OFF | OFF | OFF | OFF | OFF |
| 5 | ON | OFF | ON | OFF | OFF | OFF | OFF | OFF | OFF | OFF |
| 6 | OFF | ON | ON | OFF | OFF | OFF | OFF | OFF | OFF | OFF |
| 7 | ON | ON | ON | OFF | OFF | OFF | OFF | OFF | OFF | OFF |
| 8 | OFF | OFF | OFF | ON | OFF | OFF | OFF | OFF | OFF | OFF |
| 9 | ON | OFF | OFF | ON | OFF | OFF | OFF | OFF | OFF | OFF |
| 10 | OFF | ON | OFF | ON | OFF | OFF | OFF | OFF | OFF | OFF |
| 11 | ON | ON | OFF | ON | OFF | OFF | OFF | OFF | OFF | OFF |
| 12 | OFF | OFF | ON | ON | OFF | OFF | OFF | OFF | OFF | OFF |
| 13 | ON | OFF | ON | ON | OFF | OFF | OFF | OFF | OFF | OFF |
| 14 | OFF | ON | ON | ON | OFF | OFF | OFF | OFF | OFF | OFF |
| 15 | ON | ON | ON | ON | OFF | OFF | OFF | OFF | OFF | OFF |
| 16 | OFF | OFF | OFF | OFF | ON | OFF | OFF | OFF | OFF | OFF |
| 17 | ON | OFF | OFF | OFF | ON | OFF | OFF | OFF | OFF | OFF |
| 18 | OFF | ON | OFF | OFF | ON | OFF | OFF | OFF | OFF | OFF |
| 19 | ON | ON | OFF | OFF | ON | OFF | OFF | OFF | OFF | OFF |
| 20 | OFF | OFF | ON | OFF | ON | OFF | OFF | OFF | OFF | OFF |
| 21 | ON | OFF | ON | OFF | ON | OFF | OFF | OFF | OFF | OFF |
| 22 | OFF | ON | ON | OFF | ON | OFF | OFF | OFF | OFF | OFF |
| 23 | ON | ON | ON | OFF | ON | OFF | OFF | OFF | OFF | OFF |
| 24 | OFF | OFF | OFF | ON | ON | OFF | OFF | OFF | OFF | OFF |
| 25 | ON | OFF | OFF | ON | ON | OFF | OFF | OFF | OFF | OFF |
| 26 | OFF | ON | OFF | ON | ON | OFF | OFF | OFF | OFF | OFF |
| 27 | ON | ON | OFF | ON | ON | OFF | OFF | OFF | OFF | OFF |
| 28 | OFF | OFF | ON | ON | ON | OFF | OFF | OFF | OFF | OFF |
| 29 | ON | OFF | ON | ON | ON | OFF | OFF | OFF | OFF | OFF |
| 30 | OFF | ON | ON | ON | ON | OFF | OFF | OFF | OFF | OFF |
| 31 | ON | ON | ON | ON | ON | OFF | OFF | OFF | OFF | OFF |
| 32 | OFF | OFF | OFF | OFF | OFF | ON | OFF | OFF | OFF | OFF |
| 64 | OFF | OFF | OFF | OFF | OFF | OFF | ON | OFF | OFF | OFF |
| 128 | OFF | OFF | OFF | OFF | OFF | OFF | OFF | ON | OFF | OFF |
| 256 | OFF | OFF | OFF | OFF | OFF | OFF | OFF | OFF | ON | OFF |
| 512 | OFF | OFF | OFF | OFF | OFF | OFF | OFF | OFF | OFF | ON |
- chart was shortened due to absurd length, but a talented person can use the completed contents to determine missing attackplans, there is a pattern!
[edit] STANDOFFRANGE
STANDOFFRANGE is the value to determine the range from the target that ship will attempt to maintain.
- STANDOFFRANGE = a value from 0-1000
[edit] ATTACKVECTOR
ATTACKVECTOR is value to represent which side of the VCR the ship will enter from. a Value of 0 sets the VCR entrance to a random number from 1 to 8 that will last the entire turn.
- ATTACKVECTOR = a value from 0 thru 8 with zero being a random number that last for the duration of the turn. this value must be present in the script.
[edit] Speed
speed is the warp speed of the vessel, this value cannot exceed that of the hull/engine capabilities. but can exceed engine specs when gravatronicdrive switch is active which currently cannot be configured within the script.
[edit] Ship Devices
Ship devices currently cannot be configured within the script. at least not with script polisher, vgapanalyzis etc.
[edit] Wing
[edit] Pod
[edit] Jump Gate
[edit] Worm Hole
[edit] See also
- Master the program that will process the script file and turn it into a universe/game.
- Scriptz0r
ScriptZ0r is a program created by Roger Norris that allows you to create your own scenarios in the form of script files. - ScriptPolisher
ScriptPolisher by Roger Norris helps VGA Planets game hosts by making it easier to fine-tune scripts.
It is designed to be used in conjunction with another fully-featured script creator, such as ScriptZ0r.
