From 3a3b35f4ba71936a348ed967cdb6883087faef8d Mon Sep 17 00:00:00 2001 From: RandumKiwi Date: Sat, 18 Oct 2008 07:04:08 +0000 Subject: [PATCH] More clever and cleaner bot preperation script. git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@3117 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- config/menus_bot.cfg | 58 +++++++++++++++----------------------------- 1 file changed, 20 insertions(+), 38 deletions(-) diff --git a/config/menus_bot.cfg b/config/menus_bot.cfg index 9d8e7a9d..65b28642 100644 --- a/config/menus_bot.cfg +++ b/config/menus_bot.cfg @@ -6,7 +6,7 @@ alias genbotmaps [ loop i (listlen $arg1) [ alias listmapname (at $arg1 $i) alias menutext $listmapname (concat map $listmapname) - menuitem $menutext (concat "alias tmp_botmap" $listmapname "; startbotmap") + menuitem $menutext (concat "alias tmp_botmap" $listmapname "; preparebotmap") ] ] genbotmaps $defaultmaps @@ -16,57 +16,39 @@ alias tmp_numbots 1 alias tmp_mode alias tmp_botmap -// add bots +// Add bots. alias startbotmatch [ - - if (= $tmp_mode 7) [ // TDM + if (= $tmp_mode 7) [ // Team bot numbers. alias numrvsf (- (div $tmp_numbots 2) (curteam)) alias numcla (- (div $tmp_numbots 2) (= (curteam) 0)) addnbot $numrvsf RVSF $tmp_botskill addnbot $numcla CLA $tmp_botskill - ] [ // DM + ] [ // FFA bot numbers. addnbot $tmp_numbots ] ] -alias preparebotmatch [ - echo starting botmatch.. - - // register event that is fired during mapload - alias mapstartonce [ - kickallbots - startbotmatch // add bots - mode 0 // reset mode for next maps - ] - - mode $tmp_mode - map $tmp_botmap -] +alias preparebotmap [ + while [ $connected 1 ] [ disconnect ] // Wait till disconnected before executing the next command. + kickallbots // Loose the bots. + mode $tmp_mode // Choose bot mode. + map $tmp_botmap // Choose map. + startbotmatch // Add bots. + ] -// register events and change map -alias startbotmap [ - if $connected [ - alias mapstartonce [ preparebotmatch ] - disconnect - ] [ - preparebotmatch - ] -] - - -alias emptymap [ if $connected [ disconnect; alias mapstartonce [ emptymap2 ] ] [ emptymap2 ] ] -alias emptymap2 [ - mode 0 - showmenu maps +alias emptymap [ + while [ $connected 1 ] [ disconnect ] // Wait till disconnected before executing the next command. + kickallbots // Loose the bots. + mode 1 // An inhert mode. + showmenu maps // Load a map. ] newmenu singleplayer -// teamplay not mature yet -menuitem "Bot Team Deathmatch" "alias tmp_mode 7; showmenu botskill" -menuitem "Bot Deathmatch" "alias tmp_mode 8; showmenu botskill" -menuitem "Bot One Shot, One Kill" "alias tmp_mode 12; showmenu botskill" -menuitem "Empty Map" "emptymap" +menuitem "Bot Team Deathmatch" "alias tmp_mode 7; showmenu botskill" // Teamplay not mature yet +menuitem "Bot Deathmatch" "alias tmp_mode 8; showmenu botskill" +menuitem "Bot One Shot, One Kill" "alias tmp_mode 12; showmenu botskill" +menuitem "Empty Map" "emptymap" newmenu botskill