[SM Plugin] Votetime Plugin

Discussion in 'Coding' started by Mikleo, Apr 3, 2017.

  1. Mikleo

    Mikleo Member

    Messages:
    155
    Likes Received:
    98
    Trophy Points:
    0
    I thought I would have a go at creating a plugin. I haven't made one before and I thought I would give it a shot.

    The commands:

    !votetime [seconds]
    Sets the command vote time, compensating for expired time. Whatever you put in here is the time you see in the middle of the screen. Was going to put in !delay but I think this command is much better anyway.

    !pausevote [optional message/reason]
    !resumevote
    pauses the vote and displays notifications.

    !resettime
    resets the vote to the original comm vote time

    vt_start_buffer (20)
    if a player joins a team instantly after map start. 20 seconds is added to vote. if they join in 5 seconds, 15 seconds is to the vote. If they join after 20 seconds no time is added to the vote. Sometimes if a player joins too soon the vote seems too short to joining players, where as if a player joins a team late the vote can seem too long. the start buffer is like an invisible timer after map start. Maybe it is possible to set vt_start_buffer to higher values on large custom maps which take time to download, idk.

    vt_player_multiplier (0.5)
    Additional time added per player. So with the default settings on a full server 64*0.5=32 seconds are added to the vote. Games with a lot of players have more squads to organise, more voice spam and are harder to manage.

    Depends on EmpUtils

    Git repo: https://git.empiresmod.com/sourcemod/votetime
     
    Last edited: Oct 7, 2017
    Neoony, Xyaminou and D.D.D. Destroyer like this.
  2. Thexa4

    Thexa4 Developer Staff Member Moderator

    Messages:
    304
    Likes Received:
    98
    Trophy Points:
    0
    If you send me a message with your user account on https://git.empiresmod.com I'll give you a repository on the sourcemod plugin group, then it'll be more discoverable.
     
    Neoony and D.D.D. Destroyer like this.
  3. Mikleo

    Mikleo Member

    Messages:
    155
    Likes Received:
    98
    Trophy Points:
    0
    Added v0.2

    I added an optional message to the pause, which shows in the timed notification so that players can know why the game is paused.

    I also added a couple of cvars.

    I'm currently thinking about whether vt_start_buffer should reduce time rather than add it. It would reduce the need to change the comm_vote cvar that much. let me know what you think.
     
    Last edited: Apr 4, 2017
    Neoony likes this.
  4. Neoony

    Neoony Member

    Messages:
    1,366
    Likes Received:
    106
    Trophy Points:
    0
    Working on compatibility patch for NCEV.

    If NCEV detects your plugin.
    It will simply disable any extending if vt_paused was used at least once.
    Message will display once at NCEV marktime:
    [​IMG]

    Only the extending will be disabled...assuming that admin is taking over control of commander voting time.
    All other features of NCEV should still work.

    This will be up in next update of NCEV.
    If you notice any other "conflicts", just let me know :P

    Nice to see more people learning SM scripting :grinnf:

    ---
    [​IMG]
     
    Last edited: Apr 4, 2017
    Thexa4 and Xyaminou like this.
  5. Neoony

    Neoony Member

    Messages:
    1,366
    Likes Received:
    106
    Trophy Points:
    0
  6. Xyaminou

    Xyaminou Member

    Messages:
    1,369
    Likes Received:
    156
    Trophy Points:
    0
    Can you add an option in the config file to change the admin level required to execute the commands?
     
  7. Mikleo

    Mikleo Member

    Messages:
    155
    Likes Received:
    98
    Trophy Points:
    0
    Yea I can do, another day though, just going to release my squad control plugin today and call it a night.
     
  8. Xyaminou

    Xyaminou Member

    Messages:
    1,369
    Likes Received:
    156
    Trophy Points:
    0
    few requests,
    add a variable for how often the message appears when the vote is paused.
    add who extended the vote time when using !votetime.
    add colors like I did on my server. I can send you my file.
    add errors when using !pausevote, !resumevote and !votetime on an infantry map and when the vote is already finished.
    add the phrases to a file in addons/sourcemod/translations like many other plugins do so they can be easily accessed.

    Thanks.
     
    Neoony likes this.
  9. Xyaminou

    Xyaminou Member

    Messages:
    1,369
    Likes Received:
    156
    Trophy Points:
    0
    more requests or ideas,
    !pausevote and !resumevote votes if players in teams agree they can vote to pause the vote and to resume it.
    OR
    if both commanders agree to pause or resume the vote.
     
  10. Mikleo

    Mikleo Member

    Messages:
    155
    Likes Received:
    98
    Trophy Points:
    0
    v0.3
    added !resettime
    added colors courtesy of Mr.X
    !waittime is an alias of !votetime
    all plugin functions now work in infantry maps as well, although the language used may not match well.
    added more error messages
    added some natives that I will use in newer versions of squadcontrol and draftpick.

    In response:
    vt_pause_notification_interval already should control the interval
    phrases - maybe later
    votes - maybe later idk
    admin level - just use overrides
     
  11. Xyaminou

    Xyaminou Member

    Messages:
    1,369
    Likes Received:
    156
    Trophy Points:
    0
    Yeah I actually found out about overrides a couple of days after I posted this. I changed it to a custom admin level.
     
  12. Mikleo

    Mikleo Member

    Messages:
    155
    Likes Received:
    98
    Trophy Points:
    0
    0.4

    Fixed an issue where the infantry cvar was used on random spawn location maps(e.g. emp_bush) because the cvs spawn in late.
     
    Neoony and Xyaminou like this.
  13. Mikleo

    Mikleo Member

    Messages:
    155
    Likes Received:
    98
    Trophy Points:
    0
    0.5
    Added Pause HUD text and sounds
    Added some countdown beeps but are disabled by default until i can find some good ones.
    Added some forwards which new version of empstats needs.
     
    Neoony likes this.
  14. D.D.D. Destroyer

    D.D.D. Destroyer Member Staff Member Moderator

    Messages:
    9,509
    Likes Received:
    111
    Trophy Points:
    0
    Is the text going to show in the chat box or did you find a way to use those game_text things?
     
  15. Mikleo

    Mikleo Member

    Messages:
    155
    Likes Received:
    98
    Trophy Points:
    0
    No it shows in the middle of the screen, thank you for letting me know about that. Actually you're right i forgot to include the gamedata custom overrides in this version. I will have to release another.
     
    D.D.D. Destroyer likes this.
  16. Mikleo

    Mikleo Member

    Messages:
    155
    Likes Received:
    98
    Trophy Points:
    0
    OK that's fixed. I will have to try to get sourcemod devs to add empires to the list of supported games for HudMsg. Don't know what the correct channel to do that is atm. The custom override should work fine though.
     
  17. Xyaminou

    Xyaminou Member

    Messages:
    1,369
    Likes Received:
    156
    Trophy Points:
    0
    Well since we're talking about getting the sourcemod assets updated, keep in mind the offsets sourcemod have are outdated. So whoever gets in contact with sourcemod developers should also provide them with the updated offsets.
     
    Neoony likes this.

Share This Page