git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6309 e016b1c5-ed68-44aa-a2f7-31cac88cffde
163 lines
5.8 KiB
INI
163 lines
5.8 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 [] -1
|
|
menuitem "Bot Survival" [ showmenu "Survival Mode" ]
|
|
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
|
|
|
|
survSetsList = "survNumBots survBotsToAdd timeBetChkPts survMaxBots"
|
|
survDifList = [ "10 1 60000 20" "12 1 45000 30" "14 2 30000 50" "16 5 10000 50" ]
|
|
|
|
newmenu "Survival Mode"
|
|
menuitemslider "Map: " 0 28 "$survMap" 1 [ "ac_aqueous" "ac_arabian" "ac_arctic" "ac_arid" "ac_complex" "ac_depot" "ac_desert" "ac_desert2" "ac_desert3" "ac_douze" "ac_edifice" "ac_elevation" "ac_gothic" "ac_iceroad" "ac_industrial" "ac_ingress" "ac_keller" "ac_mines" "ac_outpost" "ac_power" "ac_rattrap" "ac_scaffold" "ac_shine" "ac_snow" "ac_stellar" "ac_sunset" "ac_toxic" "ac_urban" "ac_werk" ] [ survMap = $arg1 ]
|
|
menuitemslider "Difficulty: " 0 3 "$survDifficulty" 1 [ "easy" "intermediate" "hard" "impossible" ] [ survDifficulty = $arg1; tmpSurvCtr = 0; loop sdl 4 [ (at $survSetsList $sdl) = (at (at $survDifList $survDifficulty) $tmpSurvCtr); += tmpSurvCtr 1 ] ]
|
|
menuitem [] -1
|
|
menuitem " Customize" [ showmenu "Survival Mode - Customize" ]
|
|
menuitem " Start!" [ survival (at $defaultmaps $survMap) ]
|
|
|
|
newmenu "Survival Mode - Customize"
|
|
menuitemslider "# of bots to spawn on start: " 6 20 "$survNumBots" 1 [] [ survNumBots = $arg1 ]
|
|
menuitemslider "# of bots to spawn at checkpoints: " 1 5 "$survBotsToAdd" 1 [] [ survBotsToAdd = $arg1 ]
|
|
menuitemslider "# of milliseconds between checkpoints: " 10000 120000 "$timeBetChkPts" 10000 [] [ timeBetChkPts = $arg1 ]
|
|
menuitemslider "Maximum # of bots in survival mode: " 10 50 "$survMaxBots" 2 [] [ survMaxBots = $arg1 ]
|
|
menuitem [] -1
|
|
menuitem " Back" [ closemenu "Survival Mode - Customize" ]
|
|
|
|
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 "" ] ] |