Raised This Month: $51 Target: $400
 12% 

[TF2] Sentry Limiter


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Quaz and Wally
Junior Member
Join Date: Sep 2009
Plugin ID:
1431
Plugin Version:
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Unapprover:
    Reason for Unapproving:
    Gets array index out of bounds errors on some servers. Unsupported(?)
    Old 01-27-2010 , 15:56   [TF2] Sentry Limiter
    Reply With Quote #1

    Crucial Parts Sentry Limiter

    Description:

    This plugin limits the way engineers can construct and upgrade their sentries. The original idea was to prevent turtling in Capture the Flag modes, which can quickly become frustrating due to the nature of some maps. Players have to overcome a fortified sentry defense, only to face a respawning wave after having exhausted most of their resources. This prevents the enemy from fortifying such a defense through sentry guns, which can be easy.

    Teams are provided a certain number of crucial parts. By default, this value is three. Each level of sentry gun requires a different amount of crucial parts. By default, level 1 sentries require zero crucial parts, level 2 sentries require one crucial part, and level 3 sentries require two crucial parts. This means by default, a team can only have one level 3 sentry and a level 2 sentry, or three level 2 sentries; each team can have unlimited level 1 sentries. All these values can be changed through convars.

    A text HUD displays to all engineers, indicating how many team parts are available to them to use. After the engineer's first death, the cost of the sentry levels disappears to minimize the hud to just the available team parts. Through optional convars, users can hide this HUD, or add the values of each level sentry to the display.


    Convars:
    • sm_sl_version: This provides you the version number of your sentry limiter plugin.
    • sm_sl_enable [0/1]: This enables or disables the plugin (Default 0).
    • sm_sentry_value [level sentry] [new integer value] (Admins with Cheat Access Only): This changes the number of parts a certain level sentry costs (Default 1 costs 0, 2 costs 1, and 3 costs 2).
    • sm_max_parts [new integer value] (Admins with Cheat Access Only): This changes the number of parts teams have available to them (Default 3).
    • sm_upgrade_limit [new integer value] (Admins with Cheat Access Only): This changes the upgrade metal limit for guns that cannot be upgraded (Default 100).
    • show_sentry_values [0/1]: This determines whether or not to show the values of each sentry level to the client engineer.
    • show_sentry_hud [0/1]: This determines whether or not to show the entire hud including the number of team parts available to the client engineer.

    Known Issues and Future Plans:

    • Upgrading a gun such that you put metal in it, and it goes over the limit, will not provide a refund (eg, gun is at 90 metal, engi has 25 metal, engi hits the gun, the gun stays at 100, engi doesn't get a 15 metal refund, he stays at 0). Implementing this will require keeping track of every gun's metal, which is possible. But as of right now, it is in a fairly stable state, and I'd like to see how well it fairs in a real environment. Besides, this is an issue that does not arise often, and hasn't even been noticeable in all the testing so far.
    • Option for vote-destroying sentries that griefing engineers construct to waste team parts would be nice, waiting to see reception.
    Attached Files
    File Type: sp Get Plugin or Get Source (SentryLimit.sp - 548 views - 15.1 KB)
    File Type: smx SentryLimit.smx (9.1 KB, 195 views)
    Quaz and Wally is offline
    pheadxdll
    AlliedModders Donor
    Join Date: Jun 2008
    Old 01-27-2010 , 16:15   Re: [TF2] Sentry Limiter
    Reply With Quote #2

    You can edit: tf/scripts/objects.txt and make the same changes to the game that your plugin does.

    You should add admin immunity or something else that makes this necessary.
    pheadxdll is offline
    Quaz and Wally
    Junior Member
    Join Date: Sep 2009
    Old 01-27-2010 , 16:19   Re: [TF2] Sentry Limiter
    Reply With Quote #3

    You can make the game keep track of how many level 3 and level 2 sentries are on a team and stop the rest of the engineers from upgrading their guns?
    Quaz and Wally is offline
    demm
    Junior Member
    Join Date: Feb 2008
    Old 01-28-2010 , 09:07   Re: [TF2] Sentry Limiter
    Reply With Quote #4

    Thank you for that plugin. It's really a good idea. Until now we've just disabled engis completely on CTF maps, but of course many engi players complained.

    I will try this out immediately.
    demm is offline
    demm
    Junior Member
    Join Date: Feb 2008
    Old 01-30-2010 , 05:26   Re: [TF2] Sentry Limiter
    Reply With Quote #5

    The plugin works flawlessly. Thanks a lot.


    Is there a chance you can make the hud a bit smaller and maybe just use white instead of the current color? It's really big right now.
    demm is offline
    DarkEnergy
    SourceMod Donor
    Join Date: Apr 2008
    Location: Georgia Tech, MSECE
    Old 01-30-2010 , 19:50   Re: [TF2] Sentry Limiter
    Reply With Quote #6

    you should cache the enabled value and hook when that cvar changes

    you should get integer value for the cvar, not float

    RBGT values should not go over 255
    DarkEnergy is offline
    Quaz and Wally
    Junior Member
    Join Date: Sep 2009
    Old 02-01-2010 , 18:18   Re: [TF2] Sentry Limiter
    Reply With Quote #7

    I'm not sure of a way to shrink the size of the hud unfortunately, if anybody else knows how, then that would be great.

    And you're right, I need to change the RGB values.

    As for caching the enabled value, is there some value to doing it this way? Does it consume less resources? Maybe I'll set that up. Thanks.

    Edit: I'll also add a command to change the hud coloring.

    Last edited by Quaz and Wally; 02-01-2010 at 18:20.
    Quaz and Wally is offline
    DarkEnergy
    SourceMod Donor
    Join Date: Apr 2008
    Location: Georgia Tech, MSECE
    Old 02-24-2010 , 17:40   Re: [TF2] Sentry Limiter
    Reply With Quote #8

    caching is a style you should get used to in the computer science world, its faster to access a value instead of re-retrieving it

    hud messages cannot be shrunk, its so massive in source
    DarkEnergy is offline
    psychonic

    BAFFLED
    Join Date: May 2008
    Old 05-26-2010 , 09:57   Re: [TF2] Sentry Limiter
    Reply With Quote #9

    @'Quaz and Wally'

    Please use the safe MAXPLAYERS define (or +1) for the size of your global player arrays or at least a size large enough for the supported game. TF2 can go up to 33 or 34 max players.

    Also, please put your public cvar in the plugin post header if you would like the plugin to be tracked (once the query script is fixed).
    psychonic 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 06:21.


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