Senior Member
|
07-15-2016
, 12:55
[TF2] Custom Weapons 3 (Beta 2)
|
#1
|
Wanting new weapons in TF2? Valve not doing it? Take matters into your own hands with Custom Weapons 3! Based on the Custom Weapons 2 plugin by MasterOfTheXP, Custom Weapons 3 has a brand new menu system and the ability for servers to make shields and wearables!
Unlike Custom Weapons 2, however, Custom Weapons 3 uses a module-based system.
"What is that supposed to mean?"
Well, what that means is that if you want to contribute to Custom Weapons 3, a lot of the plugin is exposed via forwards in the .inc file. It also means that if a server owner finds a module that causes lag, it can be removed or replaced by a more optimized module.
"How do I know what to insta..."
Shhhh... I was about to get to that. In the attachments of this post, you will see something called "CW3 Starter Kit.zip". If you're setting up a server, the starter kit has everything you need to get it going, just copy the plugins folder into your servers sourcemod/plugins folder. There are a few modules in the scripting folder, but the default modules do mostly the same job. cw2legacy is only to be used if you have issues getting your CW2 server working with the split CW2 modules.
COMMANDS AND CVARS
Spoiler
Any player can equip a custom weapon by typing /c, /cus, /custom, !c, !cus, or !custom in the chat.
Admin commands- sm_cw3_addattribute <client> <slot> <"attribute name"> <"value"> <"plugin"> - Adds a custom cw3 attribute onto any weapon. Requires cw3-attributes
- sm_custom_addattribute <client> <slot> <"attribute name"> <"value"> <"plugin"> - Adds a custom cw2 attribute onto any weapon. Requires cw2attributes
- /c reload in chat or sm_c reload in client console (server console will be fixed soon) - Reloads CW3 and all the modules.
Cvars- sm_cw3_enable (1/0, def. 1) Enables the plugin, of course! Set to 0 to remove all active custom weapons.
- sm_cw3_onlyinspawn (1/0, def. 1) Only allow /custom to be used inside of a spawn room.
- sm_cw3_arena_time (def. 20) Time, in seconds, to allow /custom after spawning in Arena.
- sm_cw3_bots (def. 0.15) Percent chance, per slot, that bots will equip a random custom weapon.
- sm_cw3_menu (1/0, def. 1) Clients are allowed to say /custom to equip weapons manually. Set to 0 to disable manual weapon selection without disabling the entire plugin.
- sm_cw3_sethealth (1/0, def. 1) When a custom weapon is equipped, the user's health will be set to their maximum.
- sm_cw3_onlyteam (def. 0) If non-zero, custom weapons can only be equipped by one team; 2 = RED, 3 = BLU.
WHAT EACH OFFICIAL MODULE DOES
Spoiler
- cw2attributes
- This provides backwards compatibility with Custom Weapons 2 attribute plugins. This will spam errors if an attribute is applied to a wearable or shield.
- To add an attribute, put a block in your weapon config titled "attributes". Inside there, put blocks with the names of the attributes you want to apply, one attribute per block. Inside those blocks, insert two keys titled "plugin" and "value". The value for "plugin" is the name of the plugin the attribute is from. The value for "value" is the value of the attribute.
- cw2legacy
- This plugin basically replicates Custom Weapons 2's functionality. This can be used to guarantee compatibility with an old Custom Weapons 2 server.
- cw2model-application
- Allows custom models to be added to a weapon.
- Due to Valve making a change a few years ago, your weapon will be invisible to other players. There is no way to fix this. If you know a workaround, DO NOT POST IT HERE.
- For a custom viewmodel, insert a block into your weapon config titled "viewmodel". Inside that block, put a key titled "modelname". The value of "modelname" is the location of the model to display.
- For a custom worldmodel, insert a block into your weapon config titled "worldmodel". Inside that block, put a key titled "modelname". The value of "modelname" is the location of the model to display. This will be invisible to other players. There is no fix.
- cw2sounds
- Allows custom sounds to be played for various weapon events.
- To use this, make a block titled "sound" and inside that block, put a block titled "player" for every sound you want to replace. Inside each of those blocks, put a "find" and "replace" key. The value for "find" is the sound you want to replace, and the value for "replace" is the sound to play instead.
- cw3-attributes
- This allows vanilla and new attributes to be applied to weapons.
- To use attributes from plugins build on cw3-attributes, put a block titled "cw3_attributes" in your weapon config.
- You can put "while active" "1" in an attribute block to tell an attribute plugin to make the attribute only work while the weapon is out. Bear in mind that this is not law, an attribute plugin can ignore this if they wish.
- Other than that, the parameters are the same as cw2attributes.
- cw3model-application
- This does essentially the same thing as the cw2model-application module, but saves one entity per worldmodel. If you have server crashes due to a lot of edicts, give this a shot!
WEAPON CONFIG PARAMETER LIST/HOW TO MAKE A WEAPON CONFIG
Spoiler
Creating a new custom weapon is plain easy. Simply duplicate a custom weapon's config file, and fill out its info with your own. - The weapon's name goes right at the top, in "quotes".
- "classes" is the array of player classes the weapon should be available for; the number next to each class is the weapon slot (0 = Primary, 1 = Secondary, 2 = Melee)
- "baseclass" is the classname of the weapon, without "tf_weapon_". For a shield put "wearable_demoshield", and for a wearable (such as boots or a backpack) put "wearable".
- "baseindex" is the item index of the base weapon, see above classname link. If unsure, stick within the 0-30s.
- If it uses ammo (i.e. most non-melee weapons) it should have "mag" and "ammo" keys with the intended starting ammo.
- "logname" will be displayed in client consoles when a kill is made with the weapon. Not currently implemented.
- "killicon", also not implemented yet, will be able to change the weapon's icon in the kill feed.
- "description" is the stat list that players will see when selecting the weapon. \n = Newline. "\n \n" will skip an entire line.
- "nobots", if set to 1, will prevent bots from randomly equipping this weapon.
- "flag" or "flags" will restrict the weapon to only be usable by users with the provided admin flag(s).
- "replace"; Requires cw2legacy module, will be split into its own module fairly soon. This is a list or item indexes, each separated by a space, which will be replaced by this weapon.
- "sound"; Requires cw2legacy or cw2sounds module. Each sound has:
- A "player" array, which is used to find and replace sounds. You need one "player" array for every sound you want to replace. Each "player" array has:
- "find" is the path to the sound that you want to replace.
- "replace" is the path to the sound you want to replace the "find" key with.
- Do note that currently, you cannot replace sounds on miniguns and sniper rifles. A module will be made fairly soon to remedy this for miniguns.
- "attributes"; Requires cw2attributes or cw2legacy module. Each attribute has:
- An identifier, to set what attribute it is. This will either be a case-sensitive name (Custom Weapons, TF2Attributes) or an attribute index (TF2Items).
- "plugin": Who will provide the attribute's functionality?
- For official Valve attributes, you'll usually want to use TF2Attributes, so put "tf2attributes". A select few attributes require "tf2attributes.int" instead.
- If TF2Attributes doesn't work for said attribute (so far I've only seen "alt-fire is vampire" not work with TF2Att) then try "tf2items" instead, with the identifier being the number beside the attribute's name. (e.g. "move speed penalty" should instead be "54")
- Or, of course, a custom attribute! In which case, "plugin" should be set to the name of the attributes plugin, minus ".smx".
- And of course, a value. Most attributes are multipliers; with "damage bonus/penalty", "2.0" is double (+100%), and "0.5" is halved (-50%). With time-based attributes such as "Reload time increased/decreased", "0.5" is half time (good), whereas "2.0" makes it take twice as long (bad). And some attributes are simply "1.0 = on, 0.0 = off".
- If you're unsure about values, check out a weapon that already has that attribute (Ctrl+F the official weapon's name in tf/scripts/items_game.txt, or just look at the custom weapon's config)
- "cw3_attributes"; the bread-n-butter. Requires cw3-attributes module. Each attribute has:
- An identifier, to set what attribute it is. This will either be a case-sensitive name (Custom Weapons, TF2Attributes) or an attribute index (TF2Items).
- "plugin": Who will provide the attribute's functionality?
- For official Valve attributes, you'll usually want to use TF2Attributes, so put "tf2attributes". A select few attributes require "tf2attributes.int" instead.
- If TF2Attributes doesn't work for said attribute (so far I've only seen "alt-fire is vampire" not work with TF2Att) then try "tf2items" instead, with the identifier being the number beside the attribute's name. (e.g. "move speed penalty" should instead be "54")
- Or, of course, a custom attribute! In which case, "plugin" should be set to the name of the attributes plugin, minus ".smx". The Starter Kit includes "aw2attrib" and "rays-attributes".
- "while active": If this is 1, cw3-attributes will tell the attribute plugin that this attribute should only work while the weapon is out. Do note, that this is a recommendation, and some attributes may intentionally ignore this.
- And of course, a value. Most attributes are multipliers; with "damage bonus/penalty", "2.0" is double (+100%), and "0.5" is halved (-50%). With time-based attributes such as "Reload time increased/decreased", "0.5" is half time (good), whereas "2.0" makes it take twice as long (bad). And some attributes are simply "1.0 = on, 0.0 = off".
- If you're unsure about values, check out a weapon that already has that attribute (Ctrl+F the official weapon's name in tf/scripts/items_game.txt, or just look at the custom weapon's config)
- "viewmodel" and "worldmodel"; Requires either the cw2model-application, cw3model-application or cw2legacy module. For either key, you will need:
- A "modelname" key, which holds the path to the model you with to use. I would HIGHLY recommend you use a c_model for both view and worldmodels, or just for viewmodels if you have to.
- If you need to use a v_model for the viewmodel for some reason, you need to do a bit more work to get the model just right, and it only shows correctly at the FoV you used to set it up, and you can't have it set for multiple FoVs. Here's what you need to do:
- First things first, in the "viewmodel" block, add a line with "attachment" "1" on it.
- Next, create two lines, one with "pos" "" on it and one with "ang" "" on it.
- "pos" is the position of the viewmodel, while "ang" is its rotation. Both of these require three parameters in the quotes, each separated by a space.
- Adjust these values until your viewmodel lines up properly. It's just a matter of trial and error.
- If you don't want to do the above, try to track down a c_model version of the model you are using. If you're getting your model from the Steam Workshop, it should already be a c_model.
EXAMPLE WEAPON CONFIG
Q&A
SIMPLE INSTALLATION
First things first, make sure your server has tf2items and tf2attributes installed. You will also need tf2items.randomizer.txt from this post. (currently outdated! use the attachment in this post!) - Download the CW3 Starter Kit from this post.
- Extract the plugins folder from the .zip file you download into your sourcemod folder.
- You're done! All you have to do now is download or create some custom weapons! (They go into sourcemod/configs/customweapons btw)
MANUAL INSTALLATION
First things first, make sure your server has tf2items installed. For either of the attribute modules, make sure you also have tf2attributes installed. You will also need tf2items.randomizer.txt from this post. (currently outdated! use the attachment in this post!) - Download the latest CW3 Starter Kit from this post.
- Put cw3.smx into your sourcemod/plugins folder.
- Create a cw3 folder in sourcemod/plugins
- Inside that folder, create a folder named modules
- Inside that folder, place any modules you want to use.
- Inside the cw3 folder, create a folder named attributes
- Inside that folder, place any attribute plugins that run on cw3.
- Inside your sourcemod/configs folder, create a folder called cutsomweapons
- Inside that folder, place any weapon configs you have, or create your own!
- Place tf2items.randomizer.txt into your sourcemod/gamedata folder.
- (cw2attributes and cw2legacy users only) Inside your sourcemod/plugins folder, create a folder called customweaponstf
- Inside that folder, place any attribute plugins that are built on the CW2 base.
- You're done! All you have to do now is download or create some custom weapons!
ABOUT INVISIBLE WEAPONS
If weapon models are invisible to other people on your server, that is not a bug. Valve disabled visible weapons a few years ago. DO NOT POST A FIX HERE! IT IS BANNED ON ALLIEDMODS!
(FREE) DLC
You need weapons and modules to use CW3, so why not grab some of these? - Weapons
- Modules
- No unofficial modules posted (yet!)
- Attributes
HOTFIXES
CHANGELOG
KNOWN BUGS
Looking for a server? Come check out Custom TF2 Weapons, the officially supported Custom Weapons 3 server!
VIDEOS
__________________
Last edited by Theray070696; 11-10-2016 at 13:01.
Reason: Added known bugs section and explained the /c reload command a bit better
|
|