188 lines
3.4 KiB
C
188 lines
3.4 KiB
C
#define SCRIPT_VERSION 3
|
|
|
|
#define NUM_PARMS 16
|
|
|
|
enum OpCodes
|
|
{
|
|
CODE_NEW_GLOBAL = 0,
|
|
CODE_NEW_GLOBAL_PLUS_ASSIGNMENT,
|
|
CODE_NEW_LOCAL,
|
|
CODE_NEW_LOCAL_PLUS_ASSIGNMENT,
|
|
CODE_NEW_PARAMETER,
|
|
CODE_NEW_PARAMETER_PLUS_DEFAULT,
|
|
CODE_FIELD,
|
|
CODE_ASSIGNMENT,
|
|
CODE_ADD,
|
|
CODE_SUBTRACT,
|
|
CODE_MULTIPLY,
|
|
CODE_DIVIDE,
|
|
CODE_ADD_ASSIGNMENT,
|
|
CODE_SUBTRACT_ASSIGNMENT,
|
|
CODE_MULTIPLY_ASSIGNMENT,
|
|
CODE_DIVIDE_ASSIGNMENT,
|
|
CODE_GOTO,
|
|
CODE_PUSH,
|
|
CODE_POP,
|
|
CODE_IF,
|
|
CODE_EXIT,
|
|
CODE_SUSPEND,
|
|
CODE_WAIT_SECONDS,
|
|
CODE_WAIT_ALL,
|
|
CODE_WAIT_ANY,
|
|
CODE_MOVE,
|
|
CODE_DEBUG,
|
|
CODE_USE,
|
|
CODE_ROTATE,
|
|
CODE_PRINT,
|
|
CODE_PLAY_SOUND,
|
|
CODE_ENABLE,
|
|
CODE_DISABLE,
|
|
CODE_ANIMATE,
|
|
CODE_DEBUG_STATEMENT,
|
|
CODE_CACHE_SOUND,
|
|
CODE_COPY_PLAYER_ATTRIBUTES,
|
|
CODE_SET_VIEW_ANGLES,
|
|
CODE_SET_CACHE_SIZE,
|
|
CODE_REMOVE,
|
|
CODE_HELICOPTER,
|
|
CODE_MOVEROTATE,
|
|
CODE_PLAYSONG,
|
|
CODE_SETCVAR,
|
|
CODE_UNLOAD_SOUND,
|
|
CODE_TANK,
|
|
CODE_SNOWCAT,
|
|
CODE_CACHE_ROFF,
|
|
CODE_CACHE_STRING_PACKAGE,
|
|
CODE_CONSOLE_COMMAND,
|
|
CODE_UNLOAD_ROFF,
|
|
CODE_ON,
|
|
CODE_RESUME,
|
|
CODE_RESET_AI,
|
|
};
|
|
|
|
enum PushTypes
|
|
{
|
|
PUSH_CONST_INT = 0,
|
|
PUSH_CONST_FLOAT,
|
|
PUSH_CONST_VECTOR,
|
|
PUSH_CONST_ENTITY,
|
|
PUSH_CONST_STRING,
|
|
PUSH_VAR,
|
|
PUSH_VAR_WITH_FIELD,
|
|
PUSH_FUNCTION,
|
|
};
|
|
|
|
enum ConditionTypes
|
|
{
|
|
COND_EQUAL = 0,
|
|
COND_LESS_THAN,
|
|
COND_LESS_THAN_EQUAL,
|
|
COND_GREATER_THAN,
|
|
COND_GREATER_THAN_EQUAL,
|
|
COND_NOT_EQUAL,
|
|
};
|
|
|
|
enum FunctionTypes
|
|
{
|
|
FUNC_FIND_ENTITY_WITH_TARGET = 0,
|
|
FUNC_SIN,
|
|
FUNC_COS,
|
|
FUNC_FIND_ENTITY_WITH_SCRIPT,
|
|
FUNC_FIND_PLAYER,
|
|
FUNC_SPAWN,
|
|
FUNC_GET_OTHER,
|
|
FUNC_GET_ACTIVATOR,
|
|
FUNC_RANDOM,
|
|
FUNC_GET_PLAYER,
|
|
};
|
|
|
|
enum VariableT
|
|
{
|
|
TypeINT = 0,
|
|
TypeFLOAT,
|
|
TypeVECTOR,
|
|
TypeENTITY,
|
|
TypeSTRING,
|
|
TypeUNKNOWN,
|
|
};
|
|
|
|
enum FeatureTypes
|
|
{
|
|
FEATURE_TRIGGER = 0,
|
|
FEATURE_AMBIENT_SOUNDS,
|
|
FEATURE_CINEMATICS,
|
|
FEATURE_PLAGUE_SKINS,
|
|
};
|
|
|
|
#define VAR_LENGTH 64
|
|
|
|
// Command Flags
|
|
// Move
|
|
#define MOVE_DURATION 0x01
|
|
#define MOVE_RATE 0x02
|
|
#define MOVE_SIGNALER 0x04
|
|
#define MOVE_ABSOLUTE 0x08
|
|
|
|
// Rotate
|
|
#define ROTATE_DURATION 0x01
|
|
#define ROTATE_RATE 0x02
|
|
#define ROTATE_SIGNALER 0x04
|
|
#define ROTATE_ABSOLUTE 0x08
|
|
|
|
|
|
// MoveRotate (disk-file command)
|
|
#define MOVEROTATE_SIGNALER 0x01
|
|
|
|
// Wait
|
|
#define WAIT_CLEAR 0x80
|
|
|
|
// Print
|
|
#define PRINT_ENTITY 0x01
|
|
#define PRINT_CENTERED 0x02
|
|
#define PRINT_LEVEL 0x04
|
|
#define PRINT_CAPTIONED 0x08
|
|
|
|
// Play Sound
|
|
#define PLAY_SOUND_ENTITY 0x01
|
|
#define PLAY_SOUND_VOLUME 0x02
|
|
#define PLAY_SOUND_ATTENUATION 0x04
|
|
#define PLAY_SOUND_CHANNEL 0x08
|
|
#define PLAY_SOUND_TIMEDELAY 0x10
|
|
|
|
// Animate
|
|
#define ANIMATE_REPEAT 0x001
|
|
#define ANIMATE_TURNING 0x002
|
|
#define ANIMATE_MOVING 0x004
|
|
#define ANIMATE_SIGNALER 0x008
|
|
#define ANIMATE_SOURCE 0x010
|
|
#define ANIMATE_MOVING_ABS 0x020
|
|
#define ANIMATE_HOLD 0x040
|
|
#define ANIMATE_TARGET 0x080
|
|
#define ANIMATE_KILL 0x100
|
|
#define ANIMATE_NULLTARGET 0x200
|
|
#define ANIMATE_EMOTION 0x400
|
|
|
|
// Debug
|
|
#define DEBUG_ENABLE 0x01
|
|
#define DEBUG_MOVE 0x02
|
|
#define DEBUG_ROTATE 0x04
|
|
#define DEBUG_TIME 0x08
|
|
#define DEBUG_MOVEROTATE 0x10
|
|
|
|
//Helicopter
|
|
#define HELICOPTER_TARG 0x01
|
|
#define HELICOPTER_VECT 0x02
|
|
#define HELICOPTER_FLOAT 0x04
|
|
#define HELICOPTER_SIGNALER 0x08
|
|
|
|
//Tank
|
|
#define TANK_TARG 0x01
|
|
#define TANK_VECT 0x02
|
|
#define TANK_FLOAT 0x04
|
|
#define TANK_SIGNALER 0x08
|
|
|
|
//Snowcat
|
|
#define SNOWCAT_TARG 0x01
|
|
#define SNOWCAT_VECT 0x02
|
|
#define SNOWCAT_FLOAT 0x04
|
|
#define SNOWCAT_SIGNALER 0x08
|