
Beta-1.2.11 now available!
Re: Beta-1.2.11 now available!
To clarify currently Timer:activate() resets the timer and starts it, Timer:deactivate() stops the timer without resetting it, and toggle() starts/stops the timer without resetting. So if I change toggle() to reset the timer everybody's happy, right? 

- Montis
- Posts: 340
- Joined: Sun Apr 15, 2012 1:25 am
- Location: Grimrock II 2nd playthrough (hard/oldschool)
Re: Beta-1.2.11 now available!
See my post on the last page:
Montis wrote:I'm not quite sure but having activate, deactivate AND reset would probably leave open the most possibilities.
Although this could screw some existing scripts.
So I would suggest leaving everything as is and adding reset and continue methods for those that want to use it, what do you think?
Or alternatively do the reset on deactivate and add a pause method. Or everything combined
Re: Beta-1.2.11 now available!
but would that leave the possibility of the "pause" method? It could just be left as-is, because right now we have the option to toggle if we want a "pause" effect, or we can do deactivate/activate to get a reset effectpetri wrote:To clarify currently Timer:activate() resets the timer and starts it, Timer:deactivate() stops the timer without resetting it, and toggle() starts/stops the timer without resetting. So if I change toggle() to reset the timer everybody's happy, right?
but changing toggle() to reset the timer would be good for consistency, so maybe there should be some new way for authors to have a "pause" method, could even just be called "pause" with the understanding that repeated signals will pause/unpause/pause/unpause
Finished Dungeons - complete mods to play
Re: Beta-1.2.11 now available!
Well, I'm not convinced that pause is needed. Any scenarios in mind that would need pause?
Re: Beta-1.2.11 now available!
Just store the timer value before toggling it to get the pause effect, if you rely need it.
Re: Beta-1.2.11 now available!
I was thinking of some "LONG" timer possibilities, but they'd be rare enough that getting and storing the timer value could work easily enough I guess
Finished Dungeons - complete mods to play
- Montis
- Posts: 340
- Joined: Sun Apr 15, 2012 1:25 am
- Location: Grimrock II 2nd playthrough (hard/oldschool)
Re: Beta-1.2.11 now available!
I don't think you can access a timer value. You would need to do it with a tick-counter.
Anyway, I could see a usage that the player would have to step on a specific square or plate a complete total of [interval] seconds for something to happen. This could of course be also done with a tick-counter.
Anyway, I could see a usage that the player would have to step on a specific square or plate a complete total of [interval] seconds for something to happen. This could of course be also done with a tick-counter.
- Montis
- Posts: 340
- Joined: Sun Apr 15, 2012 1:25 am
- Location: Grimrock II 2nd playthrough (hard/oldschool)
Re: Beta-1.2.11 now available!
Another thing that happens when the reset is on activate:
I have a delay timer on opening a door and two corridors leading to it. In each corridor I have a hidden pressure plate that activates the delay timer, but when I step on one hidden plate and then on the other, the timer resets instead of just staying active, thus increasing the time the door stays closed.
Obviously I know how to do a workaround, but it might be a bit counter-intuitive for others.
I have a delay timer on opening a door and two corridors leading to it. In each corridor I have a hidden pressure plate that activates the delay timer, but when I step on one hidden plate and then on the other, the timer resets instead of just staying active, thus increasing the time the door stays closed.
Obviously I know how to do a workaround, but it might be a bit counter-intuitive for others.
-
- Posts: 163
- Joined: Fri Sep 14, 2012 6:20 pm
Re: Beta-1.2.11 now available!
Activate - Starts Timerpetri wrote:Good catch! Activating a timer with toggle() and activate() should have the same effect but clearly it doesn't. I need to think about this a bit. I'm leaning towards removing the side-effect that resets timer's value when it is activated, and adding a new method for manually resetting timer. Any comments which behavior would be logical?
Deactivate - Stops a running timer
Toggle - Starts a stopped timer / Stops a running timer
Add a timer:reset() function for .lua scripting....adding a reset field would likely break a lot of dungeons...if it doesn't already exist

Therefore we have full control over the timer!
My tuppence worth

Re: Beta-1.2.11 now available!
Here's one: Think about something Indiana Jones style. The party steals some valuable treasure and then have fixed number of seconds before the exit closes down. It is not enough to reach the exit if you run straight, but if you step on specific plates, the timer pauses.petri wrote:Well, I'm not convinced that pause is needed. Any scenarios in mind that would need pause?