Poll

?

.
84 (71.2%)
,
34 (28.8%)

Total Members Voted: 116

Author Topic: Slayer  (Read 209200 times)

What is the difference between latejoin being set at 1 and latejoin being set at 5?

Greek, could you add the option of having a spectator team? Some options would include when a player runs out of lives, they are moved to the spectator team. Or a player could simply do a command to 'join' the spectator team.
Yeah, I've been thinking about adding a "Do Not Spawn" option for teams.

What is the difference between latejoin being set at 1 and latejoin being set at 5?
That's the time (in minutes) that people are allowed to join after the round has started. So if it's 1, people can join until 1 minute has passed. If it's 5, people can join until 5 minutes have passed.


Greek2me, I am stuck here. I am making a gamemode which is not going to be implemented with slayer, but I'd like it to work aside with Slayer. What is the function called when the game is reset after the round ends?

Thanks so much, Darren.

Greek2me, I am stuck here. I am making a gamemode which is not going to be implemented with slayer, but I'd like it to work aside with Slayer. What is the function called when the game is reset after the round ends?

Thanks so much, Darren.
So you are NOT registering it as a Slayer gamemode? In that case:
Code: [Select]
package blah
{
function MinigameSO::Reset(%mini,%client)
{
parent::reset(%mini,%client);

if(isSlayerMinigame(%mini))
{
//yes it is a slayer minigame, do stuff
}
}
};
activatePackage(blah);

Hm, when the countdown till the minigame gets reset, what is the function for that? Doing stuff on round reset doesn't cut it for my script.

Here's the entire function. You can find it in Dependencies/Minigames.cs.

Code: [Select]
function Slayer_MinigameSO::endRound(%this,%winner,%resetTime)
{
if(%this.isResetting())
return;
%this.setResetting(1);

if(%resetTime $= "")
{
%resetTime = %this.timeBetweenRounds * 1000;
}

%seconds = mCeil(%resetTime / 1000);

Slayer_Support::Debug(1,"Round won",%winner TAB "resetTime:" SPC %resetTime);

if(getField(%winner,0) $= "CUSTOM")
{
%count = 1;
%nameList = getField(%winner,1);
}
else //this generates the list of winner names
{
%count = 0;
for(%i=0; %i < getFieldCount(%winner); %i++)
{
%w = getField(%winner,%i);
if(!isObject(%w))
continue;
if(getMinigameFromObject(%w) != %this)
continue;

if(%w.class $= "Slayer_TeamSO")
{
%name = "<sPush>" @ %w.getColoredName() @ "<sPop>";

for(%e=0; %e < %w.numMembers; %e++)
{
%cl = %w.member[%e];
if(isObject(%cl.player))
%cl.player.emote(winStarProjectile);
}
}
else if(%w.getClassName() $= "GameConnection")
{
%name = "<sPush><color:ffff00>" @ %w.getPlayerName() @ "<sPop>";

if(isObject(%w.player))
%w.player.emote(winStarProjectile);
}
else
continue;

%w.wins ++;

%winner[%count] = %w;
%count ++;

if(%nameList $= "")
%nameList = %name;
else
%nameList = %nameList @ "," SPC %name;
}
}

if(isFunction("Slayer_" @ %this.mode @ "_preVictory"))
call("Slayer_" @ %this.mode @ "_preVictory",%this,%winner,%nameList);

if(%count <= 0)
%msg = '\c5Nobody won this round. Resetting in %4 seconds.';
else
{
if(%count > 1)
%msg = '<color:ff00ff>%1 tied this round. Resetting in %4 seconds.';
else if(isObject(%winner))
%msg = '<color:ff00ff>%1 won this round with a score of \c3%2\c5. %1 has won \c3%3\c5. Resetting in %4 seconds.';
else
%msg = '<color:ffff00>%1 \c5won this round. Resetting in %4 seconds.';

for(%i=0; %i < %this.numMembers; %i++)
{
%cl = %this.member[%i];
%cl.setDead(1);

if(%count == 1 && isObject(%winner) && %winner.getClassName() $= "GameConnection" && isObject(%winner.player))
%cl.camera.setMode(corpse,%winner.player);
else
{
if(isObject(%cl.player))
%cl.camera.setMode(corpse,%cl.player);
else
%cl.camera.setMode(observer);
}
%cl.setControlObject(%cl.camera);
}
}

if(isObject(%winner))
%score = %winner.getScore();
%score = %score SPC (%score == 1 ? "\c5point" : "\c5points");
%wins = (%winner.wins == 1 ? "once" : %winner.wins SPC "\c5times");

//tell everybody who won
%this.messageAll('',%msg,%nameList,%score,%wins,%seconds);

for(%i=0; %i < %seconds; %i++)
{
%remaining = %seconds - %i;
%timeLeft = %remaining SPC (%remaining == 1 ? "second" : "seconds");
%this.schedule(%i*1000,bottomPrintAll,"<just:center>\c5Resetting in" SPC %timeLeft @ ".",2);
}

if(isFunction("Slayer_" @ %this.mode @ "_postVictory"))
call("Slayer_" @ %this.mode @ "_postVictory",%this,%winner,%nameList);

%this.schedule(%resetTime,Reset);
}

Is their anyway to make it so that the end of round time is longer than it normally is?

Is their anyway to make it so that the end of round time is longer than it normally is?
Yeah, it's a minigame pref. Look in the Advanced tab, [Minigame, Time Between Rounds].

If you want to change it via script, there are 2 ways to do it:
1) Change %minigame.timeBetweenRounds
10000 would be 10 seconds, 5000 would be 5 seconds, etc. I would set %minigame.timeBetweenRounds back to what it was originally once you're done with what you're doing.
Use this if you are not actually calling %minigame.endRound().

2)  Call %minigame.endRound() like so: %minigame.endRound(%winners,%resetTime), where %resetTime is something like 10000.
Use this if your mod is actually calling %minigame.endRound().
« Last Edit: April 09, 2012, 06:28:10 PM by Greek2me »

Apparently there is a glitch allowing you to gain a second life. I don't know how, but people on my server were using it.

Apparently there is a glitch allowing you to gain a second life. I don't know how, but people on my server were using it.
I was able to duplicate this on your server but not on mine. In any case I added some extra checks to try and solve it.

Any suggestions about what I can to stop it on my server?

For now you can just try to put this in console:
Code: [Select]
package blah { function serverCmdLeaveMinigame(%client) { if(%client.dead()) { return; } else { return parent::serverCmdLeaveMinigame(%client); } } }; activatepackage(blah);

Just a little update about the Map Cycler... So far most things are working server-side, including:
 - map change
 - load save file
 - load different minigames
 - automatic cycle (either time-based or round-based)
 - shuffle
 - other stuff

The big thing left to do is work on the client-side scripting and GUI.

I have a little idea to maybe make the map cycling better. Add a waiting room that doesn't go away so that when it starts to delete the build, it teleports all the players into that waiting room, and when the build is done loading it will start the minigame back up and the people will be playing as normal. Maybe a brick that will put the player that clicked it back into the minigame after there done loading so that they don't have to wait in the playing field for it to ghost.