Getting Started (for Server Operators) - nosoop/SM-TFCustomWeaponsX Wiki

First Run

The installation comes with a sample config in configs/cwx/example_items.txt, with one primary weapon each for Pyro and Demoman as a demonstration.

Once the plugin has been loaded in, switch to Pyro, open the chat and type /cwx. In the menu that pops up, select the "Primary weapon" option, and then "The Airblaster". You will have the weapon the next time you touch the resupply locker or respawn; you will be respawned immediately only if you are in spawn, not in sudden death, and you've set your game to automatically respawn on loadout changes using the tf_respawn_on_loadoutchanges ConVar.

Switch to Demoman, then select "The 'Grenade Launcher' Launcher".

To unequip the weapons, open up the menu again on Pyro / Demoman and select "[No custom item]".

Creating a new item from scratch

New items can be added by adding a new text file within configs/cwx/. There is no particular naming scheme to adhere to (as of rr-42, these files can be placed within subdirectories as well — files in subdirectories named "disabled" will not be processed). Multiple items can be added to one file, making it easy to organize them in groups.

A minimal weapon configuration is as follows:

	"{my weapon id}"
		"name"			"My Custom Item"
		"inherits"		"item_to_inherit_from"
		// other key / value entries for the item...
	"{another weapon}"
		// ...

"{my weapon id}" can be any unique identifier you want (with a limit of 63 characters), but it must not change once you've assigned it[^1]. It's used internally to determine which items a player has equipped. Ideas for unique identifiers include:

This is not displayed to players on the server, but may be used in admin commands. (It does not have to be in {curly braces}.)

ℹ️ If you end up with duplicate identifiers, CWX will log a message indicating which file contained the duplicate on startup, and will ignore such duplicates.

Here are the supported key / value entries:

To load your weapon configuration and equip your item, reload the plugin by running sm plugins reload cwx.

[^1]: You technically can, but you'd need to ensure no players are using it, or you'd need to manually erase the references to the old name in the inventory backend. This will not be done for you automatically.

Extended Data

With X.0.8-72aadbf (rr-50), a new extdata section was added. This section is intended to have nested (but otherwise free-form) subsections for other plugins to retrieve and work with. For these, you will need to refer to the documentation of any plugins using this functionality.