Jump to content

Crash-on-rest bug workarounds?


Recommended Posts

Semi-reposting this here with dim hopes that maybe someone with more knowledge might have ideas for a solution.

Aaand, I got hit with the crash-on-sleep bug. Sigh. I wish some who owned the source code for these games would allow for some bug-fixing in the engine. 

The bug occurs when you press the ‘rest’ button and a party member is injured. The game automatically checks all your memorized spells for healing effects, and auto-casts whatever it can to bring the whole party up to full health. Convenient! I guess. But if the game has to check more than 255 memorized spells, it freaks out and crashes. Because it’s 2024 and apparently 257 is still considered a really big number…? 

Anyway so my 4th level psionicist knows 11 psionic powers, and has 29 psionic strength points, which = 319 memorized spells. (Plus a couple Bhaalspawn powers and other innate abilities.) And 319 is a really big number - like, even bigger than 257! So… crash. 

Sigh. 

Is there any way this could be avoidable Can the Rest button be disabled/enabled by script?

Maybe UI modding could do something? Put an overlay over the rest button that triggers something other than resting? Maybe have it trigger a script?

I could probably write out a .BCS script that does the work of the auto-heal routine without crashing. Might involve a couple seconds’ delay, but that’s fine. I just don’t know how to insert such a script in between pressing a UI element and the engine doing its Rest thing. 

Link to comment
Posted (edited)

Well, the easiest thing would be to turn off "Rest Until Healed" option :)

 

As for UI modding - I'm pretty sure it's possible. This is the code for Rest button:
 

	button
	{
		area 3 110 73 55
		bam GUILS10
		sequence 9
		tooltip lua "getTooltipWithHotkey(31,11942)"
		tooltip force lua "sidebarForceTooltips == 1"
		tooltip force top
		clickable lua "sidebarsGreyed ~= 1"
		action
		"
			e:GetActiveEngine():OnRestButtonClick()
		"
	}

you can put some code before OnRestButtonClick or just remove it altogether. Just know that what you can do in GUI without Eeex is very limited.

Edited by SparrowJacek
Link to comment
Posted (edited)
2 hours ago, SparrowJacek said:

Well, the easiest thing would be to turn off "Rest Until Healed" option

That setting is irrelevant in this case. That option means that, if you would have to cast healing spells twice over to heal fully, then it has you rest for 16 hours to simulate it. 

With this bug, you could only have a few points of damage, necessitating a single Cure spell, so the engine would cure you and then apply a single 8-hour rest. But if you have 257 memorized spells, it crashes. 

Edited by subtledoctor
Link to comment
9 hours ago, subtledoctor said:

I could probably write out a .BCS script that does the work of the auto-heal routine without crashing. Might involve a couple seconds’ delay, but that’s fine. I just don’t know how to insert such a script in between pressing a UI element and the engine doing its Rest thing.

I'm not sure how to edit the Rest button, but for practical purposes, you could be as diabolical as I would be, and disable the button completely, then just use a script that triggers at the press of 'Z'. However, script resting doesn't trigger sleep interruptions, so yeah you can't get away with it sadly, at least not without basically completely trivializing resting mechanics into just pressing the key itself (not that it isn't very far from that already either but it'd make it way worse).

Link to comment
Posted (edited)

> However, script resting doesn't trigger sleep interruptions, so yeah you can't get away with it sadly

Is that not possible to recode interruptions (and dreams I suppose) in scripts?

EDIT: Meh probably a stupid question, disregard

Edited by mickabouille
Link to comment

I don't think it's a stupid question, I've already considered recoding interruptions, but uhh, it's just a ginormous amount of work, since those work on a by-area basis and have several kinds of checks, probabilities etc that would all have to be simulated on script *for every area in the game*. So, even if doable, it's not practical at all. And dreams I think there's just no way around them, maybe I'm wrong but at best you'd just play them after the rest, I actually don't know very well what exactly triggers them.

Link to comment

My very rough thought is: the “Dee’s Permanent Thieving Button” for cleric/thieves adds a UI element which triggers a virtual keypress, which is bound to the thieving ability. 

So maybe it would be possible to add a new UI element covering the Rest button, which runs a script to heal the party, and then 1) if the party still has damage it would do a scripted Rest action; or 2) if the party is healed it would trigger a virtual keypress which triggers the actual proper (hidden) Rest button

So the interruptions and dreams etc. would still happen, if you get to full health during that process. 

Hm, that would not address resting at an inn, though…

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...