FlaminSarge / tf2attributes

TF2Attributes SourceMod plugin
49 stars 43 forks source link

Possibility of removing static attribs #36

Open TheBluekr opened 5 years ago

TheBluekr commented 5 years ago

Title explains it. Maybe it is an idea to add a native to remove static attributes from a weapon/client. Currently there's a native to get static attributes but support ends there. Attempting to remove the attribute using TF2Attrib_RemoveByDefIndex or TF2Attrib_RemoveByName natives doesn't work, haven't tested TF2Attrib_RemoveAll yet.

FlaminSarge commented 5 years ago

Static attributes exist on the item definition rather than on any given item. I think you can only disable static attributes entirely, not individually. TF2Items has a flag for that when creating items, but existing items use whatever property they spawned with (I think it's a netprop).

TheBluekr commented 5 years ago

You mean the "PRESERVE_ATTRIBUTES" flag? I've tried overriding the weapon handle when "TF2Items_OnGiveNamedItem" gets called while not preserving the attributes yet it persists. I haven't tried the netprop part though. (Did try setting attribute 868 "crit_dmg_falloff" to 0 using tf2items_manager on Ambassador for example.)

FlaminSarge commented 5 years ago

You should be able to override any static attributes using instance attributes (SetByName/etc) but I don't remember if that combines or overrides (e.g. if you need -1 or 0)