Arcscript currently supports only assignment and conditional statements.
A simple Arcscript assignment statement is of the form:
variable = expression
Any variable must have been declared beforehand in Global variables.
x = y + 5
Arcscript also supports addition, subtraction, multiplication and division assignments using the operators:
x += 2
Inside a conditional statement you may have other statements (e.g. assignments or conditionals) or simple text.
Example of a conditional statement containing an assignment:
if (x == 5)
y = 4
Example of a conditional statement containing text:
if wielding_shieldThe knight is wielding a large shield.
There is also the option to execute statements when the condition is false:
door_unlocked = true
elseYou cannot open the door
or choose between multiple outcomes:
if age >= 20
type = "adult"
age > 0
type = "child"
type = "invalid"
Arcsript supports the creation of expressions using the following arithmetic operators:
). Expressions may combine litterals, function calls and variables.
Conditions in Arcscript may be formed by using the following conditional operators:
Combining conditions may be achieved by using the following logical operators:
The functions that are currently supported in Arcscript:
|abs(n)||The absolute value of a number|
|sqr(n)||The square of a number|
|sqrt(n)||The square root of a number|
|random()||A random decimal in [0, 1)|
|roll(d, n)||A random integer in [1, d]. If n is specified the dice is rolled n times|
|show(e1, e2, ...)||Display the evaluation of one or more expressions|
When a script has a compile-time error this is denoted by an exclamation mark image.