Author Topic: So how customisable is the interface in SCI1.1?  (Read 524 times)

0 Members and 1 Guest are viewing this topic.

Offline Scavenger

Re: So how customisable is the interface in SCI1.1?
« Reply #15 on: February 19, 2017, 01:39:54 PM »
Alright! I worked out what was going wrong, I was missing "&tmp" in the variable declaration in the method header.

By running:

Code: [Select]
(instance testDrawingCode of Code
(properties)

(method (doit &tmp oldPort)
(= oldPort (GetPort))
(SetPort -1)
(Graph grFILL_BOX 0 0 40 40 VISUAL 5 -1 -1)
(Graph grUPDATE_BOX 0 0 40 40 VISUAL)
(SetPort oldPort)
)
)

in the room's doit method I managed to draw a solid colour square without destroying the engine! I've been looking through the drawing code for the rest of it to see how to add buttons and stuff, something that makes it more difficult is that most of the variables are labelled tempX and there's very little comments telling me whats happening. I'll keep slogging through it. Running this code in Main.sc doesn't work, but I expect it's just drawing it behind the room's background instead, and if the room was differently shaped to have a hole in it it would work. Progress!

Offline troflip

Re: So how customisable is the interface in SCI1.1?
« Reply #16 on: February 19, 2017, 06:12:14 PM »
Glad you got something working.

FYI, (SetPort -1) looks like it sets the current port to the menu port (which I assume covers the entire screen).

Is there a reason you have this in a doit method of a Code instance, instead of just a procedure?

something that makes it more difficult is that most of the variables are labelled tempX and there's very little comments telling me whats happening.

That's because it was decompiled from the binary. It was a ton of work just to get it into that state.

Running this code in Main.sc doesn't work, but I expect it's just drawing it behind the room's background instead, and if the room was differently shaped to have a hole in it it would work. Progress!

What do you mean by "Running this code in Main.sc"? It matters from what code you're calling it, not what script file it's in.
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Scavenger

Re: So how customisable is the interface in SCI1.1?
« Reply #17 on: February 20, 2017, 01:44:35 AM »

Is there a reason you have this in a doit method of a Code instance, instead of just a procedure?

Okay, I'm just following what the template code is doing, because I'm certain that the template code works, so I don't want to step outside of what it's telling me to do. The statusline code I got it from does it that way, so that's what I did. Is it wrong?

That's because it was decompiled from the binary. It was a ton of work just to get it into that state.

That's understandable, I've been going through the code and putting in variable names and comments when I'm sure I know what the code does. Once I'm confident with it I'll probably go back and rename/comment all the code in the template so it's easier for other people. I just need to learn it first.

What do you mean by "Running this code in Main.sc"? It matters from what code you're calling it, not what script file it's in.

Well, I originally had it in main.sc's doit method, directly below (statusLineCode doit:). There was nothing there. But putting it in Rm110's doit method DOES work for some reason. I'm not sure why.

It was:
Code: (Main.sc Line 706) [Select]
(method (doit)
(if (GameIsRestarting)
(if (IsOneOf gRoomNumber TITLEROOM_SCRIPT)
(HideStatus)
else
(statusLineCode doit:)
(testDrawingCode doit:) ;the added code
)
(= gColorDepth (Graph grGET_COLOURS))
)
(super doit: &rest)
)

But I had to put it in Rm110 like:

Code: [Select]
(method (doit)
(testDrawingCode doit:)
)

I'll be honest, I'm not sure why it didn't work the first time.

Offline OmerMor

Re: So how customisable is the interface in SCI1.1?
« Reply #18 on: February 20, 2017, 02:59:26 AM »
That's because it was decompiled from the binary. It was a ton of work just to get it into that state.

That's understandable, I've been going through the code and putting in variable names and comments when I'm sure I know what the code does. Once I'm confident with it I'll probably go back and rename/comment all the code in the template so it's easier for other people. I just need to learn it first.
nest, I'm not sure why it didn't work the first time.

Scavenger,
you might want to read through Sierra's original SCI system scripts instead:
https://github.com/OmerMor/SCI16/tree/master/SYSTEM


SMF 2.0.11 | SMF © 2015, Simple Machines
Simple Audio Video Embedder

Page created in 0.178 seconds with 21 queries.