git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6195 e016b1c5-ed68-44aa-a2f7-31cac88cffde
143 lines
4.2 KiB
INI
143 lines
4.2 KiB
INI
// bot menus and tools
|
|
|
|
newmenu botmaps
|
|
|
|
genbotmaps = [
|
|
loop i (listlen $arg1) [
|
|
listmapname = (at $arg1 $i)
|
|
alias menutext $listmapname (concat map $listmapname)
|
|
menuitemmapload $listmapname (concat tmp_botmap "=" $listmapname ";" startbotmap)
|
|
]
|
|
]
|
|
genbotmaps $defaultmaps
|
|
|
|
alias tmp_botskill good
|
|
alias tmp_numbots 1
|
|
alias tmp_mode
|
|
alias tmp_botmap
|
|
|
|
// add bots
|
|
startbotmatch = [
|
|
if (= $tmp_mode 7) [ // TDM
|
|
numrvsf = (- (div $tmp_numbots 2) (curteam))
|
|
numcla = (- (div $tmp_numbots 2) (= (curteam) 0))
|
|
addnbot $numrvsf RVSF $tmp_botskill
|
|
addnbot $numcla CLA $tmp_botskill
|
|
] [ // DM
|
|
addnbot $tmp_numbots
|
|
]
|
|
]
|
|
|
|
preparebotmatch = [
|
|
echo starting botmatch..
|
|
// register event that is fired during mapload
|
|
addOnLoadOnce [
|
|
kickallbots
|
|
startbotmatch // add bots
|
|
mode 0 // reset mode for next maps
|
|
]
|
|
mode $tmp_mode
|
|
map $tmp_botmap
|
|
]
|
|
|
|
afterdisconnect = [
|
|
if $connected [
|
|
addOnLoadOnce $arg1
|
|
disconnect
|
|
] [
|
|
if (watchingdemo) [
|
|
addOnLoadOnce $arg1
|
|
stopdemo
|
|
] $arg1
|
|
]
|
|
]
|
|
|
|
// register events and change map
|
|
startbotmap = [ afterdisconnect [preparebotmatch] ]
|
|
|
|
emptymap = [
|
|
afterdisconnect [
|
|
mode 0
|
|
showmenu maps
|
|
]
|
|
]
|
|
|
|
newmenu singleplayer
|
|
|
|
// teamplay not mature yet
|
|
menuitem "Bot Team Deathmatch" [ tmp_mode = 7; showmenu botskill ]
|
|
menuitem "Bot Deathmatch" [ tmp_mode = 8; showmenu botskill ]
|
|
menuitem "Bot One Shot, One Kill" [ alias tmp_mode 12; showmenu botskill ]
|
|
menuitem "Empty Map" emptymap
|
|
|
|
newmenu botskill
|
|
|
|
showmenu_enemies = [ if (= $tmp_mode 7) [ showmenu "team enemies" ] [ showmenu enemies ] ]
|
|
menuitem "Best" [ tmp_botskill = best; showmenu_enemies ]
|
|
menuitem "Good (default)" [ tmp_botskill = good; showmenu_enemies ]
|
|
menuitem "Medium" [ tmp_botskill = medium; showmenu_enemies ]
|
|
menuitem "Worse" [ tmp_botskill = worse; showmenu_enemies ]
|
|
menuitem "Bad" [ tmp_botskill = bad; showmenu_enemies ]
|
|
|
|
genenemyitems = [
|
|
loop i (listlen $arg1) [
|
|
numplayers = (at $arg1 $i)
|
|
if (= $arg2 0) [ // DM
|
|
-= numplayers 1 // don't count yourself as enemy
|
|
menutext = (concat (+ $numplayers 1) players)
|
|
] [ // TDM
|
|
teamsize = (div $numplayers 2)
|
|
menutext = (concatword $teamsize vs $teamsize)
|
|
]
|
|
menuitem $menutext (concat "alias tmp_numbots" $numplayers "; showmenu botmaps")
|
|
]
|
|
]
|
|
|
|
newmenu enemies
|
|
genenemyitems "2 4 8 12 16 24 32" 0
|
|
|
|
newmenu "team enemies"
|
|
genenemyitems "4 8 12 16 24 32" 1
|
|
|
|
newmenu "Creating bot waypoints"
|
|
|
|
menuitem "Waypoints..." [ showmenu "Waypoints" ]
|
|
menuitem "Paths..." [ showmenu "Paths" ]
|
|
menuitem "Other operations..." [ showmenu "Other bot operations" ]
|
|
menuitem "" -1
|
|
menuitem "Flood map with waypoints" [ wpflood ]
|
|
menuitem "Save bot waypoints" [ wpsave ]
|
|
|
|
newmenu Waypoints
|
|
|
|
menuitem "Add a waypoint" [ addwp 0 ]
|
|
menuitem "Add auto-connecting waypoint" [ addwp 1 ]
|
|
menuitem "" -1
|
|
menuitem "Delete nearest waypoint" [ delwp ]
|
|
menuitem "Delete all waypoints" [ showmenu "Delete all waypoints" ]
|
|
|
|
newmenu Paths
|
|
|
|
menuitem "Create Start of 2-way path" [ addpath2way1 ]
|
|
menuitem "Create End of 2-way path" [ addpath2way2 ]
|
|
menuitem "Delete Start of 2-way path" [ delpath2way1 ]
|
|
menuitem "Delete End of 2-way path" [ delpath2way2 ]
|
|
menuitem "" -1
|
|
menuitem "Create Start of 1-way path" [ addpath1way1 ]
|
|
menuitem "Create End of 1-way path" [ addpath1way2 ]
|
|
menuitem "Delete Start of 1-way path" [ delpath1way1 ]
|
|
menuitem "Delete End of 1-way path" [ delpath1way2 ]
|
|
|
|
newmenu "Other bot operations"
|
|
|
|
menuitem "Set waypoint as jumpable" "setjumpwp"
|
|
menuitem "Unset waypoint as jumpable" "unsetjumpwp"
|
|
menuitem "Set waypoint direction (yaw)" "setwpyaw"
|
|
menuitem "" -1
|
|
menuitemslider "Waypoint visibility: " 0 1 " " 1 ["Hide waypoints" "Show waypoints"] "wpvisible $arg1"
|
|
menuitemslider "Select/place waypoints by: " 0 1 "($xhairwpsel)" 1 ["Your current location" "Clicking a point on the grid"] "xhairwpsel $arg1"
|
|
|
|
newmenu "Delete all waypoints"
|
|
menuinit [ delallwps = 0 ] // Ensures this menu works correctly.
|
|
menuitemcheckbox "Yes, delete all waypoints: " "alias delallwps 1" "alias delallwps $arg1"
|
|
menuitem "2 [ Apply! ]" [ if $delallwps [ wpclear ] [ showmenu "" ] ] |