AngelScript doesn't really have anything for static variables. What you can do though is to use the global variable system built into HPL3.
Getter functions:
- cScript_GetGlobalVarString
- cScript_GetGlobalVarBool
- cScript_GetGlobalVarInt
- cScript_GetGlobalVarID
- cScript_GetGlobalVarFloat
- cScript_GetGlobalVarVector2f
- cScript_GetGlobalVarVector3f
- cScript_GetGlobalVarVector4f
- cScript_GetGlobalVarMatrix
- cScript_GetGlobalVarColor
Setter functions:
- cScript_SetGlobalVarString
- cScript_SetGlobalVarBool
- cScript_SetGlobalVarInt
- cScript_SetGlobalVarID
- cScript_SetGlobalVarFloat
- cScript_SetGlobalVarVector2f
- cScript_SetGlobalVarVector3f
- cScript_SetGlobalVarVector4f
- cScript_SetGlobalVarMatrix
- cScript_SetGlobalVarColor
Usage is pretty simple. To set a variable, call one of the setter functions that matches the type of the value you wish to set.
cScript_SetGlobalVarInt("some_int_var", 1);
To get the value back, simply call the matching getter function.
cScript_GetGlobalVarInt("some_int_var");
To keep your code organized, and to prevent potential conflicts from other scripts setting their own global variables, make sure that you prefix your variable names so that they are unique to your mod or map. For example, name your variable something like "MyMod_SomeName".