timers behaving weird

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!
Post Reply
kelly1111
Posts: 349
Joined: Sun Jan 20, 2013 6:28 pm

timers behaving weird

Post by kelly1111 »

question: I presure plate connected to a timer (interval 3) , the presure plate to set onactivate timer start

the timer connected to a spawner and a counter. The counter decrements from 6 and the spawner activates each interval

the problem I have is, that the timer fires even without me stepping on the presure plate (plate is set to party only) .. I dont understand why it starts out of itself?

Can anyone figure out what I am doing wrong? ... i need it to start only when stepping on the presure plate
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: timers behaving weird

Post by minmay »

TimerComponent starts out running by default. You can get the behaviour you want by disabling the TimerComponent (uncheck its box) in the editor.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Azel
Posts: 808
Joined: Thu Nov 06, 2014 10:40 pm

Re: timers behaving weird

Post by Azel »

kelly1111 wrote:question: I presure plate connected to a timer (interval 3) , the presure plate to set onactivate timer start

the timer connected to a spawner and a counter. The counter decrements from 6 and the spawner activates each interval

the problem I have is, that the timer fires even without me stepping on the presure plate (plate is set to party only) .. I dont understand why it starts out of itself?

Can anyone figure out what I am doing wrong? ... i need it to start only when stepping on the presure plate
On every one of my maps where I use a timer, I include a script that has the following line:

Code: Select all

my_timer.timer:stop();
This code runs as soon as the Map Level loads, which prevents the timer from running automatically. This limits my timer to running only when the proper event (eg, a floor_trigger) takes place. I usually have a single Script Object on each level whose sole purpose is to run what I call "Initialization Commands."

If you do this on your map, the timer won't run until the pressure plate is clicked. Hope this helps.
Post Reply