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

[TF2] The Amplifier


Post New Thread Reply   
 
Thread Tools Display Modes
naris
AlliedModders Donor
Join Date: Dec 2006
Old 05-21-2010 , 12:56   Re: [TF2] The Amplifier
Reply With Quote #91

Quote:
Originally Posted by Kemsan View Post
My server have newset SM and Metamod:Source
No, you certainly DON'T have the newest version of SourceMod, since if you did, then TF2_RemoveCondition would be there.

You need to update to either the latest snapshot of 1.4, 1.3.3 or the released 1.3.2 version of SourceMod.

Any snapshots (including 1.4 snapshots) from earlier than about March 18th won't have the TF2_RemoveCondition() native.

Last edited by naris; 05-21-2010 at 13:10.
naris is offline
bouncer
Veteran Member
Join Date: Apr 2009
Old 05-21-2010 , 21:25   Re: [TF2] The Amplifier
Reply With Quote #92

This causes my server to crash... within every 12 hours... removed it and no crashes for 3 days since.

Should add reason: causes crashes.
__________________


bouncer is offline
Eggman
Senior Member
Join Date: Jan 2010
Old 05-21-2010 , 21:38   Re: [TF2] The Amplifier
Reply With Quote #93

bouncer, Any logs about crush?
Eggman is offline
noodleboy347
AlliedModders Donor
Join Date: Mar 2009
Old 05-22-2010 , 00:17   Re: [TF2] The Amplifier
Reply With Quote #94

Never crashed from this
noodleboy347 is offline
MisterNine
Member
Join Date: Jan 2010
Old 05-22-2010 , 02:27   Re: [TF2] The Amplifier
Reply With Quote #95

We ran this plugin for about five hours today on our 32 player server and discovered a few things:

1.) Sometimes a specific player will lose the effect, and can not benefit from the Amp until they either rejoin the server or the server changes maps. This happened 3 times that I'm aware of, maybe more to people who didn't have mics to let me know.

2.) Sometimes the broadcast wave animation will disappear for one team. The device is still working, there's just no animation to help others see the range. The other team remains unaffected. This persists until map change.

3.) It fills our error logs with this:
Code:
C:\Users\Admin\Desktop\addons\sourcemod\scripting\Amplifier.sp::SapperCheckStage1()
L 05/21/2010 - 17:29:30: [SM] Native "GetEdictClassname" reported: Invalid edict (366 - 366)
L 05/21/2010 - 17:29:30: [SM] Displaying call stack trace for plugin "Amplifier.smx":
L 05/21/2010 - 17:29:30: [SM]   [0]  Line 481,

Overall we found this to be a very fun and quite balanced device (once people developed strategies for taking it down). It doesn't seem to be as reliable as it should be though. Perhaps future updates can solve this.
MisterNine is offline
Eggman
Senior Member
Join Date: Jan 2010
Old 05-22-2010 , 07:28   Re: [TF2] The Amplifier
Reply With Quote #96

I'll fix MisterNine's bug about GetEdictClassname.
And many thx to naris for fix warnings.
---
add:
Quote:
Originally Posted by 1st post
1.0.2:
-Fixed GetEdictClassname error
-naris, thank you so much for fix warnings.
-Fixed bug when plugin saw not all players
link in 1st post

Last edited by Eggman; 05-22-2010 at 08:25.
Eggman is offline
naris
AlliedModders Donor
Join Date: Dec 2006
Old 05-22-2010 , 21:42   Re: [TF2] The Amplifier
Reply With Quote #97

I have modified this plugin to make it so that it can be configured to apply any condition, use(and regenerate) metal to apply conditions and/or have a percent chance of applying a condition.

It can also be configured to apply adverse conditions, such as slowed, jarated, taunting or on fire to enemies instead of krit or buffed to allies.

I have also added a native interface so it can be called form other plugins. I also modified it so that a player can have more than 1 amplifier, provided that another plugin (such as my remote control/build plugin http://forums.alliedmods.net/showthread.php?p=866626) is used to build a dispenser to be converted.

I have added the following convars:

amplifier_distance (default 200)
Distance the amplifier works.

amplifier_particle (0-1, default 1)
Enable the Buffed Particle.

amplifier_condition (1-22, default 16)
Condition that The amplifier dispenses (11=full crits, 16=mini crits, etc...)

amplifier_percent (0-100, default 100)
Percent chance of the amplifier applying the condition

amplifier_metal (default 5)
Amount of metal to use to apply a condition to a player (per second).

amplifier_regeneration (default 10)
Amount of metal to regenerate per second.

amplifier_max (default 400)
Maximum amount of metal an amplifier can hold.

Here is the native interface:

PHP Code:
/**
 * Assume control of the Amplifier plugin
 *
 * @param plugin_only     Set to 1 to assume complete control of Amplifier.
 * @return                none
 */
native ControlAmplifier(bool:plugin_only=true);

/**
 * Set the sate of the Amplifier flag
 *
 * @param index     Client index
 * @param enable    Set true so player builds an Amplifier instead of a dispenser
 * @param distance  Range of the amplifier (-1.0=use convar)
 * @param condition Condition to set players within range of the amplifier (-1=use convar)
 * @param percent   Percent (0-100) chance of applying the condition (-1=use convar)
 * @return            none
 */
native SetAmplifier(clientbool:enable=trueFloat:distance=-1.0TFCond:condition=TFCond:-1percent=-1);

/**
 * Count how many Amplifiers the client has constructed.
 *
 * @param index     Client index
 * @return            The number of Amplifiers the client has constructed.
 */
native HasAmplifier(client);

/**
 * Converts a dispenser into an Amplifier
 *
 * @param entity    Dispenser Entity to convert.
 * @param client     Client index of the owner.
 * @param distance  Range of the amplifier (-1.0=use convar)
 * @param condition Condition to set players within range of the amplifier (-1=use convar)
 * @param percent   Percent (0-100) chance of applying the condition (-1=use convar)
 * @return            none
 */
native ConvertToAmplifier(entityclientFloat:distance=-1.0TFCond:condition=TFCond:-1percent=-1);

/**
 * Gets called when the amplifier applys a condition to someone
 *
 * @param builder:  The index of the client that built the amplifier.
 * @param client:   The index of the player that is being afected.
 * @param condition The condition beign applied to the client.
 * @return            Plugin_Stop will prevent the client from being affected.
 */
forward Action:OnAmplify(builder,client,TFCond:condition); 
Here is an example of presenting a menu to select what type of amplifier and then using the Remote control plugin to build a dispenser and then converting it to an amplifier:
PHP Code:
WarpInAmplifier(clientamp_level)
{
    if (
m_BuildAvailable)
    {
            new 
Handle:menu=CreateMenu(Amplifier_Selected);
            
SetMenuTitle(menu,"[SC] Please choose Amplifier type:");

            new 
count HasAmplifier(client);
            
AddMenuItem(menu,"0","Slow Amplifier", (count amp_level && amp_level >= 3) ? ITEMDRAW_DEFAULT ITEMDRAW_DISABLED);
            
AddMenuItem(menu,"1","Jar Amplifier", (count amp_level && amp_level >= 2) ? ITEMDRAW_DEFAULT ITEMDRAW_DISABLED);
            
AddMenuItem(menu,"2","Fire Amplifier", (count amp_level && amp_level >= 4) ? ITEMDRAW_DEFAULT ITEMDRAW_DISABLED);
            
AddMenuItem(menu,"3","Taunt Amplifier", (count amp_level && amp_level >= 4) ? ITEMDRAW_DEFAULT ITEMDRAW_DISABLED);
            
AddMenuItem(menu,"4","Undisguising Amplifier", (count amp_level && amp_level >= 4) ? ITEMDRAW_DEFAULT ITEMDRAW_DISABLED);
            
AddMenuItem(menu,"5","Decloaking Amplifier", (count amp_level && amp_level >= 4) ? ITEMDRAW_DEFAULT ITEMDRAW_DISABLED);
            
AddMenuItem(menu,"6","Buff Amplifier", (count amp_level) ? ITEMDRAW_DEFAULT ITEMDRAW_DISABLED);
            
AddMenuItem(menu,"7","Krit Amplifier", (count amp_level && amp_level >= 3) ? ITEMDRAW_DEFAULT ITEMDRAW_DISABLED);
            
AddMenuItem(menu,"8","Uber Amplifier", (count amp_level && amp_level >= 4) ? ITEMDRAW_DEFAULT ITEMDRAW_DISABLED);
            
AddMenuItem(menu,"9","Destroy Structure", (count 0) ? ITEMDRAW_DEFAULT ITEMDRAW_DISABLED);
            
DisplayMenu(menu,client,MENU_TIME_FOREVER);
        }
}

public 
Amplifier_Selected(Handle:menu,MenuAction:action,client,selection)
{
    static const 
String:typeName[] = { "Slow""Jar""Fire""Taunt""Undisguising",
                                       
"Decloaking""Buff""Krit""Uber" };

    static const 
TFCond:condition[] = { TFCond_Slowed,
                                        
TFCond_Jarated,
                                        
TFCond_OnFire,
                                        
TFCond_Taunting,
                                        
TFCond_Disguised,
                                        
TFCond_Cloaked,
                                        
TFCond_Buffed,
                                        
TFCond_Kritzkrieged,
                                        
TFCond_Ubercharged
                                      
};

    if (
action == MenuAction_Select)
    {
            
decl String:SelectionInfo[12];
            
GetMenuItem(menu,selection,SelectionInfo,sizeof(SelectionInfo));

            new 
item StringToInt(SelectionInfo);
            if (
item == 9)
            {
                
DestroyBuildingMenu(client);
            }
            else
            {
                    new 
object BuildObject(clientTFObjectType_Dispenser1falsetrue, .check=false);
                    if (
m_AmplifierAvailable)
                    {
                        new 
Float:rangepercent;
                        new 
level GetUpgradeLevel(client,raceID,amplifierID);
                        switch (
item)
                        {
                            case 
0// Slow
                            
{
                                
range 150.0 + (20.0*float(level));
                                
percent level 25;
                            }
                            case 
3// Taunt
                            
{
                                
range 100.0 + (20.0*float(level));
                                
percent level 5;
                            }
                            case 
4,5// Undisguise, Decloak
                            
{
                                
range 150.0 + (20.0*float(level));
                                
percent level 5;
                            }
                            case 
6// Buff
                            
{
                                
range 150.0 + (50.0*float(level));
                                
percent level 25;
                            }
                            case 
7,8// Krit, Uber
                            
{
                                
range 150.0 + (30.0*float(level));
                                
percent level 15;
                            }
                            default: 
// Jar, Fire
                            
{
                                
range 150.0 + (50.0*float(level));
                                
percent level 25;
                            }
                        }
                        
ConvertToAmplifier(objectclientrangecondition[item], percent);
                    }

            }
    }

Updated for new conditions and to change the waves yellow for conditions that affect enemies instead of allies
Attached Files
File Type: sp Get Plugin or Get Source (Amplifier.sp - 215 views - 28.4 KB)
File Type: inc Amplifier.inc (2.5 KB, 267 views)
File Type: inc remote.inc (11.3 KB, 197 views)
File Type: sp Get Plugin or Get Source (remote.sp - 260 views - 85.1 KB)

Last edited by naris; 06-10-2010 at 00:54.
naris is offline
Eggman
Senior Member
Join Date: Jan 2010
Old 05-23-2010 , 02:03   Re: [TF2] The Amplifier
Reply With Quote #98

Great...and hard to understand...
I can't understand what is remore plugin...and why engineer can't regenerate AMP's metal...and why default amplifier_condition is 16, not 11 (Idea is AMP is CRIT dispenser, not MINI-crit)
Quote:
#define ME 2048
<...>
new bool:AmplifierOn[ME]=false;
AmplifierOn for 2048 players o_0
And amp's waves is faint

And I haven't linux server, you think it working on that without bugs?
Quote:
#tryinclude "ztf2grab"
What is this?

Last edited by Eggman; 05-23-2010 at 03:05.
Eggman is offline
MisterNine
Member
Join Date: Jan 2010
Old 05-23-2010 , 07:01   Re: [TF2] The Amplifier
Reply With Quote #99

Eggman thank you for fixing the problems I listed. The plugin worked great today.

Thank you again for all of your hard work on this as well as any others who helped.
MisterNine is offline
Sreaper
髪を用心
Join Date: Nov 2009
Old 05-23-2010 , 15:02   Re: [TF2] The Amplifier
Reply With Quote #100

Quote:
#tryinclude "ztf2grab"
What is this?
That's from this topic,

http://forums.alliedmods.net/showthread.php?p=866626
Sreaper 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 18:35.


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