1
SCI Syntax Help / Re: [LB2CD] approachVerbs causes inset to display graphical issues
« on: November 13, 2025, 06:08:32 PM »
Thanks again for your time and the helpful suggestions, it's appreciated. You're totally right about Insets and it's very likely that's related. "(Animate gCast 0)" or "(Animate gCast 1)" kept throwing me errors but I've seen that all around LB2CD, what's used to update the cast is "(Animate (gCast elements?) 1)" or "(Animate (gCast elements?) 0)", so I gave them a go. Unfortunately the inset keeps behaving in the same glitchy way. It's as if the game only found opportunity to update the cast once the inset is already being shown, no matter what I try within safeDoor:doVerb, but it can be just my impression.
I've been investigating a bit how Features work in the game, more specifically how they handle events, to try to understand better what's going on. I've seen that Feature:handleEvent is where is checked if ego needs to approach the Feature/Prop/View, and uses Polypath to move it if that's the case. Here:
https://github.com/sluicebox/sci-scripts/blob/12c1ab894c4bd5fbf4157eb18a9e86653ec15d1b/ra-cd-dos-1.1/src/Feature.sc#L121-L148
If ego doesn't need to approach or face the object, "(CueObj changeState: 3)" is called, CueObj in turn runs the client's doVerb method during state 3 (the client here would be safeDoor). If ego needs to approach the object, CueObj is instead called from the start after ego has been moved with Polypath.
So, CueObj's states 1 and 2 only get executed when the object has approachVerbs and ego needs to approach it (the exact situation where this inset's glitch happens). State 1 changes ego's heading so it faces the object, but state 2 has a 3 cycles wait to give ego time to face the object:
https://github.com/sluicebox/sci-scripts/blob/12c1ab894c4bd5fbf4157eb18a9e86653ec15d1b/ra-cd-dos-1.1/src/Feature.sc#L30
I've done a quick and dirty modification in state 2 to see what happens if I skip that wait:
I'll keep investigating, but if I'm unable to do further progress I think I'll end up reusing one of the Script instances already existing in #561 to call inDial from there whenever I need it. It wouldn't be the most elegant solution ever but that would be safe, would avoid the glitch and it wouldn't require a heap patch. Please let me know if you happen to look more into it and figure out another way to tackle this.
I've been investigating a bit how Features work in the game, more specifically how they handle events, to try to understand better what's going on. I've seen that Feature:handleEvent is where is checked if ego needs to approach the Feature/Prop/View, and uses Polypath to move it if that's the case. Here:
https://github.com/sluicebox/sci-scripts/blob/12c1ab894c4bd5fbf4157eb18a9e86653ec15d1b/ra-cd-dos-1.1/src/Feature.sc#L121-L148
If ego doesn't need to approach or face the object, "(CueObj changeState: 3)" is called, CueObj in turn runs the client's doVerb method during state 3 (the client here would be safeDoor). If ego needs to approach the object, CueObj is instead called from the start after ego has been moved with Polypath.
So, CueObj's states 1 and 2 only get executed when the object has approachVerbs and ego needs to approach it (the exact situation where this inset's glitch happens). State 1 changes ego's heading so it faces the object, but state 2 has a 3 cycles wait to give ego time to face the object:
https://github.com/sluicebox/sci-scripts/blob/12c1ab894c4bd5fbf4157eb18a9e86653ec15d1b/ra-cd-dos-1.1/src/Feature.sc#L30
I've done a quick and dirty modification in state 2 to see what happens if I skip that wait:
Code: [Select]
[...]
(2
(self changeState 3)
;(= cycles 3)
)
[...]After doing this, the inset glitch no longer happens after ego approaches the object. Leaving a change like that in CueObj is of course a horrible idea, this was just to investigate the matter at hand. At least now the glitch isn't so "mysterious" anymore, that 3 cycles wait makes a big difference in this case, though I don't exactly understand why it would. Maybe some of you here knows.I'll keep investigating, but if I'm unable to do further progress I think I'll end up reusing one of the Script instances already existing in #561 to call inDial from there whenever I need it. It wouldn't be the most elegant solution ever but that would be safe, would avoid the glitch and it wouldn't require a heap patch. Please let me know if you happen to look more into it and figure out another way to tackle this.
