playMaker

Author Topic: How do I make a precise timer?  (Read 2560 times)

abr

  • Playmaker Newbie
  • *
  • Posts: 7
How do I make a precise timer?
« on: February 25, 2015, 02:29:05 PM »
Hi everyone, I am totally new to Playmaker. So far I'm loving it and everything has worked out.

Iam somewhat lost - searching for this topic (extensively, about an hour) has brought up nothing really, so I'm asking:

How do I make a framerate-independent timer?

The thing I want, basically, is to add a value to a variable (integer). The way I want to do this, however, is not every frame but (for example) every second, every minute etc.

I have not found a way to do this - is there something obvious I'm missing?

Thanks in advance!  :)

Cheers!

VascBogdan

  • Full Member
  • ***
  • Posts: 118
Re: How do I make a precise timer?
« Reply #1 on: February 25, 2015, 03:04:37 PM »
Create a state with a Float Add and add 1. Then, create a Next Frame Event and drag it to another state with only: "Wait" action, and put a value in SECONDS, then drag it again to Float Add. You can replace Next Frame Event with "Float Compare" and create a variable with a max float number. (so until the first float reaches the max. float[second float], it will loop like I said).

I can't really make you a screenshot right now but if you can wait until tomorow 1-2 pm I will make you some photos to understand better.

abr

  • Playmaker Newbie
  • *
  • Posts: 7
Re: How do I make a precise timer?
« Reply #2 on: February 25, 2015, 03:36:52 PM »
Thanks, I suspected as much. Is the "Wait" Action in another state the only way to do it, though? I thought there would be a more convenient way such as an action like "Add X every X seconds" or something like that.

Thanks, much appreciated! :)

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: How do I make a precise timer?
« Reply #3 on: February 26, 2015, 01:37:03 AM »
i made an int operator per second, but i did not put it yet on Ecosystem.
i will see if i can make it so that the seconds can be adjusted.

but you will have to wait a bit , i have a lot of work atm :)
meanwhile you can check here

Friendly Greetings,

Dino

abr

  • Playmaker Newbie
  • *
  • Posts: 7
Re: How do I make a precise timer?
« Reply #4 on: February 26, 2015, 06:32:11 PM »
i made an int operator per second, but i did not put it yet on Ecosystem.
i will see if i can make it so that the seconds can be adjusted.

but you will have to wait a bit , i have a lot of work atm :)
meanwhile you can check here

Friendly Greetings,

Dino

Thanks! Checking out your script right now! :)

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
Re: How do I make a precise timer?
« Reply #5 on: February 27, 2015, 12:28:26 AM »
Here is a countdown timer.  Maybe this helps.