Zandronum Chat on our Discord Server Get the latest version: 3.2
Source Code

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001231Zandronum[All Projects] Suggestionpublic2012-12-29 17:032018-09-30 20:22
ReporterCutman 
Assigned ToTorr Samaho 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version1.0 
Target Version1.1Fixed in Version1.1 
Summary0001231: Queue management in modes such as Survival
DescriptionI've recently made a survival game mode which is best played with 4 players. This is great and fun but I noticed that we had a lot of spectators that wanted to play but had to wait for someone to quit, so I came up with an idea for a server option.

If you die in survival (or run out of lives if sv_maxlives is set), you are kicked to spectator and the back of the queue. That way when everyone is dead, the next batch of players can play. I think this has use outside my mod for survival servers that can't handle lots of players but can handle lots of clients.

We have a hacky ACS script to handle this but I've been told others could benefit from this. Perhaps it could be implemented into other modes too such as LMS.
Additional InformationHere's an example of the hacky script we're using:

str ForceSpectate[32] = {
"kickfromgame_idx 0 Spectated",
"kickfromgame_idx 1 Spectated",
"kickfromgame_idx 2 Spectated",
"kickfromgame_idx 3 Spectated",
"kickfromgame_idx 4 Spectated",
"kickfromgame_idx 5 Spectated",
"kickfromgame_idx 6 Spectated",
"kickfromgame_idx 7 Spectated",
"kickfromgame_idx 8 Spectated",
"kickfromgame_idx 9 Spectated",
"kickfromgame_idx 10 Spectated",
"kickfromgame_idx 11 Spectated",
"kickfromgame_idx 12 Spectated",
"kickfromgame_idx 13 Spectated",
"kickfromgame_idx 14 Spectated",
"kickfromgame_idx 15 Spectated",
"kickfromgame_idx 16 Spectated",
"kickfromgame_idx 17 Spectated",
"kickfromgame_idx 18 Spectated",
"kickfromgame_idx 19 Spectated",
"kickfromgame_idx 20 Spectated",
"kickfromgame_idx 21 Spectated",
"kickfromgame_idx 22 Spectated",
"kickfromgame_idx 23 Spectated",
"kickfromgame_idx 24 Spectated",
"kickfromgame_idx 25 Spectated",
"kickfromgame_idx 26 Spectated",
"kickfromgame_idx 27 Spectated",
"kickfromgame_idx 28 Spectated",
"kickfromgame_idx 29 Spectated",
"kickfromgame_idx 30 Spectated",
"kickfromgame_idx 31 Spectated",
};

script 401 RESPAWN
{
//Print(s:"You Respawned!!! lets kick player ", i:PlayerNumber());
Delay(5);
if(GetCvar("survival")==0){terminate;}
ConsoleCommand(ForceSpectate[PlayerNumber()]);
}
Attached Files

- Relationships

-  Notes
User avatar (0005618)
Torr Samaho (administrator)
2012-12-30 11:57

Interesting idea and should be pretty easy to implement. If enough players are interested in this, I can implement it.
User avatar (0005663)
Torr Samaho (administrator)
2013-01-02 17:29

Thinking a bit more about this, I'd say this kind of idea is also a good reason to add an ACS command that allows to force a player to spectate, so I added KickFromGame (int playernumber, str reason). Combined with the new GetPlayerLivesLeft/SetPlayerLivesLeft commands from 0001229 this could be enough to properly implement the requested feature. So is this request still necessary?
User avatar (0005664)
Cutman (reporter)
2013-01-02 17:51

Does the build in the lives management issue also have KickFromGame? If so I can test both features and get back to you (still need to know the ACS number for KickFromGame though)
User avatar (0005665)
Torr Samaho (administrator)
2013-01-02 18:08

No, I made that build before adding KickFromGame. I'll make a new build that contains all of the new commands.
User avatar (0005666)
hjalg (reporter)
2013-01-02 18:14

This feature is badly needed for LMS. CVAR "sv_dead2spec" for example. Because it's kinda annoying when you always have to say "dead spec please" (and they ignore it). I support.
User avatar (0005667)
Torr Samaho (administrator)
2013-01-02 18:21
edited on: 2013-01-02 18:24

This build supports KickFromGame as well as GetPlayerLivesLeft/SetPlayerLivesLeft. To use all of these functions add

    -104:GetPlayerLivesLeft(1),
    -105:SetPlayerLivesLeft(2),
    -106:KickFromGame(2),

to your zspecial.acs. One way to implement the "dead2spec" feature this request is about would be to regularly loop over all players, use PlayerIsSpectator to find dead spectators (this command returns 2 if the player is a dead spectator) and KickFromGame to force the dead spectators to spectate. This way you don't even need to use GetPlayerLivesLeft. With a suitable delay you can probable even to this with a DEATH script instead of a loop.

User avatar (0005671)
Cutman (reporter)
2013-01-02 20:02

Seems to work fine online. Here's the script I used for testing the new functions.

script 401 DEATH
{
Delay(2);
if(GetCvar("survival")==0){terminate;}

    if(GetPlayerLivesLeft(PlayerNumber())==0){
    PrintBold(s:"Kicking player ", i:PlayerNumber());
    KickFromGame(PlayerNumber(),"Game over!");
    terminate;
    }
}

script 408 (int lives) net // test
{
SetPlayerLivesLeft(PlayerNumber(),GetPlayerLivesLeft(PlayerNumber()) + lives);
}

Note: With SetPlayerLivesLeft you can go over the "maximum lives" set by sv_maxlives. Can easily get around this by using GetCvar but was wondering if it was intentional or not.
User avatar (0005744)
Torr Samaho (administrator)
2013-01-12 21:27

Quote from Cutman
Note: With SetPlayerLivesLeft you can go over the "maximum lives" set by sv_maxlives.
That's intentional. If you want to give a player more lives than sv_maxlives, you can do so.

Issue Community Support
This issue is already marked as resolved.
If you feel that is not the case, please reopen it and explain why.
Supporters: Konar6 Edward-san Cutman hjalg ZzZombo
Opponents: No one explicitly opposes this issue yet.

- Issue History
Date Modified Username Field Change
2012-12-29 17:03 Cutman New Issue
2012-12-30 11:57 Torr Samaho Note Added: 0005618
2013-01-02 17:29 Torr Samaho Note Added: 0005663
2013-01-02 17:29 Torr Samaho Status new => feedback
2013-01-02 17:51 Cutman Note Added: 0005664
2013-01-02 17:51 Cutman Status feedback => new
2013-01-02 18:08 Torr Samaho Note Added: 0005665
2013-01-02 18:14 hjalg Note Added: 0005666
2013-01-02 18:21 Torr Samaho Note Added: 0005667
2013-01-02 18:22 Torr Samaho Note Edited: 0005667
2013-01-02 18:24 Torr Samaho Note Edited: 0005667 View Revisions
2013-01-02 18:24 Torr Samaho Note Revision Dropped: 5667: 0003105
2013-01-02 18:24 Torr Samaho Note Revision Dropped: 5667: 0003106
2013-01-02 18:25 Torr Samaho Assigned To => Torr Samaho
2013-01-02 18:25 Torr Samaho Status new => needs testing
2013-01-02 20:02 Cutman Note Added: 0005671
2013-01-12 21:27 Torr Samaho Note Added: 0005744
2013-01-12 21:28 Torr Samaho Target Version => 1.1
2013-04-06 10:04 Dusk Status needs testing => resolved
2013-04-06 10:04 Dusk Fixed in Version => 1.1
2013-04-06 10:04 Dusk Resolution open => fixed
2018-09-30 20:22 Blzut3 Status resolved => closed






Questions or other issues? Contact Us.

Links


Copyright © 2000 - 2025 MantisBT Team
Powered by Mantis Bugtracker