]> de.git.xonotic.org Git - voretournament/voretournament.git/blob - data/maps/campaign_voretournament_2.cfg
At last, the chat scripts for the campaign. They echo chat messages from the server...
[voretournament/voretournament.git] / data / maps / campaign_voretournament_2.cfg
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
4 \r
5 // ----------------------------------------------------------------\r
6 // Automated chat bot code:\r
7 // ----------------------------------------------------------------\r
8 \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
13 \r
14 // chat script settings\r
15 set chatbot_msg_count 3 "number of messages (chatbot_msg_# cvars)"\r
16 set chatbot_msg_time 8 "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
18 \r
19 // chat script messages\r
20 set chatbot_msg_0 "First message from the list"\r
21 set chatbot_msg_1 "A second message message from the list"\r
22 set chatbot_msg_2 "A third message message from the list"\r
23 \r
24 // chat script system\r
25 alias chatbot_count "qc_cmd rpn /chatbot_tmp_counter chatbot_tmp_counter 1 add $chatbot_msg_count mod def"\r
26 alias chatbot_say "say ${$1}"\r
27 alias chatbot_do "chatbot_say chatbot_msg_$chatbot_tmp_counter;chatbot_count"\r
28 alias chatbot_loop "chatbot_do;defer $chatbot_msg_time chatbot_loop"\r
29 \r
30 // kill the chat script when the match ends\r
31 alias cl_hook_campaign_gameend "alias chatbot_loop \"\""\r
32 \r
33 // start the chat script\r
34 defer $chatbot_msg_time chatbot_loop\r
35 \r
36 // ----------------------------------------------------------------\r
37 // End of automated chat bot code.\r
38 // ----------------------------------------------------------------