Page 1 of 2

Global timer

Posted: Sun Oct 26, 2014 12:23 pm
by cromcrom
Is there a way to set up a global timer, that will carry on at the same "speed" over different areas ?

Re: Global timer

Posted: Sun Oct 26, 2014 2:31 pm
by Ixnatifual
Perhaps you could teleport the timer to the new area when the party changes location. Or attach it to the party.

Re: Global timer

Posted: Sun Oct 26, 2014 2:38 pm
by NutJob
I found the timer slows down, too, if the party leaves the level it's on.

Re: Global timer

Posted: Sun Oct 26, 2014 3:18 pm
by cromcrom
Exactly.

Re: Global timer

Posted: Sun Oct 26, 2014 3:28 pm
by Batty
I'm doing a timer test, I'll have a thread on it. If you want a global timer, you probably need it to "follow" the party wherever they go.

Re: Global timer

Posted: Sun Oct 26, 2014 4:36 pm
by Komag
You create a separate timer for every level, and just have the timer on the party level be the next that updates your ticker

Re: Global timer

Posted: Sun Oct 26, 2014 5:10 pm
by cromcrom
Thanks for the ideas, I will give it a try once I have some more script definitions

Re: Global timer

Posted: Sun Oct 26, 2014 6:16 pm
by cromcrom
Something I could try is to have a "party_detect" timer that runs all the time on each level. If it detects the party on his level, then it starts the "global_timer" that is also on this level. If it doesn't detect the party, it turns the "global_timer" off.

I really don't like that. At all.

Re: Global timer

Posted: Mon Oct 27, 2014 7:01 am
by Diarmuid
The onGui / onUpdate timer solution will be the easiest to implement once we get the reference.

Re: Global timer

Posted: Wed Oct 29, 2014 7:05 pm
by JKos
I suddenly got this crazy idea that I have to try to attach a TimerComponent to the Party-object. And you know what? It works :o

Code: Select all

defineObject{
   name = "party",
   baseObject = "party",
   components = {
		{
			class = "Timer"
		}
   }
}
then in script:

Code: Select all

party.timer:addConnector("onActivate", "t", "onPartyTimer")
Now you have a timer which follows the party. But I haven't tested this much, so it's possible that it causes some problems.