ok i made this script for a 3 team CTF it works great, except for a slight hitch which i will be able to overcome but it means sacrificing part of the game, i will say more on this in a minute.
firstly here is the script...
westscore = 0
eastscore = 0
resiscore = 0
flagW setflagtexture "usa_vlajka.pac"
flagW setflagside west
flagE setflagtexture "rus_vlajka.pac"
flagE setflagside east
flagR setflagtexture "white.pac"
flagR setflagside resistance
westhaveeast = false
westhaveresi = false
easthavewest = false
easthaveresi = false
resihavewest = false
resihaveeast = false
ehw = false
rhw = false
whe = false
rhe = false
whr = false
ehr = false
westflagdeadcount = 0
eastflagdeadcount = 0
resiflagdeadcount = 0
timer = 0
#loop
~1
timer = timer + 1
westflagowner = flagowner flagW
eastflagowner = flagowner flagE
resiflagowner = flagowner flagR
?(alive westflagowner): westflagdeadcount = 0
?(alive eastflagowner): eastflagdeadcount = 0
?(alive resiflagowner): resiflagdeadcount = 0
?(side westflagowner == east) AND (!ehw) AND (alive westflagowner): goto "easthavewest"
?(side westflagowner == resi) AND (!rhw) AND (alive westflagowner): goto "resihavewest"
?(side eastflagowner == west) AND (!whe) AND (alive eastflagowner): goto "westhaveeast"
?(side eastflagowner == resi) AND (!rhe) AND (alive eastflagowner): goto "resihaveeast"
?(side resiflagowner == west) AND (!whr) AND (alive resiflagowner): goto "westhaveresi"
?(side resiflagowner == east) AND (!ehr) AND (alive resiflagowner): goto "easthaveresi"
?(side westflagowner == east) AND (westflagowner distance flagE < 5): goto "eastcapturewest"
?(side westflagowner == resi) AND (westflagowner distance flagR < 5): goto "resicapturewest"
?(side eastflagowner == west) AND (eastflagowner distance flagW < 5): goto "westcaptureeast"
?(side eastflagowner == resi) AND (eastflagowner distance flagR < 5): goto "resicaptureeast"
?(side resiflagowner == west) AND (resiflagowner distance flagW < 5): goto "westcaptureresi"
?(side resiflagowner == east) AND (resiflagowner distance flagE < 5): goto "eastcaptureresi"
?(side westflagowner == east) AND (westflagowner distance flagR < 5): flagW setflagowner flagW; flagW setflagside west; titleText [format["The West flag is back"], "PLAIN DOWN"]; easthavewest = false; resihavewest = false
?(side westflagowner == resi) AND (westflagowner distance flagE < 5): flagW setflagowner flagW; flagW setflagside west; titleText [format["The West flag is back"], "PLAIN DOWN"]; easthavewest = false; resihavewest = false
?(side eastflagowner == west) AND (eastflagowner distance flagR < 5): flagE setflagowner flagE; flagE setflagside east; titleText [format["The East flag is back"], "PLAIN DOWN"]; westhaveeast = false; resihaveeast = false
?(side eastflagowner == resi) AND (eastflagowner distance flagW < 5): flagE setflagowner flagE; flagE setflagside east; titleText [format["The East flag is back"], "PLAIN DOWN"]; westhaveeast = false; resihaveeast = false
?(side resiflagowner == west) AND (resiflagowner distance flagE < 5): flagR setflagowner flagR; flagR setflagside resistance; titleText [format["The Resistance flag is back"], "PLAIN DOWN"]; westhaveresi = false; easthaveresi = false
?(side resiflagowner == east) AND (resiflagowner distance flagW < 5): flagR setflagowner flagR; flagR setflagside resistance; titleText [format["The Resistance flag is back"], "PLAIN DOWN"]; westhaveresi = false; easthaveresi = false
?(!alive westflagowner AND easthavewest) OR (!alive westflagowner AND resihavewest) OR (!alive eastflagowner AND westhaveeast) OR (!alive eastflagowner AND resihaveeast) OR (!alive resiflagowner AND westhaveresi) OR (!alive resiflagowner AND easthaveresi): goto "ppldeadaroundhere"
goto "loop"
#easthavewest
titleText [format["%1 (East) takes the West flag", name westflagowner], "PLAIN DOWN"]
easthavewest = true
ehw = true
playsound "UCapture"
goto "loop"
#resihavewest
titleText [format["%1 (Resistance) takes the West flag", name westflagowner], "PLAIN DOWN"]
resihavewest = true
rhw = true
playsound "UCapture"
goto "loop"
#westhaveeast
titleText [format["%1 (West) takes the East flag", name eastflagowner], "PLAIN DOWN"]
westhaveeast = true
whe = true
playsound "UCapture"
goto "loop"
#resihaveeast
titleText [format["%1 (Resistance) takes the East flag", name eastflagowner], "PLAIN DOWN"]
resihaveeast = true
rhe = true
playsound "UCapture"
goto "loop"
#westhaveresi
titleText [format["%1 (West) takes the Resistance flag", name resiflagowner], "PLAIN DOWN"]
westhaveresi = true
whr = true
playsound "UCapture"
goto "loop"
#easthaveresi
titleText [format["%1 (East) takes the Resistance flag", name resiflagowner], "PLAIN DOWN"]
easthaveresi = true
ehr = true
playsound "UCapture"
goto "loop"
#eastcapturewest
eastscore = eastscore + 1
flagW setflagowner flagW; flagW setflagside west
titleText [format["%1 (East) captures the West flag\nWest - %2\nEast - %3\nResistance - %4", name westflagowner, westscore, eastscore, resiscore], "PLAIN DOWN"]
easthavewest = false
resihavewest = false
ehw = false
rhw = false
playsound "UScore"
goto "loop"
#resicapturewest
resiscore = resiscore + 1
flagW setflagowner flagW; flagW setflagside west
titleText [format["%1 (Resistance) captures the West flag\nWest - %2\nEast - %3\nResistance - %4", name westflagowner, westscore, eastscore, resiscore], "PLAIN DOWN"]
easthavewest = false
resihavewest = false
ehw = false
rhw = false
playsound "UScore"
goto "loop"
#westcaptureeast
westscore = westscore + 1
flagE setflagowner flagE; flagE setflagside east
titleText [format["%1 (West) captures the East flag\nWest - %2\nEast - %3\nResistance - %4", name eastflagowner, westscore, eastscore, resiscore], "PLAIN DOWN"]
westhaveeast = false
resihaveeast = false
whe = false
rhe = false
playsound "UScore"
goto "loop"
#resicaptureeast
resiscore = resiscore + 1
flagE setflagowner flagE; flagE setflagside east
titleText [format["%1 (Resistance) captures the East flag\nWest - %2\nEast - %3\nResistance - %4", name eastflagowner, westscore, eastscore, resiscore], "PLAIN DOWN"]
westhaveeast = false
resihaveeast = false
whe = false
rhe = false
playsound "UScore"
goto "loop"
#westcaptureresi
westscore = westscore + 1
flagR setflagowner flagR; flagR setflagside resistance
titleText [format["%1 (West) captures the Resistance flag\nWest - %2\nEast - %3\nResistance - %4", name resiflagowner, westscore, eastscore, resiscore], "PLAIN DOWN"]
westhaveresi = false
easthaveresi = false
whr = false
ehr = false
playsound "UScore"
goto "loop"
#eastcaptureresi
eastscore = eastscore + 1
flagR setflagowner flagR; flagR setflagside resistance
titleText [format["%1 (East) captures the Resistance flag\nWest - %2\nEast - %3\nResistance - %4", name resiflagowner, westscore, eastscore, resiscore], "PLAIN DOWN"]
westhaveresi = false
easthaveresi = false
whr = false
ehr = false
playsound "UScore"
goto "loop"
#ppldeadaroundhere
?(!alive westflagowner AND easthavewest) OR (!alive westflagowner AND resihavewest): westflagdeadcount = westflagdeadcount + 1; ehw = false; rhw = false;
?(!alive eastflagowner AND westhaveeast) OR (!alive eastflagowner AND resihaveeast): eastflagdeadcount = eastflagdeadcount + 1; whe = false; rhe = false
?(!alive resiflagowner AND westhaveresi) OR (!alive resiflagowner AND easthaveresi): resiflagdeadcount = resiflagdeadcount + 1; whr = false; ehr = false
?(westflagdeadcount >= 15): flagW setflagowner flagW; flagW setflagside west; titleText [format["The West flag is back"], "PLAIN DOWN"]; easthavewest = false; resihavewest = false
?(eastflagdeadcount >= 15): flagE setflagowner flagE; flagE setflagside east; titleText [format["The East flag is back"], "PLAIN DOWN"]; westhaveeast = false; resihaveeast = false
?(resiflagdeadcount >= 15): flagR setflagowner flagR; flagR setflagside resistance; titleText [format["The Resistance flag is back"], "PLAIN DOWN"]; westhaveresi = false; easthaveresi = false
goto "loop"
Like i said this script works fine except for one small detail which is...
when a unit takes the flag and then dies, you are able to pick up the flag and score aslong as you pick it up before 15 seconds, it will say both of the players names who have the flag when they take it, and you are able to score and the game will carry on fine but...
when a player takes the flag and then dies, then another player takes the flag and then dies, the script seems to grind to a virtual hault but it still goes round the #loop 'loop' but it wont go anywhere else lol, you can pick the flag up from the 2nd deceased but it wont say that you have and you are unable to score.
this is my problem because in a game this sequence of events is not unlikely, and if the game stops there it will be quite bad!
i have only tested this with west as the players side all 3 and taking the resistance flag, i had 2 AIs to 'give' the flag to and subsequently kill for the purposes of my cyber experiment! *lol i just wanted to talk like that then for some reason lol*
if you could find the time to look at this i would be more than greatful as there seems to be a severe lack of game modes for ofp that support more than 2 teams, all you need is to make a map with 3 flags flagW, flagE and flagR start the script by whatever means and test away lol.
thankyou very much in advance you lovely lot of people.
also when this script is finished we can store it on this site for all to see, then soon there will be lots of 3 team CTFs YES!!! (its my dream, make it yours) *lol i just wanted to say that then aswell lol, silly me*
Also one thing i forgot to say was to overcome this i thought it would be possible to cut out the time delay of returning the flag when a flag carrier dies if when they died we just returned it straight away and reset all the variables i think that would do it cos it would be alot simpler. But this is not what we want cos the time delay is part of the game so i think people would like to see it there.
Aww c**p 2 more things i forgot to say lol 1st its not playing the sounds this is a very simple one probably a simple mistake cos i guessed at how to make em lol (and yes they are defined in the description.ext and i have them in a folder called "Sound", 2nd i have not tested what happens when a player returns their own flag by going up to a deceaced body, its meant to say ..... flag was returned but this is not proven lol.
ok thats it (i hope) a bit big i know lol, sorry