Valve still not adding new weapons to TF2? No problem. Custom Weapons 2 allows you to create your own weapons and let your players use them.
Once you've installed the plugin and some weapons, all players have to do is say /custom, /cus or /c for the list of custom weapons for that class.
It's somewhat like Advanced Weaponiser, except the creation, modification, and selection of weapons is not limited to a certain group of people; it's up to whoever installs the plugin.
You can create your own weapons with unique stats, and share them with other servers using Custom Weapons 2. Apply any Valve attribute you'd like onto your weapon.
Valve attributes not unique enough? Create your own attributes sub-plugin with ease. Each custom attribute added allows for more and more unique weapons to be created with it!
COMMANDS / CVARS
->
All players can equip custom weapons by saying /custom, /cus, or /c.
Admin commands
custom_addattribute <client> <slot> <"attribute name"> <"value"> <"plugin"> - Adds a custom attribute onto any weapon.
Want your melee weapon to ignite whoever it crits on? custom_addattribute @me 2 "crits ignite" "1" "basic-attributes"
Cvars
sm_customweapons_enable (1/0, def. 1) Enables the plugin, of course! Set to 0 to remove all active custom weapons.
sm_customweapons_onlyinspawn (1/0, def. 1) Only allow /custom to be used inside of a spawn room.
sm_customweapons_arena_time (def. 20) Time, in seconds, to allow /custom after spawning in Arena.
sm_customweapons_bots (def. 0.15) Percent chance, per slot, that bots will equip a random custom weapon.
sm_customweapons_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_customweapons_killwearablesondeath (1/0, def. 1) Removes custom weapon models when the user dies. Recommended unless bad things start happening.
sm_customweapons_sethealth (1/0, def. 1) When a custom weapon is equipped, the user's health will be set to their maximum.
sm_customweapons_onlyteam (def. 0) If non-zero, custom weapons can only be equipped by one team; 2 = RED, 3 = BLU.
HOW TO MAKE CUSTOM WEAPONS
->
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_".
"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.
"attributes"; the bread-n-butter. 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 pack includes "basic-attributes" and "custom-attributes".
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)
To Do: Make a fancy schmancy guide for all that. Make a weapon creator webform.
HOW TO MAKE CUSTOM ATTRIBUTES
->
To be able to make custom attributes, all you need to know are the basics of SourcePawn. That's it! (Also, you need customweaponstf.inc from the bottom of this post)
Take a look at basic-attributes.sp in the Starter Weapons Pack; it's fairly simple, and has some comments here, there, and everywhere to explain things. Think of it as somewhat of a template for attributes plugins.
QUESTIONS N' ANSWERS
->
How is this different from Advanced Weaponiser?
You (who runs the game server) can change around the weapons in whatever ways you'd like. The weapons are always equippable, and not tied to any "master server". Also, this plugin isn't abandoned, private, or what have you.
I gave my custom weapon a model, can other players besides the user see it?
Nope. The player will be able to see it in both first and third person, though.
<weapon name> is overpowered/underpowered! Fix it!
No u! Change its stats, or disable it (after all, that's the point of this plugin!) and perhaps suggest a tweak to its stats once you've done so.
Was there a Custom Weapons 1?
Yes. It was 100% hardcoded, and terrible. Thankfully, it was private.
Why is it called "customweaponstf.smx"?
I actually, for some reason, originally made this for CS:GO; as a proof of concept, and because bot matches were getting a bit stale with CS:GO's plain, realistic weapons.
So, this is the "TF2 edition" of Custom Weapons.
INSTALLATION
Your server needs both TF2Items and TF2Attributes loaded.
1. Install customweaponstf.smx into your sourcemod/plugins/ directory.
2. Install tf2items.randomizer.txt into your sourcemod/gamedata/ directory.
3. Install whatever custom weapons/attributes/packs you'd like. You need at least one custom weapon for this to work, and most likely, that weapon will require an attributes plugin.
4. sm plugins load customweaponstf, or sm plugins reload customweaponstf when you install more.
5. Done!
DLC!
You need custom weapons (which usually require custom attributes) in order to run Custom Weapons. Why not start with these?
Custom model and sound support is in, but isn't the best yet
The menu starts looking weird if a class has more than 7 custom weapons (I think)
Not tested much!
Weapons with non-bonemerged custom viewmodels, like the HL2 weapons, will look different to different viewmodel FoVs.
To do:
Applying custom attributes to official weapons a la TF2Items Manager
The ability to change kill icons and weapon_logclassname
Translation support like FF2's boss descriptions has?
The ability to apply/not apply certain attributes if certain cvars (such as hale_enable) are active
Custom wearables! (e.g. Gunboats, Chargin' Targe)
Auto chat advertisements (optional, obviously)
Downloads for weapons, controlled right from the weapon config; just like FF2 has
UPDATES
->
BETA 2 March 12, 2014
Custom Weapons 2
Added support for Arena
Added 9 natives for other plugins to use
Added 3 more cvars to configure the plugin
Added error message for when there are no custom weapons for the player's class
Added warning message to server console for when there are no custom weapons installed at all
Added simple output for typing "custom" into the server console
Added version cvar (whoops!)
"nobots" "1" may now be placed in weapon configs to prevent bots from equipping them
Fixed weapons that changed maximum health not having health updated upon equip
Fixed being able to equip weapons that players already had equipped
Released the WIP Weapons Pack! Contains a few unbalanced/unfinished weapons. Try 'em, and see if you can get them working/balanced!
Starter Weapons Pack
Hell-Sap
Increased damage bonus to 80% (up from 65%)
Decreased length of both effects (cooldown and rage) to 10 seconds (was 20 seconds)
HL2 Weapons
Annabelle
Reversed self-aimpunch (now recoils upwards instead of downwards)
Custom Attributes
Fixed the effects of "sapper causes rage" never ending (the user would take crits from the victim for the rest of the match)
"fires lasers" now accepts a value, which will set the base damage of the laser (formerly always 25)
Added missing documentation for a few attributes to the top of the .sp
---
This is a beta of Custom Weapons 2. Think twice before adding it to your production server(s). It hasn't been fully tested in actual "combat" servers, and I'd like to get a better idea of what everyone thinks about specific features, weapons, and attributes.
Things might change completely, but I doubt it.
let's see if something's broken this time
Servers could add that if they really wanted, but ultimately, either weapons would need to be non-modifyable for a global database (defeating the purpose of the plugin) or which drops the player has for each server would have to be inconsistent (they could have a weapon available on one server, but not on the other, even if both servers have the exact same weapon)
I assume none of the examples within the StarterWeaponPack.zip works? So far I'm toying around with it, to see how it exactly works. But can't use any of the examples, as they don't seem to work. Though it grabs the correct weapon when I "use" it, but for example leech with "Cloaking deducts 4 health per second.\nNo other cloak cost; unlimited cloak as long as you have health." doesn't appear to do anything.
And yea, I've installed everything that it requires.
Also, if you use "plugin" within the weapon config file incorrectly, for example:
Quote:
"plugin" "tf2items"
"value" "1.75"
it crashes your client. And it appears other people along with it as well. Not sure if this is known.