Page 1 of 1

TIMER ISSUES IN LOG2

Posted: Tue Jul 14, 2015 10:46 pm
by WaspUK1966
I think I'm going MAD! In LOG1, a timer wont run until you tell it to (by plate activation etc). But for some reason, any timer I put on a map in LOG2 runs from the start of the mod by itself, without even being activated!. Which is causing me a whole lot of problems with my scripts! . (One of which is supposed to trigger a timer when an item is placed on a altar, but the timer is already running). Doesn't matter what option you select for the timer, onActivate etc, because the damn things just start anyway! AM I missing something here? I've even tried turning the timers off at the start of the level, but they just run anyway. HELP!!!

Re: TIMER ISSUES IN LOG2

Posted: Tue Jul 14, 2015 11:24 pm
by minmay
Yes, you're missing something: you can disable the TimerComponent to stop it from running. It won't run until it's enabled. (Starting it with the "start" method will also enable it.)

Re: TIMER ISSUES IN LOG2

Posted: Wed Jul 15, 2015 10:23 am
by WaspUK1966
Why didn't I try that? Must be losing it! LOL! Works like a charm now. Must have disabled everything except the Timer Component, because I thought the Timer would be permanently disabled if I did..Still learning. Getting there..eventually! Thanks once again.

George

Re: TIMER ISSUES IN LOG2

Posted: Mon Apr 17, 2017 9:23 am
by Halluinoid
I am running a timer ticked (from start)

when I tested it with 10 I saw the door close after 10 seconds, works

however, when i change the 10 to 7200 (2 hours) come back after 2 hours, (the whole of the dungeon game I organised) the door is still open , 2:01 still open, 2:02 still open :evil:

I am looking at the time in "Statistics" from menu while the game is running. I thought when "statistics" shows 2 hours game play, the door would close, it doesn't

My dungeon is designed as a time test "you must return to the Oubliette within 2 hours" if the timer doesn't work as expected it kind of sours the whole thing a bit

Re: TIMER ISSUES IN LOG2

Posted: Mon Apr 17, 2017 12:30 pm
by zimberzimber
Timers located on a level you're not currently on run slower. (About twice as slow from what I could tell)
If you want the timer to stay consistent throughout the whole dungeon, you'll have to define it as a component for the party.

Re: TIMER ISSUES IN LOG2

Posted: Mon Apr 17, 2017 2:51 pm
by Halluinoid
crikey I should have known, sounds right Zimber thanks

reminds me of the Teleporters located on a level you're not currently on run slower. yeah you bet! at least twice as slow

it really helps if you know these things

so in my case I think I do want the timer to stay consistent throughout the whole dungeon, so I'll have to define it as a component for the party. like how do I do that? :lol:

Re: TIMER ISSUES IN LOG2

Posted: Mon Apr 17, 2017 4:05 pm
by zimberzimber
Assuming you know how to define components -
You'll have to redefine the party object (named party) and give it all the extra components you want it to carry.
Like so:

Code: Select all

defineObject{
	name = "party",
	baseObject = "party",
	components = {
		{
			class = "Party",
			-- party hooks go here (Like onDrawGui or onDie)
		},
		{
			class = "Timer",
			name = "myTimer",
			timerInterval = 30,
			disableSelf = true,
			enabled = false,
			onActivate = function(self)
				hudPrint("myTimer onActivated")
			end,
		},
	},
}