3 #define BOT_EXEC_STATUS_IDLE 0
4 #define BOT_EXEC_STATUS_PAUSED 1
5 #define BOT_EXEC_STATUS_WAITING 2
7 #define CMD_STATUS_EXECUTING 0
8 #define CMD_STATUS_FINISHED 1
9 #define CMD_STATUS_ERROR 2
12 // NOTE: New commands should be added here. Do not forget to update BOT_CMD_COUNTER
13 const int BOT_CMD_NULL = 0;
14 const int BOT_CMD_PAUSE = 1;
15 const int BOT_CMD_CONTINUE = 2;
16 const int BOT_CMD_WAIT = 3;
17 const int BOT_CMD_TURN = 4;
18 const int BOT_CMD_MOVETO = 5;
19 const int BOT_CMD_RESETGOAL = 6; // Not implemented yet
20 const int BOT_CMD_CC = 7;
21 const int BOT_CMD_IF = 8;
22 const int BOT_CMD_ELSE = 9;
23 const int BOT_CMD_FI = 10;
24 const int BOT_CMD_RESETAIM = 11;
25 const int BOT_CMD_AIM = 12;
26 const int BOT_CMD_PRESSKEY = 13;
27 const int BOT_CMD_RELEASEKEY = 14;
28 const int BOT_CMD_SELECTWEAPON = 15;
29 const int BOT_CMD_IMPULSE = 16;
30 const int BOT_CMD_WAIT_UNTIL = 17;
31 const int BOT_CMD_MOVETOTARGET = 18;
32 const int BOT_CMD_AIMTARGET = 19;
33 const int BOT_CMD_BARRIER = 20;
34 const int BOT_CMD_CONSOLE = 21;
35 const int BOT_CMD_SOUND = 22;
36 const int BOT_CMD_DEBUG_ASSERT_CANFIRE = 23;
37 const int BOT_CMD_WHILE = 24; // TODO: Not implemented yet
38 const int BOT_CMD_WEND = 25; // TODO: Not implemented yet
39 const int BOT_CMD_CHASE = 26; // TODO: Not implemented yet
41 const int BOT_CMD_COUNTER = 24; // Update this value if you add/remove a command
43 // NOTE: Following commands should be implemented on the bot ai
44 // If a new command should be handled by the target ai(s) please declare it here
45 .float(entity, vector) cmd_moveto;
46 .float(entity) cmd_resetgoal;
49 const int BOT_CMD_PARAMETER_NONE = 0;
50 const int BOT_CMD_PARAMETER_FLOAT = 1;
51 const int BOT_CMD_PARAMETER_STRING = 2;
52 const int BOT_CMD_PARAMETER_VECTOR = 3;
54 float bot_cmds_initialized;
55 int bot_cmd_parm_type[BOT_CMD_COUNTER];
56 string bot_cmd_string[BOT_CMD_COUNTER];
59 entity bot_cmd; // global current command
60 .entity bot_cmd_current; // current command of this bot
62 .float is_bot_cmd; // Tells if the entity is a bot command
63 .float bot_cmd_index; // Position of the command in the queue
64 .int bot_cmd_type; // If of command (see the BOT_CMD_* defines)
65 .float bot_cmd_parm_float; // Field to store a float parameter
66 .string bot_cmd_parm_string; // Field to store a string parameter
67 .vector bot_cmd_parm_vector; // Field to store a vector parameter
69 float bot_barriertime;
72 .float bot_cmd_execution_index; // Position in the queue of the command to be executed
75 void bot_resetqueues();
76 void bot_queuecommand(entity bot, string cmdstring);
77 void bot_cmdhelp(string scmd);
78 void bot_list_commands();
79 float bot_execute_commands(entity this);
80 entity find_bot_by_name(string name);
81 entity find_bot_by_number(float number);