Community

SCI Programming => SCI Community How To's & Tutorials => Topic started by: miracle.flame on February 10, 2025, 04:54:31 AM

Title: LSL6 Interface help question mark bug
Post by: miracle.flame on February 10, 2025, 04:54:31 AM
How to reproduce:
1. Skip intro into game
2. Go in menu Help - Interface
3. Dialog says "Click once to clear this message. When you do, your cursor will change into a Question Mark. Pass the Question Mark over the other areas of the screen to learn what they do. When you are done, click again anywhere to turn off these messages." which comes from n093.msg
4. Click as the message suggests

Result: Cursor is not Question Mark but Hourglass instead, otherwise the function of cursor works as help (expected).
This is reproducible with vanilla LSL6SVGA in Dosbox and ScummVM alike.

There is no script n093 but there's ll6ControlPanel.sc (https://github.com/sluicebox/sci-scripts/blob/5ce19d3be606f2f9a758f54144904d201bc4a8e9/lsl6-cd-dos-1.000.000/src/ll6ControlPanel.sc#L202) with very similar message "Click once to clear this message. Your cursor will change into a Question Mark. Pass the Question Mark over the Control Panel to learn what each knob does. Click again to turn off these messages." though this message does not really display in Control Panel after clicking the help icon - there's another message "This is where you clicked to pull down the Help menu."

There's also nClickHelp.sc (https://github.com/sluicebox/sci-scripts/blob/5ce19d3be606f2f9a758f54144904d201bc4a8e9/lsl6-cd-dos-1.000.000/src/nClickHelp.sc) which looks like it's involved.

Title: Re: LSL6 Interface help question mark bug
Post by: doomlazer on February 11, 2025, 12:13:19 AM
In nClickHelp (https://github.com/EricOakford/SCI-Decompilation-Archive/blob/3a779bdb7c0dc2294cc57c34cef88d4e9c65322e/lsl6svga/src/nClickHelp.sc#L53) script 75 doit method (theGame setCursor: helpCursor) needs to be inside the while loop.

Code: [Select]
(method (doit &tmp temp0 temp1 temp2)
(= temp2 gTheCursor)
;(gGame setCursor: helpCursor)
(while (!= ((= temp1 (Event new:)) type:) evMOUSEBUTTON)
(gGame setCursor: helpCursor) ;move here
(temp1 y: (- (temp1 y:) 10))
(= temp0 (self firstTrue: #onMe temp1))
(if (and (gTalkers size:) (!= local0 temp0))
(gMessager cue:)
)
Title: Re: LSL6 Interface help question mark bug
Post by: miracle.flame on February 11, 2025, 02:16:19 PM
I've tried to make the change and compile but that failed:
Title: Re: LSL6 Interface help question mark bug
Post by: miracle.flame on February 11, 2025, 02:28:30 PM
OK, I've tried to use sluicebox's scripts and that compiled successfully.
Note that this time reverting resource files to vanilla after compilation and using just the exported 75.scr worked without troubles.
Title: Re: LSL6 Interface help question mark bug
Post by: Kawa on February 11, 2025, 02:34:25 PM
The error message doesn't lie. nClickHelp is an instance of a Set so it can't add selectors (methods or properties), only change them.
Title: Re: LSL6 Interface help question mark bug
Post by: doomlazer on February 17, 2025, 10:29:15 AM
Sluicebox's SVM fix:
https://github.com/scummvm/scummvm/commit/8a5c1f20e031d34504fe58db8dc6161784be8d63

...and suggestion for patch file:
Code: [Select]
(method (doit &tmp temp0 temp1 temp2 prevWaitCursor)
    (= temp2 gTheCursor)
   
    ; 1. set current cursor and wait cursor to helpCursor so
    ; that LarryTalker will use them instead of the hourglass.
    (= prevWaitCursor gWaitCursor)
    (= gWaitCursor helpCursor)
    (gGame setCursor: helpCursor)
   
    (while (!= ((= temp1 (Event new:)) type:) evMOUSEBUTTON)
        (temp1 y: (- (temp1 y:) 10))
        (= temp0 (self firstTrue: #onMe temp1))
        (if (and (gTalkers size:) (!= local0 temp0))
            (gMessager cue:)
        )
        (if (and temp0 (!= temp0 local0))
            (Print font: gUserFont width: 250 modeless: 2)
            (gMessager
                say: (temp0 noun:) (temp0 case:) 0 1 0 (temp0 modNum:)
            )
        )
        (= local0 temp0)
        (temp1 dispose:)
    )
    (temp1 dispose:)
    (if (gTalkers size:)
        (gMessager cue:)
    )
    (gGame setCursor: temp2)
   
    ; 2. restore gWaitCursor
    (= gWaitCursor prevWaitCursor)
)