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
mNo edit summary
mNo edit summary
 
(3 intermediate revisions by the same user not shown)
Line 481: Line 481:


= Modifying vanilla weapons =
= Modifying vanilla weapons =
''This section will potentially include a different method for editing vanilla weapons that isn't widely used. In the meantime, please do '''not''' write any current methods here or use this as a guide.''
''This section will potentially include a different method for editing vanilla weapons that isn't widely used. In the meantime, please do '''not''' write any other methods here, and use this method with caution if you plan on editing vanilla weapons.''


By including empty copies of stock weapons in your custom item schema, you can prevent them from disappearing when you edit one of them.
To modify vanilla items, you can include blank item entries in your custom schema with the same IDs as the ones you want to edit. From there, simply add new parameters, and they will merge with the original item's in game. If the same parameter or attribute is in both the vanilla item entry and the copy, then the copy's version will take priority.


Everything added into the empty copies will be combined with the corresponding entries in the vanilla item schema.
When attempting to override a item entry with the {{code|preset=3|baseitem}} parameter, you may have noticed that every other item with it disappears. To counteract this, include a blank copy of any base item you haven't modified in your custom item schema. It should be noted that any base items added to the vanilla item schema in updates must also be added to your custom schema, otherwise they will fail to appear in game. However, this is a rare occurrence, so constant maintenance won't be necessary.


Below is an example {{code|custom_items_game.txt}} file that contains empty copies of every item with the {{code|preset=3|baseitem}} parameter.
Below is an example {{code|custom_items_game.txt}} file that contains empty copies of every item with the {{code|preset=3|baseitem}} parameter as of [[3.0.0]].


<pre>
<pre>
Line 609: Line 609:


= List of useful attributes =
= List of useful attributes =
This is going here temporarily before the table entries from [[List of TF2C item attributes]] are added.
The table below lists generally useful attributes from [[List of TF2C item attributes|this page]].


 
<div style="max-width: 100%; overflow-x: scroll;">
43 – scattergun no reload single (set_scattergun_no_reload_single)
{| class="wikitable sortable grid"
 
! class="header" style="font-size: 16px;background-color: #583a31;color: white;" | ID
128 - provide on active (provide_on_active)
! class="header" style="font-size: 16px;background-color: #583a31;color: white;" | Name
 
! class="header" style="font-size: 16px;background-color: #583a31;color: white;" | Description
280 – override projectile type (override_projectile_type)
! class="header" style="font-size: 16px;background-color: #583a31;color: white;" | Value Type
 
! class="header" style="font-size: 16px;background-color: #583a31;color: white;" | Class
298 – mod ammo per shot (mod_ammo_per_shot)
! class="header" style="font-size: 16px;background-color: #583a31;color: white;" | Notes
 
|-
303 – mod max primary clip override (mod_max_primary_clip_override)
| 43 || scattergun no reload single || Attrib_Scattergun_NoReloadSingle || additive || set_scattergun_no_reload_single || Hidden
 
|-
551 – special taunt (special_taunt)
| 128 || provide on active || When weapon is active || additive || provide_on_active ||
 
|-
674 – class select override vcd ( class_select_override_vcd)
| 280 || override projectile type || || additive || set_scattergun_no_reload_single || Hidden
 
Changes the projectile type of the weapon
675 - custom projectile model (custom_projectile_model)
|-
 
| 298 || mod ammo per shot || Per Shot: -%''s1'' ammo || additive || mod_ammo_per_shot ||
796 – min_viewmodel_offset (min_viewmodel_offset)
|-
 
| 303 || mod max primary clip override ||  || additive || mod_max_primary_clip_override || Hidden
2029 - allowed in medieval mode (allowed_in_medieval_mode)
|-
 
| 551 || special taunt ||  || additive || special_taunt || Hidden
2058 – meter_label (meter_label)
|-
 
| 674 || class select override vcd || Attrib_Class_Select_Override_VCD || additive || class_select_override_vcd || Hidden
5011 - extra wearable bodygroup toggle active (extra_wearable_bodygroup_toggle_active)
|-
 
| 675 || custom projectile model ||  || additive || custom_projectile_model || Hidden
5048 - custom hand viewmodel (custom_hand_viewmodel)
Supports Rockets, Pipes, Stickies and Tranquillizer Darts
 
|-
5129 – mod burstfire (mod_burstfire)
| 796 || min_viewmodel_offset || || additive || min_viewmodel_offset || Hidden
 
Used for "tf_use_min_viewmodels 1" to shift the viewmodel's position
5135 – hidden separator (hidden_separator)
|-
 
| 2029 || allowed in medieval mode ||  ||  || allowed_in_medieval_mode || Hidden
5157 – passive reload holstered (passive_reload_holstered)
|-
 
| 2058 || meter_label ||  ||  || meter_label || Hidden
5194 – hide ammo hud (hide_ammo_hud)
|-
 
| 5011 || extra wearable bodygroup toggle active || || additive || extra_wearable_bodygroup_toggle_active || Hidden
5199 - banned in medieval mode (banned_in_medieval_mode)
|-
 
| 5048 || custom hand viewmodel || || additive || custom_hand_viewmodel ||
5201 - custom disguise sound (custom_disguise_sound)
Hidden <br>
 
Uses a string
5228 - mod ammo per reload (mod_ammo_per_reload)
|-
 
| 5129 || mod burstfire || Sentry Gun turns +%s'''1'''% faster || additive || mod_burstfire || Note: Uses Wrong Localization string
5229 - set reload single (set_reload_single)
|-
 
| 5135 || hidden separator || || || hidden_separator || All attributes in a weapon after this one will be hidden from the tooltip.
5230 - Reload time start (mult_reload_time_start)
|-
 
| 5157 || passive reload holstered || Passively reloads ammo while holstered || additive || passive_reload_holstered ||
5231 - Reload time refill (mult_reload_time_refill)
|-
 
| 5194 || hide ammo hud || || additive || hide_ammo_hud || Hidden
5249 - mod use custom ammo type (mod_use_custom_ammo_type)
|-
 
| 5199 || banned in medieval mode || || additive || banned_in_medieval_mode || Hidden
5252 - set sentry bullet (set_sentry_bullet)
|-       
 
| 5201 || custom disguise sound || || additive || custom_disguise_sound || Hidden
5253 - set sentry rocket (set_sentry_rocket)
|-
 
| 5228 || mod ammo per reload || || additive || mod_ammo_per_reload || Hidden
5254 - weapon exclusive to holiday (weapon_exclusive_to_holiday)
|-
 
| 5229 || set reload single || || additive || set_reload_single ||
5256 - mod projectiles per shot (mod_projectiles_per_shot)
|-
 
| 5230 || Reload time start || || inverted percentage || mult_reload_time_start ||
5263 - mod set banner flag model (mod set banner flag model)
|-
 
| 5231 || Reload time refill || || inverted percentage || mult_reload_time_refill ||
5264 - custom banner sound (custom_banner_sound)
|-
 
| 5249 || mod use custom ammo type || || additive || mod_use_custom_ammo_type ||
5268 - auto jumping (auto_jumping)
Hidden <br>
 
Modes: <br>
5270 - always draw tracer (mod_always_draw_tracer_effect)
1 = Primary Ammo <br>
 
2 = Secondary Ammo <br>
5271 - never draw tracer (mod_never_draw_tracer_effect)
3 = Metal <br>
 
4 = Grenades1 <br>
5272 - duck jumping (duck_jumping)
5 = Grenades2
 
|-
??? - custom_magazine_model
| 5252 || set sentry bullet || || additive || set_sentry_bullet ||
Hidden <br>
Value is the projectile index from "override_projectile_type"
|-
| 5253 || set sentry rocket || || additive || set_sentry_rocket ||
Hidden <br>
Value is the projectile index from "override_projectile_type"
|-
| 5254 || weapon exclusive to holiday || || additive || weapon_exclusive_to_holiday ||
Hidden <br>
Modes: <br>
1 = TF Birthday <br>
2 = Halloween <br>
3 = Christmas <br>
4 = End of the Line <br>
5 = Invasion <br>
6 = Valentines <br>
7 = Pyromania <br>
8 = Full Moon <br>
9 = Halloween OR Full Moon <br>
10 = Halloween OR Full Moon OR Valentines <br>
11 = April Fools <br>
12 = Soldier Day (Rick May Passing) <br>
13 = Summer
|-
| 5256 || mod projectiles per shot || || additive || mod_projectiles_per_shot ||
|-
| 5263 || mod set banner flag model || || additive || mod_set_banner_flag_model || Hidden
|-
| 5264 || custom banner sound || || additive || custom_banner_sound || Hidden
|-
| 5268 || auto jumping || Wearer can automatically jump by holding the jump button || additive || auto_jumping ||
|-
| 5270 || always draw tracer || || additive || mod_always_draw_tracer_effect ||
Hidden <br>
Value is frequency, 1 being always
|-
| 5271 || never draw tracer || || additive || mod_never_draw_tracer_effect || Hidden
|-
| 5272 || duck jumping || Wearer can jump while crouching || additive || duck_jumping ||
|-
| ??? || N/A || N/A || N/A || custom_magazine_model || Requires custom attribute
|}


= See also =
= See also =