This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

[TF2] Get non-stock weapon attributes?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TinyDeskEngineer
Junior Member
Join Date: May 2023
Location: Inside your walls
Old 05-10-2023 , 10:24   [TF2] Get non-stock weapon attributes?
Reply With Quote #1

I'm trying to make a plugin out of an idea I had while playing on a private TF2 server, which requires me to get the attributes of any non-stock TF2 weapon, along with attribute values, solely using item definition IDs. Preferably in a format in which it would be relatively simple to give players custom weapons using attributes from the base weapon. Has anyone made a plugin for this purpose before?
TinyDeskEngineer is offline
nosoop
Veteran Member
Join Date: Aug 2014
Old 05-10-2023 , 13:12   Re: [TF2] Get non-stock weapon attributes?
Reply With Quote #2

Both TF2Attributes and Econ Data allow you to get the item's static attributes. Both use the same calls into the game's functionality.

(In case it's not clear, for TF2Econ_GetItemStaticAttributes you can retrieve the value by calling attributeList.Get(index, 1).)

You'll need to take some care and ensure the attribute is one of the normal "runtime" modifiers before applying it to your items, as the client is likely to crash otherwise.
__________________
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)
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 10:04.


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