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
This commit is contained in:
RandumKiwi
2008-10-18 07:04:08 +00:00
parent e97e03b3d5
commit 3a3b35f4ba
+20 -38
View File
@@ -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