Raised This Month: $32 Target: $400
 8% 

[TF2] 5CP Gamemode Fix Suggestions (1.0, [2017-11-21])


Post New Thread Reply   
 
Thread Tools Display Modes
Author
vitalyu
New Member
Join Date: Nov 2017
Plugin ID:
5922
Plugin Version:
1.0
Plugin Category:
Gameplay
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Implements a shottimer for the 5 Control Point Gamemode.
    Old 11-21-2017 , 11:22   [TF2] 5CP Gamemode Fix Suggestions (1.0, [2017-11-21])
    Reply With Quote #1

    Description

    Implements a shottimer, akin to the one found in basketball for the 5CP gamemode. For more information see this reddit thread.

    If a team caps a point that they don't own by default a timer will start.
    When the timer expires the aggressive points will either be unassigned (sm_5cpfs_punishment 0)
    given to the defensive team (sm_5cpfs_punishment 1).

    Based on suggestions from FUNKe, MR SLIN and sigafoo.

    FUNKe in Youtube Video Comment
    Quote:
    "Do you think resetting point captures without changing player locations would work? Example, blue holds 4th for too long, let's say 4 minutes, points reset and now they have to recap mid, ideally with a slower capture rate that becomes extremely fast when stacked with multiple people. Now the attacking team is forced to send at minimum one scout back to recapture, giving defenders number advantage on a potential push. Ideally the mid cap becomes extremely slow when it resets. Attackers cannot take last because mid has to be capped, defenders now have an opportunity to push without major reprocussions. It would be best to insentivize two players recapping mid, because a single scout cap still leaves attackers with a hard to crack stalemate, but it at least creates an opportunity that your defenders dying might not be terrible because they can respawn before attackers take 2nd again."
    MR SLIN in Youtube Video @ 8:'35

    sigafoo in Youtube Video @ 1:'48:'38

    The timer is arbitrarily set at 360 seconds (6 minutes) by default.

    The plugin can not detect whether or not a map is 5CP, which means you will have to enable and disable it manually.

    Artist's rendition.

    CVAR List
    Code:
    sm_5cpfs_version - Current version.
        
    sm_5cpfs_enabled - Is the plugin enabled or disabled? [0 = Disabled, 1 = Enabled, Default = 1]
    
    sm_5cpfs_timer_mode - Where should the timer be shown? [1 = HUD Timer, 2 = Chat Timer, 0 = No Timer, Default = 1]
        
    sm_5cpfs_chat_interval - How often should the chat timer be shown? [0 = Never, =>1 = Whenever the timer is divisible by this number., Default = 10]
    
    sm_5cpfs_countdown_voice - Should Announcer voicelines be played when the timer is about to run out? [-1 = Don't play any sounds, 0 = Only the stalemate sound will be played., 
    =>1 = A voiced countdown will play at this number (max 5)., Default = 5]
    
    sm_5cpfs_debug_switch_teams - See known issues below. [1 = Enabled, 0 = Disabled, Default = 0]
    
    sm_5cpfs_punishment - How should the offensive team be punished for letting the time run out? [0 = Points are unassigned, 1 = Points are assigned to the defensive team., Default = 0]
    
    sm_5cpfs_punishment_timer - If sm_5cpfs_punishment is 1, should a new shottimer start for the defensive team since they are aggressive in mid? [1 = Yes, 0 = No, Default = 0]
    
    sm_5cpfs_shottimer - What should the shottimer start at? [>= 1 = The timer will start at this number., Default = 360]
    
    sm_5cpfs_show_timer_below "30" - When should the timer be shown? [0 = Never, => 1 = The timer will be shown when the time left is below this amount.]
    
    sm_5cpfs_stalemate_sound - Which sound should be played when the points are reassigned? [Default = "vo/announcer_overtime.mp3"]
    Changelog
    Code:
    [2017-11-21] (1.0)
    * Initial release
    Known Issues
    If the defensive team is capping a point while the timer runs out the HUD will show that the point capture has no progress and that you are not capping the point. This is purely a visual bug, the progress is saved and you can still cap but the HUD will not update until you actually cap the point.

    On the following maps:
    cp_badlands
    cp_prolands_b2c
    cp_process_final
    cp_gullywash_final1
    cp_metalworks
    cp_sunshine
    cp_granary_pro_rc8
    cp_reckoner_rc2

    the OnCapTeam1 and OnCapTeam2 do not return the values that the official documentation say that they should.
    Instead they return the opposite. I have tested the above maps and the plugin is working on them. If you experience weird behavior in regards to the wrong control points being unassigned, try
    to enable sm_5cpfs_debug_switch_teams.

    Notes/questions for people who read the source code

    Does AlliedMods/SourceMod have any coding standards? Plugins I looked at seemed to use systems hungarian, although I am not a fan I kept it since I couldn't find anything that laid out a specific coding style.

    When should you precache sounds and how much of a performance drain is it to unnecessarily precache sounds?

    Is there a way to get the current owner of a CP on demand? Neither the team_control_point nor trigger_capture_area seem to have any outputs for this.

    What is the SOP for creating ConVars? The way I'm currently doing it with a global var that constantly has the value seems to work fine, although it might get stupid if you need a lot of ConVars.
    Attached Files
    File Type: sp Get Plugin or Get Source (sm_5cpfs.sp - 636 views - 16.9 KB)

    Last edited by vitalyu; 11-21-2017 at 12:37. Reason: Added .sp file
    vitalyu is offline
    Michalplyoutube
    Veteran Member
    Join Date: Jan 2013
    Location: Tank Carrier in Mannhatt
    Old 11-21-2017 , 11:35   Re: [TF2] 5CP Gamemode Fix Suggestions (1.0, [2017-11-21])
    Reply With Quote #2

    No source or plugin
    __________________
    The plugin developer of TF2BWR Reborn
    And a TF2 Player
    Michalplyoutube is offline
    vitalyu
    New Member
    Join Date: Nov 2017
    Old 11-21-2017 , 12:36   Re: [TF2] 5CP Gamemode Fix Suggestions (1.0, [2017-11-21])
    Reply With Quote #3

    Quote:
    Originally Posted by Michalplyoutube View Post
    No source or plugin
    What the hell?

    Where is the file upload when you've already created a thread? I can't find it under edit.

    EDIT: Edit -> Go Advanced.

    Last edited by vitalyu; 11-21-2017 at 12:38.
    vitalyu is offline
    Pelipoika
    Veteran Member
    Join Date: May 2012
    Location: Inside
    Old 11-21-2017 , 13:46   Re: [TF2] 5CP Gamemode Fix Suggestions (1.0, [2017-11-21])
    Reply With Quote #4

    GetEntProp(iCaller, Prop_Data, "m_iDefaultOwner") instead of GetEntData
    __________________
    Pelipoika is offline
    vitalyu
    New Member
    Join Date: Nov 2017
    Old 11-21-2017 , 14:47   Re: [TF2] 5CP Gamemode Fix Suggestions (1.0, [2017-11-21])
    Reply With Quote #5

    Quote:
    Originally Posted by Pelipoika View Post
    GetEntProp(iCaller, Prop_Data, "m_iDefaultOwner") instead of GetEntData
    Noted, thanks.

    Is there a list of common rookie mistakes or any specific plugins that are widely considered to be well written?
    vitalyu is offline
    Pelipoika
    Veteran Member
    Join Date: May 2012
    Location: Inside
    Old 11-21-2017 , 16:19   Re: [TF2] 5CP Gamemode Fix Suggestions (1.0, [2017-11-21])
    Reply With Quote #6

    Quote:
    Originally Posted by vitalyu View Post
    Noted, thanks.

    Is there a list of common rookie mistakes or any specific plugins that are widely considered to be well written?
    If a thread you found looking for help is >= 4 years old you propably should look for another one:

    There's also https://wiki.alliedmods.net/Category...eMod_Scripting
    __________________
    Pelipoika is offline
    nosoop
    Veteran Member
    Join Date: Aug 2014
    Old 11-21-2017 , 20:58   Re: [TF2] 5CP Gamemode Fix Suggestions (1.0, [2017-11-21])
    Reply With Quote #7

    Nice work; I thought a shot-clock style setup would be an interesting experiment back when this discussion was posted.

    Coding review in the spoilers below.

    Spoiler
    __________________
    I do TF2, TF2 servers, and TF2 plugins.
    I don't do DMs over Discord -- PM me on the forums regarding inquiries.
    AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)

    Last edited by nosoop; 11-21-2017 at 21:02.
    nosoop 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 07:48.


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