playMaker

Author Topic: Using TIME[SOLVED]  (Read 2445 times)

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Using TIME[SOLVED]
« on: April 26, 2016, 01:01:51 PM »
I looked at the TIME actions, but I can't understand how to use them.
In example, if I want to take the actual time when the player press a button, and then check how much time has passed when he releases the button, how should I act?
I am not interested in how much time has passed since the map was loaded or stuff like that, I'm much more interested in knowing what time is it NOW, so I can compare it later on when the button is released with the actual time again.
« Last Edit: April 28, 2016, 04:48:57 AM by jeanfabre »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Using TIME
« Reply #1 on: April 27, 2016, 01:13:22 AM »
Hi,
you can use the action "get Time info" and set it on "time in current state"
and probably set it every frame.

place it in the state after you press the button or in a different fsm and use send event when pressing and releasing the button

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Using TIME
« Reply #2 on: April 27, 2016, 02:31:43 AM »
Thank you.
I solved by using Network Get Time, gives the time in seconds, which is perfect.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Using TIME
« Reply #3 on: April 28, 2016, 03:18:49 AM »
Hi,

 That's very dangerous to use this action, as it will soon be obsolete and replace with  the new Networking system.

 I would use "Get Time Info" action,

 Bye,

 Jean

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Using TIME
« Reply #4 on: April 28, 2016, 03:31:49 AM »
Hi,

 That's very dangerous to use this action, as it will soon be obsolete and replace with  the new Networking system.

 I would use "Get Time Info" action,

 Bye,

 Jean

The problem is resolution: how deep is Get Time Info? I can read in the help it's only up to the minute. I need sharp timing to the 1/10 of second at least, better 1/100.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Using TIME
« Reply #5 on: April 28, 2016, 04:36:48 AM »
Hi.

 not at all, where did you read that? it's as precise.

to check a down time, record the time when the user pressed down, and when the user press up record the time, then make a substraction and you have the duration of the press, precise as it can be...

use "RealTimeSinceStartup", which means it's not going to be affected by te time scale. use "TimeSinceStartup" if you want to toy around with slowing down time inside the game and account for this in your timer.

Bye,

 Jean

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Using TIME
« Reply #6 on: April 28, 2016, 04:47:24 AM »
Hi.

 not at all, where did you read that? it's as precise.

to check a down time, record the time when the user pressed down, and when the user press up record the time, then make a substraction and you have the duration of the press, precise as it can be...

Exactly what I've done :)



Quote
use "RealTimeSinceStartup", which means it's not going to be affected by te time scale. use "TimeSinceStartup" if you want to toy around with slowing down time inside the game and account for this in your timer.

OK, I will replace the action with your recommendation, thank you very much!