Need help understanding timers and counters.

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
sevenbirds
Posts: 10
Joined: Wed Sep 19, 2012 9:26 am

Re: Need help understanding timers and counters.

Post by sevenbirds »

Hello everyone,

I just wanted to chime in and say that this worked wonderfully. I implemented this in a maze full of ogres and had a friends test it out. It really got him sweating! Thanks for creating awesome posts guys.
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Need help understanding timers and counters.

Post by Komag »

sounds great - it's always good news to hear something works the right way!
Finished Dungeons - complete mods to play
davehca
Posts: 21
Joined: Sat Sep 15, 2012 6:09 pm

Re: Need help understanding timers and counters.

Post by davehca »

Grimwold wrote:Awesome! Thanks for the quick reply. Somehow I missed the getValue hook when reading the reference.

I had to make one change to your script to get it to work, as hudPrint was expecting a string.

Code: Select all

function printTime()
  hudPrint(tostring(time_01:getValue()))
end
I couldn't get this to work. I created a timer; timer_1 is it's ID in the Inspector. Reading the above, I tried

hudPrint(tostring(timer_1:getValue()))

but it returns "attempt to call method 'getValue' (a nil value)"

So what I am doing wrong?
User avatar
Montis
Posts: 340
Joined: Sun Apr 15, 2012 1:25 am
Location: Grimrock II 2nd playthrough (hard/oldschool)

Re: Need help understanding timers and counters.

Post by Montis »

What you're doing wrong is that timers don't have a getValue() method. Grimwold was referring to "time", which was a counter.

http://www.grimrock.net/modding/scripting-reference/
When destiny calls, the chosen have no choice.

My completed dungeon (LoG1): Hypercube
davehca
Posts: 21
Joined: Sat Sep 15, 2012 6:09 pm

Re: Need help understanding timers and counters.

Post by davehca »

[quote="Montis"]What you're doing wrong is that timers don't have a getValue() method. Grimwold was referring to "time", which was a counter.

d'oh! :oops:

Thanks.
Post Reply