Trouble with levels not updating when party is not on them

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

Trouble with levels not updating when party is not on them

Post by MrChoke »

I am learning how the game works as it relates to refreshing entities on different levels from the one the party is on. I observed the behavior with how often onThink() was called months ago. But it applies to more than that. Its basically everything. The way it seems to work is:

Any level that is adjacent to the party's level (adjacent is defined with up and down as well), then the game will update game entities about every 8 to 10 seconds. This is not only related to how often it calls hooks like onThink() for any monster on that level. But it doesn't even update object updates like doors opening and closing until after a 10 second delay. Yes, isOpen() will reflect the state change immediately but calls like checkObstacle() and checkLineOfSight() will not register the door being opened until later. This can be easily confirmed. Just trigger a door to open 2 or more levels away from the party and keep calling checkObstacle2(). It will keep saying door for 10 seconds.

If the level is more than one level away, all entities will not be updated AT ALL!! Note, as soon as the party enters the level, all pending refreshes are immediately done. And if the party becomes only 1 level adjacent they start getting done but after the delay.

So this hurts my plans badly. I was going to control the AI off level with delayedCall() but how can I get entities like doors to update???

To AH, is there a way to force a level update via script??

Thanks
Post Reply