How do you prevent a party from resting?

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
WaspUK1966
Posts: 135
Joined: Sat Aug 09, 2014 9:17 am

How do you prevent a party from resting?

Post by WaspUK1966 »

I want to stop the party resting if there is a monster near. Not sure of the code. Do you need to "read" when the R key is pressed, so that it runs a script that prevents the party resting? Or is there another way? Any help greatly appreciated.

George
User avatar
Dr.Disaster
Posts: 2876
Joined: Wed Aug 15, 2012 11:48 am

Re: How do you prevent a party from resting?

Post by Dr.Disaster »

According to the modding reference "Party:isResting()" should tell if the party rests and "Party:wakeUp(immediate)" wakes it up again. The parameter immediate controls how fast the wakeup is.
minmay
Posts: 2770
Joined: Mon Sep 23, 2013 2:24 am

Re: How do you prevent a party from resting?

Post by minmay »

You might find the scripting reference and asset definition reference interesting reads. They tell you exactly how to do this:
party.onRest: a hook which is called when the party starts resting. The function gets one parameter, the party itself. If the function returns false, resting is cancelled.
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.
Post Reply