UCC+UIS Item : how can I add durability to sword?

honesyokan

New member
I was searching for this but couldn't find one.

what Im trying to do
[1]make new Attribute on Item (using Attribute Manager) that contains variables named"Durability"
[2]On Recoil Module, decrease "Durability" based on surface type
[3]If "durability"<0, the ItemState is"broken"
[4]if player is dead, the "durability" is halfed

I did [1], and maybe I can do [2]
but I can't come up with idea of [3] and [4]
[3]->may be using State system? (If I can change State from Attribute Manager )
[4]->may be using Player Ability?

If there is better way or good references, please let me know, thanks.
 
I'm afraid we don't really have an example for something like that.
There are many different ways you could implement this. It's really up to you what makes the most sense for your project.

I would probably add a custom component (let's call it ItemDurabilityControl) on the item and handle everything from that.
you could have a custom recoil Module that tells the ItemDurabilityControl that you hit something. Then from there you decrease the durability, check if it's below zero, if so then it's "broken". That can mean many things' that's up to you.
Adn when dying, you should have an event for that, just listen to it on your ItemDurabilityControl component.

I hope that points you in the right direction
 
Thanks for quick reply!
I hope if I can implement this for example, using "Recoil Module" or "Extra Module" and "AttributeManger"(since UCC + UIS is very solid solution) but thanks!
I'll try to make my own!

And I realized I should have make this thread in the UIS question forum. ill do that next time!
 
Back
Top