What if delayedScript is pending and the game is saved?

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
MrChoke
Posts: 324
Joined: Sat Oct 25, 2014 7:20 pm

What if delayedScript is pending and the game is saved?

Post by MrChoke »

Not that I have seen this first-hand yet in my dungeon but I may. I use delayedScript calls from time to time. What happens to a delayedScript call waiting to execute if the game is saved before it does? Is this condition saved so that a reload will have the delayedScript waiting pick up where they left off? Wondering if anybody knows.
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: What if delayedScript is pending and the game is saved?

Post by petri »

Many things in the main campaign would break if this was not handled.
MrChoke
Posts: 324
Joined: Sat Oct 25, 2014 7:20 pm

Re: What if delayedScript is pending and the game is saved?

Post by MrChoke »

Very good. Just wanted to make sure. Thanks.
User avatar
FeMaiden
Posts: 290
Joined: Wed Jan 16, 2013 8:16 am

Re: What if delayedScript is pending and the game is saved?

Post by FeMaiden »

ouch...I used delayed calls a lot in my mod. Mainly just with the dialogue boxes. I had no idea it could break if someone saved and reloaded in the middle of one. Hopefully nobody does that...
minmay
Posts: 2789
Joined: Mon Sep 23, 2013 2:24 am

Re: What if delayedScript is pending and the game is saved?

Post by minmay »

FeMaiden wrote:ouch...I used delayed calls a lot in my mod. Mainly just with the dialogue boxes. I had no idea it could break if someone saved and reloaded in the middle of one. Hopefully nobody does that...
It can't break. That's what petri just said.
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.
User avatar
FeMaiden
Posts: 290
Joined: Wed Jan 16, 2013 8:16 am

Re: What if delayedScript is pending and the game is saved?

Post by FeMaiden »

minmay wrote:
FeMaiden wrote:ouch...I used delayed calls a lot in my mod. Mainly just with the dialogue boxes. I had no idea it could break if someone saved and reloaded in the middle of one. Hopefully nobody does that...
It can't break. That's what petri just said.
oops, i misinterpreted , i thought he meant, that "we" have to "handle" it or many things would break lol.
never mind.
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: What if delayedScript is pending and the game is saved?

Post by Komag »

Not sure how exactly it is handled in Grimrock, but likely there is some list with entries of delayed scripts to run, with a timer time attached. This list is saved and reloaded properly, everything simply continues as normal. I do the same thing in my Roku game, but there I can't reset the system clock, so I have to save whatever the current clock is, and make sure to subtract that out when loading. But the principle is the same.
Finished Dungeons - complete mods to play
Post Reply