Any ideas somebody ?
script which prevents sleeping
script which prevents sleeping
Help pls. Subject is quite clear - I need to disable sleeping possibility in particular level of the dungeon. As I do not think that it is possible to completely disable Zzz option, just to make that hp/energy will be not replenished up during sleep is fine
Any ideas somebody ?
Any ideas somebody ?
Re: script which prevents sleeping
simply break onRest hook for the party, or set up a temporary condition which causes it to return false for a while so that it will work again later 
Finished Dungeons - complete mods to play
Re: script which prevents sleeping
aah. hooks. not there yetKomag wrote:simply break onRest hook for the party, or set up a temporary condition which causes it to return false for a while so that it will work again later
Also I am wondering some script which disable mappin on automap ? I need some area of the level have no possibility to be automaped (could be bordered by hidden pressure plates)
- JohnWordsworth
- Posts: 1397
- Joined: Fri Sep 14, 2012 4:19 pm
- Location: Devon, United Kingdom
- Contact:
Re: script which prevents sleeping
Editing party hooks is as easy as using a clone of the party object and over-riding the provided onX hook functions. In order to prevent sleeping, you just need to do the following.
I've got this weird hunch that if you have onRest / onWakeUp then you have to have the other (this is certainly true if you want to override onWakeUp, if you don't override onRest then it causes a crash I think - or at least it used too).
If you want to make it conditional (only when the party is on level 3 of your dungeon say), do something like...
Enjoy!
Code: Select all
cloneObject{
name = "party",
baseObject = "party",
onRest = function(party)
return false;
end,
onWakeUp = function(party)
end,
}If you want to make it conditional (only when the party is on level 3 of your dungeon say), do something like...
Code: Select all
cloneObject{
name = "party",
baseObject = "party",
onRest = function(party)
if ( party.level == 3 ) then
return false;
end
end,
onWakeUp = function(party)
end,
}My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
Re: script which prevents sleeping
wow I am quite suprised of capacatibility of this editor... really awesome, thanks a lot, working fine as I intended.JohnWordsworth wrote:Editing party hooks is as easy as using a clone of the party object and over-riding the provided onX hook functions. In order to prevent sleeping, you just need to do the following.
I've got this weird hunch that if you have onRest / onWakeUp then you have to have the other (this is certainly true if you want to override onWakeUp, if you don't override onRest then it causes a crash I think - or at least it used too).Code: Select all
cloneObject{ name = "party", baseObject = "party", onRest = function(party) return false; end, onWakeUp = function(party) end, }
If you want to make it conditional (only when the party is on level 3 of your dungeon say), do something like...
Enjoy!Code: Select all
cloneObject{ name = "party", baseObject = "party", onRest = function(party) if ( party.level == 3 ) then return false; end end, onWakeUp = function(party) end, }
Re: script which prevents sleeping
if you're not going to put anything in onWakeUp you don't need that part in there
Finished Dungeons - complete mods to play
- JohnWordsworth
- Posts: 1397
- Joined: Fri Sep 14, 2012 4:19 pm
- Location: Devon, United Kingdom
- Contact:
Re: script which prevents sleeping
@Komag: Are you certain of that (I should test it really). There was a crashing bug before XMas where if you defined onWakeUp but not onRest the the game would crash when you woke up! I know this is the opposite, and might also be fixed now, but I just wanted to highlight it incase!
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
Re: script which prevents sleeping
I suppose I'm not certain, maybe something has changed in new version, worth testing to be sure (it doesn't make sense to me that the crash you rescind happens, sounds like a bug)
Finished Dungeons - complete mods to play
Re: script which prevents sleeping
I'm using this no rest code in Onkalo project and have gotten no complaint about it:
This function is attached to a timer called no_rest_timer with 0 time and timer is started at start of game and running constantly. Yup I'm a lazy coder doing all the shortcuts 
Code: Select all
function restcheck()
if party:isResting() == true then
party:wakeUp(true)
hudPrint("You feel at unease resting here.")
end
end
Re: script which prevents sleeping
According to the releasenotes this has been fixed in version 1.3.6:Komag wrote:I suppose I'm not certain, maybe something has changed in new version, worth testing to be sure (it doesn't make sense to me that the crash you rescind happens, sounds like a bug)
Didn't test it though.bug fix: crash when party stops resting and there is a onRest hook but no onWakeUp hook
Did you visit the Wine Merchant's Basement? And heard about the Awakening of Taarnab?
