Page 1 of 1

Resting quest

Posted: Sat Jan 05, 2013 6:39 pm
by xbdj
How do you code a puzzle like "rest where the 2 dragons gaze"
Im guessing it must be some hook thing with onRest() function...but I cant quite wrap my head around it...

Preferrably I would like the puzzle to check where and how long the party rests

Re: Resting quest

Posted: Sat Jan 05, 2013 6:44 pm
by Phitt
I would probably use the onRest hook, check for the party position (party.level, party.x, party.y - you could also use a hidden pressure plate that triggers a counter or something and check for that) and if it returns true I'd start a timer. Then you could use the onWakeUp hook to reset and stop the timer if the party wakes up to early. There may be a more elegant way, but this is what comes to my mind right now.

Re: Resting quest

Posted: Sat Jan 05, 2013 6:51 pm
by xbdj
Sounds about right

But where to place that hook? Is that in some external lua file?
Or in a script entity in the editor?

ps: playing the Mine right now ;-)
Cool stuff...!

Re: Resting quest

Posted: Sat Jan 05, 2013 7:00 pm
by xbdj
I think I figured it out
Cloned the party in a lua file and added the "onRest" hook...

Re: Resting quest

Posted: Sat Jan 05, 2013 7:43 pm
by Komag
by the way, the two statues gaze puzzle on level 5 doesn't require resting at all, just standing in that square for 31s (if you step off and back on the timer resets).

Re: Resting quest

Posted: Sat Jan 05, 2013 9:38 pm
by xbdj
Ah ok, cool

Well...my wife decided that you need to actually rest for this puzzle, so I had to do the programming right
And not cheat like Almost Human ;-)

Re: Resting quest

Posted: Sat Jan 05, 2013 11:58 pm
by Komag
I discovered a lot of "cheating" going on throughout my rebuild, some interesting shortcuts that work well usually. :)