View Single Post
nosoop
Veteran Member
Join Date: Aug 2014
Old 02-14-2021 , 03:04   Re: [TF2] Custom Attributes
Reply With Quote #6

Quote:
Originally Posted by LeAlex14 View Post
I'll try that thanks! Also, I can explain you what I do, so I code a plugin for mvm call wave manager, with this plugin, client can attach condition/models/sounds/custom attributes on a bot. So, I use TF2CustAttr_SetString when the bot wasn't on the spawn (ubercharged condition) and for some reason TF2CustAttr_SetString doesn't works, also, how work sm_custattr_add_on ?
In that case, make sure that both you and the game are not removing any existing game attributes on the entity after the custom attributes are applied. They're cleared after the player_spawn and post_inventory_application events are fired, so if you're attempting to attach custom attributes on players in one of those callbacks, you may need to defer applying them via RequestFrame.

It sounds like you're attaching them at a different point in time though, and I'm not entirely familiar with how MvM works at the code level. You may need to tinker a bit more with when you call TF2CustAttr_SetString.

Try using TF2Attrib_SetByName on the player entity at same time - if that also gets cleared then it's definitely getting wiped by the game (or a different plugin); if it doesn't, then my assumptions are out.

The sm_custattr_add_on is an admin command, so you can run sm_custattr_add_on @bots <name> <value> to apply a custom attribute to all bots for testing and seeing when you can apply it. You'll want to verify that the custom attribute is actually applied to your bots using sm_custattr_show <player> as well (the latter only takes a single target though).
__________________
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)

Last edited by nosoop; 02-14-2021 at 03:07.
nosoop is offline