Download

Oxygen Tank: Remember the tank's remaining level

Hi,

I want UE4 to remember the value of an oxygen tank which has been partially used. You can pick up and drop the tanks, but in my current setup the contents resets to full each time. Can’t seem to find anything on the forum or google - probably how I’m expressing the search query!

Any pointers would be a great help!

I currently have the oxygen charge as:

8c78c957a0c9a49f918ea46f48b6f751832a3b42.png

I would like to be able to feed off the timeline value.

The oxygen tanks are the only item on an inventoried DataStructure, which creates a new ID reference for each item added to the inventory. This structure might work as a vehicle for the data retention by freezing the value for previously picked-up items, I’m just not sure.

Screenshot 2015-05-28 11.55.30.png
(The break inventory data isn’t attached because I don’t want a HUD-based inventory.)

Thanks!

SUPERSEDED

I think it would be possible to use the function GetPlaybackPosition on the oxygen tank timeline which activates as part of the unequipping executive, just before the tanks are dropped. This value could then be used as a variable default for this actor instance.

However, this idea would have been a bonus. My game is very small, maybe 10-15 minutes. I’ve decided to drop the timeline element and simply have a delta second timer to chart the tank depletion. This method allows me to randomise the tank capacity within a range too, which I’m not sure can be done as easilly in a timeline.

To solve the problem of players picking up a dropped tank… well, I might make them impossible to drop: new tanks simply replace old ones without any waste. At least it’s more environmentally friendly…

SOLVED

I don’t mean to be bumping my own thread (especially as it seems I’m the only one in here…) but I solved this problem.

At this stage, it requires each oxygen tank to be unique but for UE4 to ‘remember’ the remaining oxygen level, a Meter variable will be required which can feed off the countdown. When the IsDropped variable is True, the countdown sets the Meter value. Bingo!