1 // per-campaign-level configuration file. Used to execute scripts and other commands for campaign levels
\r
2 // do NOT attempt to set cvars here! Those cvars must be set from the campaign file properly
\r
3 // this is only for scripts and other commands you wish to run for a given level
\r
5 // ----------------------------------------------------------------
\r
6 // Automated chat bot code:
\r
7 // ----------------------------------------------------------------
\r
9 // this is a chat bot system, used in campaign levels to simulate dialogues between the player and bots
\r
10 // it only makes the player automatically speak certain messages, just like manually be typing them
\r
11 // eg. In a campaign level where you try to advance to the next area, you can make the script say "Bot: I will not let you pass!"
\r
12 // that does print "My-Playername: Bot: message", but it's the best this script can do
\r
14 // chat script settings
\r
15 set chatbot_msg_count 8 "number of messages (chatbot_msg_# cvars)"
\r
16 set chatbot_msg_time 15 "each message is posted after this many seconds"
\r
17 set chatbot_tmp_counter 0 "chatbot system variable, used to cycle the messages (do not set this manualy)"
\r
19 // chat script messages
\r
20 set chatbot_msg_0 "^1Guard: ^7You! How did you escape? Get back in your cell, now!"
\r
21 set chatbot_msg_1 "^2Self: ^7Who are you? Where am I? And why am I being held here?"
\r
22 set chatbot_msg_2 "^1Guard: ^7I need backup! We have a prisoner on the loose!"
\r
23 set chatbot_msg_3 "^2Self: ^7I want to know what's going on! What am I being held for? What happened?"
\r
24 set chatbot_msg_4 "^1Guard: ^7I'm hit! Someone please come over here! I can't take this one down by myself!"
\r
25 set chatbot_msg_5 "^2Self: ^7If you don't wish to let me go, I have no choice but to brake out of here!"
\r
26 set chatbot_msg_6 "^1Guard: ^7Shut up and get back in there, or you will regret this! You hear me?"
\r
27 set chatbot_msg_7 "^2Self: ^7I have nothing against you, just let me get out of here!"
\r
29 // chat script system
\r
30 alias chatbot_count "qc_cmd rpn /chatbot_tmp_counter chatbot_tmp_counter 1 add $chatbot_msg_count mod def"
\r
31 alias chatbot_say "say ${$1}"
\r
32 alias chatbot_do "chatbot_say chatbot_msg_$chatbot_tmp_counter;chatbot_count"
\r
33 alias chatbot_loop "chatbot_do;defer $chatbot_msg_time chatbot_loop"
\r
35 // kill the chat script when the match ends
\r
36 alias cl_hook_campaign_gameend "alias chatbot_loop \"\""
\r
38 // start the chat script
\r
39 defer $chatbot_msg_time chatbot_loop
\r
41 // ----------------------------------------------------------------
\r
42 // End of automated chat bot code.
\r
43 // ----------------------------------------------------------------