Raised This Month: $ Target: $400
 0% 

[TF2] TF2Attributes (v1.7.2, 2022/09/18)


Post New Thread Reply   
 
Thread Tools Display Modes
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 05-17-2015 , 04:19   Re: [TF2] TF2Attributes (v1.1.1, 08/27/2013)
Reply With Quote #301

Quote:
Originally Posted by WakaFlocka View Post
It's broken https://forums.alliedmods.net/showthread.php?t=227831 are you sure there is no other way?
wat



2013
__________________

Last edited by Chdata; 05-17-2015 at 05:22.
Chdata is offline
vadia111
BANNED
Join Date: Dec 2013
Location: Usa
Old 05-18-2015 , 13:00   Re: [TF2] TF2Attributes (v1.1.1, 08/27/2013)
Reply With Quote #302

It's broken plugin https://forums.alliedmods.net/showthread.php?t=234076


someone can fix ?
vadia111 is offline
Send a message via ICQ to vadia111 Send a message via AIM to vadia111 Send a message via Yahoo to vadia111 Send a message via Skype™ to vadia111
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 05-18-2015 , 14:15   Re: [TF2] TF2Attributes (v1.1.1, 08/27/2013)
Reply With Quote #303

Quote:
Originally Posted by WakaFlocka View Post
give an example i'm not following you?
You're telling me TF2Items is broken because of a bug that appeared two years ago.
__________________
Chdata is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 05-18-2015 , 14:31   Re: [TF2] TF2Attributes (v1.1.1, 08/27/2013)
Reply With Quote #304

Quote:
Originally Posted by Chdata View Post
You're telling me TF2Items is broken because of a bug that appeared two years ago.
It's not strictly a bug.

You CANNOT change the classname of a weapon. Ever. Instead, you have to block the weapon and give the player a new one instead.

I do this in Huntsman Hell, which is why that bug report originally appeared.

Having said that, changing the attributes a weapon has mid-game works perfectly fine... you just can't remove a built-in attribute (you have to set it a second time with its default value instead).
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 05-18-2015 at 14:33.
Powerlord is offline
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 05-19-2015 , 01:39   Re: [TF2] TF2Attributes (v1.1.1, 08/27/2013)
Reply With Quote #305

Does anyone have any quick example on how to add attributes that use integer attributes like "multiple sentries"? The include file confused me insanely.

Also, how am I supposed to use this "address" thing? Whenever I grab the address of an attribute name, and then pass it in another native to get its value, I get an index error.

Lastly, what is this currency thing in the includes and what do they do?

Thanks! (Or if I missed all this data somewhere, link me the page too.)

Last edited by Potato Uno; 05-19-2015 at 01:39. Reason: English
Potato Uno is offline
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 05-19-2015 , 15:50   Re: [TF2] TF2Attributes (v1.1.1, 08/27/2013)
Reply With Quote #306

Quote:
Originally Posted by Powerlord View Post
It's not strictly a bug.

You CANNOT change the classname of a weapon. Ever. Instead, you have to block the weapon and give the player a new one instead.

I do this in Huntsman Hell, which is why that bug report originally appeared.

Having said that, changing the attributes a weapon has mid-game works perfectly fine... you just can't remove a built-in attribute (you have to set it a second time with its default value instead).
From what i recall it is possible to fix by hooking CTFPlayer::ItemsMatch() function and altering return value it gives
This function seems to be doing check whether both CEconItemView * objects match
If they do then it checks replacement weapon's classname whether it matches or not.

If any of those checks fails then weapon is removed which results in spawning without altered weapon. It should happen if you change in TF2Items_OnGiveNamedItem it's classname or item definition index.

Either way whether you detour CTFPLayer::ItemsMatch or do it powerlord's way it won't make a difference.
__________________
...

Last edited by Oshizu; 05-19-2015 at 15:52.
Oshizu is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 05-20-2015 , 18:05   Re: [TF2] TF2Attributes (v1.1.1, 08/27/2013)
Reply With Quote #307

Quote:
Originally Posted by Powerlord View Post
It's not strictly a bug.

You CANNOT change the classname of a weapon. Ever. Instead, you have to block the weapon and give the player a new one instead.

I do this in Huntsman Hell, which is why that bug report originally appeared.

Having said that, changing the attributes a weapon has mid-game works perfectly fine... you just can't remove a built-in attribute (you have to set it a second time with its default value instead).
You mean to say changing a weapon's clip/ammo mid-game will automatically update the weapon's clip/ammo?

Also, what about VSH... Hale's fists are tf_weapon_shovel but the item definition index is Heavy's fists. Or was it the other way around? Still, 'most of the time' you cannot change the classname. Well, I guess you could say this is 'mismatching' the classname, I guess you can't change it midgame without just spawning a new weapon.

You can spawn tf_weapon_builder (a weapon engineers cannot switch to) with the item definition index of tf_weapon_pda_build/destroy, and it'll have the item name "Construction PDA" but be unable to be weapon switched too, whereas if you had the classname tf_weapon_pda_x, you'd be able to switch to it (and do nothing).
__________________

Last edited by Chdata; 05-21-2015 at 14:08.
Chdata is offline
FlaminSarge
Veteran Member
Join Date: Jul 2010
Old 05-28-2015 , 14:11   Re: [TF2] TF2Attributes (v1.1.1, 08/27/2013)
Reply With Quote #308

Quote:
Originally Posted by Potato Uno View Post
Does anyone have any quick example on how to add attributes that use integer attributes like "multiple sentries"? The include file confused me insanely.

Also, how am I supposed to use this "address" thing? Whenever I grab the address of an attribute name, and then pass it in another native to get its value, I get an index error.

Lastly, what is this currency thing in the includes and what do they do?

Thanks! (Or if I missed all this data somewhere, link me the page too.)
Attributes that use integer values can be set in the same way as float-valued attributes. However, instead of using float(int_value) (this converts the value, which we don't want) in the native, you merely re-tag the int value as a float (Float:int_value, though I think it's (float)int_value in SM1.7 syntax), so that its value remains the same in integer representation but the native doesn't balk at the tag mismatch.

Quote:
Originally Posted by Chdata View Post
You mean to say changing a weapon's clip/ammo mid-game will automatically update the weapon's clip/ammo?

Also, what about VSH... Hale's fists are tf_weapon_shovel but the item definition index is Heavy's fists. Or was it the other way around? Still, 'most of the time' you cannot change the classname. Well, I guess you could say this is 'mismatching' the classname, I guess you can't change it midgame without just spawning a new weapon.

You can spawn tf_weapon_builder (a weapon engineers cannot switch to) with the item definition index of tf_weapon_pda_build/destroy, and it'll have the item name "Construction PDA" but be unable to be weapon switched too, whereas if you had the classname tf_weapon_pda_x, you'd be able to switch to it (and do nothing).
VSH has tf_weapon_shovel with index 5, and the sole purpose of index 5 is to make the viewmodel just the hands (since the fists don't use a viewmodel). It has the nice side effect of being inspected as "Fists", so there's that too.

Engineers with tf_weapon_builder can switch to it using build # without a PDA.

Changing a weapon's clip midgame will update the max clip but will not cause them to automatically have a full clip. I think you both understand this, but PL's referring to maxclip and Ch's referring to current clip count. Same goes for ammo.

OGNI doesn't allow for swapping classnames out because of what Oshizu said.

@Oshizu nice, sounds like a good idea for an addon extension/plugin for TF2Items_OGNI.

@ChData, remind me every day to update things. It's summer now. I should have time.

@WakaFlocka try using TF2Items_OnGiveNamedItem_Post, getting the item index from that, and then setting the attributes. Don't use post_inventory_application, it's too late (heck, OGNI_Post might be too late too but you never know until you try).
__________________
Bread EOTL GunMettle Invasion Jungle Inferno 64-bit will break everything. Don't even ask.

All plugins: Randomizer/GiveWeapon, ModelManager, etc.
Post in plugin threads with questions.
Steam is for playing games.
You will be fed to javalia otherwise.
Psyduck likes replays.

Last edited by FlaminSarge; 05-28-2015 at 14:14.
FlaminSarge is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 05-29-2015 , 17:18   Re: [TF2] TF2Attributes (v1.1.1, 08/27/2013)
Reply With Quote #309

Quote:
Originally Posted by Chdata View Post
You mean to say changing a weapon's clip/ammo mid-game will automatically update the weapon's clip/ammo?
No, you have to regenerate the player to fix their ammo count. Which is really annoying.

Actually, I think we were discussing this in another thread, but some functions on CTFWeaponBase that could be used to update the ammo count don't work properly on games with CEconItems (i.e. TF2 and CS:GO).

One thing I found out digging through the Source SDK2013 is that ammo counts are exclusively attached to players and not weapons. TF2 adjusts the max reserve ammo that these ammo types store through attributes on weapons. That's why the attributes to adjust primary and secondary ammo are separate attributes.

I *suspect* the ammo pool used is actually tied to the class in TF2 rather than the weapon. However, then you have things like the Shortstop which uses the Scout's pistol ammo pool instead of the scattergun ammo pool.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 05-29-2015 at 17:28.
Powerlord is offline
vadia111
BANNED
Join Date: Dec 2013
Location: Usa
Old 05-30-2015 , 19:25   Re: [TF2] TF2Attributes (v1.1.1, 08/27/2013)
Reply With Quote #310

which is the latest version of tf2 items to download?
someone can put the link for me please
vadia111 is offline
Send a message via ICQ to vadia111 Send a message via AIM to vadia111 Send a message via Yahoo to vadia111 Send a message via Skype™ to vadia111
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 17:42.


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