Official Soldat Forums

Server Talk => Scripting Releases => Topic started by: rhide on January 13, 2008, 04:42:20 pm

Title: Soldat 1v1 Tournament
Post by: rhide on January 13, 2008, 04:42:20 pm
Script Name:
Soldat 1v1 Tournament

Original Author: rhide
Core Version: 2.6.3

Script Description:
This script is strongly inspired by the Quake III Arena mode Tournament, where 2 players play 1v1 and the others wait as spectators. The winner stays and fight, but the looser is placed last in que (you might think of it as king of the hill).

Finally, after intense learning pascal and soldat scripting, I managed to produce something I like. The script contains various features listed below:


Code: [Select]
function OnPlayerDamage(Victim, Shooter: Byte; Damage: Integer) : integer;
Begin
   if sudden_death_active = true then
      Result := 1000 { Increase damage }
   else
      Result:=Damage; { Normal damage }
End;

Toggle sudden death with the admin command /suddendeath.
[/list]
 
Code: [Select]
procedure Chat(ID : Byte; Text : string);
var
   i    : integer;
   Message : string;
Begin
   { Cut off / from text (first letter) }
   Message := '';
   if length(Text) >= 2 then
      for i:=2 to length(Text) do
Message := Message + Text[i];
   
   { Spectator chat should not be visible to fighters }
   { Fighters chat should be visible to everyone }
   if (ID = que[1]) or (ID = que[2]) then
      writeConsole(0, '[' + IdToName(ID) + '] ' + Message, colorWHITE)
   else
      if NumPlayers >= 3 then
for i:=3 to NumPlayers do
    writeConsole(que[i], '[' + IdToName(ID) + '] ' + Message, colorWHITE);
End;


Server setup for best performance:
Game type: DeathMatch
BotChat: OFF
Match time: ~6 minutes
Sudden death time: ~5 minutes
Kill limit: ~10 kills
Maps: Good 1v1 maps, e.g. Bridge, Blocks, Lagrange etc


Version:
1.0 alpha release candidate 3
1.0 alpha release candidate 4 (Removed due to unresolved bug)

Title: Re: Soldat 1v1 Tournament
Post by: DorkeyDear on January 13, 2008, 06:15:31 pm
Awesome!
If somebody is going to host a server with this, I wanna check it out so post the ip/port please :)
Title: Re: Soldat 1v1 Tournament
Post by: chillis34 on January 14, 2008, 12:21:04 am
Hey Dorks i think ill host it :) btw will this work well with realistic mod?
Edit: why is it saying cant load C:\Documents and Settings\Owner\Desktop\1v1\maps\A.P MS/ ? it isnt letting me use the normal maplist im confused is it a bug?\
I cant use this script untill this is fixed sorry looks like a nice script looking forward to using it when it doesnt do that.

/nextmap (127.0.0.1)
Next map: ÿþA
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Error: Could not load map (ÿþA)
Title: Re: Soldat 1v1 Tournament
Post by: DorkeyDear on January 14, 2008, 06:36:15 am
Tip: "includes.txt" should have capped "i" so "Includes.txt" (case-sensitive os' may have it so it doesn't work properly)

Lol, I tried to run the script as a CTF and it told me that its supost2 be a DM and then crashed :P

Does the timer still go when the game is paused?

When an admin does a command (like /pause), it acts as if its a message and also preforms the cmd

I never got a chance to test with people, although seems pretty cool so far.

Quote
/kick 3
Billy has been kicked.
  • New Folder (2): FATAL! Billy is not in the waiting que!
  • New Folder (2): FATAL! Billy is not in the waiting que!
  • New Folder (2): FATAL! Billy is not in the waiting que!
  • [Error] New Folder (2) -> (OnLeaveGame): Out Of Range

/kick 4
Kruger has been kicked.
  • New Folder (2): FATAL! Kruger is not in the waiting que!
  • New Folder (2): FATAL! Kruger is not in the waiting que!
  • New Folder (2): FATAL! Kruger is not in the waiting que!
  • [Error] New Folder (2) -> (OnLeaveGame): Out Of Range

/kick 5
Boogie Man has been kicked.
  • New Folder (2): FATAL! Boogie Man is not in the waiting que!
  • New Folder (2): FATAL! Boogie Man is not in the waiting que!
  • New Folder (2): FATAL! Boogie Man is not in the waiting que!
  • [Error] New Folder (2) -> (OnLeaveGame): Out Of Range
Error message when I kicked a few test bots..
Title: Re: Soldat 1v1 Tournament
Post by: chillis34 on January 14, 2008, 07:21:01 am
am i the only one getting that error?
Title: Re: Soldat 1v1 Tournament
Post by: KwS Pall on January 14, 2008, 09:04:27 am
i had a bug like that because i had in one directory soldatserver and soldat
Title: Re: Soldat 1v1 Tournament
Post by: rhide on January 14, 2008, 10:56:50 am
Hey guys! Thank's for reporting bugs and thanks for liking the script :)

DorkeyDear:
If you add bots manually they are not added to the waiting que, I was thinking of adding another command for that, but then what the heck... why would you want bots quing anyway? :P
With players it works flawless for all I've seen.
Thanks for reporting though!

chris:
This is a very strange error and I've never seen anything like it... I belive KwS Pall can help you more than me there...

Date Posted: January 14, 2008, 03:54:45 pm
Oh, and one more thing, I also set up a test server:

IP: 87.227.89.200
Port: 23073 (std)
Title: Re: Soldat 1v1 Tournament
Post by: chillis34 on January 14, 2008, 12:24:24 pm
So you cant help me with that problem? ill try reinstalling i found a work around tho i named a map ÿþA and just used that to play.
Title: Re: Soldat 1v1 Tournament
Post by: rhide on January 14, 2008, 12:59:28 pm
I belive there's a problem with your servers map list. Maby it has been saved in some evil format that have added the strange characters, or perhaps it's empty and soldat tries to use default but fails... I dont know.

Anyway, the map list file is in the soldat servers root directory (same folder as soldatserver.exe), try editing that before editing map names. Post again if it doesnt work, gl
Title: Re: Soldat 1v1 Tournament
Post by: chillis34 on January 14, 2008, 01:57:31 pm
I belive there's a problem with your servers map list. Maby it has been saved in some evil format that have added the strange characters, or perhaps it's empty and soldat tries to use default but fails... I dont know.

Anyway, the map list file is in the soldat servers root directory (same folder as soldatserver.exe), try editing that before editing map names. Post again if it doesnt work, gl

I know its my server computer now because i tried it from the school and it worked maby its a bad version of the server or my computer. It has nothing to do with your script sorry for the inconvenence
Title: Re: Soldat 1v1 Tournament
Post by: rhide on January 14, 2008, 04:59:47 pm
Tip: "includes.txt" should have capped "i" so "Includes.txt" (case-sensitive os' may have it so it doesn't work properly)
Didn't know that, but fixed now. Thanks!

Lol, I tried to run the script as a CTF and it told me that its supost2 be a DM and then crashed :P
Yes I know, I put in a test to see if the server is DM, and if it's not I use the command shutdown.

Code: [Select]
   { Make sure that the gametype is deathmatch }
   if GameStyle <> DEATH_MATCH then
   Begin
      writeln('****** ERROR ******');
      writeln('[*] Game type must be Deathmatch. Now shutting down...');
      shutdown;
   End;

It crached for me aswell, but I don't know what to do about it. I could really use a hand here please!

Does the timer still go when the game is paused?
No. Unless soldat's built in match timer still goes when the game is paused, because I have not created my own clock, I just check TimeLimit - MatchTime to see how long time has passed.

Quote from: Chillis34
will this work well with realistic mod?
Yes. The server must be set to DM, but anything else goes. real/survival/dodgeball etc etc


Now try it on yer own server lads  8) It would be fun to see if people would play, after all i'ts very hard to find 1v1 servers on the internet.

Cya round!
Title: Re: Soldat 1v1 Tournament
Post by: Mr Pink on January 14, 2008, 05:43:30 pm
Lol, I tried to run the script as a CTF and it told me that its supost2 be a DM and then crashed :P
Yes I know, I put in a test to see if the server is DM, and if it's not I use the command shutdown.

Code: [Select]
{ Make sure that the gametype is deathmatch }
 if GameStyle <> DEATH_MATCH then
 Begin
 writeln('****** ERROR ******');
 writeln('[*] Game type must be Deathmatch. Now shutting down...');
 shutdown;
 End;

It crached for me aswell, but I don't know what to do about it. I could really use a hand here please!

You could try 'DisableScript', from the official help: If you set this variable to true (by doing "DisableScript := true;"), then your script will no longer receive event calls from the server. Eg, AppOnIdle, OnPlayerSpeak etc.
Title: Re: Soldat 1v1 Tournament
Post by: rhide on January 14, 2008, 08:12:07 pm
Ah, thanks!
I changed it and uploaded the new version. Now going release candidate 3, hope there has to be no more before stable  :P
Title: Re: Soldat 1v1 Tournament
Post by: chillis34 on January 14, 2008, 10:16:59 pm
found another bug it doesnt kick the bot when the last person leaves 
Quote
[Error] Tournament -> (OnLeaveGame): Invalid variant operation
Title: Re: Soldat 1v1 Tournament
Post by: rhide on January 15, 2008, 04:42:52 am
It's not supposed to kick the bot when the last person leaves ;o The server is meant never to be empty... I know of the invalid invariant though, but I havn't seen any effect of it at all, neither positive nor negative. I'll look in to it and see if the message can be removed, but for all I know the script might just be stable now! :)

Date Posted: January 15, 2008, 09:21:27 am
Fixed the error message.

Apparantly I deleted the player from the waiting que before checking what team he was on - hence the soldat server tried to check team of a non-existing player wich is a big nono.
Thanks for drawing my attention to the bug! :)
Title: Re: Soldat 1v1 Tournament
Post by: Leo on January 15, 2008, 05:49:34 am
System fails, no one wait to play. When they join the server and become spectators they leave after a while. Always 2 players only playing or a player and a bot.
Title: Re: Soldat 1v1 Tournament
Post by: chillis34 on January 15, 2008, 11:24:20 am
well could you send me a custom script so it does that i find an empty server gets more people than a botted server
Title: Re: Soldat 1v1 Tournament
Post by: Sub Zero on March 01, 2008, 02:01:05 pm
so what do i do with a script after dling or copy and pasting one
Title: Re: Soldat 1v1 Tournament
Post by: rhide on March 24, 2008, 05:57:59 pm
Either try it out or move it to some folder no one will ever have to see it again

Date Posted: March 03, 2008, 03:20:57 pm
After testing this script today it seems like the update I made for RC4 made the script not work somwehy... Therefore I uploaded RC3 wich should work flawlessly but without the features found in CHANGELOG.TXT
Title: Re: Soldat 1v1 Tournament
Post by: BRADEN on March 26, 2008, 12:04:40 pm
Shouldn't this script have been tested before releasing?
Title: Re: Soldat 1v1 Tournament
Post by: rhide on March 26, 2008, 05:21:24 pm
yes

why ask a question you know the answer to?