Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: DevinFM on November 29, 2019, 04:42:03 PM
-
Hi there,
I'm trying to compare the amount of time between two dates and if the player waits too long the x happens, too little then y happens, just right then z happens.
My "time at click" and "time now" variables both register properly, but I can't get the time between them even with "get time span between dates". The value stays at zero. I'm totally clueless as to why.
Thanks for reading
-
Hi.
Probably the format is wrong.
-
That's what I thought, but it's the default "MM/dd/yyyy hh:mm"
-
Changed the formatting to match this (https://hutonggames.com/playmakerforum/index.php?topic=20414.0) post, still nothing.
-
Hi.
Can you show the setup of your time span action?
I just tested on a clean project, and it seems to work fine on my end :)
(https://i.imgur.com/Z7TktNs.png)
-
Sorry for the delay, just got home from work.
I'm attaching 2 screenshots of my work. One gets the time when the user clicks, the second gets the current time then compares them.
Really nervous that I'm doing something glaringly stupid. That would be an embarrassing first post for me.
-
Hi,
No one is judging you :) there is no such thing as a stupid question as well in the context of programming... learning all of this is tricky.
one trick, turn on the debug to see the values of your variables, it helps a lot.
(https://i.imgur.com/cIwbMt0.png)
can you give us the actual value of your your string input for that action?
Bye,
Jean
-
I solved it. Solution: I'm a mega dummy. Every time it would loop back around, the "SAVSystem Time at Click" variable would get replaced, thus making it and "current time" the exact same every single time. I owe you two. I clicked debug and immediately saw my mistake.
As an aside, I want to thank both of you (jeanfabre and djaydino) for doing what you do here because you two have answered a TON of questions I've had in countless old threads dating back to like 2012.
-
Hi,
Happy to help :)
-
Hi,
yep, we are here to help, and indeed this forum is really worth your time to search and look for similar questions you might have, chances are it's been answered already.
Bye,
Jean