I had this for a while, shared with few players, it could be better.
And maybe added to 1105 aswell :D
Its a singleplayer mode where you have to kill the "zombots" and survive the waves (i wish i could mod or skin some zombies :'( ).
I could improve it depending on the feed back, like adding the best number of waves record save, better randomization of the bots to add at each wave...
Try it out, have fun.
And maybe added to 1105 aswell :D
Its a singleplayer mode where you have to kill the "zombots" and survive the waves (i wish i could mod or skin some zombies :'( ).
I could improve it depending on the feed back, like adding the best number of waves record save, better randomization of the bots to add at each wave...
Try it out, have fun.
[SELECT ALL] Code:
//ZomBot BY =SA=macm
//to start type: /zombot map
alias botskill_list ["best" "good" "medium" "worse" "bad"]
alias zombot [
if (strcmp $arg1 "0") [zombot_ = 0] [map_ = $arg1; zombot_ = 1; zombot_1]
]
//mmsg = (result (at $msglist (rnd (listlen $msglist))))
alias zombot_1 [
oldgamma = $gamma; oldfog = $fog; oldfogcolour = $fogcolour
mode 7; map $map_
waves = 1; btm3 = 0
mmsg = [msglist (rnd 10)]
mmsg1 = [msglist1 (rnd 3)]
echo "2ZOMBOT IS STARTING..."
sleep 1000 [
botn_ = 1
botn = [+ (rnd $botn_) (+ (rnd 2) 1)]
botteam = (if (= (curteam) 0) (result "RVSF") (result "CLA"))
botskill_ = [at $botskill_list (rnd 5)]
loop a (botn) [addbot $botteam (botskill_)]
sleep 1000 [echo "11st wave is starting..."; mmsg; loadsky textures/skymaps/kothic/atsea; fog 64; fogcolour FFFFFF; gamma 100; gammav; sleep 2000 [zombot_2; sleep 2000 [botsheadtome]]]
]
]
alias zombot_2 [
if (= $zombot_ 0) [kickallbots; echo "3##### GAME OVER #####"; echo (concat "0you survived" (- $waves 1) "waves"); fog $oldfog; fogcolour $oldfogcolour; gamma $oldgamma ] [
botalive = 0
if (!= (strcmp (at $conline 0) "2you") 1) [] [if (= (strstr $conline "were") 1) [] [
if (= (listlen $conline) 3) [kickbot (at $conline 2)] [
if (= (listlen $conline) 4) [kickbot (concat (at $conline 2) (at $conline 3))] [
if (= (listlen $conline) 5) [kickbot (concat (at $conline 2) (at $conline 3) (at $conline 4))] [zombot_ = 0; echo "ERROR #3"]]]]];
if (= (alive) 1) [] [zombot_ = 0]
if (= btm3 1) [] [loop a 100 [if (= (strcmp (findpn $a) "") 1) [] [if (= $a (findcn $curname)) [] [botalive = 1]]];
if (= $botalive 0) [echo "0you survived wave number" (+ $waves 1)); mmsg1; zombot_3] []]
sleep 1 [zombot_2]
]]
alias zombot_3 [btm3 = 1;
waves = (+ $waves 1)
botn_ = (result (+ $botn_ 2))
loop a (botn) [addbot $botteam (botskill_)]
sleep 1000 [echo (concat "0wave number" $waves "is starting..."); mmsg; sleep 4000 [botsheadtome]]
sleep 4000 [btm3 = 0]
]
alias gammav [
if (= $zombot_ 0) [] [
if (= $gamma 100) [gmd = 1] []
if (= $gamma 50) [gmd = 0] []
if (= $gmd 1) [gamma (- $gamma 10)] [gamma (+ $gamma 10)]
sleep 250 [gammav]
]]
msglist = [
arg_ = $arg1
switch arg_
case 0 echo "3Will you survive this one?" break;
case 1 echo "3Do you have what it takes?" break;
case 2 echo "3KILL THOSE DAMN BOTS!" break;
case 3 echo "3You can do this!" break;
case 4 echo "3LET'S GET'EM!" break;
case 5 echo "3Do you have the guts?" break;
case 6 echo "3Can you handle the pressure?" break;
case 7 echo "3KILL'EM ALL!" break;
case 8 echo "3GO GO GO!" break;
case 9 echo "3Piece of cake..." break;
]
msglist1 = [
arg_ = $arg1
switch arg_
case 0 echo "1Good job!" break;
case 1 echo "1Well done!" break;
case 2 echo "1AWESOME!" break
]
docident [zombot] [starts a bot game];
docargument [M] [the map name (if 0 stops the game)];
docexample [zombot ac_desert];
//Bad switch script by =SA=macm
alias switch [ switch1 = $arg1; st = 0; def = 0]
alias case [
cnumargs = $numargs;
switch2 = [];
if (= (strcmp (getalias (concatword "arg" $cnumargs)) "break") 1) [
loop f (- $cnumargs 1) [if (= $f 0) [] [f = (+ $f 1); add2alias_ switch2 (getalias (concatword "arg" $f))]]
][
loop f $cnumargs [if (= $f 0) [] [f = (+ $f 1); add2alias_ switch2 (getalias (concatword "arg" $f))]]
];
if (= (strcmp (getalias (concatword "arg" $cnumargs)) "break") 1) [
if (= (getalias (getalias switch1)) $arg1) [
switch2; def = 1] []
] [
if (= $st 0) [
if (= (getalias (getalias switch1)) $arg1) [
switch2; st = 1; def = 1
] []
] [switch2; def = 1]
]
]
alias case_cmp [
cnumargs = $numargs;
switch2 = [];
if (= (strcmp (getalias (concatword "arg" $cnumargs)) "break") 1) [
loop f (- $cnumargs 1) [if (= $f 0) [] [f = (+ $f 1); add2alias_ switch2 (getalias (concatword "arg" $f))]]
][
loop f $cnumargs [if (= $f 0) [] [f = (+ $f 1); add2alias_ switch2 (getalias (concatword "arg" $f))]]
];
if (= (strcmp (getalias (concatword "arg" $cnumargs)) "break") 1) [
if (= (strcmp (getalias (getalias switch1)) $arg1) 1) [
switch2; def = 1] []
] [
if (= $st 0) [if (= (strcmp (getalias (getalias switch1)) $arg1) 1) [
switch2; st = 1; def = 1] []
] [switch2; def = 1]]
]
alias case_str [
cnumargs = $numargs;
switch2 = [];
if (= (strcmp (getalias (concatword "arg" $cnumargs)) "break") 1) [
loop f (- $cnumargs 1) [if (= $f 0) [] [f = (+ $f 1); add2alias_ switch2 (getalias (concatword "arg" $f))]]
][
loop f $cnumargs [if (= $f 0) [] [f = (+ $f 1); add2alias_ switch2 (getalias (concatword "arg" $f))]]
];
if (= (strcmp (getalias (concatword "arg" $cnumargs)) "break") 1) [
if (= (strstr (getalias (getalias switch1)) $arg1) 1) [
switch2; def = 1] []
] [
if (= $st 0) [if (= (strstr (getalias (getalias switch1)) $arg1) 1) [
switch2; st = 1; def = 1] []
] [switch2; def = 1]]
]
alias default [
if (= $def 0) [
cnumargs = $numargs;
switch2 = [];
loop f $cnumargs [f = (+ $f 1); add2alias_ switch2 (getalias (concatword "arg" $f))];
switch2
] [
]
]
//wstr by DES|V-man
// wstr -- finds a given string among muddled messes of CubeScript punctuation.
// Parentheses were not possible. :(
// This is a very laborious, resource-intensive process. AssaultCube will hang for a moment each time this is used.
alias wprefixes (concat "[" "[[" "[[[" "[[[[")
alias wsuffixes (concat "]" "]]" "]]]" "]]]]" ";")
alias wordcheckloop [loop w (listlen $searchlist) [loop p 4 [loop s 5 [
if (strcmp $itemtofind (at $searchlist $w)) [alias wmatch 1] [
if (strcmp (concatword (at $wprefixes $p) $itemtofind (at $wsuffixes $s)) (at $searchlist $w)) [alias wmatch 1] [
if (strcmp (concatword (at $wprefixes $p) $itemtofind) (at $searchlist $w)) [alias wmatch 1] [
if (strcmp (concatword $itemtofind (at $wsuffixes $s)) (at $searchlist $w)) [alias wmatch 1] []]]]]]]]
// A Beast of a string-comparison tool
alias wstr [
alias itemtofind $arg2
alias searchlist $arg1
alias wmatch 0
wordcheckloop
result $wmatch]