Author Topic: Where'd my buttons go (Sierra Script Conversion)  (Read 60 times)

0 Members and 1 Guest are viewing this topic.

Offline Doan Sephim

Where'd my buttons go (Sierra Script Conversion)
« on: June 11, 2019, 07:12:48 PM »
All Scripts are now converted and without error message, and yet...
See attachment
Here's the code I was using from the Controls Script:
Code: [Select]
(method (setSize &tmp [rect 4])
(TextSize @rect text font)
(= [rect rtBOTTOM] (+ [rect rtBOTTOM] 2))
(= [rect rtRIGHT] (+ [rect rtRIGHT] 2))
(= nsBottom (+ nsTop [rect rtBOTTOM]))
(= [rect rtRIGHT] (* (/ (+ [rect rtRIGHT] 15) 16) 16))
(= nsRight (+ [rect rtRIGHT] nsLeft))
)
(method (draw &tmp x y x2 y2 w h [rect 4])
; Calculate the areas
(= x2 (- nsRight 8))
(= y2 (- nsBottom 8))
(= w (- nsRight nsLeft))
(= h (- nsBottom nsTop))
(TextSize @rect text font)
; Draw the side borders
(for ( (= y (+ nsTop 8))) (< y y2)  ( (= y (+ y 8))) (DrawCel gWB 0 4 nsLeft y -1) (DrawCel gWB 0 6 x2 y -1))
; Draw the top and bottom borders
(for ( (= x (+ nsLeft 8))) (< x x2)  ( (= x (+ x 8))) (DrawCel gWB 0 5 x nsTop -1) (DrawCel gWB 0 7 x y2 -1))
; Draw the corners
(DrawCel gWB 0 0 nsLeft nsTop -1)
(DrawCel gWB 0 1 x2 nsTop -1)
(DrawCel gWB 0 2 nsLeft y2 -1)
(DrawCel gWB 0 3 x2 y2 -1)
; Draw the text
(Display
text
dsCOORD
(+ nsLeft (>> (- w [rect rtRIGHT]) 1))
(+ (+ nsTop (>> (- h [rect rtBOTTOM]) 1)) 1 dsCOLOR)
gWndColor
dsBACKGROUND
clTRANSPARENT
dsFONT
font
dsWIDTH
[rect
rtRIGHT]
)
)
« Last Edit: June 11, 2019, 07:49:40 PM by Doan Sephim »


Artificial Intelligence Competition

Offline lskovlun

Re: Where'd my buttons go (Sierra Script Conversion)
« Reply #1 on: June 11, 2019, 07:18:11 PM »
Hard to say what that is without seeing any code... it seems clear that you must have modified something to get that effect? otherwise, copy the SYSWINDOW.SC file over from the template game (contains the Save class and friends..) and delete whatever file contains the converted class.

Offline Doan Sephim

Re: Where'd my buttons go (Sierra Script Conversion)
« Reply #2 on: June 11, 2019, 07:34:09 PM »
Hmm...no dice.
I'm also experiencing some strange behavior with my character changing region script...

Will tinker around a bit.

EDIT:
Got my text back, but lost my sweet custom button artwork. One step forward, One step back :)
This is with the following template code in the Controls script
Code: [Select]
(method (setSize &tmp [rect 4])
(TextSize @rect text font)
(= [rect rtBOTTOM] (+ [rect rtBOTTOM] 2))
(= [rect rtRIGHT] (+ [rect rtRIGHT] 2))
(= nsBottom (+ nsTop [rect rtBOTTOM]))
(= [rect rtRIGHT] (* (/ (+ [rect rtRIGHT] 15) 16) 16))
(= nsRight (+ [rect rtRIGHT] nsLeft))
)
« Last Edit: June 11, 2019, 07:46:53 PM by Doan Sephim »
Artificial Intelligence Competition

Offline Doan Sephim

Re: Where'd my buttons go (Sierra Script Conversion)
« Reply #3 on: June 11, 2019, 07:45:20 PM »
Borders up, but smooshed...no text  :o
Hmmm...looks like the template did half the trick lol

Offline Doan Sephim

Re: Where'd my buttons go (Sierra Script Conversion)
« Reply #4 on: June 11, 2019, 08:00:25 PM »
Got 'em back!
Conversion misplaced a single parenthesis that threw the whole thing off.
I had this:
Code: [Select]
(Display
text
dsCOORD
(+ nsLeft (>> (- w [rect rtRIGHT]) 1))
(+ (+ nsTop (>> (- h [rect rtBOTTOM]) 1)) 1 dsCOLOR)
                        gWndColor
But I realized that it should have been this:
Code: [Select]
(Display
text
dsCOORD
(+ nsLeft (>> (- w [rect rtRIGHT]) 1))
(+ (+ nsTop (>> (- h [rect rtBOTTOM]) 1)) 1)
dsCOLOR
                        gWndColor
« Last Edit: June 11, 2019, 08:02:15 PM by Doan Sephim »
Artificial Intelligence Competition

Offline MusicallyInspired

Re: Where'd my buttons go (Sierra Script Conversion)
« Reply #5 on: June 11, 2019, 11:19:33 PM »
Looks good!
Brass Lantern Prop Competition


SMF 2.0.14 | SMF © 2017, Simple Machines
Simple Audio Video Embedder

Page created in 0.099 seconds with 24 queries.