Community
SCI Programming => SCI Syntax Help => Topic started by: troflip on May 08, 2015, 09:06:30 AM
-
Here's a puzzle for someone to figure out (or maybe it's already known?)
In room 100 (the title screen), the code puts up a dialog with 5 buttons (play new game, restore old game, see intro, etc...).
As a result, Print should return a number from 0 to 4 inclusive. The calling code reacts to those numbers, but if 5 is returned, it looks like it pops up a dialog asking which room you want to go to. What would cause Print to return that sixth option when it only has 5 buttons?
(Print:
dialog(myDialog)
font(gFont)
width(150)
mode(1)
addColorButton(0 8 1 0 6 0 30 0 0 15 23 5 5 5)
addColorButton(1 8 1 0 1 0 40 0 0 15 23 5 5 5)
addColorButton(2 8 1 0 2 0 50 0 0 15 23 5 5 5)
addText(8 1 0 4 0 0 0)
addText(8 1 0 5 0 10 0)
)
(switch (= temp0 (Print:
addColorButton(4 8 1 0 7 0 70 0 0 15 23 5 5 5)
addColorButton(3 8 1 0 3 0 60 0 0 15 23 6 6 6)
init()
)
)
(case 0
(send global2:newRoom(104))
)
(case 1
(send global2:newRoom(110))
)
(case 2
(send gSQ5:restore())
(self:changeState(state))
)
(case 3
= global4 1
)
(case 4
= state (- state 2)
(send gTestMessager:say(1 0 0 0 self 100))
)
(case 5
= temp1 0
= temp0 (Print:
addText("Which room do you want?")
addText("Other" 110 25)
addEdit(@temp1 6 115 35)
posn(50 30)
addButton(100 "Start 100" 5 35)
init()
)
(if (temp1)
= temp0 ReadNumber(@temp1)
(send global2:newRoom(temp0))
)(else
(self:changeState(state))
)
)
)
-
I don't know the answer, but I saw that as well when I looked at the code when you first posted it. I had assumed that they just deleted the line that displays the button prior to release. Without that there, there was no reason to bother removing any other code. Since this bit of code is so specific to the title screens print statement, it didn't feel like it was a real debug kind of option.
-
Remember though that the beta of SQ4 had a dialog at the beginning asking which room to go to. Maybe we should check the SQ5 beta.
-
I should have a copy of the SQ5 beta if needed.