Getting a precise time... and Inventory System in Battle?

Hello, this is newbie questions again.

I may need helps and suggestions for my 2D Action JRPGs Project like Chrono Trigger (or old Final Fantasy like).

1.But I wonder few times about real time check.

Personally, using delta time from Tick would be enough for my project.

Sometimes I wondered myself, what if I have to use real time? such as checking Play Time and so on.

Is delta time enough for using as Real Time, if it is not what is the right solution?

2.It may sounds complicated, nevertheless I actually need to ask this question.

In battles, there is a Player Unit, who can use his unarmed, melee weapons and ammo by ranged weapon, if I selected his “Fight” Command in UI (I think I gonna implement it as UMG)

However when I open the list of available actions from “Fight” command, I really need to show his default attacks -> unarmed, and changing, yet persistent melee weapons (it has durability) and ammo (it has quantity) from the inventory (it is shared through Player Units)

My initial plan is I will use separate TArray as that unit’s “CurrentFightDisplayList”, put unarmed skills and it gets data from the inventory about weapons (there is separate Inventory datas though, TArray by Weapons, TMap for Ammo and Goods).

Sounds okay for first action, but when it comes to another action, he already used (or worse, destroyed) a melee weapon with a cost of its durability. So that I may need to change only Datas from Weapons.

To do that, I thought I clear whole data in TArray “CurrentFightDisplayList” again, put unarmed, weapons again… but is it okay? repeating the whole process? if it is not, is there better solution for it?

Oh I forgot to mention that, I used Rama’s custom Game Instance, that contains UObject as Item Inventory, which contains TArray(Weapon) and TMap (Ammo and Goods) for every Player Units.

I may need to modify only that selected weapon from that Item Inventory and “CurrentFightDisplayList”… the problem is… is it fast? and how can I find right data to modify it?

You could either get the system time at the start and end of the game.
Or you can accumulate the delta timings together.
But I would get the system time when the level is loaded (the player can start playing), Then get the system time again when the player pauses/quits/whatever the game and add that to the total time played metric.

I am not familiar with Rama’s plugin.
UMG combo box’s do not have a function to remove items, It’s a remove all or nothing.
So you could repopulate the UMG widget each time the player opens the menu, It should not be expensive if it is a trivial checks to see what should be available.
If the UMG widget reads from the arrays, Well then you should be able to remove the item from the list and see if the widget updates.


System time… I will check it out.

i didn’t know UMG combo box is about remove all or nothing. i will try it out as you pointed. by the way what is HTH?

It means Hope That Helps.

HTH :slight_smile:

Okay. thank you, right now, I gotta write down the list of things to do and watch tutorial, i will experiment with UMG later.