Raised This Month: $ Target: $400
 0% 

TF2Items_SetClassname defaulting ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CoolJosh3k
AlliedModders Donor
Join Date: Mar 2010
Old 06-07-2013 , 16:55   TF2Items_SetClassname defaulting ?
Reply With Quote #1

If I understand correctly, a string value for TF2Items_SetClassname is required.

Is there some value I can use, so as to automatically use whatever would be correct for a weapon? Can I safely use "" or possibly even omit the command entirely?

Will I have to write extra code, that changes a string variable, based on a weapon index integer passed into my function?
CoolJosh3k is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 06-07-2013 , 17:52   Re: TF2Items_SetClassname defaulting ?
Reply With Quote #2

TF2Items_SetClassname is required for TF2Items_GiveNamedWeapon, but not for the callback. The classname determines the base weapon type while the item definition index determines which model it uses. The Item Definition Indexes list lists both the indexes and the appropriate classname for each weapon. It even includes the correct shotgun and saxxy declarations now (because they're different for each class)!

Fun fact: You can't change the weapon classname or item definition index in the callback; it will just be ignored.

The TF2ItemsInfo plugin may have a method for fetching the classname, but be aware that it won't work on shotguns or all-class weapons.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 06-07-2013 at 18:06.
Powerlord is offline
CoolJosh3k
AlliedModders Donor
Join Date: Mar 2010
Old 06-07-2013 , 18:11   Re: TF2Items_SetClassname defaulting ?
Reply With Quote #3

Thanks for the link.

Looks like I will just pass the appropriate string into my function.
CoolJosh3k is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 06-08-2013 , 10:53   Re: TF2Items_SetClassname defaulting ?
Reply With Quote #4

If the web api has the correct weapon name, my items plugin would return that.. Tough I have not really had much need/use for that yet so have not messed with it.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 06-08-2013 , 13:13   Re: TF2Items_SetClassname defaulting ?
Reply With Quote #5

Quote:
Originally Posted by friagram View Post
If the web api has the correct weapon name, my items plugin would return that.. Tough I have not really had much need/use for that yet so have not messed with it.
My understanding is that tf_weapon_shotgun and saxxy are meta-names and the server does translations from those to the following based on the player class:
  • tf_weapon_shotgun_soldier
  • tf_weapon_shotgun_pyro
  • tf_weapon_shotgun_hwg
  • tf_weapon_shotgun_primary
and
  • tf_weapon_bat
  • tf_weapon_shovel
  • tf_weapon_fireaxe
  • tf_weapon_bottle
  • tf_weapon_fists
  • tf_weapon_wrench
  • tf_weapon_bonesaw
  • tf_weapon_club
  • tf_weapon_knife
respectively.

Edit:

It may also do so for tf_weapon_pistol, it's not clear... there are three classes for pistols in the server files: tf_weapon_pistol, tf_weapon_pistol_scout, and tf_weapon_handgun_scout_secondary.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 06-08-2013 at 13:16.
Powerlord is offline
CoolJosh3k
AlliedModders Donor
Join Date: Mar 2010
Old 06-08-2013 , 16:15   Re: TF2Items_SetClassname defaulting ?
Reply With Quote #6

Ah, so I could use the "saxxy" definition and it should be treated as the appropriate datamap entry. Thanks for the tip.
CoolJosh3k is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 06-08-2013 , 18:39   Re: TF2Items_SetClassname defaulting ?
Reply With Quote #7

Quote:
Originally Posted by CoolJosh3k View Post
Ah, so I could use the "saxxy" definition and it should be treated as the appropriate datamap entry. Thanks for the tip.
Well, no, the problem is that using "saxxy" doesn't work. Which is why you need to replace it with the appropriate class-specific classname from the list above.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
CoolJosh3k
AlliedModders Donor
Join Date: Mar 2010
Old 06-08-2013 , 19:35   Re: TF2Items_SetClassname defaulting ?
Reply With Quote #8

ah, okay.

Might as well mention, but the "tf_wearable" for the demo booties, causes a crash. Not entirely sure if this is a bug.
CoolJosh3k 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 21:00.


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