0 Members and 1 Guest are viewing this topic.
//SuperVillians Script v0.3 //concocted and shoddily put together by Londonbrig0 var VTeam: array[1..12] of string; //VTeam is supposed to stand for "villian team" Leader: array[1..12] of boolean; //and 12 is current max number of players i: integer; //used for id of players Winner: boolean; //variable used to end game when everyone is on the same team //When someone joins, set their team to their own name, and make them a leaderprocedure OnJoinGame(ID, Team: byte); begin VTeam[ID] := +IDToName(ID); if VTeam[ID] = +IDToName(ID) then Leader[ID] := true; end;//this is so I can check teams when I'm testing//I'll probably leave this in to let players check the teams ingame if they want.function OnCommand(ID: Byte; Text: string): boolean; begin if (Text = '/teams') then for i := 1 to 12 do begin WriteConsole(ID, +IDToName(i) +' is on team ' +VTeam[i], $EE81FAA1) end; end;//what happens when someone is killedprocedure OnPlayerKill(Killer, Victim: byte;Weapon: byte); begin if VTeam[Victim] = VTeam[Killer] then //if it was somehow a team kill SetScore(Killer,GetPlayerStat(Killer, 'Kills') - 1) //take away the point the killer got else begin VTeam[Victim] := VTeam[Killer]; //they are now fighting on the team of their killer SetScore(NameToID(VTeam[Killer]),GetPlayerStat(NameToID(VTeam[Killer]), 'Kills') + 1); //the leader of the killer's team get's a bonus point if Leader[Victim] = true then //if the victim was a leader begin Leader[Victim] := false; //the victim is now no longer a leader for i := 1 to 12 do begin if VTeam[i] = +IDToName(Victim) then //everyone who was fighting for the victim begin VTeam[i] := +IDToName(i); //are now free Leader[i] := true //and leaders again end; end; end; end;//There are probably issues with semicolons between line 26 and here Winner := true; //temporarily set end game variable for i := 1 to 12 do begin if VTeam[i] != +IDToName(Killer) then //is there anyone not on the killer's team? Winner := false; //if so, no one has won yet end; if Winner = true then //if there is a winner begin DrawText(0,2,'Team' + VTeam[Killer] + 'wins!',330,RGB(255,0,0),0.20,40,240); TimeLeft := 0; //end the game (will this work?) end; end;
Soldat has only 4 teams(and spectator). It's possible but will suck ass.
begin if player[shooter].team = player[victim].team then result := 0; // Or something like thisend;
Why don't you just use the teams to show which team they are on (wow, ingenious)
I already covered everything in the very first reply...
Quote from: chutem on December 15, 2009, 01:10:50 amWhy don't you just use the teams to show which team they are on (wow, ingenious)Yeah, I could do that, but like I said, up to 12 people need the ability to be on their own team at the start of the game
Quote from: Londonbrig0 on December 15, 2009, 11:36:10 amQuote from: chutem on December 15, 2009, 01:10:50 amWhy don't you just use the teams to show which team they are on (wow, ingenious)Yeah, I could do that, but like I said, up to 12 people need the ability to be on their own team at the start of the gameAnd saving players teams and resetting them at the end of a round OR splitting teams up randomly doesn't solve this problem?Or am I not understanding you...
it would have to be a free-for-all
You could put the leader of alpha team on charlie, and bravo's leader on delta, then script it so the team can't kill their leader and away we go.Now we have:A way of seeing who is on what team, and who the leader of each team is.And a way of having up to 32 people to be in two teams: alpha-charlie, bravo-deltadoes that satisfy you?Quote from: Londonbrig0 on December 16, 2009, 10:32:50 amit would have to be a free-for-allWhy?
http://www.enesce.com/help/index.html?Functions/WorldImage.htmlorhttp://www.enesce.com/help/html/Functions/WorldText.htmlDisplay a text above heads. Use different colors. Be happy :]
How are you going to negate m79 shot btw?
Yea, it will be possible to kill your teammates even if you set damage to 0. That's how these f**king m79 bullets work.
Quote from: Neosano on December 17, 2009, 09:16:47 amYea, it will be possible to kill your teammates even if you set damage to 0. That's how these f**king m79 bullets work.Oh, I didn't know that. Do grenades and the Law do the same thing, or is just the m79? It wouldn't really be a problem, if someone gets killed by their teammate they would just respawn on the same team. I would just have to make sure that in the script a teamkill resulting in the death of the leader doesn't screw everything up.
Quote from: Neosano on December 17, 2009, 09:16:47 amYea, it will be possible to kill your teammates even if you set damage to 0. That's how these f**king m79 bullets work.Bulls**t.
Just a question about the game mode itself...If victory can only be achieved by being the leader of the winning team...why would anyone actually play. I mean, if you get killed by someone, you join their team. Now, unless either your team leader dies you can't win. So every player who "joins" another team will just try to get their leader killed.So pretty much the only way to win is if you kill everyone really quickly, while everyone on your "team" is trying to f**k you up.That seems...I dunno...counter-intuitive?
If the leader got killed - all his team is moving to another team or only the leader?First one will solve this.
was it DM btw?
Quote from: miketh2005 on July 10, 2009, 07:31:20 pmDonate to enesceHAHAHAHAHAHAHA
Donate to enesce
[...]Any advice is much appreciated, thank you.[...]
Go "if Winner Then", instead of "if Winner = True". Same thing for "Leader[Victim] = True". Go "if Leader[Victim] Then"..
About the Script, I don't understand quite what you're asking.
[...]1. Basically, I'm not sure when I shouldn't have semicolons in the middle of if then else statements.2. I want to know how to combine some text and a string variable into one string, for example the variable VTeam[Killer] and the text 'wins!'3. Can I end the game by setting TimeLeft to 0?
[...] if VTeam[Killer] = 'Blablabla' Then WriteConsole(Killer,'Wins!',$FFFFFF);
const White = $FFFFFF;Procedure OnPlayerSpeak(ID:Byte; Text:String);var Disable:Boolean; begin WriteConsole(ID,'Text1' + ' Text2', White); // Will display the text "Text1 Text2" WriteConsole(ID,IDToName(ID) + '''s name is cool!', White); // Displays "<XXX>'s name is cool!" ('' = ' in text') if LowerCase(Text) = '!disable' then begin Disable := not Disable; WriteConsole(ID,'Script got ' + iif(Disable=true,'enabled','disabled') + '.', White); end; end;
Just go for[...]
Code: (pascal) [Select] WriteConsole(ID,IDToName(ID) +'''s name is cool!', White);
WriteConsole(ID,IDToName(ID) +'''s name is cool!', White);
Wow, just noticed what I did. Thanks DC.Although, I'm still curious.Why do you have '''s name ...', instead of 's name ...' ?:O
WriteConsole(ID,'Script got ' + iif(Disable,'dis','en') + 'abled.', White);
1 - You just don't use ";" after:If,Else,Begin,Then,Try,Except,Const,Type,Var.You DO use ";" after ")", and everything else.
3 - To end the game, just go "Command('/nextmap');
Just go for[...]Last text will display "Script got enabled." if Disable is true and "Script got disabled." when it's false.
-A way to tell who is on your team (have your clothes change to look the same as your leader? have people on your team emit flames?)
You can create an interface that shows you the people on your team. I attached something you can work with.
for I := 1 to 32 do [...]
for I := 1 to 32 do // Start the loop if GetPlayerStat(I,'Active') = true then // Check ID AllDraw(I)
Type XXX = Record Team: Byte;end; var Player: Array[1..32] of XXX;
<ArrayName>[<ID>].<Variable> // Note the dot!