Spell/Ability System based on Weapon Type

conraddu

Member
Hello,

I want to run some ideas and questions by you guys before I start implementing this spell/ability system so that I might be able to get some ideas & clarifications on how it can be built ontop of Opsive's UIS and UCC.

I want a spell/ability system that allows a player to cast spells/abilities using their hot-bar, but the spells/abilities available are specific to the characters currently equipped weapon type (like New World). The player can also always just swing their weapon with left-click for standard attacks.

My original thoughts on this were to use UIS for the spells/abilities, where a spell/ability is just an `item definition` that has some hidden `spell` category so that spells cant be seen in the normal inventory. Based on the currently equipped weapon category, I can then restrict which spells/abilities can be bound to the hot-bar. So, if the player is equipping a two-handed sword, they will see a set of abilities they can perform with the hot-bar, but they can also just left-click with the sword to perform the `use` ability of UCC, where the two-handed sword has a standard MeleeWeapon.cs ItemAction.

Does it make sense to use UIS for this kind of thing? What's the best way to set this up in UCC? Should I have a different slot on the UCC character for each hot-bar slot that a spell can be bound to?
 
If I understand correctly you want those spells/Abilities to be per Weapon type?

In that case if I were you I'd create a custom solution for this on top of UIS and UCC. Where the "hotbar" would be completely custom to your system.

Then you have 2 choices for defining the Actions available for that weapon
1) On the ItemCategory/ItemDefinition as scriptableObjects
2) on the Weapon prefab

If you choose option 1 " On the ItemCategory/ItemDefinition" you have many options on how you want to activate those actions
1) As UIS ItemActions
2) on the Character as Abilitities
3) on the weapon as UCC Item Actions
4) with custom solution

If you choose option 2 "on the Weapon prefab" then your choice is either
1) UCC ItemActions
2) Custom solution


In all those cases your custom hotbar will find where the actions exist for that equipped weapon and it will bind whatever input you want to start the action.

If you have a few weapons any solution is good.
If you have a lot of weapons then I would suggest thinking about it thougohly and abstracting it such that you do not have to define things manually for every single item, but instead define it by item type and then simply change the values either on a component or on the Item attributes.

I hope that points you in the right direction
 
Top