Creating custom weapons - basics: Difference between revisions
From TF2 Classified Wiki
More actions
No edit summary |
mNo edit summary |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 65: | Line 65: | ||
<pre> | <pre> | ||
" | "items_game" | ||
{ | { | ||
"name" "<internal name>" | "items" | ||
{ | |||
"<item id>" | |||
{ | |||
"name" "<internal name>" | |||
"item_name" "<item name>" | |||
"item_type_name" "<item type name>" | |||
"item_quality" "<item name colour>" | |||
"item_logname" "<dev console name>" | |||
"item_iconname" "<icon name>" | |||
"item_class" "<item class>" | |||
"item_slot" "<backpack slot>" | |||
"anim_slot" "<player model and c_model animations>" | |||
"bucket" "<inventory slot override>" | |||
"bucket_position" "<inventory subslot override>" | |||
"model_player" "<view model>" | |||
"model_world" "<world model>" | |||
"image_inventory" "<backpack icon>" | |||
"attach_to_hands" "<view model animation type>" | |||
"used_by_classes" | |||
{ | |||
"<class>" "<backpack slot>" | |||
} | |||
" | "attributes" | ||
{ | |||
"<attribute name>" | |||
{ | |||
"attribute_class" "<attribute class>" | |||
"value" "<value>" | |||
} | |||
} | |||
"static_attrs" | |||
{ | |||
"<attribute class>" "<value>" | |||
} | |||
"visuals" | |||
{ | |||
"<parameter>" "value" | |||
} | |||
"mouse_pressed_sound" "<backpack select sound>" | |||
"drop_sound" "<backpack deselect sound>" | |||
" | |||
} | } | ||
} | } | ||
} | } | ||
</pre> | </pre> | ||
| Line 188: | Line 194: | ||
<pre> | <pre> | ||
" | "items_game" | ||
{ | { | ||
"name" "CUSTOM_PISTOL_TEST" | "items" | ||
{ | |||
"10000" // Custom Pistol | |||
// You can add comments to your item schema with double slashes! | |||
{ | |||
"name" "CUSTOM_PISTOL_TEST" | |||
"item_name" "Custom Pistol" | |||
"item_type_name" "#TF_Weapon_Pistol" | |||
"item_logname" "pistol_test" | |||
"item_iconname" "pistol" | |||
"item_class" "tf_weapon_pistol" | |||
"item_slot" "secondary" | |||
"anim_slot" "secondary" | |||
"model_player" "models/weapons/v_models/v_pistol_scout.mdl" | |||
"model_world" "models/weapons/w_models/w_pistol.mdl" | |||
"image_inventory" "backpack/weapons/w_models/w_pistol" | |||
"attach_to_hands" "1" | |||
"used_by_classes" | |||
{ | |||
"scout" "1" | |||
} | |||
"attributes" | |||
{ | |||
"clip size bonus" | |||
{ | |||
"attribute_class" "mult_clipsize" | |||
"value" "2" | |||
} | |||
"damage penalty" | |||
{ | |||
"attribute_class" "mult_dmg" | |||
"value" "0.67" | |||
} | |||
} | |||
"static_attrs" | |||
{ | |||
"min_viewmodel_offset" "10 0 -10" | |||
} | |||
"visuals" | |||
{ | |||
"sound_single_shot" "Weapon_Winger.Single" | |||
"sound_burst" "Weapon_Winger.SingleCrit" | |||
} | |||
"mouse_pressed_sound" "ui/item_light_gun_pickup.wav" | |||
"drop_sound" "ui/item_light_gun_drop.wav" | |||
" | |||
} | } | ||
} | } | ||
} | } | ||
</pre> | </pre> | ||
| Line 251: | Line 263: | ||
<pre> | <pre> | ||
" | "items_game | ||
{ | { | ||
" | "items" | ||
{ | { | ||
"attribute_class" "mult_dmg" | "<item ID>" | ||
{ | |||
<...> | |||
"attributes" | |||
{ | |||
"damage bonus" | |||
{ | |||
"attribute_class" "mult_dmg" | |||
"value" "1.33" | |||
} | |||
"clip size penalty" | |||
{ | |||
"attribute_class" "mult_clipsize" | |||
"value" "0.5" | |||
} | |||
"can headshot" | |||
{ | |||
"attribute_class" "can_headshot" | |||
"value" "1" | |||
} | |||
} | |||
<...> | |||
} | |||
} | } | ||
} | } | ||
| Line 283: | Line 306: | ||
<pre> | <pre> | ||
" | "items_game" | ||
{ | { | ||
"name" "can headshot VISIBLE" | <...> | ||
"attributes" | |||
{ | |||
"40000" | |||
{ | |||
"name" "can headshot VISIBLE" | |||
"attribute_class" "can_headshot" | |||
"description_format" "value_is_additive" | |||
"stored_as_integer" "1" | |||
"description_string" "#Attrib_RevolverUseHitLocations" | |||
} | |||
} | |||
} | } | ||
</pre> | </pre> | ||
| Line 310: | Line 340: | ||
<pre> | <pre> | ||
" | "items_game" | ||
{ | { | ||
" | "items" | ||
{ | { | ||
"attribute_class" "can_headshot" | "<item ID>" | ||
{ | |||
<...> | |||
"attributes" | |||
{ | |||
"can headshot VISIBLE" | |||
{ | |||
"attribute_class" "can_headshot" | |||
"value" "1" | |||
} | |||
"damage bonus" | |||
{ | |||
"attribute_class" "mult_dmg" | |||
"value" "1.33" | |||
} | |||
"clip size penalty" | |||
{ | |||
"attribute_class" "mult_clipsize" | |||
"value" "0.5" | |||
} | |||
} | |||
<...> | |||
} | |||
} | } | ||
} | } | ||
| Line 338: | Line 379: | ||
<pre> | <pre> | ||
" | "items_game" | ||
{ | { | ||
"name" "can headshot VISIBLE" | <...> | ||
"attributes" | |||
{ | |||
"40000" | |||
{ | |||
"name" "can headshot VISIBLE" | |||
"attribute_class" "can_headshot" | |||
"description_format" "value_is_additive" | |||
"stored_as_integer" "1" | |||
"description_string" "#Attrib_RevolverUseHitLocations" | |||
"effect_type" "positive" | |||
} | |||
} | |||
} | } | ||
</pre> | </pre> | ||
| Line 361: | Line 409: | ||
<pre> | <pre> | ||
"item_logname" "pistol_test" | "items_game" | ||
"item_iconname" "winger" | { | ||
"items" | |||
{ | |||
"<item ID>" | |||
{ | |||
<...> | |||
"item_logname" "pistol_test" | |||
"item_iconname" "winger" | |||
"item_class" "tf_weapon_pistol" | "item_class" "tf_weapon_pistol" | ||
"item_slot" "secondary" | "item_slot" "secondary" | ||
"anim_slot" "secondary" | "anim_slot" "secondary" | ||
"model_player" "models/workshop/weapons/c_models/c_winger_pistol/c_winger_pistol.mdl" | "model_player" "models/workshop/weapons/c_models/c_winger_pistol/c_winger_pistol.mdl" | ||
"image_inventory" "backpack/workshop/weapons/c_models/c_winger_pistol/c_winger_pistol" | "image_inventory" "backpack/workshop/weapons/c_models/c_winger_pistol/c_winger_pistol" | ||
"attach_to_hands" "1" | "attach_to_hands" "1" | ||
"used_by_classes" | "used_by_classes" | ||
{ | { | ||
"scout" "1" | |||
"engineer" "1" | |||
} | |||
<...> | |||
} | |||
} | |||
} | } | ||
</pre> | </pre> | ||
| Line 394: | Line 453: | ||
<pre> | <pre> | ||
" | "items_game" | ||
{ | { | ||
"engineer" "models/weapons/v_models/v_pistol_engineer.mdl" | "items" | ||
{ | |||
"<item ID>" | |||
{ | |||
<...> | |||
"model_player_per_class" | |||
{ | |||
"engineer" "models/weapons/v_models/v_pistol_engineer.mdl" | |||
"scout" "models/weapons/v_models/v_pistol_scout.mdl" | |||
} | |||
<...> | |||
} | |||
} | |||
} | } | ||
</pre> | </pre> | ||