playMaker

Author Topic: "Get Time Span Between Dates" not storing value [SOLVED]  (Read 148 times)

DevinFM

  • Playmaker Newbie
  • *
  • Posts: 5
    • View Profile
"Get Time Span Between Dates" not storing value [SOLVED]
« on: November 29, 2019, 02: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
« Last Edit: December 05, 2019, 09:40:00 AM by DevinFM »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4613
    • View Profile
    • jinxtergames
Re: "Get Time Span Between Dates" not storing value
« Reply #1 on: November 29, 2019, 08:52:29 PM »
Hi.
Probably the format is wrong.

DevinFM

  • Playmaker Newbie
  • *
  • Posts: 5
    • View Profile
Re: "Get Time Span Between Dates" not storing value
« Reply #2 on: November 30, 2019, 05:14:36 PM »
That's what I thought, but it's the default "MM/dd/yyyy hh:mm"

DevinFM

  • Playmaker Newbie
  • *
  • Posts: 5
    • View Profile
Re: "Get Time Span Between Dates" not storing value
« Reply #3 on: December 03, 2019, 03:10:05 PM »
Changed the formatting to match this (https://hutonggames.com/playmakerforum/index.php?topic=20414.0) post, still nothing.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4613
    • View Profile
    • jinxtergames
Re: "Get Time Span Between Dates" not storing value
« Reply #4 on: December 03, 2019, 08:06:24 PM »
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 :)


DevinFM

  • Playmaker Newbie
  • *
  • Posts: 5
    • View Profile
Re: "Get Time Span Between Dates" not storing value
« Reply #5 on: December 04, 2019, 03:30:16 PM »
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.


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14684
  • Official Playmaker Support
    • View Profile
Re: "Get Time Span Between Dates" not storing value
« Reply #6 on: December 04, 2019, 11:05:43 PM »
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.



can you give us the actual value of your your string input for that action?

Bye,

 Jean


DevinFM

  • Playmaker Newbie
  • *
  • Posts: 5
    • View Profile
Re: "Get Time Span Between Dates" not storing value
« Reply #7 on: December 05, 2019, 09:38:27 AM »
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.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4613
    • View Profile
    • jinxtergames
Re: "Get Time Span Between Dates" not storing value [SOLVED]
« Reply #8 on: December 06, 2019, 08:49:01 AM »
Hi,
Happy to help :)