Page 2 of 2

Re: Global timer

Posted: Wed Oct 29, 2014 7:37 pm
by Ixnatifual
Ixnatifual wrote:Or attach it to the party.
:P

Re: Global timer

Posted: Wed Oct 29, 2014 8:02 pm
by JKos
Damn ;) I thought that it was an unique idea. But it seems to work so far, no more complicated scripts or timers on every level needed for this.

Re: Global timer

Posted: Wed Oct 28, 2015 7:23 pm
by FeMaiden
JKos wrote: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.
do you need to create a function () for this?
or do I just copy paste that into a scripting entity?