Arx scripting language: Difference between revisions

From Arx Libertatis Wiki
Jump to navigation Jump to search
(Created page with "This article describes the scripting language used in Arx Fatalis and Arx Libertatis. == Entities == == Classes == == Events == == Variables == {{Main|Script:Variables}} ...")
 
Line 10: Line 10:


{{Main|Script:Variables}}
{{Main|Script:Variables}}
Arx scripts know three basic data types: {{int}}, {{real}} and {{text}}. Variables can be either global (shared between all entities) or entity-specific. There are also special system variables than can only be read. The variable type is defined by the first character of the variable name.
{| class="wikitable" style="text-align:center;"
! Char !! Byte !! Scope !! Type
|-
| <code>#</code> || <code>0x23</code> || global || {{int}}
|-
| <code>&</code> || <code>0x26</code> || global || {{real}}
|-
| <code>$</code> || <code>0x24</code> || global || {{text}}
|-
| <code>§</code> || <code>0xA7</code> || entity || {{int}}
|-
| <code>@</code> || <code>0x40</code> || entity || {{real}}
|-
| <code>£</code> || <code>0xA3</code> || entity || {{text}}
|-
| <code>^</code> || <code>0x5E</code> || system || (mixed)
|}
While variables in Arx scripts are typed, there are no type restrictions for where variables are used: the types are converted automatically.


== Commands ==
== Commands ==


{{Main|Script:Commands}}
{{Main|Script:Commands}}

Revision as of 20:41, 14 November 2012

This article describes the scripting language used in Arx Fatalis and Arx Libertatis.

Entities

Classes

Events

Variables

Main article: Script:Variables.

Arx scripts know three basic data types: int, Template:Real and Template:Text. Variables can be either global (shared between all entities) or entity-specific. There are also special system variables than can only be read. The variable type is defined by the first character of the variable name.

Char Byte Scope Type
# 0x23 global int
& 0x26 global Template:Real
$ 0x24 global Template:Text
§ 0xA7 entity int
@ 0x40 entity Template:Real
£ 0xA3 entity Template:Text
^ 0x5E system (mixed)

While variables in Arx scripts are typed, there are no type restrictions for where variables are used: the types are converted automatically.

Commands

Main article: Script:Commands.