Raised This Month: $ Target: $400
 0% 

Changing Weapon Attributes


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Disrupted_Hunter
Member
Join Date: Apr 2012
Old 06-20-2014 , 16:43   Changing Weapon Attributes
Reply With Quote #1

I'd like to change some of the weapon attributes back to what they originally were before the love and war update, but I'm not sure how to go about this. I was told I could use tf2items to nullify the attributes it got and add the old ones back, but I have no idea how to go about this. Can someone explain how I would revert it to the old attributes on my server, like say the Axtinguisher for instance I would like it to go back to normal. I'd also like this to be server wide.

Disrupted_Hunter is offline
MasterOfTheXP
Veteran Member
Join Date: Aug 2011
Location: Cloudbank
Old 06-20-2014 , 17:17   Re: Changing Weapon Attributes
Reply With Quote #2

This should work for the Axtinguisher to start off, requires TF2Attributes (a much cleaner way to set attributes, which usually works just as well as TF2Items):
PHP Code:
#include <tf2items>
#include <tf2attributes>

public TF2Items_OnGiveNamedItem_Post(clientString:classname[], indexlevelqualityentity)
{
    switch (
index)
    {
        case 
384571000// Axtinguisher item indexes
        
{
            
TF2Attrib_SetByName(entity"axtinguisher properties"0.0); // Remove its new mechanic
            
TF2Attrib_SetByName(entity"crit vs burning players"1.0); // Add this one back in
        
}
    }

Keep in mind that you cannot remove "schema attributes" (attributes that come with the item) using TF2Attributes, so you need to set them to 0.0 (or 1.0, if they are a percentage) instead. But in 99% of cases, it will work.

(Custom Weapons 2: The Lazy Update still coming soon, which will basically be this in config form instead of plugin-just-to-do-this form)
Attached Files
File Type: smx axtinguisher.smx (2.8 KB, 180 views)
File Type: sp Get Plugin or Get Source (axtinguisher.sp - 197 views - 418 Bytes)
__________________
Plugins / My Steam / TF2 Sandbox (plugin beta testing!)

Last edited by MasterOfTheXP; 06-20-2014 at 17:20.
MasterOfTheXP is offline
VoiDeD
AlliedModders Donor
Join Date: Mar 2009
Location: Illinois, USA
Old 06-22-2014 , 01:27   Re: Changing Weapon Attributes
Reply With Quote #3

Quote:
Originally Posted by MasterOfTheXP View Post
Keep in mind that you cannot remove "schema attributes" (attributes that come with the item) using TF2Attributes
m_bOnlyIterateItemViewAttributes exists for a reason.
__________________
VoiDeD is offline
Disrupted_Hunter
Member
Join Date: Apr 2012
Old 06-27-2014 , 12:34   Re: Changing Weapon Attributes
Reply With Quote #4

Would I have to edit anything or just install the plugin you provided? I already have TF2Attributes
Disrupted_Hunter is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 06-27-2014 , 19:26   Re: Changing Weapon Attributes
Reply With Quote #5

Quote:
Originally Posted by MasterOfTheXP View Post
This should work for the Axtinguisher to start off, requires TF2Attributes (a much cleaner way to set attributes, which usually works just as well as TF2Items):
PHP Code:
#include <tf2items>
#include <tf2attributes>

public TF2Items_OnGiveNamedItem_Post(clientString:classname[], indexlevelqualityentity)
{
    switch (
index)
    {
        case 
384571000// Axtinguisher item indexes
        
{
            
TF2Attrib_SetByName(entity"axtinguisher properties"0.0); // Remove its new mechanic
            
TF2Attrib_SetByName(entity"crit vs burning players"1.0); // Add this one back in
        
}
    }

Keep in mind that you cannot remove "schema attributes" (attributes that come with the item) using TF2Attributes, so you need to set them to 0.0 (or 1.0, if they are a percentage) instead. But in 99% of cases, it will work.

(Custom Weapons 2: The Lazy Update still coming soon, which will basically be this in config form instead of plugin-just-to-do-this form)
Or...
You can tell the guy to install TF2Items 1.6.0, edit code so that it gets old attributes back(as tf2items 1.6.0 CAN remove schema attributes) and it doesn't require another plugin.
WildCard65 is offline
Disrupted_Hunter
Member
Join Date: Apr 2012
Old 06-28-2014 , 00:15   Re: Changing Weapon Attributes
Reply With Quote #6

Quote:
Originally Posted by WildCard65 View Post
Or...
You can tell the guy to install TF2Items 1.6.0, edit code so that it gets old attributes back(as tf2items 1.6.0 CAN remove schema attributes) and it doesn't require another plugin.

How would I go about this? What do I put in and where?
Disrupted_Hunter is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 06-28-2014 , 20:03   Re: Changing Weapon Attributes
Reply With Quote #7

Quote:
Originally Posted by Disrupted_Hunter View Post
How would I go about this? What do I put in and where?
Too busy with something myself to do it, but tf2items natives + tf2items 1.6.0 will work.
WildCard65 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 08:29.


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