Set timer command?

New releases and general discussions.

Post » Mon Mar 10, 2008 6:42 pm

Would it be difficult to implement a 'set timer' action? The shooter I'm working on uses timed events extensively, and there are parts where I need to basically pause the timer (set it to a value every frame). That would be very helpful for branching paths, too.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Mon Mar 10, 2008 6:52 pm

I can do one in a build or two, but you can work around it using your own clock in a global variable. Store the clock offset in a global, and use a function in the function object to get the time - return from the function something along the lines of:
timer - global('clock offset')

Then, to set the timer, you can change the 'clock offset' variable.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,630

Post » Mon Mar 10, 2008 8:11 pm

I had tried making my own timer, but kept running into reasons why the conditions wouldn't work - but I just realized a way to make it work (forgot about that handy 'trigger once' condition!). I guess I don't need that feature after all (tho it would still be handy). Either way, thanks!
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Mon Mar 10, 2008 10:53 pm

I guess I spoke too soon - the events I'm making sometimes aren't running, and I don't know why. :( If that set timer action would still be possible, I'd really appreciate it.

Edit: Stupid post, they were running, reason was my fault. :roll:
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 0 guests