$
followed by an identifier (name). The global variable name is any combination of letters, digits and _
:$variable1 $100 $____
DMA
-variable (Direct Memory Address). See also Alloc.LCS
and VCS
modes. Its name is prefixed with $_
, e.g. $_var
. The value of this variable persists across saved games. Global variables denoted by $
only (e.g. $var
) are not saved and they get blank values when the LCS or VCS game loads.@
.TIMERA
and TIMERB
. The value of a timer variable is increased automatically when the game clock advances, so they are commonly used to measure time elapsed since the timer reset:TIMERA
and TIMERB
names are only available starting with Sanny Builder v3.3.0. In older scripts the timers are known as [email protected]
, [email protected]
(GTA3, VC) or [email protected]
, [email protected]
(SA).0058
for integer values and 0059
for floating-point values.VAR..END
construct.VAR..END
construct allows to declare variables and their types for the advanced use.var
<variable>: <type>
end
Integer
, Int
- integer valuesFloat
- floating-points valuesString
, ShortString
- a variable containing a string literal with the fixed length (only for the arrays, use s$
, @s
for variables)LongString
- a variable containing a string literal with the variable length (only for the arrays, use v$
, @v
for variables)'Food'
script [email protected]
is the floating-point variable. In the 'Loop'
script [email protected]
is the integer variable.Int
, Float
, String
, LongString
) using only the type name.<type> <variable name>
=
and then the value:$fVar
is now declared as Float
and the compiler adds the opcode 0005
in the script: