Creating custom weapons - basics: Difference between revisions
From TF2 Classified Wiki
More actions
mNo edit summary |
No edit summary |
||
| Line 103: | Line 103: | ||
=== Example === | === Example === | ||
Below is an example item entry for a custom | Below is an example item entry for a custom [[Pistol]] with a clip size bonus, a damage penalty and the [[tf:Winger|Winger]]'s fire sounds. Copy it and try modifying it to get a feel for making items. If you're looking for models and soundscripts, try using [https://developer.valvesoftware.com/wiki/Half-Life_Model_Viewer%2B%2B HLMV++] and/or [https://developer.valvesoftware.com/wiki/Hammer%2B%2B Hammer ++], or look at item entries in TF2 and TF2C's item schemas. | ||
[[File:example_04_custompistol.png]] | [[File:example_04_custompistol.png]] | ||
| Line 112: | Line 112: | ||
[[File:example_04_backpack.png]] | [[File:example_04_backpack.png]] | ||
== 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? | |||
[[File:example_07_canheadshot.png]] | |||
Now, the Custom Pistol instead has a damage bonus and a clip size penalty, resulting in 20 base damage and a clip size of 6. More importantly though, the {{code|"can headshot"}} attribute has given it the ability to deal crits on headshot. Pretty cool, eh? | |||
Let's see how the description looks in game: | |||
[[File:example_07_backpack.png]] | |||
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? | |||
Well, remember the {{code|preset=3|"attributes"}} explained [[Creating custom weapons#Explanation|here]]? | |||
== Changing the model(s) == | |||
What's that? You want to change the model too? Well, with the base selection, there's only one that works with {{code|preset=3|"attach_to_hands" "2"}} - the Pistol model that we're currently using. However, what about TF2's c_models? | What's that? You want to change the model too? Well, with the base selection, there's only one that works with {{code|preset=3|"attach_to_hands" "2"}} - the Pistol model that we're currently using. However, what about TF2's c_models? | ||
| Line 125: | Line 142: | ||
You might've noticed that the Engineer was added to {{code|preset=3|"used_by_classes"}}. Due to the way c_models work, you don't need to set different models for each class for the animations to work properly | You might've noticed that the Engineer was added to {{code|preset=3|"used_by_classes"}}. Due to the way c_models work, you don't need to set different models for each class for the animations to work properly. However, v_models have the animations baked into the models themselves, so how do you get them to change between classes? | ||
The answer lies with the {{code|preset=3|"model_player_per_class"}} parameter. | The answer lies with the {{code|preset=3|"model_player_per_class"}} parameter. | ||
| Line 132: | Line 149: | ||
By adding this to the first version of the Custom Pistol, you can change the v_model used by each class, allowing you to have the weapon on both Scout and Engineer without making them share animations. | By adding this to the first version of the Custom Pistol, you can change the v_model used by each class, allowing you to have the weapon on both Scout and Engineer without making them share animations. | ||
== Testing the weapon == | == Testing the weapon == | ||