SRB2 Message Board

SRB2 Message Board (https://mb.srb2.org/index.php)
-   Miscellaneous (https://mb.srb2.org/forumdisplay.php?f=113)
-   -   Rock the Vote (https://mb.srb2.org/showthread.php?t=44632)

Wolfy 03-08-2019 01:12 PM

Rock the Vote
 
4 Attachment(s)
Based on the equivalent SourceMod plugin (common in Team Fortress 2 community servers), this script gives players the ability to rock the vote, or RTV for short, allowing players to determine by majority whether or not to exit the current stage. Using it is quite straightforward: send a message with "RTV" (case-insensitive) right at the beginning. It'll announce your RTV to the server, count the current number of votes, and display how many are needed for the RTV to succeed. Of course, the script also has some failsafes in place to prevent griefing as well:
  • Spectators are not counted in the overall player count, and by extension, their RTVs do not count as well.
  • RTV is disabled once a player has completed a lap.
  • Each player can only RTV once. This resets when a new map is loaded.
  • RTV cannot be triggered at intermissions. The script clears RTVs on level load anyway, but this prevents janky, meaningless prints in the chat.
  • [1.0.4+] Splitscreen players are not counted in the overall player count, otherwise they could inflate it and make it impossible for RTV to succeed.
This script was designed for Kart, but should in theory function in vanilla SRB2 as well. If you intend to use it there, do so at your own risk. Please do not report issues regarding vanilla compatibility.

Spoiler: Known Issues:
  • Splitscreen players can inflate the overall player count in versions 1.0.3 and prior, causing RTV to always fail in games with a high enough splitscreen player count. Due to Lua's poor support for splitscreen at the moment, this bug is unfixable without a new patch. The next patch for Kart will include a means of detecting these splitscreen players, which this script has already been tested against. As the script is already written to account for this, no updates will be necessary at that time, and splitscreen players will be fully supported.

Spoiler: Changelog:

v1:
  • Initial release.

Please get in contact with me either through Discord or a private message if you find any issues. I'll try to get them fixed as soon as possible.

D00D64 03-08-2019 02:14 PM

With the intentions of the code being for Kart, I decided to place it in Kart Misc. instead of SRB2 Misc. I also can't recall test to see if this works in multiplayer, but at least creating a Lan server by myself let it work, so I feel confident it'll work.


All times are GMT. The time now is 07:18 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.