Page 1 of 1

How do you prevent a party from resting?

Posted: Thu Nov 27, 2014 7:41 pm
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

Re: How do you prevent a party from resting?

Posted: Thu Nov 27, 2014 7:57 pm
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.

Re: How do you prevent a party from resting?

Posted: Thu Nov 27, 2014 8:34 pm
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.