Author Topic: variant of ctf  (Read 1010 times)

0 Members and 3 Guests are viewing this topic.

Offline Dr.Thrax

  • Major
  • *
  • Posts: 70
    • Lostgalaxy.de
variant of ctf
« on: January 25, 2010, 09:03:48 am »
Hi guys,
I got an idea of an variant of the all loved mod ctf:
- you play Charlie instead of Alpha and Delta instead of Bravo
- Alpha spawns get Charlie spawns and Bravo spawns are Delta spawns
- joining Alpha team gets you in Charlie team and joining Bravo gets you in Delta team

So its more or less the same as CTF only with yellow and green teams for those who got sick of the red and blue colors, but there is one thing changed, the caping system:
- you gain a point for your team when you hold both flags at the same time anywhere on the map
-> if you got a point the flags will automatically return to their original spawns and it will go on like in CTF

that means that if you hold you teams flag your mates can go for the enemies flag and bring it to you so that you can cap ( as long as they throw it to you ;< )

I've already made the whole script because it didnt take so much time and effort:
Code: [Select]
{$VERSION 2.6.5}

var
flagger_red, flagger_blue : integer;

procedure ActivateServer();
var i : integer;
begin
Flagger_red := 0;
Flagger_blue := 0;
end;

procedure AppOnIdle(Ticks: integer);
begin
if GetPlayerStat(Flagger_red,'Flagger') = false then flagger_red := 0;
if GetPlayerStat(Flagger_blue,'Flagger') = false then flagger_blue := 0;
end;

procedure OnJoinTeam(ID, Team: byte);
begin
if ID = Flagger_red then Flagger_red := 0 else
if ID = Flagger_blue then Flagger_blue := 0;
if Team = 1 then Command('/setteam3 '+inttostr(ID))
else if Team = 2 then Command('/setteam4 '+inttostr(ID));
end;

procedure OnLeaveGame(ID, Team: byte; Kicked: boolean);
begin
if ID = Flagger_red then Flagger_red := 0 else
if ID = Flagger_blue then Flagger_blue := 0;
end;

procedure ShowCapture(ID,TeamFlag : byte);
begin
WriteConsole(0,idtoname(ID)+' captured the '+iif(GetPlayerStat(ID,'Team') = 3,'Red','Blue')+' Flag',iif(GetPlayerStat(ID,'Team') = 3,RGB(255,255,0),RGB(0,244,0)));
DrawText(0,iif(GetPlayerStat(ID,'Team') = 3,'Charlie','Delta')+' captured the '+iif(TeamFlag = 1,'Red','Blue')+' Flag',330,iif(GetPlayerStat(ID,'Team') = 3,RGB(255,255,0),RGB(0,244,0)),0.12,20,400);
end;

procedure OnFlagGrab(ID, TeamFlag: byte; GrabbedInBase: boolean);
begin
if TeamFlag = 1 then
begin
         Flagger_red := Id;
ShowCapture(ID,TeamFlag);
         end;
if TeamFlag = 2 then
begin
         Flagger_blue := Id;
ShowCapture(ID,TeamFlag);
         end;
if (Flagger_red = Flagger_blue) and (Flagger_red > 0) then
begin
         KillObject(1);
         KillObject(2);
         If GetPlayerStat(Flagger_Red,'team') = 3 then
          begin
                 WriteConsole(0,'Alpha [Charlie] Team scores',RGB(255,0,0));
                 DrawText(0,'Alpha [Charlie] Team scores',330,RGB(255,0,0),0.12,20,400);
                 SetTeamScore(1,AlphaScore+1);
                 Flagger_red := 0;
                 Flagger_blue := 0;
                 end;
         If GetPlayerStat(Flagger_Red,'team') = 4 then
          begin
                 WriteConsole(0,'Bravo [Delta] Team scores',RGB(0,0,255));
                 DrawText(0,'Bravo [Delta] Team scores',330,RGB(0,0,255),0.12,20,400);
                 SetTeamScore(2,Bravoscore+1);
                 Flagger_red := 0;
                 Flagger_blue := 0;
                 end;
         end;
end;

procedure OnFlagDrop(ID, TeamFlag: byte);
begin
if TeamFlag = 1 then Flagger_red := 0;
If TeamFlag = 2 then Flagger_blue := 0;
end;

procedure OnMapChange(NewMap: string);
var i : integer;
begin
Flagger_red := 0;
Flagger_blue := 0;

for i := 1 to 254 do
begin
         if (GetSpawnStat(i,'active') = true) and (GetSpawnStat(i,'style') = 3) then SetSpawnStat(i,'active',false);
         if (GetSpawnStat(i,'active') = true) and (GetSpawnStat(i,'style') = 4) then SetSpawnStat(i,'active',false);
         if (GetSpawnStat(i,'active') = true) and (GetSpawnStat(i,'style') = 1) then SetSpawnStat(i,'style',3);
         if (GetSpawnStat(i,'active') = true) and (GetSpawnStat(i,'style') = 2) then SetSpawnStat(i,'style',4);
         end;

end;

procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
begin
if Victim = Flagger_red then Flagger_red := 0 else
if Victim = Flagger_blue then Flagger_blue := 0;
end;

It was just an idea and can be improved if necessary or declared bullshit :)
Dr.Thrax



Offline Neosano

  • Camper
  • ***
  • Posts: 253
  • IIAWAK!
Re: variant of ctf
« Reply #1 on: January 26, 2010, 09:45:07 am »
So it's similar to hold the flag? Or am I missing something?
KAWAAAAAAAIIIIIIIIII

Offline Furai

  • Administrator
  • Veteran
  • *****
  • Posts: 1908
    • TransHuman Design
Re: variant of ctf
« Reply #2 on: January 26, 2010, 06:11:28 pm »
To cap you have to hold both flags at the same time...so it's a bit different, you won't get points for holding flag.
"My senses are so powerful that I can hear the blood pumping through your veins."

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: variant of ctf
« Reply #3 on: January 27, 2010, 08:22:37 am »
If I recall correctly, there is a 'bug' where you return a flag or something not expected (forget exactly what) if your holding the alpha flag, trying to pick up the bravo flag when the bravo flag is near it's spawn (but when not, it works fine; maybe multiple spawns may fix) (for charlie / delta / probably dm as well teams when on ctf)

« Last Edit: January 27, 2010, 12:19:21 pm by DorkeyDear »

Offline Furai

  • Administrator
  • Veteran
  • *****
  • Posts: 1908
    • TransHuman Design
Re: variant of ctf
« Reply #4 on: January 27, 2010, 10:54:25 am »
If I recall correctly, there is a 'bug' where you return a flag or something not expected (forget exactly what) if your holding the alpha flag, trying to pick up the bravo flag when the bravo flag is near it's spawn (but when not, it works fine; maybe multiple spawns may fix) (for charlie / delta / probably dm as well teams when no ctf)


Yeah, when your on non-ctf-team and you've got flag of one team you cannot pick-up second one from it's spawn cause you will do something similar to cap but with no points for you...
"My senses are so powerful that I can hear the blood pumping through your veins."

Offline Dr.Thrax

  • Major
  • *
  • Posts: 70
    • Lostgalaxy.de
Re: variant of ctf
« Reply #5 on: January 27, 2010, 01:00:07 pm »
Did I get it right then ?
Is it a scripting bug or did you just understand sth. in a wrong way ?
When you hold both flags you'll get a point for your team but nothing is counted in your scores

Offline Furai

  • Administrator
  • Veteran
  • *****
  • Posts: 1908
    • TransHuman Design
Re: variant of ctf
« Reply #6 on: January 27, 2010, 02:01:24 pm »
Nonononon. Try it yourself...join charlie/delta team in ctf and try to pick 2nd flag when it's on its spawnpoint - you'll see what we meant.
"My senses are so powerful that I can hear the blood pumping through your veins."