Variables
These will be usable by the CON as well as special variables will be used by the weapon system.
These variables are CASE SENSITIVE. (FOOBAR is NOT the same as FooBar)
There are 'system' variables that allow you to change the way the weapon (and other) systems work.
In addition, you can add your own variables in your code. Take a look at what Tuco has done in these CONs: there's some pretty amazing stuff.
I'm sure that you can come up with more.
Here's the additions to the CON language:
gamevar <name> <value> <flags>
ifvarg <varname>
<value>
ifvarl <varname> <value>
ifvare <varname> <value>
ifvarvarg <varname1> <varname2>
ifvarvarl <varname1> <varname2>
ifvarvare <varname1> <varname2>
Does the usual 'if' processing on the variable (g=greater than, l=less than, e=equal)
setvar <varname>
<value>
Sets the value of the variable
addvar <varname>
<value>
add <value> to variable. <value> can be negative
addvarvar
<varname1> <varname2>
adds <varname2> to <varname1> with the result in <varname1>
setvarvar
<varname1> <varname2>
sets <varname1> equal to <varname2>
There are also pre-defined 'system' variables that can be overridden. See below for a list of these.
Example of definitions:
gamevar FAVORITE_WEAPON 0 1
gamevar GOTBIGCLIP 0 1
gamevar ALIENSKILLED 0 0
gamevar MYTARGET 0 2
Defines a new variable of 'FAVORITE_WEAPON' per-player.
Defines a per-player variable of 'GOTBIGCLIP' with the initial value of zero
Defines a global variable of 'ALIENSKILLED' with an initial value of zero
Defines a per-actor variable of 'MYTARGET' with an initial value of zero
In the code (for example, in a state or actor), the following could be
executed:
// use GOTBIGCLIP as a 'boolean' >0
mean 'true'
ifvarg GOTBIGCLIP 0
{
setvar WEAPON1_CLIP 30
setvar GOTBIGCLIP 0 // so we don't keep executing
}