Official Soldat Forums
Server Talk => Scripting Releases => Topic started by: As de Espada on July 11, 2008, 08:22:17 pm
-
Script Name: TagMod 0.2
Script Description: This is a new gamestyle, where one player is the tagger, and the others have to flee from him.
Only the tagger have weapons, and the others do NO damage,but they can use their nades to push the tagger, and eachother. Only playable in DeathMatch and RamboMatch (more fun).
If the server is running in Rambo Match, the tagger will ALWAYS use the FlameBow. When you start you have ScoreLimit-1 points, and they will decrease if you are tagging. If your time reaches 0 then you lost, and the map will change (you don't gain points by killing).
This gamemod can't be played together with the Anti - Weapon Drop Bug script.
Original Author(s): As de Espada
Core Version: 2.6.3
Code: The start of it, without the consts... you can get the spirit
procedure Disarm(ID: byte);
begin
ForceWeapon(ID,NoWeapon,NoWeapon,1);
end;
procedure OnWeaponChange(ID, PrimaryNum, SecondaryNum: Byte);
begin
if (ID<>Tagger1) and (ID<>Tagger2) then begin
Disarm(ID);
end else
if (GameStyle=4) and (ID=Tagger1) then
forceweapon(ID,FLAMEBOW,FLAMEBOW,0);
end;
procedure SwitchTagger(Before,After: integer);
var MyByte:byte;
begin
if After=-1 then begin
if Tagger1<>-1 then begin
Disarm(Tagger1);
Tagger1:=-1;
end
if Tagger2<>-1 then begin
Disarm(Tagger2);
Tagger2:=-1;
end
end else
if NumPlayers>=TwoTaggers then begin
if before<>0 then begin
if Tagger1=before then begin
Disarm(Tagger1);
Tagger1:=after
end else begin
Disarm(Tagger2);
Tagger2:=after;
end;
if (GameStyle=4) and (Tagger1=before)then
forceweapon(after,FLAMEBOW,FLAMEBOW,0);
end else begin
//before=0 here
if Tagger2=-1 then
Tagger2:=After
else
if Tagger1=-1 then
Tagger1:=After
else begin
MyByte:=random(0,2);
disarm(iif(MyByte=0,Tagger1,Tagger2));
if MyByte=0 then
Tagger1:=after
else
Tagger2:=after;
end;
end;
end else begin
//numplayers<twotaggers here
if tagger1<>-1 then
disarm(tagger1);
tagger1:=after;
end;
end;
procedure Resettagtimes;
var i:integer;
begin
for i:=1 to Max_Players do begin
TagTime[i]:=ScoreLimit-1;
SetScore(i,ScoreLimit-1);
end;
end;
Commands wheeee
function OnCommand(ID: Byte; Text: string): boolean;
var MyByte:byte;
begin
if ID<>255 then
case GetPiece(Text,' ',0) of
'/help','/command','/commands':begin
WriteConsole(ID,'/arm '+'/'+'/Armageddon',cDspl);
WriteConsole(ID,'/randr '+'/'+'/Randrom Respawn',cDspl);
WriteConsole(ID,'/2tag # '+'/'+'/Number of players for 2 Taggers',cDspl);
WriteConsole(ID,'/tagban '+'/'+'/Leaving tagger will get ban?',cDspl);
function OnPlayerCommand(ID: Byte; Text: string): boolean;
var i:integer;
begin
case GetPiece(Text,' ',0) of
'/help','/command','/commands':begin
WriteConsole(ID,'When someone reaches tagtime 0, he/she looses the game,',cDspl);
WriteConsole(ID,'and the map changes. You tag people by killing them.',cDspl);
WriteConsole(ID,'Available commands:',cDspl);
WriteConsole(ID,'/weapon # '+'/'+'/Change to Weapon (only for the Tagger)',cDspl);
WriteConsole(ID,'/showw '+'/'+'/Show Weapons',cDspl);
Future work on this:
support for team mod
0.1.2 -> 0.2: added: 2 taggers on DM
if the tagger leaves the game, he/she get banned 5 min (that can be turned off by an admin)
modified: now the entering player only tags when the number of the taggers is supposed to grow
removed: admin's teleport command
0.1.1 -> 0.1.2: fixed: random tagger will only choose active players
the 64k score thing is absolutely NOT happening
0.1 -> 0.1.1: fixed: sometimes peopple got 0 score in the start of a map, then they go to 64k
looser is now loser xD
added: /help on joingame
-
Pretty nice for a first script, By the way "loser" only has one o [retard], and the scriptingcore is v 2.6.3, unless you're testing on an enesce server.
-
thanks... actualy, it was version 2.2 @_@
-
Well, it wasn't 2.2 - I don't even think that had scripting...
-
...
-
Ripper you're right... and we have always posted the SoldatServer version instead of script core version XD
-
[b ]Core Version:[ /b] (Version of the Dedicated Server you made this script with)
That's a little hard to understand, because we don't make a script WITH a dedicated server, we made it FOR one... and the name, core version, is pretty suggestive :)
It's the dedicated or the core version number?
-
2.6.3 is the current server version. 2.2 is the scriptingcore.
Server version 2.2 did not have scripting support :Q
Good to see you using object oriented coding on from the start (with all the functions and procedures)
-
updated!
-
sounds interesting, can i play it somewhere?
-
There's a guy that hosts the server, a brasilian one, but maybe you'll be kicked because of your ping.
Careca Cabeludo wrote:
pegapega.servegame.com
porta 23073
that's the server... but it's not always active :p
-
cant seem to even connect to that.. oh well. are u on irc? maybe we can play it sometime and perhaps ill add it to my server
-
I was uploading one extra file .BKP
tagmod is still 0.1.1, just the name is 0.1.2 to not mischanging files :p
-
oh well i played this with a few people on my local server
a few things that i dont get:
it shows "you have -88 seconds left" and it keeps decreasing (-88, -89, -90). the caplimit was 100
it needs friendlyfire to be enabled in CTF match
it would be nice if u can see how much seconds the tagger has left
new players that join shouldnt automaticly become the tagger
a lot of bullshit admin commands which are useless imo :P
-
in order
that shouldn't happen, when someone reaches 0 the map should change and all timers should reset
this mod doesn't suppor team matches yet
you can see the tag time of all palyers, by pressing f1, the tagger is the decreasing one :p
hummm... in my childhood, that's the way it worked. Do you have any suggestion?
hahaha I was just messing around with scripting, making some tests, and I didn't take them out :)
Date Posted: July 19, 2008, 12:24:58 pm
I pretend to uderstand better how the IDs change when someone leave/enters the game. I'll use the "active" thing too. That will fix various bugs.
-
hmm, in my experience the timer started at 0 and then started decreasing
i can enable FF and force everyone to the red team with some other scripts i have on multimode, so that isnt really a problem for me
i still think it would be nice that you see the taggers name and 'seconds left' in a drawtext
my suggestion is simple: dont change the tagger when someone joins :P in a 10 slot server youll have many joins and parts, and the newcomer might not understand a damn..
-
again, in order:
yeah... sometimes the timer starts at 0 and then "decreases" to 64k (UNDERFLOW).
only FF should do it, you don't get any points by killing anyone...
ok ok, I'll make that in next version
ok ok, I'll make an admin command for disable the tagger join thing. (whee finaly usefull admin commands =D)
Date Posted: July 19, 2008, 01:31:15 pm
known bug: if the maplist of the dedicated server is empty, the command "/nextmap" doesn't work at all, and the game will stop working
maybe I'll check the length of the maplist, and if it's zero then I'll do "/restart", instead of "/nextmap", but I have to test that (when I get home)
Date Posted: July 19, 2008, 01:39:27 pm
known bugs:
random tagger may choose a person that's not in the server anymore
/armageddon may enter in a loop
I'll fix those in the next days
-
Here's how to fix the random tagger may not be in the server, because I had the same problem with my script.
for i := 1 to 255 do begin
Ran := Random(1, MAXPLAYER{providing you have this variable to save loop time});
if GetPlayerStat(Ran, 'Active') then begin
tagger[Ran] := true; //or whatever variable it is that makes someone it for you.
break;
end;
end;
well...its the best I could find, just have everyone ingame before it chooses the random person.
-
ok, thanks, I really have to start using that active thing. But I'll try making something better than 1 to 255 ;)
-
It never really goes that high, the max I've ever seen that loop go is about 13 times with 3 people in the server.
-
now the script is checking if the player is active. I did it this way:
procedure RandomTagger(ID:byte);
var i,MyInt:integer;
begin
if ID=0 then begin
MyInt:=random(1,NumPlayers+1);
for i:=1 to MyInt do
if not(getplayerstat(i,'active')) then
inc(MyInt,1);
end else begin
//ID<>0
MyInt:=random(1,NumPlayers);
for i:=1 to MyInt do
if not(getplayerstat(i,'active')) or i=ID then
inc(MyInt,1);
end
SwitchTagger(MyInt);
WriteConsole(0,getplayerstat(myint,'name')+' was randomly choosed to be the new tagger',cTag);
DrawText(Tagger,'You''re tagging now!',330,cTag,0.15,40,240);
end;
The id is there to use random tagger when someone leaves the game. In that procedure, the leaving players is still active. 0 is when you can choose anyone
Date Posted: July 22, 2008, 11:18:26 pm
(...)
my suggestion is simple: dont change the tagger when someone joins :P in a 10 slot server youll have many joins and parts, and the newcomer might not understand a damn..
Now I remembered why I did it that way. Is to avoid people exiting the server and reentering so they will not be tagging anymore. I could do a buffer list of ips, but that's too much work for now :(
-
onleave game if ID = tagger /banip IP for 5 min
Date Posted: July 23, 2008, 05:32:25 pm
tell me if youre going to add that or not, so i can put it on my server.
-
I will
uhhh forgot to add the time of the tagger on the screen.... sorry
v0.2.1 will have that, and an admin funtion that's not working very well will be fixed
installed on my server
nuclearsoldat.no-ip.org:23073