Change Lyra Item Informations in-game

Hi!

I’m currently making a game in the LyraStarterGame project. I want to add a feature where my players can upgrade their weapons in game without creating many weapons with different stats.

So basically, there will be a machine in my game where the player can upgrade his weapons. The machine will take the item (weapon) in the current active slot. it will double the damages, increase the magazine size and change the texture of the weapon in hand. But I don’t know how to change all these variable in game.

I want to add some details. The problem I have is that the weapons are stored as “Items” in the inventory. But I can’t get any attribute from my item because I guess I can get them from a subclass.

I know I can get the ammo attributes with gameplay tags, but those tags don’t exist for the other attributes like the damage.

The items in Lyra are stored in a data structure within the ULyraInventoryManagerComponent class. In this class, you will find various functions such as AddItemDefinition(), AddItemInstance(), and RemoveItemInstance(). The actual item created in the game is the ULyraInventoryItemInstance object. To modify the item at runtime, you will need to create functions in the ULyraInventoryItemInstance class. Anticipating this, the functionality you want to modify items is more complex than it appears.

It was the conclusion I had when I checked the code. I had to modify the cpp files to do that. Thanks^^

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.