Timer interval
Timer interval
How much time is the timer interval? If I set it to 27 I would expect it to count 27 seconds and then activate, but it seems to activate at random times. Thanks in advance for the help.
Grey Island mod(WIP): http://www.grimrock.net/forum/viewtopic ... 99#p123699
Re: Timer interval
It depends on the relative location of the timer; timers that are not on the same map level as the party have reduced processing.
If you MUST have a precise timer, [and assuming Grimrock2] then create it as a timer component on the party object.
Re: Timer interval
I'm new to the game. How would I create a timer component on the party object?
Also I've encountered a new problem. I have it so that when the party steps onto the pressure plate, It starts the timer, but the timer starts before they've stepped on it.
Also I've encountered a new problem. I have it so that when the party steps onto the pressure plate, It starts the timer, but the timer starts before they've stepped on it.
Grey Island mod(WIP): http://www.grimrock.net/forum/viewtopic ... 99#p123699
- Zo Kath Ra
- Posts: 937
- Joined: Sat Apr 21, 2012 9:57 am
- Location: Germany
Re: Timer interval
Put this code in a script entity:
Code: Select all
function timerTick()
print(Time.currentTime())
end
party:createComponent("Timer")
party.timer:addConnector("onActivate", self.go.id, "timerTick")
currentLevelOnly = false
disableSelf = false
timerInterval = 1
triggerOnStart = false
To change these values:
party.timer:setCurrentLevelOnly(true)
party.timer:setDisableSelf(true)
party.timer:setTimerInterval(27)
party.timer:setTriggerOnStart(true)
If you want to attach multiple timers to the party, you must give them names.
Example:
Code: Select all
function timerTick1()
print("timerTick1", Time.currentTime())
end
function timerTick2()
print("timerTick2", Time.currentTime())
end
party:createComponent("Timer", "timer_1")
party.timer_1:setTimerInterval(5)
party.timer_1:addConnector("onActivate", self.go.id, "timerTick1")
party:createComponent("Timer", "timer_2")
party.timer_2:setTimerInterval(10)
party.timer_2:addConnector("onActivate", self.go.id, "timerTick2")
party:removeComponent("timer")
party:removeComponent("timer_1")
party:removeComponent("timer_2")
- Zo Kath Ra
- Posts: 937
- Joined: Sat Apr 21, 2012 9:57 am
- Location: Germany
Re: Timer interval
You need to disable the Timer component.
In the dungeon editor, click on the timer and remove the check mark next to Components -> timer.
If the check mark is set, the timer starts running automatically as soon as the dungeon has been loaded.
Re: Timer interval
okay thanks.
Grey Island mod(WIP): http://www.grimrock.net/forum/viewtopic ... 99#p123699