Raised This Month: $ Target: $400
 0% 

TF2 Vote Usermessages


Post New Thread Reply   
 
Thread Tools Display Modes
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 06-27-2011 , 11:55   Re: TF2 Vote Usermessages
Reply With Quote #61

Quote:
Originally Posted by asherkin View Post
Here's the batch script I use to setup my envars (on win 7 as well), using the setx command doesn't require a restart.
Code:
@echo off
echo Setting up environment...
setx SOURCEMOD13 %cd%\sourcemod-1.3
setx SOURCEMOD %cd%\sourcemod-central
setx MMSOURCE18 %cd%\mmsource-1.8
setx MMSOURCE %cd%\mmsource-central
setx HL2SDK %cd%\hl2sdk
setx HL2SDKDARKM %cd%\hl2sdk-darkm
setx HL2SDK-DARKM %cd%\hl2sdk-darkm
setx HL2SDKOB %cd%\hl2sdk-ob
setx HL2SDKOBVALVE %cd%\hl2sdk-ob-valve
setx HL2SDKL4D %cd%\hl2sdk-l4d
setx HL2SDKL4D2 %cd%\hl2sdk-l4d2
setx HL2SDKSWARM %cd%\hl2sdk-swarm
setx HL2SDK-SWARM %cd%\hl2sdk-swarm
setx HL2SDK-BGT %cd%\hl2sdk-bgt
setx HL2SDKBGT %cd%\hl2sdk-bgt
setx MYSQL5 %cd%\mysql-5.0
echo ... Done.
pause
Getting back to this VS2K10 problem after like a month isn't something I wanted to do, but I've recently found out that VS2K10 appears to be caching environment variables for a certain length of time.

I recently changed where my MMSOURCE18 environment variable pointed, rebooted the computer, used setx to make sure it was changed, and deleted the entire VS2K10 project folder and used the copy from the sample_ext project, in that order.

After all this, Visual Studio 2010 is still picking up the old value. I can tell, because I can see the old value when I go to the Project Configuration -> Configuration Properties -> C/C++ -> Command Line section.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 06-27-2011 at 14:08.
Powerlord is offline
jasonfrog
Senior Member
Join Date: Mar 2008
Old 06-27-2011 , 13:52   Re: TF2 Vote Usermessages
Reply With Quote #62

I've nothing constructive or helpful to add, but, Powerlord, this would be amazing if you saw this through. It would make a big difference to voting and finally provideing a solution to the clash between SM vote menu keys and weapon selection keys.

Best of luck and thanks for your efforts this far
jasonfrog is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-01-2011 , 21:39   Re: TF2 Vote Usermessages
Reply With Quote #63

Quick update on this, I'm beginning private testing of this extension along with TF Mapchooser (Mapchooser modded to use TFVotes).

Unfortunately, I need to set up my Linux compilation environment, since I only have Linux dedicated servers. Unfortunately, I noticed that the MetaMod crew have a new version of the HL2SDK OB-Valve, which is the version TF2 uses.

I suppose I could test it on a local Windows dedicated copy, but then I'd have to install it first. Besides, I'll have to set up a Linux compilation environment anyway.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Afronanny
Veteran Member
Join Date: Aug 2009
Old 07-11-2011 , 12:52   Re: TF2 Vote Usermessages
Reply With Quote #64

Send me the stuffs, ill linux compile it for ya
Afronanny is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-11-2011 , 13:13   Re: TF2 Vote Usermessages
Reply With Quote #65

Quote:
Originally Posted by Afronanny View Post
Send me the stuffs, ill linux compile it for ya
Actually, I think it's compiling correctly now, but I need to attach a debugger and find out why it's segfaulting when it tries to start a vote (and see if it's doing this on Windows as well).
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-13-2011 , 10:13   Re: TF2 Vote Usermessages
Reply With Quote #66

I didn't have a chance to debug this yet, but I just gained a wealth of valuable information from the L4D Vote Manager 2 topic.

First, those strange 255 values that appear in the UserMessages? They're supposed to be signed values. So, what does 255 become when switched to signed? -1. What else uses -1? The team identifier in the vote events for "no team". Therefore, the first byte of all the UserMessages is the team number.

Second, using a translation string that consists of a single "%s1" will allow you to use a custom vote name. What translation string is that in TF2? #TF_playerid_noteam

For reference, here's the latest UserMessages meanings:

Code:
VoteSetup Structure
    - Byte      Count of vote issues allowed on this server
    * String    Vote Issues, same number as Count above.

VoteStart Structure
    - Byte      Team index or -1 for all
    - Byte      Client index (NOT USERID) of person who started the vote, or 99 for the server.
    - String    Vote issue translation string
    - String    Vote issue text
    - Bool      true for Yes/No, false for Multiple choice

VotePass Structure
    - Byte      Team index or -1 for all
    - String    Vote issue translation string
    - String    Vote winner (same as vote issue text for Yes/No?)

VoteFail Structure
    - Byte      Team index or -1 for all
    - Byte      Failure reason code (0, 3-4)

CallVoteFailed
    - Byte      Failure reason code (1-2, 5-10)
    - Short     If above is 2, number of seconds until you can next start a vote
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 07-13-2011 at 21:45. Reason: Updated usermessages
Powerlord is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-13-2011 , 16:10   Re: TF2 Vote Usermessages
Reply With Quote #67

I'm going to use this script to do some more vote sniffing tonight for the build-in votes.

I haven't tested it to see if any of the log messages are incorrectly formatted yet, but I wanted to upload it before I forget, since I never did my last one.

Edit: Here's the version with the votefail and callvotefail functions that I used to test those.
Attached Files
File Type: sp Get Plugin or Get Source (votesniffer.sp - 298 views - 9.1 KB)
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 07-13-2011 at 21:57.
Powerlord is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-13-2011 , 21:07   Re: TF2 Vote Usermessages
Reply With Quote #68

I found all the vote fail reasons. Note, these vote fail reasons only work in the usermessage noted, if you try to use it with the other usermessage, it will print the last Vote Failed screen again (or generic one if you haven't sent one yet).

0 = Generic Vote Failed - VoteFailed
1 = Cannot call vote while other players are still loading - CallVoteFailed
2 = You called a vote recently and cannot call another one yet (second argument is number of seconds until you can call another vote) - CallVoteFailed
3 = Yes votes must outnumber No votes - VoteFailed
4 = Not Enough Votes - VoteFailed
5 - Server has disabled that issue. - CallVoteFailed
6 - That map does not exist. - CallVoteFailed
7 - You must specify a map name - CallVoteFailed
8 - This vote failed recently - CallVoteFailed
9 - Your team cannot call this vote - CallVoteFailed
10 - Voting not allowed while Waiting for Players - CallVoteFailed

Sending usermessages of the wrong type to a user may cause they to no longer display new errors.

Additionally, I've deciphered the remaining UserMessage elements and edited my earlier post to include them.

Now, I just need to add these to my extension and get it actually working.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 07-14-2011 at 09:22.
Powerlord is offline
Mr. Zero
Veteran Member
Join Date: Jun 2009
Location: Denmark
Old 07-14-2011 , 09:04   Re: TF2 Vote Usermessages
Reply With Quote #69

Thanks for the fail vote reasons. Most of them seem to fit with L4D2 ;3
Mr. Zero is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-15-2011 , 15:52   Re: TF2 Vote Usermessages
Reply With Quote #70

I compiled all the information on TF2 voting onto a wiki page on the AlliedModders wiki.

TF2 Voting Wiki page

I need to rewrite large sections of my extension now to add L4D and L4D2 support. I think I need a separate vote handler for each one, while the vote objects can stay the same... literally the only difference is that the TF2 vote object has storage for the option strings.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 07-15-2011 at 15:58.
Powerlord is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:32.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode