Forum rules - please read before posting.

Countdown Timer and its replenishment

Good afternoon!

I need to implement a countdown timer in the game, which can replenish its time by taking 3D objects in game that give additional seconds.

I have studied similar topics on the site and am confused, as I see that in the current versions of Adventure Creator there is a Timer Editor created just for the same purpose that I have.

Please help me with the solution to this problem.
1 Step:
A countdown timer that runs throughout the game and on expiry leads to loss/death
2 Step:
3D objects, on contact with which a certain number of seconds is added to the timer.

I am guided by Chapter 7.5 in Manual on encountering obstacles due to lack of understanding of the whole process.
-Timer Editors created
-Global variable (Type:Integer) created is bound to it.
-Created Menus items and Timer,Label elements
-ActionList/Variable/Set Timer connected

As a result, the timer is displayed on the screen in gameplay and counts down to a given second.

Please orient me in general, what and where, how to consistently implement the system?

Comments

  • What do you have set up already, and what is your AC version?

    The steps you've given above are generally the way to go: use the Timers Editor to create a Timer, with a Max value of the total duration of the countdown, in seconds. To have it go down, set the Value increases per tic to -1.

    You'll need to link it to a Global Variable if you want to be able to adjust its value at runtime. Check Link to Global Variable, and select an Integer variable you've created in the Variables Manager.

    To run the Timer, use the Variable: Set Timer Action.

    To increase the Timer's current value (when the Player contacts a 3D object), use the Variable: Set Action to increase the linked Integer variable by some amount.

    To display the Timer on-screen, create a Menu with a Label element, and then use the [timer:0] token within its text box. This will display the timer formatted using the format defined for it in the Timers editor.

  • Thank you very much for the detailed explanation, @ChrisIceBox

    I am working in version 1.80.5 and I was able to build systems with replenishing seconds in the timer and displaying it on the screen.

    But I am confused about one thing again:
    How can I make it so that when the time expires, the player's death animation occurs and the game ends?

    I have an ActionList where the starting point is a Variable Set Timer.
    As I understand, the end point of this chain will be Character Animate for death animation and Engine End Game.
    Anything in the middle in between, I assume, is Varable Set/Check.

    I've tried various combinations but it doesn't work.
    Can you please explain what the sequence should be?

  • When editing the Timer in the Timers Editor, you can assign an ActionList in the ActionList on complete field. This will run when the Timer reaches its end - this is likely where you'd want to place death animation / restart logic.

  • Thank you very much @ChrisIceBox !
    I managed to do it !)

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.