Raised This Month: $32 Target: $400
 8% 

Edit tags on weapons


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Psyphil
Junior Member
Join Date: Sep 2015
Old 09-29-2015 , 10:57   Edit tags on weapons
Reply With Quote #1

Sorry for 2 threads in a row

Is there anyway to edit the tags of a weapon?

Looking at http://git.optf2.com/schema-tracking...=teamfortress2 weapons have tags like can_deal_damage and can_headshot I wonder if TF2items can help me edit those somehow?

Here's the code of The Ambassador as an example of tags:
Code:
		"weapon_ambassador"
		{
			"item_class"	"tf_weapon_revolver"
			"craft_class"	"weapon"
			"craft_material_type"	"weapon"
			"capabilities"
			{
				"nameable"		"1"
				"can_gift_wrap" 	"1"
			}
			"tags"
			{
				"can_deal_damage"		"1"
				"can_headshot"			"1"
				"can_deal_critical_damage"	"1"
				"can_deal_mvm_penetration_damage"	"1"
				"can_deal_long_distance_damage"	"1"
			}
			"show_in_armory"	"1"
			"item_type_name"	"#TF_Weapon_Revolver"
			"item_name"	"#TF_Unique_Achievement_Revolver"
			"item_slot"	"secondary"
			"item_quality"	"unique"
			"propername"	"1"
			"item_logname"	"ambassador"
			"item_iconname"	"ambassador"
			"min_ilevel"	"5"
			"max_ilevel"	"5"
			"image_inventory"	"backpack/weapons/c_models/c_ambassador/parts/c_ambassador_opt"
			"image_inventory_size_w"		"128"
			"image_inventory_size_h"		"82"
			"model_player"	"models/weapons/c_models/c_ambassador/c_ambassador.mdl"
			"attach_to_hands" "1"
			"used_by_classes"
			{
				"spy"	"1"
			}
			"attributes"
			{
				"revolver use hit locations"
				{
					"attribute_class"	"set_weapon_mode"
					"value"	"1"
				}
				"damage penalty"
				{
					"attribute_class"	"mult_dmg"
					"value" "0.85"
				}
				"fire rate penalty"
				{
					"attribute_class"	"mult_postfiredelay"
					"value"	"1.2"
				}
				"crit mod disabled"
				{
					"attribute_class"	"mult_crit_chance"
					"value"	"0"
				}
			}
			"visuals"
			{
				"sound_single_shot" "Weapon_Ambassador.Single"
				"sound_burst" "Weapon_Ambassador.SingleCrit"
			}
			"mouse_pressed_sound"	"ui/item_light_gun_pickup.wav"
			"drop_sound"		"ui/item_light_gun_drop.wav"
		}
Psyphil is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 09-29-2015 , 11:33   Re: Edit tags on weapons
Reply With Quote #2

There's no point to it. "tags" is there for the central item server as it controls which strange parts can be assigned to the Strange version of a weapon.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Psyphil
Junior Member
Join Date: Sep 2015
Old 09-29-2015 , 12:36   Re: Edit tags on weapons
Reply With Quote #3

So how would one go about in making a weapon crit on headshots then?

Only such attribute is the one making The Ambassador headshot and it only works on revolvers.
Psyphil is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 09-29-2015 , 13:23   Re: Edit tags on weapons
Reply With Quote #4

Quote:
Originally Posted by Psyphil View Post
So how would one go about in making a weapon crit on headshots then?

Only such attribute is the one making The Ambassador headshot and it only works on revolvers.
You realize that tags and attributes are two different things, right?

The Ambassador has an item attribute named "revolver use hit locations" (item attribute 51) that causes it to headshot.

However, I'm not sure if it works on weapons that aren't revolvers.

Edit: In fact, I'm sure it won't as it's an attribute change type of "set_weapon_mode", which is used by a wide variety of weapons to change their modes. The hidden (and thus generic) version of this attribute is named "lunchbox adds minicrits" and is on a wide variety of weapons, such as the Ubersaw and Buffalo Steak Sandvich (which is where it got its name).
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 09-29-2015 at 13:28.
Powerlord is offline
Psyphil
Junior Member
Join Date: Sep 2015
Old 09-29-2015 , 13:27   Re: Edit tags on weapons
Reply With Quote #5

You just quoted me saying that the attribute The Ambassador doesn't work on revolvers.

Yes I know the difference between attributes and tags, yes I know about the attribute I told you about, I asked if I could change the tags because I didn't find a way via attributes. Please do not take me for an idiot just because I'm asking questions.
Psyphil is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 09-29-2015 , 15:04   Re: Edit tags on weapons
Reply With Quote #6

Powerlord's post has the attitude it has because you've done the classic XY problem - which is extremely frustrating for people trying to help others for free in their spare time.

You want to make a weapon crit on headshots, so you asked about changing weapon tags.

Even if your question was answered satisfactorily, you still wouldn't have been able to do what you wanted as the tags have nothing to do with weapon functionality - they're just metadata.
__________________
asherkin is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 09-29-2015 , 15:16   Re: Edit tags on weapons
Reply With Quote #7

Quote:
Originally Posted by asherkin View Post
Powerlord's post has the attitude it has because you've done the classic XY problem - which is extremely frustrating for people trying to help others for free in their spare time.

You want to make a weapon crit on headshots, so you asked about changing weapon tags.

Even if your question was answered satisfactorily, you still wouldn't have been able to do what you wanted as the tags have nothing to do with weapon functionality - they're just metadata.
Yes that... definitely not because I wasn't paying enough attention to note he'd already mentioned it or because writing docs for other developers on how to do basic operations in TFS is sapping my brainpower.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 09-29-2015 at 15:17.
Powerlord is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 09-29-2015 , 15:25   Re: Edit tags on weapons
Reply With Quote #8

Quote:
Originally Posted by Powerlord View Post
writing docs for other developers on how to do basic operations in TFS is sapping my brainpower.
Throw them off the building right after the TFS server.
__________________
asherkin is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 09-29-2015 , 16:43   Re: Edit tags on weapons
Reply With Quote #9

Quote:
Originally Posted by asherkin View Post
Throw them off the building right after the TFS server.
Wish I could.

Somehow, despite being a Java Web Developer and not a sysadmin, I got tasked with setting everything up for the mandatory SVN to TFS conversion, including writing the materials to teach the Java and Oracle devs the basics of using TFS. Despite having never used TFS for code stuff prior to today.

Well, everything except for the actual import from SVN to TFS which actually is being done by a sysadmin.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Psyphil
Junior Member
Join Date: Sep 2015
Old 09-29-2015 , 18:19   Re: Edit tags on weapons
Reply With Quote #10

Lol

You could assume I asked about tags because I wanted to know about headshots.

But I asked about tags and THEN about headshots after getting a good answer on the first question.
Psyphil 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 00:45.


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