View Single Post
Author Message
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-15-2011 , 16:28   [L4D,L4D2,TF2] BuiltinVotes 0.5.8 (2013-01-29)
Reply With Quote #1

Instead of using this extension, help us test NativeVotes!

Any servers running SourceMod 1.4 or 1.5 hg3754 or below need version 0.5.7. Linux TF2 servers running 3754 or below will need the .so file from this post.


Now on Google Code!

Don't forget about the Client Side Transparency mod for TF2!

Common Problems:

I'm seeing an error "[BV] Unknown fatal error while translating a phrase."

These errors are related to the vote progress cvars. One of the SourceMod Core translation phrases has the wrong number of arguments. You can find out which phrase and which language number it's for using a Debug version of the extension. You can then get the language name and code using the plugin in this post.

Please, post the error in this thread and we'll see if we can get the translation phrase fixed in the next SourceMod version.

Currently known translation issues (1.4.1):
  • Dutch (nl): "Voted For", fix expected in 1.4.2
Previous known translation issues (if you see these errors, update your translation files):
  • Swedish (sv) : "Vote Count", fixed in 1.4.1
  • Danish (da): "Vote Count", fixed in 1.4.0
I'm getting a FAILED error for your extension, but I'm not running L4D/L4D2/TF2 or am not [interested in] running your extension!

Assuming you mean this error:

Code:
[4] <FAILED> file "builtinvotes.ext.dll": The specified module could not be found.
This is a known SourceMod issue. Any extension or plugin that you're not running that is listed as an optional dependency for a plugin will show this error.

You'll run into this error if you're using MapChooser Extended 1.8 or newer.

For End Users:

What is BuiltinVotes?

BuiltinVotes is a SourceMod 1.4 Extension that lets plugins use the L4D/L4D2/TF2 built-in vote screens.

Why use it?

The SourceMod vote system uses the 0-9 keys to register votes, which prevent weapon changes while the vote is displayed. This system uses F1-F2 for Yes/No votes and F1-F5 for multiple choice votes (TF2 only).

Better yet, most non-custom votes have their vote message, success message, and failure message translated by Valve for all languages the games support.

What are the Downsides?

/revote and !revote display a failure message and have a 3 second delay before redisplaying the vote. The technical reason for this is explained in the Plugin Developers section.

L4D and L4D2 are limited to Yes/No votes only. TF2 votes are limited to 5 choices.

For votes with more than these, you still need to use the SourceMod voting system.

Settings

BuiltinVotes hooks five SourceMod vote-related cvars for displaying ongoing votes:
  • sm_vote_delay
  • sm_vote_progress_hintbox
  • sm_vote_progress_chat
  • sm_vote_progress_console
  • sm_vote_progress_client_console
These are configured in cfg/sourcemod/sourcemod.cfg and are also used by the SourceMod vote system.


Plugins that currently support BuiltinVotesThe rest of this documentation is for developers, so you probably want to skip down to the builtinvotes.zip link.

For Plugin Developers:

Spoiler


Changelog:
  • 0.5.8 (2013-01-29)
    • Updated for breaking changes in the SourceMod IUserMessages extension interface.
    • This is the FINAL version of BuiltinVotes. Its replacement, the plugin NativeVotes, is nearly ready to begin testing.
  • builtinvotes.inc update #2 (2012-03-20)
    • Added DisplayBuiltinVoteToAllNonSpectators
    • Fixed the previously added team vote functions.
  • builtinvotes.inc update #1 (2012-03-16)
    • Added DisplayBuiltinVoteToTeam, DisplayBuiltinVoteToAllButOne, and DisplayBuiltinVoteToTeamButOne.
  • 0.5.7a (2012-03-06):
    • Modified debugging code to help track down translation issues. Main extension unchanged.
  • 0.5.7 (2012-02-20):
    • Reworked Cancel method to call CancelVoting internally
    • Cancel now properly kills the Display timer, which prevents a crash.
    • Rolled back DecrementPlayerCount change from previous version because it potentially introduced new issues.
    • The Cancel screen is no longer automatically shown when a vote object is disposed. This was necessary to fix the issues with Canceling votes causing errors.
    • Votes that were canceled will no longer be redisplayed if a user uses !revote unless another vote is called first. Hopefully you won't do that, as the vote may have the old vote type or title with the new vote's options.
    • Oh hey, it looks like Cancel is finally working and stable. It only took from 0.5.2 to 0.5.7 to iron out the bugs... now to debug the translations issue.
  • 0.5.4 (2012-02-19):
    • Fixed issue with crashes on map change. Be aware that the Cancel and End callbacks will be called on map start for the vote object.
    • Fixed an issue where disconnecting players were not being removed from the maximum vote count.
  • 0.5.1 (2012-01-19):
    • Fixed two potential memory leaks.
  • 0.5.0 (2011-12-04):
    • The L4D2 Alltalk vote is now present as a vote translation text.
    • Now includes a plugin to enable !revote and /revote for BuiltinVotes. NOTE: Because of the way this plugin is written, any Radio or Valve menus will not have /revote or !revote available when a BuiltinVotes vote is showing.
      • There is a forced 3 second delay between when you type !revote and the revote screen appearing. This is required due to how Valve handles votes in TF2; a vote failed screen is required to re-enable the vote keys. Due to this, !revote isn't allowed within the last 3 seconds of a vote.
      • Only tested on TF2, although it should also work on L4D and L4D2.
    • Fixed an error in the BuiltinVotes revoting logic which would end votes early if people revoted.
    • Fixed a bug in cvar handling that would sometimes cause a crash when the extension was unloaded. Unfortunately, there's still a OnClientDisconnected bug that sometimes causes the extension to crash when unloaded that I haven't been able to track down. (Technically, it's SourceMod that's crashing, but it only happens when the BuiltinVotes extension is reloaded)
    • New function, DisplayBuiltinVotePass2. This allows you to specify the translation constant that the Vote Passed screen should use. This should only be done for game-specific plugins, as the translation phrases for L4D/L4D2 don't work in TF2 (and vice versa).
    • Updated builtinvotes.inc that includes the new function mentioned above plus all the translation constants from the Extension side... including the START translations which aren't actually used for anything on the plugin side... yet...
  • 0.4.1 (2011-11-08)
    • Fixed a bug in L4D/L4D2 were recording votes backwards. Turns out that missing an == 0 is bad. L4D still untested, but L4D2 support appears to work.
    • Fixed a bug where vote counts weren't cleared before the start of a vote in L4D/L4D2.
    • Updated Makefile and Visual C++ projects to SourceMod 1.4 versions. The net result of this is that Linux builds are now slightly smaller and the Makefile will now work in OSX.
  • 0.4.0 (2011-11-07)
    • Preliminary (and untested) support for L4D and L4D2
    • Fixed issues with Yes/No votes in TF2
    • Updated builtinvotes.inc
      • Added two new constants: BUILTINVOTES_VOTE_YES and BUILTINVOTES_VOTE_NO, which are returned as param1 for a Yes/No vote's BuiltinVoteAction_VoteEnd callback.
      • Removed BUILTINVOTES_NO_VOTE, which is from the C++ side and not exposed to the public.
      • Updated documentation for BuiltinVoteAction_Cancel to document that yes, it does return a param1 value.
  • 0.0.3.0 (2011-11-05 (am))
    • Fix bug where players could vote multiple times.
    • Modified when the vote command is hooked. Normal built-in votes should now work when no vote is being displayed. Later versions may also hook callvote to prevent built-in votes from being called while the vote is displayed.
    • OnClientCommand moved to Vote classes from VoteStyle classes. BuiltinVoteHandler now gets passed vote item first and does sanity checks.
    • Fixed dumb mistake in marking users as having pending votes.
  • 0.0.2.0 - Initial Public TF2 Release
Attached Files
File Type: inc builtinvotes.inc (25.2 KB, 1787 views)
File Type: zip builtinvotes 0.5.7.zip (423.9 KB, 2504 views)
File Type: zip builtinvotes debug 0.5.7a.zip (2.30 MB, 930 views)
File Type: zip builtinvotes_src 0.5.7a.zip (68.5 KB, 983 views)
File Type: zip builtinvotes 0.5.8.zip (452.7 KB, 3842 views)
File Type: zip builtinvotes src 0.5.8.zip (69.0 KB, 1447 views)
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 02-14-2013 at 11:09. Reason: Updated builtinvotes.inc
Powerlord is offline