Note
|
This is a draft. It may be wrong, incomplete and subject to change. |
Introduction
Grand Theft Auto III was released in 2001 to great critical acclaim, becoming one of the most important titles of all time and changing the gaming landscape forever with its immersive open world sandbox.
To support this open world, a scripting language was created in order to fasten development, reducing the complexities of programming languages for less-skilled personnel.
This is an attempt to produce a formal language specification for this language. More specifically, this document is an extension to [GTA3script Specification], providing details specific to the implementation of the language in GTA III.
1. Scope
This document is an extension to the GTA3script language. It provides the necessary changes to the translation (and part of the execution) environment to accomodate the details of the implementation used in 2001’s GTA III.
[GTA3script Specification] provides important context and specification for this extension. The sections of this document should be read as if merged to the original sections of [GTA3script Specification].
2. Terms and Definitions
For the purposes of this document, the terms and definitions given in [GTA3script Specification] and the following apply.
- mission
-
TODO
- collectable
-
TODO
- progress points
-
TODO
- timer
-
TODO
- model
-
TODO
- level model
-
TODO
- text key
-
TODO
3. General Principles
3.1. Implementation Conformance
Other extensions may expand and alter this document for the purpose of specifying other implementations, provided they still conform to [GTA3script Specification].
4. Elements
5. Parameters
5.1. String Constants
There exists an enumeration called the default models enumeration.[1]
5.2. Used Objects
An object string constant is a string constant matching any string constant in the default models enumeration or any level model name (in this order).[2]
A parameter definition can be associated with object string constants. Further semantics for this association are defined along this specification.
Any object string constant used in the multi-file is called an used object.
5.3. Parameter Types
5.3.1. INPUT_INT
If the parameter is associated with object string constants, it should behave as if the parameter was associated with an enumeration containing the object string constants.
5.3.2. VAR_TEXT_LABEL
As text label variables are not supported, this parameter type is not supported.
7. Statements
8. Supporting Commands
The GTA III implementation of the language provides an extensive list of commands to interact with the game engine. It is not of the intent of this specification to document these commands. This is left as a task for other projects in the modding community. Please see [GTAMods Wiki], [GTAG Opcode Database] and [GTA3script Configuration] for some of these efforts.
Nevertheless, there are commands that require additional support from the translation environment. These commands are specified below.
8.1. START_NEW_SCRIPT
The definition present in [GTA3script Specification] remains with the following rectification in the constraints of the command.
Constraints
The specified label location must be within a scope. Such scope can begin at the next non-empty embedded statement relative to the label location.
8.2. PLAYER_MADE_PROGRESS
Parameters
PLAYER_MADE_PROGRESS INT
Side effects
Adds the given amount of progress points to the game.
8.3. SET_PROGRESS_TOTAL
Parameters
SET_PROGRESS_TOTAL INT
Side effects
Sets the total amount of progress points that can be archieved in the game.
Constraints
The translation environment must enforce the following constraints.
There shall be only a single occurrence of this command in the multi-file.
The given integer value shall be equal zero. The argument must be rewritten to correspond to the sum of the arguments to all instances of PLAYER_MADE_PROGRESS in the multi-file.
8.4. REGISTER_MISSION_PASSED
Parameters
REGISTER_MISSION_PASSED TEXT_LABEL
Side effects
Registers that the mission associated with the given text key has been passed.
8.5. SET_TOTAL_NUMBER_OF_MISSIONS
Parameters
SET_TOTAL_NUMBER_OF_MISSIONS INPUT_INT
Side effects
Sets the total number of missions present in the game.
Constraints
The translation environment must enforce the following constraints.
There shall be only a single occurrence of this command in the multi-file.
The argument must not be a variable and shall evaluate to an interger value equal zero. The argument must be rewritten to correspond to the number of times the command REGISTER_MISSION_PASSED occurs in the multi-file.
8.6. CREATE_COLLECTABLE1
Parameters
CREATE_COLLECTABLE1 INPUT_FLOAT INPUT_FLOAT INPUT_FLOAT
Side effects
Creates a collectable at the specified X, Y and Z coordinates respectively.
If the given Z coordinate is equal -100.0
, the collectable is created at the ground of the given X, Y coordinates.
8.7. SET_COLLECTABLE1_TOTAL
Parameters
SET_COLLECTABLE1_TOTAL INPUT_INT
Side effects
Sets the total number of collectables in the game.
Constraints
The translation environment must enforce the following constraints.
There shall be only a single occurrence of this command in the multi-file.
The argument must not be a variable and shall evaluate to an interger value equal zero. The argument must be rewritten to correspond to the number of times the command CREATE_COLLECTABLE1 occurs in the multi-file.
9. Supporting Command Selectors
The following rectifies a few command selectors specified in [GTA3script Specification] to eliminate unsupported alternatives from the selection set.
9.1. SET
The following alternatives are not supported and thus removed:
SET_VAR_INT_TO_CONSTANT VAR_INT INPUT_INT SET_LVAR_INT_TO_CONSTANT VAR_INT INPUT_INT SET_VAR_TEXT_LABEL VAR_TEXT_LABEL TEXT_LABEL SET_LVAR_TEXT_LABEL LVAR_TEXT_LABEL TEXT_LABEL
9.2. IS_THING_EQUAL_TO_THING
The following alternatives are not supported and thus removed[3]:
IS_INT_VAR_EQUAL_TO_CONSTANT VAR_INT INPUT_INT IS_INT_LVAR_EQUAL_TO_CONSTANT LVAR_INT INPUT_INT IS_VAR_TEXT_LABEL_EQUAL_TO_TEXT_LABEL VAR_TEXT_LABEL TEXT_LABEL IS_LVAR_TEXT_LABEL_EQUAL_TO_TEXT_LABEL LVAR_TEXT_LABEL TEXT_LABEL IS_INT_LVAR_EQUAL_TO_INT_VAR LVAR_INT VAR_INT IS_FLOAT_LVAR_EQUAL_TO_FLOAT_VAR LVAR_FLOAT VAR_FLOAT
9.3. IS_THING_GREATER_THAN_THING
The following alternatives are not supported and thus removed:
IS_INT_VAR_GREATER_THAN_CONSTANT VAR_INT INPUT_INT IS_INT_LVAR_GREATER_THAN_CONSTANT LVAR_INT INPUT_INT IS_CONSTANT_GREATER_THAN_INT_VAR INPUT_INT VAR_INT IS_CONSTANT_GREATER_THAN_INT_LVAR INPUT_INT LVAR_INT
9.4. IS_THING_GREATER_OR_EQUAL_TO_THING
The following alternatives are not supported and thus removed:
IS_INT_VAR_GREATER_OR_EQUAL_TO_CONSTANT VAR_INT INPUT_INT IS_INT_LVAR_GREATER_OR_EQUAL_TO_CONSTANT LVAR_INT INPUT_INT IS_CONSTANT_GREATER_OR_EQUAL_TO_INT_VAR INPUT_INT VAR_INT IS_CONSTANT_GREATER_OR_EQUAL_TO_INT_LVAR INPUT_INT LVAR_INT
References
-
[GTA3script Specification] GTA3script Core Specification.
-
[GTA3script Configuration] GTA3script Configuration Files for Compilers and Disassemblers.
-
[GTAMods Wiki] GTAMods Wiki — List of opcodes.
-
[GTAG Opcode Database] GTAG Modding — Opcode Database.