Skip to content

Extend VOTEINFO's features, addresses 0001420

Trillster requested to merge topic/default/voteinfo-extension into branch/default

This topic extends the VOTEINFO lump to include more features from the initial VOTEDEF proposal which will hopefully address recent feedback in ticket 0001420.

Notable changes are the following:

  • Added a new Display property which is used as the name of the vote in lieu of the internal name in relevant contexts. Mods may choose to name their votes odd things to avoid conflicts, so this gives them an easy way to still keep the votes readable.
  • Added the remainder of the Arg types from the initial proposal:
    • Float: A float value, passed to ACS as a fixed point number.
    • Player: Either a player's name or a player's number. Displayed as the player's name but passed to ACS as their player number.
    • Map: Either a map name or the index which represents the map. Displayed as a map name and passed to ACS as a string.
  • ACS scripts ran by the Action property now have an activator of the player who called the vote if they are still in the server. This enables votes such as voting to become a party leader. If the player has left the game after the vote passed, the activator is World instead.
  • Added a new PreflightAction property which specifies an ACS script to run as a pre-vote validation step. This script is responsible for returning a true / false as well as indicating any errors to the player attempting to call the vote. Has the same activator rules as Action and receives the same Arg if defined.
  • Added a new Menu property which can specify the name and display name of a menu to be added to ZA_CallVote. This allows mods to add their vote menus without having to potentially step on the toes of other mods which add votes.
  • Added a listvotetypes CCMD to list all of the vote types, including both native and custom ones, displaying which ones are currently allowed by the server.

I've attached an example file below which makes use of some of these features.

3.2-custom-votes.pk3

Edited by Trillster

Merge request reports