nosoop / SM-TFCustomWeaponsX

SourceMod plugin that allows players to use custom TF2 items.
GNU General Public License v3.0
21 stars 11 forks source link

Add "Replace" functionality from CW2 #32

Open megascatterbomb opened 3 years ago

megascatterbomb commented 3 years ago

Custom Weapons 2 has a feature that allows existing weapons to be replaced by custom weapons with custom stats. This would be incredibly useful for this plugin as developers could use custom attributes in their rebalance mods.

Use in CW2 looked like this: "replace" "425" where 425 is a weapon id.

For example: I could implement a custom attribute on the Family Business, and anyone who connects to the server and equips the Family Business normally would receive the modified version. A popup would appear with an item description so the user knows what the changes are (although I intend on documenting my balance changes elsewhere so I would greatly appreciate this popup being toggleable).

nosoop commented 3 years ago

Definitely an idea worth looking into. That said it may be tricky to add with how persistence is currently handled, since the "no custom item" case operates on the assumption that the game will handle equipment.

The description popup idea would be tied-ish to #7 (where a plugin API would handle the menu logic in the future, leading to more flexible applications).

For the time being, you may also want to look at the basic attribute manager in Custom Attributes.

nosoop commented 3 years ago

The newest release adds some much desired native functionality for developers to work with; the important one for this issue is CWX_SetPlayerLoadoutItem.

However, it still holds that persistence makes this specific feature request complicated — CWX knows that it's replacing items in a particular class / loadout slot combination without having to know what item it's replacing. On the other hand, CW2/3 is way simpler since it stomps on item entities on every resupply (and so it knows what items the player has), but that's also the cause of a whole class of bugs.

All that's missing at this point is being able to determine what item would've been spawned without actually creating it. That's definitely possible; just a matter of if I'd like to introduce that additional complexity and how I'd implement that.

(The idea would be that on spawn, a separate plugin can determine if an item needs replacing, then force a specific loadout item to override user preference.)

H20Gamez commented 2 years ago

Hi. I was wondering if any work has been done in this certain request? I have been previously using Rebalanced Fortress 2 for my own server just so I edit default weapons. Only problem I ran into was that I wanted jarate and milk to be like the gas passer. So when I stubbled upon your TF2 Attribute fix pack I thought I was saved. Turns out it uses the way of replacing items that you are talking about here. So I was just wondering if anything has changed? My friends and I do like messing with balancing our own weapons and it would be cool to see them come into what we imagine.

nosoop commented 2 years ago

Hello — no new progress in this request on my part; I do have ideas for API changes that would make this a bit easier, CWX just hasn't been a priority for me to work on.

H20Gamez commented 2 years ago

Oh okay. Just wanted to check :)