Showing the timer

Started by nightmarer, Mon 04/01/2021 23:57:03

Previous topic - Next topic

nightmarer

Hello!

In the game I am developing the main Character has x time to do one action before the time finishes and he needs to start again.
So far I have configured one timer running in checked by Repetely executed in Global Script which already knows when this Timer is over,
but I would like to stablish a count down in the game, so the player is able to see how much time left does he have,
but I didn't find any function to check the time left for the timer.
Can you please provide me any idea?

Regards.

morganw

I don't think there is any built-in function that allows you to read a timer value, but you can effectively create your own timer by making an integer variable to count down the frames as they elapse and use the value from GetGameSpeed to convert the counter value into another format.

i.e. if your game speed is 40 this means that repeatedly executing commands will be run 40 times per second, so a 2 second delay could mean decrementing the value from 80 to 0.

nightmarer

Hi.

Thanks for you answer. That is a solution.
Is there iny way to access to the class created in orger to build a get method?

Regards,

Crimson Wizard

#3
I once wrote a timer module that allows to read remaining time, and some more: https://www.adventuregamestudio.co.uk/forums/index.php?topic=55545.0

Quote from: nightmarer on Tue 05/01/2021 09:47:20
Is there iny way to access to the class created in orger to build a get method?

Please clarify, what class are you refering to?

nightmarer

Thank you very much for your work.

SMF spam blocked by CleanTalk