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
 
(One intermediate revision 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>