playMaker

Author Topic: constant int increment while boolean is true  (Read 1158 times)

robau

  • Playmaker Newbie
  • *
  • Posts: 1
constant int increment while boolean is true
« on: April 24, 2017, 02:22:15 PM »
Hi, first post here.

I'm trying to set up a very simple time-system, that I have previously coded in c#.

How it's supposed to work step by step:

variables:
int seconds
int mintues
int hours
int days
int months
int years
boolean isPaused

now to the meaty part:

If isPaused = False, increase int seconds every frame.
If int seconds >= 60 -> minute++
If int minute >= 60 -> hour++
If int hour >= 24 -> day++

In C# it was rather easy, as I could just do:
second += Time.deltaTime; but I can't figure out how to do it in playmaker, I'm rather new to this plugin.

That didn't quite work:
« Last Edit: April 24, 2017, 02:29:49 PM by robau »

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: constant int increment while boolean is true
« Reply #1 on: April 24, 2017, 11:41:39 PM »
You can do it like so  :)
Very simple system like this. If you wanted minutes, hours, days, you could set that up in playmaker too. However, it might be easier to write a custom action. Send me your exact c# code if you want, and I can make you a custom action.
« Last Edit: April 24, 2017, 11:43:54 PM by tcmeric »