ctfcap2 — updated CtfCaptains script (17.01.2016)

Maps, modifications, add-ons, projects, and other releases for Zandronum. Also includes announcers.
Post Reply
User avatar
ZZYZX
Posts a lot
Posts: 742
Joined: Thu Jun 07, 2012 5:56 pm
Location: Ukraine
Clan: A3
Clan Tag: [A3]

ctfcap2 — updated CtfCaptains script (17.01.2016)

#1

Post by ZZYZX » Mon Oct 13, 2014 10:16 pm

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)
Image
Spoiler: Screenshot in the log (Open)
Image
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.
Last edited by ZZYZX on Sun Jan 17, 2016 2:56 pm, edited 1 time in total.

User avatar
Combinebobnt
Retired Staff / Community Team Member
Posts: 1906
Joined: Mon Jun 04, 2012 3:37 am
Location: Earth
Contact:

RE: ctfcap2 — updated CtfCaptains script

#2

Post by Combinebobnt » Tue Oct 14, 2014 1:30 am

Good now actually get it on the servers

User avatar
Torr Samaho
Lead Developer
Posts: 1543
Joined: Fri May 25, 2012 6:03 pm
Location: Germany

RE: ctfcap2 — updated CtfCaptains script

#3

Post by Torr Samaho » Wed Oct 15, 2014 7:48 pm

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

Watermelon
Zandrone
Posts: 1244
Joined: Thu Jun 28, 2012 9:07 pm
Location: Rwanda

RE: ctfcap2 — updated CtfCaptains script

#4

Post by Watermelon » Wed Oct 15, 2014 8:40 pm

Great job.

Can you include a random number and coinflip in there as well?

Kara Kurt
Frequent Poster Miles card holder
Posts: 887
Joined: Sat Oct 12, 2013 6:58 pm
Location: Strasbourg, France
Contact:

RE: ctfcap2 — updated CtfCaptains script

#5

Post by Kara Kurt » Wed Oct 15, 2014 8:46 pm

/me misses the randteams

User avatar
ZZYZX
Posts a lot
Posts: 742
Joined: Thu Jun 07, 2012 5:56 pm
Location: Ukraine
Clan: A3
Clan Tag: [A3]

RE: ctfcap2 — updated CtfCaptains script

#6

Post by ZZYZX » Thu Oct 16, 2014 12:50 am

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.

User avatar
ZZYZX
Posts a lot
Posts: 742
Joined: Thu Jun 07, 2012 5:56 pm
Location: Ukraine
Clan: A3
Clan Tag: [A3]

RE: ctfcap2 — updated CtfCaptains script

#7

Post by ZZYZX » Fri Oct 17, 2014 7:16 pm

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).

Watermelon
Zandrone
Posts: 1244
Joined: Thu Jun 28, 2012 9:07 pm
Location: Rwanda

RE: ctfcap2 — updated CtfCaptains script

#8

Post by Watermelon » Sat Oct 18, 2014 12:03 am

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)

User avatar
ZZYZX
Posts a lot
Posts: 742
Joined: Thu Jun 07, 2012 5:56 pm
Location: Ukraine
Clan: A3
Clan Tag: [A3]

RE: ctfcap2 — updated CtfCaptains script

#9

Post by ZZYZX » Sat Oct 18, 2014 6:42 pm

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?
Last edited by ZZYZX on Sat Oct 18, 2014 6:48 pm, edited 1 time in total.

Watermelon
Zandrone
Posts: 1244
Joined: Thu Jun 28, 2012 9:07 pm
Location: Rwanda

RE: ctfcap2 — updated CtfCaptains script

#10

Post by Watermelon » Sat Oct 18, 2014 9:12 pm

I think the \c- is to restore it to normal colors so any text after it can be processed as normal.

User avatar
ZZYZX
Posts a lot
Posts: 742
Joined: Thu Jun 07, 2012 5:56 pm
Location: Ukraine
Clan: A3
Clan Tag: [A3]

RE: ctfcap2 — updated CtfCaptains script

#11

Post by ZZYZX » Sun Jan 17, 2016 2:34 pm

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
Last edited by ZZYZX on Sun Jan 17, 2016 2:48 pm, edited 1 time in total.

User avatar
ZZYZX
Posts a lot
Posts: 742
Joined: Thu Jun 07, 2012 5:56 pm
Location: Ukraine
Clan: A3
Clan Tag: [A3]

RE: ctfcap2 — updated CtfCaptains script (17.01.2016)

#12

Post by ZZYZX » Sat Jan 23, 2016 6:09 pm

<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

Post Reply