Author Topic: Sci.0 wish-list: diagonal movement, title-bar colour, and parser questions  (Read 9566 times)

0 Members and 1 Guest are viewing this topic.

Offline scott_furphies

Hi all,
this is my first post here, many times I've been about to ask for help I've had another last look and been able to figure it out for myself. Sci programming is wonderfully intuitive like that!

There's a few things on my Sci-wish-list I haven't been able to tackle, and I was hoping I could get a few nudges in the right direction!

1 - In certain rooms up and down arrow will result in diagonal movement. Codename: Iceman has this in one or two of the beach rooms at the beginning. it's subtle, but saves a lot of up-left-up-left movement to get through a narrow 45 degree angle path.

2 - Change colour of the title bar from grey to red. I've seen a lot of complicated stuff in fan games for customizing windows, I actually like the look of the windows as they are (Reminds me of Space Quest III) but the grey clashes with the look of the game I'm creating.

3 - This is probably a hard one, which I've basically given up on. Is there a way to ask questions to the parser? It would be cool if it switches to 'conversation mode' when you 'talk to' a character, and now you can say 'where is the lighthouse' instead of 'ask about lighthouse', which is more clunky and I think less intuitive for the player.

Thanks for any help I can get!




Offline cosmicr

Re: Sci.0 wish-list: diagonal movement, title-bar colour, and parser questions
« Reply #1 on: September 19, 2020, 10:11:04 PM »
Hi There, I have been studying Codename Iceman's code to work out a few tricks here and there.

1. It looks like it has a custom looper class called "Grooper" - this sets the appropriate view for the direction facing. In Main.sc there's a method that calls setloop on Ego that sets the loop to that class. In Feature.sc there's a method for setDirection in the Act class that will work out the angles and set the actor's motion to that direction. There's probably a little more to it, but you could get a general idea from examining the code.

2. As far as I know you can't change the title bar colour in SCI0. DrawStatus is a Kernel Function.

3. I would just change my Said parameters. Like you said, change it from "ask about" to "where is".  If you wanted to have two different modes of conversation, just keep a flag variable that switches between the two.

Good luck with your game!

Offline scott_furphies

Re: Sci.0 wish-list: diagonal movement, title-bar colour, and parser questions
« Reply #2 on: September 19, 2020, 11:31:58 PM »
Thanks, Cosmic, I'll take a look at these - I'm definitely into the idea of more than the standard 4 walking loops! What I was actually thinking was having the up key result in a diagonal direction in certain rooms.

As for changing the 'Said parameters', do you mean when I'm writing out the actual if-said statements, or is there there a script which deals with the sentence syntax I need to look at?

Thanks again!

Offline cosmicr

Re: Sci.0 wish-list: diagonal movement, title-bar colour, and parser questions
« Reply #3 on: September 20, 2020, 04:42:55 AM »
In the setDirection method of Act in Iceman the angle of walking is determined by the "vanishingX" and "vanishingY" values set. In beachHuts1.sc these are set to 0,-50 (ie toward the top-left of screen). This is how it forces the angular walking. It's quite sophisticated. Let me know if you have any luck with reverse-engineering it.

Offline scott_furphies

Re: Sci.0 wish-list: diagonal movement, title-bar colour, and parser questions
« Reply #4 on: September 20, 2020, 05:16:40 AM »
Cool, I'll have a look - still not sure how to read the script files of genuine Sierra games, is there another piece of software I'm missing?

Offline Kawa

Re: Sci.0 wish-list: diagonal movement, title-bar colour, and parser questions
« Reply #5 on: September 20, 2020, 06:41:58 AM »
2. As far as I know you can't change the title bar colour in SCI0. DrawStatus is a Kernel Function.
But the status bar is white. Title bars would be the things on top of windows, and those are gray in SCI0.

Even though DrawStatus would only take color arguments in the VGA terps, and the window drawer would switch to black (can't guarantee #8 is dark gray any more), both of these things can be custom-drawn.

Cool, I'll have a look - still not sure how to read the script files of genuine Sierra games, is there another piece of software I'm missing?
A plain text editor?

Offline cosmicr

Re: Sci.0 wish-list: diagonal movement, title-bar colour, and parser questions
« Reply #6 on: September 20, 2020, 06:48:32 AM »
But the status bar is white. Title bars would be the things on top of windows, and those are gray in SCI0.

Oops I had a brain fart there. Yeah you can change dialog window title colours. Brian's tutorial has a section on how to do it. In SCI0 you can't change the status bar.

Offline troflip

Re: Sci.0 wish-list: diagonal movement, title-bar colour, and parser questions
« Reply #7 on: September 20, 2020, 04:23:24 PM »
1 - In certain rooms up and down arrow will result in diagonal movement. Codename: Iceman has this in one or two of the beach rooms at the beginning. it's subtle, but saves a lot of up-left-up-left movement to get through a narrow 45 degree angle path.

In the Rm properties, assign values to vanishingX and vanishingY. They indicate where the vanishing point (https://en.wikipedia.org/wiki/Vanishing_point) of the room is. Pressing up will make the player walk towards the vanishing point, pressing down will make them walk away from it. (Assuming it's all hooked up properly in the SCI0 template - not sure it is because it was based off LSL3, which maybe didn't use this feature.)

Typical values might be
Code: [Select]
vanishingX 160 ; right in the middle
vanishingY -200 ; 200 pixels above the top of the screen

You could probably make the player walk at close to 45 degrees if you placed it way off to the side, like I dunno, (-1000, 1160) or something.
« Last Edit: September 20, 2020, 04:24:57 PM by troflip »
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Kawa

Re: Sci.0 wish-list: diagonal movement, title-bar colour, and parser questions
« Reply #8 on: September 20, 2020, 05:16:21 PM »
And of course a vanishingX 160 Y -30000, which is the default, is so ridiculously far away that walking up or down gives an effectively straight vertical line.

Fun fact: the SCI0 template has a default vanishingY of 35536, but this is just -30000 with too many (ignored) bits.

Offline cosmicr

Re: Sci.0 wish-list: diagonal movement, title-bar colour, and parser questions
« Reply #9 on: September 20, 2020, 08:59:44 PM »
Cool, I'll have a look - still not sure how to read the script files of genuine Sierra games, is there another piece of software I'm missing?

You can decompile them using SCI Companion from the script menu. The product is mostly readable code (some procedures and variables etc are unnamed).

Offline scott_furphies

Re: Sci.0 wish-list: diagonal movement, title-bar colour, and parser questions
« Reply #10 on: September 20, 2020, 09:06:01 PM »
Awesome, so much good advice here! That vanishing point thing is surprisingly simple and cool - I had no idea the concept of a vanishing point would be used in those games!
Thanks, everyone for your help!

Offline EricOakford

Re: Sci.0 wish-list: diagonal movement, title-bar colour, and parser questions
« Reply #11 on: September 20, 2020, 09:30:45 PM »
2. As far as I know you can't change the title bar colour in SCI0. DrawStatus is a Kernel Function.
But the status bar is white. Title bars would be the things on top of windows, and those are gray in SCI0.

Even though DrawStatus would only take color arguments in the VGA terps, and the window drawer would switch to black (can't guarantee #8 is dark gray any more), both of these things can be custom-drawn.

Cool, I'll have a look - still not sure how to read the script files of genuine Sierra games, is there another piece of software I'm missing?
A plain text editor?

I can verify that the ability for DrawStatus to take color arguments was added in 11/30/1990, per the Run-Time System Changes document. I tested this in my SCI01 template (which uses Seasoned Professional EGA's interpreter), and it works.

Now I know why the title bar color was changed from grey to black.
My SCI templates
SCI0 SCI0.1 SCI1.0 SCI1.1
SCI2.1 planned

Offline MusicallyInspired

Re: Sci.0 wish-list: diagonal movement, title-bar colour, and parser questions
« Reply #12 on: September 21, 2020, 09:14:46 AM »
I once added an EGA SCI1.0 ego sprite to a SCI0 game and its diagonal loops were automatically used.
« Last Edit: September 21, 2020, 09:25:19 PM by MusicallyInspired »
Brass Lantern Prop Competition

Offline Kawa

Re: Sci.0 wish-list: diagonal movement, title-bar colour, and parser questions
« Reply #13 on: September 21, 2020, 09:47:56 AM »
If an Actor is set in motion, the Motion class will first set the actor's heading, then either call the actor's looper (which may be a Grooper), or use the DirLoop kernel call, giving either of them the actor's heading.

DirLoop's logic, as seen in SCI11:
Code: [Select]
nLoops = GetNumLoops(ResLoad(RES_VIEW, IndexedProp(actor, actView)));

//Set the loop for the actor based on how many loops it has.
if (angle > 315 || angle < 45)
loop = (nLoops >= 4)? 3 : -1;
else if (angle > 135 && angle < 225)
loop = (nLoops >= 4)? 2 : -1;
else if ((angle < 180))
loop = 0;
else
loop = 1;

//If the loop is not 'same' (-1), set it.
if (loop != -1)
IndexedProp(actor, actLoop) = loop;

Testing this in The Dating Pool by removing the grooper from ego, my diagonals go unused. It is in fact the grooper that specifically adds diagonal support. And not all SCI0 had a grooper! Iceman, KQ1, and QFG2 are the only ones in whose decompiles I can find the line "class Grooper" -- the rest are all SCI10 or later. There could of course be other SCI0 games that supported diagonals but didn't gradually switch from one loop to the other.

I once added an EGA SCI1.0 ego sprite to a SCI0 game and its diagonal views were automatically used.
Was it one of those three? If not, which was it?

Offline cosmicr

Re: Sci.0 wish-list: diagonal movement, title-bar colour, and parser questions
« Reply #14 on: September 21, 2020, 05:25:48 PM »
I think colonel's bequest might also - edit: it doesn't.
« Last Edit: September 21, 2020, 09:29:47 PM by cosmicr »


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.04 seconds with 23 queries.