Global timer

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Ixnatifual

Re: Global timer

Post by Ixnatifual »

Ixnatifual wrote:Or attach it to the party.
:P
User avatar
JKos
Posts: 464
Joined: Wed Sep 12, 2012 10:03 pm
Location: Finland
Contact:

Re: Global timer

Post 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.
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
User avatar
FeMaiden
Posts: 290
Joined: Wed Jan 16, 2013 8:16 am

Re: Global timer

Post 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?
Post Reply