This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

L4D Vote Manager 2


Post New Thread Reply   
 
Thread Tools Display Modes
instantn00b
Member
Join Date: Jun 2011
Old 06-27-2011 , 13:57   Re: L4D Vote Manager 2
Reply With Quote #581

Quote:
Originally Posted by rava View Post
<Failed> "L4D Vote Manager 2" (1.5.7) by Madcap

L 06/27/2011 - 16:40:28: [SM] Unable to load plugin "votemanager2.smx": Required extension "GeoIP" file("geoip.ext") not running
Do you have geoip.ext.so (or dll for windows) in sourcemod/extensions? It's a standard sourcemod extension with comes with your install

That error is not so hard to read is it?
instantn00b is offline
xioSlayer
Senior Member
Join Date: Apr 2011
Old 07-12-2011 , 13:27   Re: L4D Vote Manager 2
Reply With Quote #582

This plugin seems to work perfectly, with only one flaw. It doesn't recognize votes for ALLTALK.

Can someone please modify this plugin so that it recognizes all talk votes? Currently the plugin disallows everyone from starting an alltalk vote.
xioSlayer is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-12-2011 , 16:15   Re: L4D Vote Manager 2
Reply With Quote #583

After looking over some of the code in this, I'm intrigued.

Specifically, I saw this:
PHP Code:
SetEventString(voteEvent,"issue","#L4D_TargetID_Player");
SetEventString(voteEvent,"param1",customVote); 
How does that look in game?

Simply put, I'm doing a lot with votes in Team Fortress 2, and it appears that part of the voting mechanism is the same, with the exception of it using UserMessages when votes are passed or fail. I'm wondering how exactly that would look.

Edit: I figured out how that works, after looking up the translation phrase. It's a simple translation phrase that consists of just "%s1". The TF2 equivalent is #TF_playerid_noteam.

I'll likely write a TF2 version of this plugin soon, as it does things a bit differently. I need to do some more observations on the TF2 vote events and usermessages first.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 07-12-2011 at 16:39.
Powerlord is offline
Mr. Zero
Veteran Member
Join Date: Jun 2009
Location: Denmark
Old 07-12-2011 , 20:51   Re: L4D Vote Manager 2
Reply With Quote #584

Quote:
Originally Posted by Powerlord View Post
After looking over some of the code in this, I'm intrigued.

Specifically, I saw this:
PHP Code:
SetEventString(voteEvent,"issue","#L4D_TargetID_Player");
SetEventString(voteEvent,"param1",customVote); 
How does that look in game?

Simply put, I'm doing a lot with votes in Team Fortress 2, and it appears that part of the voting mechanism is the same, with the exception of it using UserMessages when votes are passed or fail. I'm wondering how exactly that would look.

Edit: I figured out how that works, after looking up the translation phrase. It's a simple translation phrase that consists of just "%s1". The TF2 equivalent is #TF_playerid_noteam.

I'll likely write a TF2 version of this plugin soon, as it does things a bit differently. I need to do some more observations on the TF2 vote events and usermessages first.
Here is a custom one I made for my server:

http://i55.tinypic.com/2gwxhj9.jpg

The structures of the usermessages in L4D2:
PHP Code:
    /**
     * VoteStart Structure
     * - Byte      Team index voting
     * - Byte      Unknown, always 1
     * - String    Vote issue id
     * - String    Vote issue text
     * - String    Vote initiator name
     */

    /**
     * VotePass Structure
     * - Byte      Team index voting
     * - String    Vote issue id
     * - String    Vote issue text
     */

    /**
     * VoteFail Structure
     * - Byte      Team index voting
     */

    /**
     * VoteRegistered Structure
     * - Byte      Vote casted. 0: No, 1: Yes
     */ 
VoteRegistered is only send to the client that is voting and that updates their hud to fade out the options.

To update all clients of the choice I had to create the "vote_changed" event, with the updated values.

Other things I noticed: If initiator name is left empty, instead of "Vote called by: NAME" it will just say "VOTE" as pre vote update of l4d2.

Last edited by Mr. Zero; 07-12-2011 at 20:54.
Mr. Zero is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-13-2011 , 10:36   Re: L4D Vote Manager 2
Reply With Quote #585

Quote:
Originally Posted by Mr. Zero View Post
Here is a custom one I made for my server:

http://i55.tinypic.com/2gwxhj9.jpg

The structures of the usermessages in L4D2:
PHP Code:
    /**
     * VoteStart Structure
     * - Byte      Team index voting
     * - Byte      Unknown, always 1
     * - String    Vote issue id
     * - String    Vote issue text
     * - String    Vote initiator name
     */

    /**
     * VotePass Structure
     * - Byte      Team index voting
     * - String    Vote issue id
     * - String    Vote issue text
     */

    /**
     * VoteFail Structure
     * - Byte      Team index voting
     */

    /**
     * VoteRegistered Structure
     * - Byte      Vote casted. 0: No, 1: Yes
     */ 
VoteRegistered is only send to the client that is voting and that updates their hud to fade out the options.

To update all clients of the choice I had to create the "vote_changed" event, with the updated values.

Other things I noticed: If initiator name is left empty, instead of "Vote called by: NAME" it will just say "VOTE" as pre vote update of l4d2.
You've given me a lot of valuable information here. I wasn't sure what those strange 255 values were that I was seeing in the TF2 vote UserMessages. It turns out that those are the team index... apparently it's supposed to be a signed byte, but it's being read as unsigned in SourceMod. I need to make a note to ask the SourceMod team to add a function to read signed bytes from BitBuffers...

TF2's votes are slightly different than L4D2s. Some differences:

For example, TF2 has two vote types: Yes/No and 5 option. VoteStart now has a bool for whether the vote is multiple choice. The unknown byte is 1 for Yes/No, 99 for multiple choice. VoteStart is also missing the initiator argument.

It uses the vote_option event to set up the voting parameters for 5 option.

VoteFail now has a second byte for the fail reason (4 is Not Enough Votes, I haven't tested other values).

VoteRegistered was replaced by the vote_cast event, which includes the vote option, team, and userid... and is sent to all users.

As for events, I need to check. Most of my TF2 vote testing was done on 5 option voting, which is only triggered by the server. It could be that the vote_start event is issued whenever a user starts a vote. The same could also be true for vote_ended, vote_failed, vote_passed, and vote_changed events, though.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-13-2011 , 19:52   Re: L4D Vote Manager 2
Reply With Quote #586

I figured out what the unknown byte is in VoteStart. It's the player index of the person who starts the vote. In TF2, it uses 99 as the server's player index, rather than 0. I haven't figured out why that is.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Mr. Zero
Veteran Member
Join Date: Jun 2009
Location: Denmark
Old 07-13-2011 , 21:32   Re: L4D Vote Manager 2
Reply With Quote #587

Quote:
Originally Posted by Powerlord View Post
I figured out what the unknown byte is in VoteStart. It's the player index of the person who starts the vote. In TF2, it uses 99 as the server's player index, rather than 0. I haven't figured out why that is.
Ah. Yeah I was the only player on the server so that explains why it always was 1.

As for the 99 as server, can't help you with that. Server cannot start any votes so I can't tell you what it returns in L4D2. My guess would probably be that it returns 99 as well.
Mr. Zero is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-13-2011 , 23:49   Re: L4D Vote Manager 2
Reply With Quote #588

Quote:
Originally Posted by Mr. Zero View Post
Ah. Yeah I was the only player on the server so that explains why it always was 1.

As for the 99 as server, can't help you with that. Server cannot start any votes so I can't tell you what it returns in L4D2. My guess would probably be that it returns 99 as well.
Yeah, in TF2, the only vote the server starts is the map vote. Which isn't applicable to L4D2.

I've updated the documentation on TF2's Vote Usermessages over on the Scripting board. I haven't documented the events recently, though.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 07-14-2011 at 01:15.
Powerlord is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-14-2011 , 01:15   Re: L4D Vote Manager 2
Reply With Quote #589

I wrote a quick test plugin for a TF2 Yes/No vote, and you can see that passing 99 shows the name "Server" for the initiator. This plugin code was added to the wiki on the TF2 Voting page.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
arnold
Junior Member
Join Date: Jul 2011
Old 07-23-2011 , 21:13   Re: L4D Vote Manager 2
Reply With Quote #590

some ppl say abut this plugin makes server crash is that right
[QUOTE][/QUOTE]
arnold 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 21:00.


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