Unreal MMO Development with Yaz

UE5 MMO Devlog 85: Potions overview

devlog 85 - healing potions overview

devlog 85 - healing potions overview

MMO Devlog 85 - Healing potions overview

In this update I introduce Potions into the game. These are new ‘Consumable’ Item types.

Potions required several considerations:

First question is regarding Potion definitions. For this, I slightly adjusted the definition of Item and ItemEffects:


            "itemId": "4000",
            "itemName": "Weak HP Potion",
            "category": "CONSUMABLE",
            "itemEffects": {
               "HP_REGEN": {
                 "affectedAttribute": "HP_REGEN",
                 "additiveModifier": 40,
                 "multiplyModifier": 1.0
               }
            },

Using this definition will allow me to make potions have whatever effect I want them to have. For example they can increase hp/mp regen for basic potions. Otherwise they can increase attack speed, damage, movement speed, etc.

Inventory actions

I decided that I wanted potions to be stacking items, so they also have the option of:


            "stacking": {
                "canStack": true,
                "maxStacks": 10
            }

This will get processed by inventory service in java, to handle accordingly.

I will still need to update the UE widget to display the actual count, which I can do a little later.

Next, is calling Java to ‘use item’, which will happen when the item is double clicked inside the inventory slot. Simply it evaluates the item category, if consumable, then it will request to activate the item.

Animation

When Java executes the ‘useitem’ function, one of the things it requests clients is to start playing the Drinking animations.

This animation was taken from Mixamo: https://www.mixamo.com

Simply search for ‘Drinking’ and you should find it. You will need to export it using their skeleton and then can start migrating it to your own.

Exit mobile version