Community
SCI Programming => SCI Syntax Help => Topic started by: Scavenger on July 16, 2026, 03:42:39 PM
-
Hey, I'm trying to customise the IconBar in the template game so it's always on screen and at the bottom, as a first step towards turning it into a verb box. So far I have it positioned right and removed all the hide/show commands so it doesn't crash the engine after a few clicks, however it eats all the user input no matter where on screen the mouse is. Is there a way to solve this? I'll paste my edited code below. The scripts are a little hard to read as there's lots of magic numbers and temp variable names, but I'm sure I can work it out. Thanks in advance!
(method (handleEvent pEvent &tmp temp0 pEventType temp2 temp3 theGCursorNumber theCurIcon theCurInvIcon)
(pEvent localize:)
(= pEventType (pEvent type?))
(cond
((& state $0004))
(
(or
(and
(not pEventType)
(& state $0400)
;(<= -10 (pEvent y?))
(<= 168 (pEvent y?) )
(<= 0 (pEvent x?))
(<= (pEvent x?) 320)
(not (= temp0 0))
)
(and
(== pEventType evKEYBOARD)
(or
(== (pEvent message?) KEY_ESCAPE)
(== (pEvent message?) KEY_DELETE)
)
(= temp0 1)
)
)
(pEvent globalize:)
(= oldMouseX (pEvent x?))
(= oldMouseY (pEvent y?))
(= theGCursorNumber gCursorNumber)
(= theCurIcon curIcon)
(= theCurInvIcon curInvIcon)
;(self show:)
;(gGame setCursor: 999)
(if temp0
(gGame
setCursor:
gCursorNumber
1
(+
(curIcon nsLeft?)
(/ (- (curIcon nsRight?) (curIcon nsLeft?)) 2)
)
(- (curIcon nsBottom?) 3)
)
)
(self doit:)
(= temp3
(if (or (gUser canControl:) (gUser canInput:))
(curIcon cursor?)
else
gWaitCursor
)
)
(if temp0
(gGame setCursor: temp3 1 oldMouseX oldMouseY)
else
(gGame
setCursor: temp3 1 ((pEvent new:) x?) (Max (pEvent y?) (+ 1 height))
)
)
;(self hide:)
)
((& pEventType evKEYBOARD)
(switch (pEvent message?)
(KEY_RETURN
(cond
((not (IsObject curIcon)))
((or (!= curIcon useIconItem) curInvIcon)
(pEvent
type: (curIcon type?)
message:
(if (== curIcon useIconItem)
(curInvIcon message?)
else
(curIcon message?)
)
)
)
(else (pEvent type: 0))
)
)
(KEY_NUMPAD0
(if (gUser canControl:) (self swapCurIcon:))
(pEvent claimed: TRUE)
)
(JOY_NULL
(if (& (pEvent type?) evJOYSTICK)
(self advanceCurIcon:)
(pEvent claimed: TRUE)
)
)
)
)
((& pEventType evMOUSEBUTTON)
(cond
((& (pEvent modifiers?) emSHIFT) (self advanceCurIcon:) (pEvent claimed: TRUE))
((& (pEvent modifiers?) emCTRL)
(if (gUser canControl:) (self swapCurIcon:))
(pEvent claimed: TRUE)
)
((IsObject curIcon)
(pEvent
type: (curIcon type?)
message:
(if (== curIcon useIconItem)
(curInvIcon message?)
else
(curIcon message?)
)
)
)
)
)
)
)
-
Have you looked at LSL6? Does it do what you want?
-
I did look at LSL6, but opening LSL6 in SCI Companion gives me basically machine code that I can't read, so unless someone has done all that work deciphering it and commenting it, I don't think I could use it.
-
The trick I recall seeing from studying Gabriel Knight and LSL6 is that the icon bar you see is not the real icon bar. If I remember correctly off the top of my head there was a separate "draw everything" function or method, and putting the mouse cursor in the hot zone activated the "real" icon bar. Hope this helps~
-
There is a newer decompiler by Sluicebox, which does better. The LSL6 decompilation is here: https://github.com/sluicebox/sci-scripts/tree/main/lsl6-dos-1.000/src