Page 1 of 1
ctfcap2 — updated CtfCaptains script (17.01.2016)
Posted: Mon Oct 13, 2014 10:16 pm
by ZZYZX
subj. An updated (rewritten from scratch actually) version of the script that:
- has pretty high probability of it being less broken (e.g. "called by" line has been fixed, there is no wait time before results are shown, logging to console is done in a nicer way, also its not squished in widescreen);
- has proper support for AFK players (nicknames that end with asterisk aren't included in the active player list);
- logs all successful pukes to the server log;
- doesn't pick same captains multiple times;
- can as well be used to pick random teams, random map or just flip a coin.
Spoiler: Screenshot on the map (Open)
Spoiler: Screenshot in the log (Open)
Spoiler: Usage (Open)cc_help (puke 905): Display this message in the console.
cc_caps (puke 903): Pick random captains.
cc_teams <count> (puke 903 1 <count>): Pick random teams of <count> players.
cc_random <min> <max> (puke 903 2 <min> <max>): Pick random number between <min> and <max> inclusive.
cc_coinflip (puke 903 3): Flip a coin.
Download:
link (source included in the pk3, scripts directory)
P.S.: according to little investigation in #grandvoid, the wrong "called by" line was caused by a bug in CTFCaptains and not by wrong activator of puke scripts. More specifically, the author used "n:-1" as the activator's name instead of "n:0" in Print format. This bug was compensated by another bug (or absence of feature?) in Zandronum itself that treated "n:-1" as "n:0". In Zandronum 1.3 this has changed so that "n:-1" points to the level's name instead, which we saw in effect.
RE: ctfcap2 — updated CtfCaptains script
Posted: Tue Oct 14, 2014 1:30 am
by Combinebobnt
Good now actually get it on the servers
RE: ctfcap2 — updated CtfCaptains script
Posted: Wed Oct 15, 2014 7:48 pm
by Torr Samaho
Circunei Z wrote:
P.S.: according to little investigation in #grandvoid, the wrong "called by" line was caused by a bug in CTFCaptains and not by wrong activator of puke scripts. More specifically, the author used "n:-1" as the activator's name instead of "n:0" in Print format. This bug was compensated by another bug (or absence of feature?) in Zandronum itself that treated "n:-1" as "n:0". In Zandronum 1.3 this has changed so that "n:-1" points to the level's name instead, which we saw in effect.
The is a feature ported from ZDoom:
https://bitbucket.org/Torr_Samaho/zandr ... 0f65e83cd7
RE: ctfcap2 — updated CtfCaptains script
Posted: Wed Oct 15, 2014 8:40 pm
by Watermelon
Great job.
Can you include a random number and coinflip in there as well?
RE: ctfcap2 — updated CtfCaptains script
Posted: Wed Oct 15, 2014 8:46 pm
by Kara Kurt
/me misses the randteams
RE: ctfcap2 — updated CtfCaptains script
Posted: Thu Oct 16, 2014 12:50 am
by ZZYZX
Updated, added various new pukes.
Spoiler: usage (Open)cc_caps (puke 903): Pick random captains.
cc_teams <count> (puke 903 1 <count>): Pick random teams of <count> players.
cc_random <min> <max> (puke 903 2 <min> <max>): Pick random number between <min> and <max> inclusive.
cc_coinflip (puke 903 3): Flip a coin.
RE: ctfcap2 — updated CtfCaptains script
Posted: Fri Oct 17, 2014 7:16 pm
by ZZYZX
Tried playing it on GV, suddenly discovered a bug that was hardly possible to reproduce in local server...
Fixed: starred players shouldn't anymore get picked under any circumstances.
Fixed: nicknames of normal length shouldn't overlap now in cc_teams output, and the output itself should be aligned properly (blue team to the left, red team to the right edge).
RE: ctfcap2 — updated CtfCaptains script
Posted: Sat Oct 18, 2014 12:03 am
by Watermelon
If you haven't, can you put the logged messages inside a puke script like cc_help or something? Then just log() on the clientside something like
Log(s: "CTFCaptains v4 loaded. Type 'cc_help' in console for more information");
You can all it V4 or whatever you want. I have no problems there (only cause I made 3 versions :P)
RE: ctfcap2 — updated CtfCaptains script
Posted: Sat Oct 18, 2014 6:42 pm
by ZZYZX
Updated.
Fixed: starred players with colored nicknames shouldn't anymore get picked under any circumstances.
Fixed: random teams don't skip a line (tested with cc_teams 5, nearly killed my PC, heh).
Implemented this:
Watermelon wrote:If you haven't, can you put the logged messages inside a puke script like cc_help or something?
Added command cc_help (puke 905) for that.
Unrelated: why does StrParam(n:something) return a \c- in the end of a nickname if it has colors?
RE: ctfcap2 — updated CtfCaptains script
Posted: Sat Oct 18, 2014 9:12 pm
by Watermelon
I think the \c- is to restore it to normal colors so any text after it can be processed as normal.
RE: ctfcap2 — updated CtfCaptains script
Posted: Sun Jan 17, 2016 2:34 pm
by ZZYZX
Updated the script.
- Fixed the puke -903 exploit to circumvent the 30 second puke delay, shouldn't work anymore.
- Puke flood timer is nulled for disconnected players now (before, you could connect at the same time with someone disconnecting and get someone else's not-yet-expired "wait for 30 seconds").
- The script will also remember previously picked captains and not pick same people unless there's no choice.
http://static.[bad site]/wads/ctfcap2d.pk3
RE: ctfcap2 — updated CtfCaptains script (17.01.2016)
Posted: Sat Jan 23, 2016 6:09 pm
by ZZYZX
<Siferah> AlexMax actually
<Siferah> ctfcap2d wont remember already picked caps
<Siferah> I'm stupid and forgot to make script global
<Siferah> I mean
<Siferah> array
<Siferah> global
<Siferah> And since it's not global it will reset every map and not make sense overall
^
gotta fix eventually