top of page

ULTIMATE GACHA

Release Date: December 2025

GHOST RUN PARKOUR

PROTOTYPE

This snippet of Verse code displays how to convert the returned active duration of the timer_device to a positive float value. The reason this conversion is necessary is because the timer is configured to count upward (from 0 toward 3600 seconds) rather than downward.

 

However, the GetActiveDuration() function in Verse returns the remaining time until the timer’s maximum value. In this case, 3600 seconds (1 hour). So, if a player completes a run in 6 minutes and 53.44 seconds, the timer would report a remaining time of:

3600 - 413.44 = 3186.56

var currentRun: float = (TimerDevice.GetActiveDuration() * -1 ) + 3600.00

To convert this to the player’s actual run time, we invert the returned value relative to the one hour cap.

 

This calculation effectively transforms the countdown style return value into an elapsed time format which helps yield a readable positive float that represents how long the player’s run actually took. In the above example, this would return 413.44xxxxxx seconds (6:53.44).

Unfortunately, the printed float value contains roughly 8-9 digits after the decimal place and only the first 5-6 of those are precise. To fix this, I created a custom truncation function. It starts by converting the input float into a string, so it can be edited character by character. Then, it finds where the decimal point appears in that string. Once the decimal is located, the function calculates where to stop based on the number of decimals you want to keep. For example, if you want two decimal places, it sets the stopping point a few characters past the decimal which is just enough to include those digits but nothing extra. It also makes sure not to exceed the string’s total length. After that, it slices the string from the start up to that stopping point, truncating any extra digits. Finally, it returns this shortened string, giving a clean display value. 

ToTruncatedString<public>(Number:float, Decimals:int):[]char=

        var Str:[]char = ToString(Number)

        if:

            DotIndex := Str.Find['.']

            StopIndex := if(Decimals > 0 ) then Min(DotIndex+Decimals+1,Str.Length)else DotIndex

            TempStr := Str.Slice[0, StopIndex]

            set Str = TempStr

        return Str

bottom of page