Raised This Month: $32 Target: $400
 8% 

[TF2] Custom Weapons X


Post New Thread Reply   
 
Thread Tools Display Modes
Author
nosoop
Veteran Member
Join Date: Aug 2014
Plugin ID:
7558
Plugin Version:
X.0.9
Plugin Category:
Gameplay
Plugin Game:
Team Fortress 2
Plugin Dependencies:
Servers with this Plugin:
24 
Plugin Description:
A take on Custom Weapons for modern-day TF2.
Old 03-13-2021 , 05:15   [TF2] Custom Weapons X
Reply With Quote #1

⚠️ This is currently a preview. While I consider the core of it usable, there's still some additional QoL things that need work. ⚠️

Description:
New weapons in TF2? Want to BYOHU (Bring Your Own Heavy Update)?

Introducing Custom Weapons X, because this plugin has ascended past the concept of numbers and 23 of the 26 letters in the English alphabet.

It's lightyears ahead to the point where it's not backwards compatible with just about anything from Custom Weapons 2 or Custom Weapons 3. I figured a total overhaul of the design was due, after gaining a ton of experience working with existing Custom Weapons iterations and with how the game itself operates.

In exchange for having to start over, it provides support for dropped weapons and not blowing up your buildings because the game wants you to have your own weapon and not the plugin's.

While yes, CW3 attributes aren't compatible with this plugin, it does support the Custom Attributes framework in addition to the game's native attributes, so there's a number of attributes available for item designers to play with, and developers can of course create new ones.

If you'd like things ported from one of the old CW* formats, I am also open for paid inquiries. Send me a forum PM if you're interested.

Usage:
For people that play the video games:
  • Saying /cwx brings up the menu, allowing you to pick a custom item for your current class.
  • /c, /cus, and /custom are also supported, but will only be processed by CWX if CW3 isn't running.
For the server operators:
  • You can run this alongside any of your existing Custom Weapons plugins. I wouldn't recommend doing this in production as they'll try to equip over each other, but otherwise they effectively exist separately.
  • sm_cwx_equip <uid> equips the specified custom item on yourself. This bypasses the equip menu, allowing you to apply custom items that aren't normally compatible for the class you're playing as.
  • sm_cwx_equip_target <target> <uid> equips the specified custom item on the player matching the given target string. Again, bypasses the menu.
  • sm_cwx_export exports your currently equipped item to a file, allowing for a WYSIWYG approach.
  • There's an example of a weapon config in the configs/ directory of the repository. There's also a slightly more thorough instructional guide on creating a weapon config here.
For developers:
  • Attributes can be implemented using either native attributes or the Custom Attribute Framework.
  • The plugin API for CWX is in the works. API design is hard
More information is provided in the project wiki.

Installation:
Installation instructions are provided in the project repository.
The plugin currently has no "stable" build, but rolling releases are available. While I do try and test to avoid builds that are completely unstable, some bugs may occasionally slip through the cracks; please report any you come across if they can be reproduced in the latest release.

Releases / Source
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)

Last edited by nosoop; 07-27-2022 at 07:09.
nosoop is offline
Naleksuh
Member
Join Date: Dec 2018
Old 03-13-2021 , 13:03   Re: [TF2] Custom Weapons X (preview)
Reply With Quote #2

This is really interesting and resolves a lot of issues with previous versions...especially dropping all your weapons when you touch a resupply...I hated that.

Any plans for taking the plugin in the direction of SQL based weapon storage, events for addition/removal, and a custom weapons MOTD?
Naleksuh is offline
nosoop
Veteran Member
Join Date: Aug 2014
Old 03-13-2021 , 13:39   Re: [TF2] Custom Weapons X (preview)
Reply With Quote #3

Quote:
Originally Posted by Naleksuh View Post
This is really interesting and resolves a lot of issues with previous versions...especially dropping all your weapons when you touch a resupply...I hated that.

Any plans for taking the plugin in the direction of SQL based weapon storage, events for addition/removal, and a custom weapons MOTD?
The custom item schema will remain file-based for the time being since it's easier for the average server operator to work with, though the plan is to parse it out into an enum struct internal representation instead of scanning over KeyValues. Maybe a separate plugin can handle schema updates and install item updates dynamically.

Letting other plugins update loadouts is an idea in the design process; probably won't be working on a web frontend for it myself.

There are no plans for weapon addition / removal events, if that's what you're asking (attribute-related events are outside of scope). Still working on the API design, but I think most things can be handled without it.
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)
nosoop is offline
Naleksuh
Member
Join Date: Dec 2018
Old 03-14-2021 , 03:58   Re: [TF2] Custom Weapons X (preview)
Reply With Quote #4

"There are no plans for weapon addition / removal events, if that's what you're asking (attribute-related events are outside of scope). Still working on the API design, but I think most things can be handled without it. "

In attribute development it's a common need to know when a weapon is equipped to perhaps do a particular action (maybe add a condition, grant health, etc). At this time there's no real good way of doing this
Naleksuh is offline
nosoop
Veteran Member
Join Date: Aug 2014
Old 03-16-2021 , 04:14   Re: [TF2] Custom Weapons X (preview)
Reply With Quote #5

Quote:
Originally Posted by Naleksuh View Post
In attribute development it's a common need to know when a weapon is equipped to perhaps do a particular action (maybe add a condition, grant health, etc). At this time there's no real good way of doing this
There's a few different ways you can check when a weapon is equipped:
  • post_inventory_application event (notably, this plugin spawns and equips all items before that event runs, so any item checks like "does this person have a shield" should be correct by this time)
  • SDKHooks Equip/Post hooks (also runs on weapon pickups)
  • Various options through DHooks
That can all be done in a separate shared plugin, if not inlined directly within the plugin that needs it; there's no special handling that would make it necessary for this plugin to have an implementation.

A native function for other plugins to identify a specific custom item from an entity is something I do intend to add in the future (likely by embedding the weapon ID through one of the supported attribute systems).
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)

Last edited by nosoop; 03-16-2021 at 07:54.
nosoop is offline
BlazingDiancie
Member
Join Date: Sep 2014
Old 04-07-2021 , 15:19   Re: [TF2] Custom Weapons X (preview)
Reply With Quote #6

Loving this plugin already. Feels much more efficient and lightweight than CW3, and a lot less subtly buggy. I'm assuming all the stuff CW3 could do like custom log names and sound replacements will be added in due time. Can't wait to see where this goes. I'll keep you posted on GitHub if I find any issues.
BlazingDiancie is offline
nosoop
Veteran Member
Join Date: Aug 2014
Old 12-27-2021 , 12:47   Re: [TF2] Custom Weapons X (preview)
Reply With Quote #7

Quote:
Originally Posted by nosoop View Post
It's lightyears ahead to the point where it's not backwards compatible with just about anything from Custom Weapons 2 or Custom Weapons 3. [...]

While yes, CW3 attributes aren't compatible with this plugin [...]
So, that was a lie. I've written a plugin that should allow well-behaved CW3 plugins to work with CWX. Happy holidays.

CW2 probably won't happen since they don't support removal of attributes.

Anyways, progress is going. If you'd like to see some specific functionality within the project, please do file issues.
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)

Last edited by nosoop; 12-27-2021 at 12:47.
nosoop is offline
Pony_Phreak
Junior Member
Join Date: Feb 2022
Old 02-16-2022 , 21:43   Re: [TF2] Custom Weapons X (preview)
Reply With Quote #8

I've been toying with this plugin a bit and have noticed a recurring error- Wearable items are duplicating their effects-- epically after respawn or on hitting supply lockers., so a +25hp turns into +50. Inspecting another player with the item will always show the intended "+25" though.

what makes their even weirder, is they always happen on certain players and not others.

Either way, this has consistently happened on wearable, but not weapons. I'll put one of the wearable's code here so you can take a peek and see if I'm making a mistake, before ya consider bug-hunting. maybe you can point out something I'm doing wrong


Code:
    //Sniper SMG Pack
    "{a9f81fa5-4edb-4601-858a-fd0d4d177cf6}"
	{
		"name"		"The Blitzing Bersagliere"
		"inherits"		"The Cozy Camper"
		"item_class"	"tf_wearable"
        "used_by_classes"
		{
			"sniper" "primary"
		}
        "keep_static_attrs"		"0"
		"attributes_game"
		{
        	"max health additive bonus"		"25"
			"maxammo secondary increased"	"2.5"
		}
        "attributes_custom"
		{
        	"mod crit type on target condition"		"condition=25 crit_type=1"
		}

	}

Last edited by Pony_Phreak; 02-16-2022 at 21:44.
Pony_Phreak is offline
nosoop
Veteran Member
Join Date: Aug 2014
Old 02-17-2022 , 00:01   Re: [TF2] Custom Weapons X (preview)
Reply With Quote #9

Quote:
Originally Posted by Pony_Phreak View Post
I've been toying with this plugin a bit and have noticed a recurring error- Wearable items are duplicating their effects-- epically after respawn or on hitting supply lockers., so a +25hp turns into +50. Inspecting another player with the item will always show the intended "+25" though.

what makes their even weirder, is they always happen on certain players and not others.

Either way, this has consistently happened on wearable, but not weapons. I'll put one of the wearable's code here so you can take a peek and see if I'm making a mistake, before ya consider bug-hunting. maybe you can point out something I'm doing wrong
What's happening here is that you've specified a wearable that normally occupies the secondary loadout slot as a primary slot item; because of how persistence is handled, that sort of thing is currently unsupported.

It's actually covered under this issue, which was deemed a wontfix at the time.

There's an improvement to item persistence that I've been meaning to test so that weapons not intended for the class aren't discarded on resupply; it might also work to apply wearables in slots they are normally not suitable for. I've gone ahead and pushed those changes; download the newest build and let me know how it goes.
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)

Last edited by nosoop; 02-17-2022 at 00:42.
nosoop is offline
Pony_Phreak
Junior Member
Join Date: Feb 2022
Old 02-18-2022 , 00:55   Re: [TF2] Custom Weapons X (preview)
Reply With Quote #10

Quote:
Originally Posted by nosoop View Post
There's an improvement to item persistence that I've been meaning to test so that weapons not intended for the class aren't discarded on resupply; it might also work to apply wearables in slots they are normally not suitable for. I've gone ahead and pushed those changes; download the newest build and let me know how it goes.
I know its only about a day since the latest release, but so far so good. No one reported anything funny, and I never saw anything out of the ordinary after this update. looks like you fixed it. Thanks.
Pony_Phreak is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:47.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode