Voter - new tool for wad and mod authors

Maps, modifications, add-ons, projects, and other releases for Zandronum. Also includes announcers.
User avatar
Hypnotoad
Retired Staff / Community Team Member
Posts: 528
Joined: Tue May 29, 2012 8:50 pm
Location: Britland

Voter - new tool for wad and mod authors

#1

Post by Hypnotoad » Tue Nov 26, 2013 2:30 pm

Do you develop or host any wads/mods but are unsatisfied with either repeating the same map rotation over and over, or having sv_randommaprotation on and having an annoyingly unpredictable pseudo-random map rotation? I know I AM!

For this reason, I have developed a simple patchwad that adds an entirely new voting system to be initiated at the end of each level (how it is initiated is at your discretion, as I will explain below).

This mod adds three rounds of voting, giving players a large amount of control as to how they would like to proceed along the mapset online.

The first round simply asks the players if they would like to restart the map they are on to play it again.

[spoiler]Image[/spoiler]

If there are not enough votes (less than half) or the result is a draw, it will default to proceeding to the next round, if reset map wins the vote however then it wont proceed to any other rounds of voting and will immediately reset the map.

The second round asks if you would like to simply proceed to the next map in the rotation (random map rotation should be off) as if to exit normally, or to choose between two random maps (which is the default).

[spoiler]Image[/spoiler]

If random maps wins the vote (or there is a draw or not enough votes) then the third round of voting is initiated, presenting two random maps for players to choose from.

[spoiler]Image[/spoiler]

If there is not enough votes or there is a draw, then the script will randomly choose between those two maps.

Voters are totally frozen during the voting.

Unfortunately, because Zandronum does not properly support dynamic strings yet, in order to make this work for your wad you MUST edit the library script (called MAPVOTER inside the wad) to include information about your mapset and recompile, and then save that wad with a specific prefix/suffix to distinguish it from other versions of the wad.

Fortunately, I made this super easy for you. All you have to do is edit a few lines at the very top of the script, no knowledge of ACS is required.

At the top of the script, you will see this, the comments provide instructions on what to do:

Code: Select all

//BELOW IS FOR WAD AUTHORS TO EDIT

#define nummaps 7 //Change this value to the number of maps in rotation
#define HUDID1 500 //If you are a mod author, change these values if they conflict with any hud message ids used in your mod
#define HUDID2 501
#define HUDID3 502
#define HUDID4 503
#define VOTESCRIPT1 501 //If you are a mod author, change these values if they conflict with any script numbers in your wad
#define VOTESCRIPT2 502
#define VOTESCRIPT3 503
#define VOTESCRIPT4 504
#define VOTESCRIPT5 505
#define VOTESCRIPT6 506

//Below is the map name array. 
//the format is changemap [LUMPNAME] where the lumpname must obviously be IDENTICAL to the maplump names in your wad otherwise it will not work. 
//Edit the array to include all of the maps in rotation
str maps[nummaps] = {"changemap MAP01", "changemap MAP02", "changemap MAP03", "changemap MAP04", "changemap MAP05", "changemap MAP06", "changemap MAP07"};

//Genre of each map (for mods that have multiple genres of gameplay, e.g. minigame wads)
str genre[nummaps] = {"Coop","Coop","Coop","Coop","Coop","Coop","Coop"};

//Description of each map
str description[nummaps] = {"Entryway","Underhalls","The Gauntlet","The Focus","The Waste Tunnels","The Crusher","Dead Simple"};


//IGNORE THE BELOW
Once this is edited, simply compile the script (ensure its output is MAPVOTER and is stored between a_start and a_end in the wad if not already done so) and it should work as intended.


Initiating the vote


The vote is initiated by executing VOTESCRIPT1 (by default this is script 501); when this is executed is down to your discretion. Typically this will be after a specified timer runs out, on pressing an "exit" switch or after some check to see if the game has ended.

This mod also includes a simple timer that will initiate the voting after a specified time period. Simply set the cvar "v_tlimit" in the server console to how long in minutes you want to wait until voting is initiated.

Download: http://static.[bad site]/wads/voterv4.wad

edit: oh and if you need any help getting this to work with your mod do not hesitate to ask!
Last edited by The Toxic Avenger on Wed Nov 27, 2013 12:12 am, edited 1 time in total.

one_Two
Addicted to Zandronum
Posts: 1753
Joined: Thu Jun 07, 2012 4:47 pm

RE: Voter - new tool for wad and mod authors

#2

Post by one_Two » Tue Nov 26, 2013 5:06 pm

Good work. How is it doing get full button info now?

Lollipop
Zandrone
Posts: 1123
Joined: Tue Jul 24, 2012 10:34 am
Location: Denmark

RE: Voter - new tool for wad and mod authors

#3

Post by Lollipop » Tue Nov 26, 2013 5:43 pm

Holy muffins, this is plain genius :eek:
Spoiler: Modding Qualifications (Open)
ACS: If it's of ridiculous scope and of suicide-inducing complexity then it's the thing for me.
DECORATE: I can make more or less any godawful hack I need. Doesn't mean it works, though.
Maps: I only map for testing ACS.
GFX: Not enough time or experience.

If you need help, advice or similar, feel free to send me a PM. ;)
Spoiler: My Current Projects (Open)
> ZMemory
> Various undeveloped ideas. (This one is an immutable fact)
Combinebobnt wrote:i can see the forum league is taking off much better than the ctf ones
GalactusToday at 1:07 PM
are you getting uncomfortable jap
feeling something happen down there

Ijon Tichy
Frequent Poster Miles card holder
Posts: 901
Joined: Mon Jun 04, 2012 5:07 am

RE: Voter - new tool for wad and mod authors

#4

Post by Ijon Tichy » Tue Nov 26, 2013 6:01 pm

one_Two wrote: Good work. How is it doing get full button info now?
compat_clientssendfullbuttoninfo has been in as a cvar for a while (by a while I mean years)

(autocorrect, please eat a dick)
Last edited by Ijon Tichy on Tue Nov 26, 2013 6:02 pm, edited 1 time in total.

one_Two
Addicted to Zandronum
Posts: 1753
Joined: Thu Jun 07, 2012 4:47 pm

RE: Voter - new tool for wad and mod authors

#5

Post by one_Two » Tue Nov 26, 2013 6:21 pm

Yeah I thought it couldn't be called from acs?

User avatar
Ænima
Addicted to Zandronum
Posts: 3489
Joined: Tue Jun 05, 2012 6:12 pm

RE: Voter - new tool for wad and mod authors

#6

Post by Ænima » Tue Nov 26, 2013 6:33 pm

one_Two wrote: Yeah I thought it couldn't be called from acs?
ConsoleCommand can execute ANY serverside CCMD.
­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­
Doom64: Unabsolved: New weapons, monsters, and gameplay twists for survival / coop !


ZandroSkins
: a pack made by our community

User avatar
Empyre
Zandrone
Posts: 1282
Joined: Sun Jul 08, 2012 6:41 am
Location: Garland, TX, USA

RE: Voter - new tool for wad and mod authors

#7

Post by Empyre » Tue Nov 26, 2013 8:55 pm

I really like this idea!
Hypnotoad wrote: The vote is initiated by executing VOTESCRIPT1 (by default this is script 501); when this is executed is down to your discretion. Typically this will be after a specified timer runs out, on pressing an "exit" switch or after some check to see if the game has ended.

This mod also includes a simple timer that will initiate the voting after a specified time period. Simply set the cvar "v_tlimit" in the server console to how long in minutes you want to wait until voting is initiated.
Just to clarify, if I edit this to fit my maps and put it on my server, would it automatically start the vote when a player exits, or would I have to write some acs to call the script?

If I don't want to use the timer, do I simply not set v_tlimit?

Here's a suggestion that I am not sure is possible because I don't know acs, but if it is possible, it should be done in order to not step on the toes of server operators:

Code: Select all

Store the current value of compat_clientssendfullbuttoninfo in a variable.
Turn compat_clientssendfullbuttoninfo on.
...
After all the voting is done, use the variable to restore compat_clientssendfullbuttoninfo to what it was before.
"For the world is hollow, and I have touched the sky."

User avatar
Hypnotoad
Retired Staff / Community Team Member
Posts: 528
Joined: Tue May 29, 2012 8:50 pm
Location: Britland

RE: Voter - new tool for wad and mod authors

#8

Post by Hypnotoad » Tue Nov 26, 2013 9:35 pm

Empyre wrote: Just to clarify, if I edit this to fit my maps and put it on my server, would it automatically start the vote when a player exits, or would I have to write some acs to call the script?
You will need to make sure the exit in the map calls script 501 (or whatever you set it to) rather than exiting straight away. If it uses the exit_normal special you will probably have to edit the map directly to change the linedef and make it execute the script, unless there is a way to patch all exit_normal functions.
If I don't want to use the timer, do I simply not set v_tlimit?
Yes.
Here's a suggestion that I am not sure is possible because I don't know acs, but if it is possible, it should be done in order to not step on the toes of server operators:

Code: Select all

Store the current value of compat_clientssendfullbuttoninfo in a variable.
Turn compat_clientssendfullbuttoninfo on.
...
After all the voting is done, use the variable to restore compat_clientssendfullbuttoninfo to what it was before.
Perhaps, depends if there is any particular reason a host would want compat_clientssendfullbuttoninfo off.

User avatar
Ænima
Addicted to Zandronum
Posts: 3489
Joined: Tue Jun 05, 2012 6:12 pm

RE: Voter - new tool for wad and mod authors

#9

Post by Ænima » Tue Nov 26, 2013 9:38 pm

Hypnotoad wrote:
Here's a suggestion that I am not sure is possible because I don't know acs, but if it is possible, it should be done in order to not step on the toes of server operators:

Code: Select all

Store the current value of compat_clientssendfullbuttoninfo in a variable.
Turn compat_clientssendfullbuttoninfo on.
...
After all the voting is done, use the variable to restore compat_clientssendfullbuttoninfo to what it was before.
Perhaps, depends if there is any particular reason a host would want compat_clientssendfullbuttoninfo off.
Probably because of bandwidth. But honestly you won't notice a huge difference between having that flag on or off. Especially with a good host like [BE] or Grandvoid.
­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­
Doom64: Unabsolved: New weapons, monsters, and gameplay twists for survival / coop !


ZandroSkins
: a pack made by our community

Ijon Tichy
Frequent Poster Miles card holder
Posts: 901
Joined: Mon Jun 04, 2012 5:07 am

RE: Voter - new tool for wad and mod authors

#10

Post by Ijon Tichy » Tue Nov 26, 2013 9:46 pm

samsara forces full button info on
cyberrunner forces full button info on
almost all of my mods force full button info on

no one ever complains, or notices

edit: re exit starts voting: I would recommend looking into xlat for doom and boom format maps - won't get every map, but it'll get quite a lot of them
Last edited by Ijon Tichy on Tue Nov 26, 2013 9:49 pm, edited 1 time in total.

User avatar
Empyre
Zandrone
Posts: 1282
Joined: Sun Jul 08, 2012 6:41 am
Location: Garland, TX, USA

RE: Voter - new tool for wad and mod authors

#11

Post by Empyre » Tue Nov 26, 2013 11:01 pm

OK, I concede the point about forcing full button info. I just thought it was generally considered bad form to use Console Command at all because server operators don't like their settings messed with.

I looked up xlat in ZDoom's wiki and it wasn't clear exactly what it does. Would it edit my wad so the maps are in doom-in-hexen format instead of boom format? Years ago, I upgraded from doom format to boom format. Recently, I have been thinking about upgrading from boom format to doom-in-hexen format, but it would be a lot of work. A translator would make it a lot easier.
"For the world is hollow, and I have touched the sky."

FateLord
Forum Regular
Posts: 307
Joined: Fri Apr 05, 2013 8:39 pm
Location: Columbus, USA

RE: Voter - new tool for wad and mod authors

#12

Post by FateLord » Tue Nov 26, 2013 11:13 pm

This is gonna be annoying as fuck if you try to add jumpmaze.
There's 72 maps of JumpMaze, almost 40 of Jumpix, 11 LJM, 14 NJM. About 136!
<Sean> .broadcast FateLord has a massive, hard wallhack
<Exciter> Global broadcast sent.

User avatar
Ænima
Addicted to Zandronum
Posts: 3489
Joined: Tue Jun 05, 2012 6:12 pm

RE: Voter - new tool for wad and mod authors

#13

Post by Ænima » Tue Nov 26, 2013 11:14 pm

Empyre wrote: Years ago, I upgraded from doom format to boom format. Recently, I have been thinking about upgrading from boom format to doom-in-hexen format, but it would be a lot of work. A translator would make it a lot easier.
You'd be better off just going straight to UDMF.
­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­
Doom64: Unabsolved: New weapons, monsters, and gameplay twists for survival / coop !


ZandroSkins
: a pack made by our community

User avatar
Hypnotoad
Retired Staff / Community Team Member
Posts: 528
Joined: Tue May 29, 2012 8:50 pm
Location: Britland

RE: Voter - new tool for wad and mod authors

#14

Post by Hypnotoad » Wed Nov 27, 2013 12:07 am

FateLord wrote: This is gonna be annoying as fuck if you try to add jumpmaze.
There's 72 maps of JumpMaze, almost 40 of Jumpix, 11 LJM, 14 NJM. About 136!
It will take a while but it's doable. If anyone is willing to do this for me I'd be hugely thankful.

User avatar
Ænima
Addicted to Zandronum
Posts: 3489
Joined: Tue Jun 05, 2012 6:12 pm

RE: Voter - new tool for wad and mod authors

#15

Post by Ænima » Wed Nov 27, 2013 12:32 am

I've been reading up on this "XLAT" thing, but I have no clue how to go about implementing it (yes the page includes instructions on how to compile but I'm still confused).

http://zdoom.org/wiki/Xlat


If it does what I think it does, you could easily replace all instances of Exit_Normal linedef actions with ACS_ExecuteAlways and call the voting scripts. And that wouldn't require editing any maps themselves in Doombuilder. Which would be very good.
­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­
Doom64: Unabsolved: New weapons, monsters, and gameplay twists for survival / coop !


ZandroSkins
: a pack made by our community

User avatar
Hypnotoad
Retired Staff / Community Team Member
Posts: 528
Joined: Tue May 29, 2012 8:50 pm
Location: Britland

RE: Voter - new tool for wad and mod authors

#16

Post by Hypnotoad » Wed Nov 27, 2013 1:24 am

Ænima wrote: I've been reading up on this "XLAT" thing, but I have no clue how to go about implementing it (yes the page includes instructions on how to compile but I'm still confused).

http://zdoom.org/wiki/Xlat


If it does what I think it does, you could easily replace all instances of Exit_Normal linedef actions with ACS_ExecuteAlways and call the voting scripts. And that wouldn't require editing any maps themselves in Doombuilder. Which would be very good.
I've been looking into it, I'm unsure if xlat can only translate from doom format maps or any format maps. If doom format, I would need to do something like

11 = USE, acs_execute (501, 0, 0, 0, 0)

edit: just tested, it works
Last edited by Hypnotoad on Wed Nov 27, 2013 1:31 am, edited 1 time in total.

User avatar
Kaminsky
Forum Regular
Posts: 159
Joined: Sun Apr 14, 2013 7:17 pm
Location: Somewhere...

RE: Voter - new tool for wad and mod authors

#17

Post by Kaminsky » Wed Nov 27, 2013 1:57 am

This is a very intriguing idea to implement into modifications that use various maps such as WhoDunIt, Jump Maze, and Zombie. It at least gives players an opportunity to select maps that they want to play on, rather than configured by the Server. If possible, you should offer more of a selection for the "Third Round" of the voting system. A minimum of five randomly selected maps would be ideal.
Last edited by Kaminsky on Wed Nov 27, 2013 1:57 am, edited 1 time in total.

User avatar
Hypnotoad
Retired Staff / Community Team Member
Posts: 528
Joined: Tue May 29, 2012 8:50 pm
Location: Britland

RE: Voter - new tool for wad and mod authors

#18

Post by Hypnotoad » Wed Nov 27, 2013 2:27 am

Please declare strong support for this http://zandronum.com/tracker/view.php?id=1594 so that I can get this to work with any exit swtich on any map format.

User avatar
Empyre
Zandrone
Posts: 1282
Joined: Sun Jul 08, 2012 6:41 am
Location: Garland, TX, USA

RE: Voter - new tool for wad and mod authors

#19

Post by Empyre » Wed Nov 27, 2013 3:30 am

Ænima wrote:
Empyre wrote: Years ago, I upgraded from doom format to boom format. Recently, I have been thinking about upgrading from boom format to doom-in-hexen format, but it would be a lot of work. A translator would make it a lot easier.
You'd be better off just going straight to UDMF.
No, because I want the maps to work in ZDaemon as well as Zandronum and ZDoom. Portability is why I chose Boom over Doom-in-Hexen in the first place.
"For the world is hollow, and I have touched the sky."

Klofkac
Forum Regular
Posts: 481
Joined: Sat Jun 09, 2012 1:31 pm
Location: Ask Grandvoid servers

RE: Voter - new tool for wad and mod authors

#20

Post by Klofkac » Wed Nov 27, 2013 9:48 am

Actually, most of the jumpmaze maps use custom exit function (JmGameExit()), it can be redefined to puke the script 501 instead, since it uses #import for jm functions.
One loadacs with redefined function is enough to convert most of jumpmaze maps. It can be done in less than 5 minutes for experienced scripters. At least I did this to override some ZH functions back in early 2012.
Last edited by Klofkac on Wed Nov 27, 2013 10:03 am, edited 1 time in total.
𝕂𝕝𝕠𝕗𝕜𝕒𝕔

Post Reply