Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Creating custom weapons - basics: Difference between revisions

From TF2 Classified Wiki
No edit summary
No edit summary
Line 113: Line 113:


== Attributes ==
== Attributes ==
=== Adding / adjusting item attributes ===
As mentioned above, the Custom Pistol has two attributes: a clip size bonus and a damage penalty, which gives it a clip size of 24 and a base damage of 10. It's a bit boring, so how about we spice things up a bit?
As mentioned above, the Custom Pistol has two attributes: a clip size bonus and a damage penalty, which gives it a clip size of 24 and a base damage of 10. It's a bit boring, so how about we spice things up a bit?


Line 124: Line 125:
[[File:example_07_backpack.png]]
[[File:example_07_backpack.png]]


 
=== Making custom attributes ===
Oh dear. It seems the {{code|"can headshot"}} attribute lacks a description string, and is therefore hidden. This, of course, isn't ideal for stat clarity, so how exactly do we go about fixing this?
Oh dear. It seems the {{code|"can headshot"}} attribute lacks a description string, and is therefore hidden. This, of course, isn't ideal for stat clarity, so how exactly do we go about fixing this?


Line 132: Line 133:




In your {{code|preset=3|"attributes"}} parameter (the one with the same indentation as {{code|preset=3|"items"}} and {{code|preset=3|"prefabs"}} - I know, it's confusing), copy the above attribute. This is an exact copy of the {{code|"can headshot"}} attribute with 3 key differences: the ID is different to avoid clashing with the original; the {{code|"name"}} is different for the same reason; and, most importantly, a {{code|"description_string"}} parameter has been added. This parameter is responsible for the coloured text displayed in an item's description. Here, it's been set to the plaintext "Crits on headshot"
In your {{code|preset=3|"attributes"}} parameter (the one with the same indentation as {{code|preset=3|"items"}} and {{code|preset=3|"prefabs"}} - I know, it's confusing), copy the above attribute. This is a copy of the {{code|"can headshot"}} attribute that's been simplified for this tutorial.
 
The {{code|"description_string"}} parameter is responsible for the stats displayed in an item's description. Here, it's been set to the plaintext "Crits on headshot", which means that it won't be affected by language. Thankfully, in this instance, there's a suitable localised string that can be used instead to ensure that it's understandable to a wider range of people.
 
By setting the value to '''#Attrib_RevolverUseHitLocations''' (the localised string used by the [[tf:Ambassador|Ambassador]]'s headshot attribute), the same text will be displayed, but will now also be localised to the user's language.
 
After replacing the Custom Pistol's {{code|"can headshot"}} attribute with the newly created {{code|"can headshot VISIBLE"}}, here's how it should look in game:
 
[[File:example_08_backpack.png]]
 
 
Now we're getting somewhere! There's still a couple of issues that we need to fix though, so let's go through how to do that.


== Changing the model(s) ==
== Changing the model(s) ==