From 8918e802f6850ad7de1d95bc358e127fe1547d5e Mon Sep 17 00:00:00 2001 From: Bukz Date: Sat, 16 Feb 2013 22:43:49 +0000 Subject: [PATCH] fixes for startbotmap and friends git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7218 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- changelog.txt | 38 ++++++++++++++++++++++---------------- config/menus_bot.cfg | 27 ++++++++++++++++++++------- 2 files changed, 42 insertions(+), 23 deletions(-) diff --git a/changelog.txt b/changelog.txt index 79a85733..caa9f47b 100644 --- a/changelog.txt +++ b/changelog.txt @@ -127,6 +127,25 @@ Bots CubeScript --------------------- +[*] persistidents bug fix, aliases write to saved.cfg much more reliably now. +[*] modmdl*N aliases, load custom weapon/pickup/gib models from in-game, on-the-fly via cubescript. +[*] loadcrosshair bug fix, you can load custom crosshairs for each weapon again. +[*] getalias can now work on built-in client variables (CVARs). - (e.g. fov) +[*] forceteam now can target specific team +[*] "Sleeps" can be persistent. (e.g. "Persist" even through map loads - new optional 3rd argument of the /sleep command) +[*] Substr crash bug is fixed. Also the command can now use a negative position value. +[*] New stat in (pstat_score) for teamkills. New list is: FLAGS FRAGS DEATHS POINTS TEAM TEAMKILLS NAME +[*] on_quit.cfg for deleting aliases from saved.cfg upon quit. +[*] Missing bracket ([], (), etc.) errors now also notify the client of what file the error resides in. +[*] New automatically executed scripts folder in the root install directory of AC. +[*] New delta_edit/game_# aliases for easily tweaking gamma/fov/flyspeed on-the-fly. (e.g. Hold F5 and scroll for gamma, F6 for fov, bind "domodifier 10" to a key for flyspeed) +[*] The /mapsize command now silenty returns 6-12, instead of conoutf'ing ssize. +[*] The /spectate command can now only be used if connected to a server. +[*] The /togglebotview command can no longer be used in arena modes. +[*] /keybind bug fix. No more client crash if the argument is an unknown key. +[*] Moved some old/redundant commands to /config/compatibility.cfg. +[*] Hardcoded key bind/editbind/specbind +[*] const - Creates or sets an alias as a constant [*] div= and div=f - Divides an alias by a value. [*] addpunct - Injects CubeScript punctuation. (e.g. echo (addpunct hello) // Output: "hello") [*] break - Jumps out of a loop created with the "loop" or "while" command. @@ -216,22 +235,9 @@ CubeScript [*] isclient - Determines if the client number given is a valid client (player). [*] winners - Returns the list of winning teams or players [*] drawzone - Draw a rectangular zone on the minimap -[*] const - Sets an alias as a constant -[*] getalias can now work on built-in client variables (CVARs). - (e.g. fov) -[*] forceteam now can target specific team -[*] "Sleeps" can be persistent. (e.g. "Persist" even through map loads - new optional 3rd argument of the /sleep command) -[*] Substr crash bug is fixed. Also the command can now use a negative position value. -[*] New stat in (pstat_score) for teamkills. New list is: FLAGS FRAGS DEATHS POINTS TEAM TEAMKILLS NAME -[*] on_quit.cfg for deleting aliases from saved.cfg upon quit. -[*] Missing bracket ([], (), etc.) errors now also notify the client of what file the error resides in. -[*] New automatically executed scripts folder in the root install directory of AC. -[*] New delta_edit/game_# aliases for easily tweaking gamma/fov/flyspeed on-the-fly. (e.g. Hold F5 and scroll for gamma, F6 for fov, bind "domodifier 10" to a key for flyspeed) -[*] The /mapsize command now silenty returns 6-12, instead of conoutf'ing ssize. -[*] The /spectate command can now only be used if connected to a server. -[*] The /togglebotview command can no longer be used in arena modes. -[*] /keybind bug fix. No more client crash if the argument is an unknown key. -[*] Moved some old/redundant commands to /config/compatibility.cfg. -[*] Hardcoded key bind/editbind/specbind +[*] swapelements - Returns a modified list swapping the positions of 2 elements. +[*] sortlist - Returns an alphabetically sorted list. +[*] Too many others to list... I18n / L10n --------------------- diff --git a/config/menus_bot.cfg b/config/menus_bot.cfg index 5fbe1abf..f929a850 100644 --- a/config/menus_bot.cfg +++ b/config/menus_bot.cfg @@ -18,11 +18,22 @@ tmp_numbots = 1 tmp_mode = tmp_botmap = +const isbotteammode [ + tmpmode = $arg1 + if (|| (|| (|| (|| (= $tmpmode (modenum btdm)) (= $tmpmode (modenum bdm))) (|| (= $tmpmode (modenum bosok)) (= $tmpmode (modenum btosok)))) (|| (= $tmpmode (modenum blss)) (= $tmpmode (modenum bpf)))) (= $tmpmode (modenum bts))) [ + return 1 + ] [ return 0 ] +] + // add bots -startbotmatch = [ - if (|| (= $tmp_mode 7) (|| (= $tmp_mode 20) (= $tmp_mode 21))) [ // team botmode - numrvsf = (- (div $tmp_numbots 2) (curteam)) - numcla = (- (div $tmp_numbots 2) (= (curteam) 0)) +const startbotmatch [ + if (isbotteammode $tmp_mode) [ // team botmode + numrvsf = (div $tmp_numbots 2) + numcla = (div $tmp_numbots 2) + if (= (curteam) 0) [ -- numcla ] [ + if (= (curteam) 1) [ -- numrvsf ] + ] + if (&& (= $numrvsf $numcla) $needsswitch) [ -- numrvsf ] addnbot $numrvsf RVSF $tmp_botskill addnbot $numcla CLA $tmp_botskill ] [ // DM @@ -30,8 +41,10 @@ startbotmatch = [ ] ] -preparebotmatch = [ +const preparebotmatch [ echo starting botmatch.. + needsswitch = 0 + if (&& (!= (curteam) 0) (!= (curteam) 1)) [ needsswitch = 1; team RVSF ] // register event that is fired during mapload addOnLoadOnce [ kickallbots @@ -42,7 +55,7 @@ preparebotmatch = [ map $tmp_botmap ] -afterdisconnect = [ +const afterdisconnect [ if $connected [ addOnLoadOnce $arg1 disconnect @@ -57,7 +70,7 @@ afterdisconnect = [ // register events and change map startbotmap = [ afterdisconnect preparebotmatch ] -emptymap = [ +const emptymap [ afterdisconnect [ mode 0 showmenu maps