Author Topic: Brian's SCI1 Script Compiler  (Read 11048 times)

0 Members and 1 Guest are viewing this topic.

Offline MusicallyInspired

Brian's SCI1 Script Compiler
« on: December 12, 2015, 12:30:02 PM »
So I've taken the SCI Studio VGA source (which includes the VGA SCI1 template game, which is basically the source for the demo he released) and the included CLI script compiler tool. It's a little hardcoded, I had to create a specific directory structure the compiler was looking for. However, it's looking for a VOCAB.900 file now which I grabbed from his demo, but it still won't accept it. Has anyone ever gotten Brian's SCI1 Script Compiler to work?

My goal is to see if I can rig it up to work for compiling SCI1 games, or at the very least his VGA template game to start with.
« Last Edit: December 12, 2015, 12:31:57 PM by MusicallyInspired »


Brass Lantern Prop Competition

Online Collector

Re: Brian's SCI1 Script Compiler
« Reply #1 on: December 12, 2015, 01:51:58 PM »
I have been making some minimal attempts at an SCI1 template as well. Brian had released his scripts for his SCI1 template game, but it had come with no other resources. I had thought about seeing if I could strip down LSL5, which is what I believe he started from. While the game will open in the new Companion, every time I try to do anything with the resources in the new companion it makes the resources unreadable. I hadn't reported this because I know that Phil is concentrating on SCI1.1.
KQII Remake Pic

Offline troflip

Re: Brian's SCI1 Script Compiler
« Reply #2 on: December 12, 2015, 02:19:03 PM »
Lol, if Companion is corrupting resources, I want to know about it!
Which resources in particular?

If the goal is to make an SCI1 template game, I think you'd get further with Brian's template game using SCI Companion than his compiler...
(or rather just pruning a LSL1 VGA decompile, since it didn't look like he got very far when it comes to naming variables and such).

I've managed to load his template game into Companion (into a LSL1 VGA game) and compile a few files, but there are definitely issues. He mixes use of global[$10] and the actual global variable name. This can be worked around temporarily by renaming the first global variable from "gEgo" to "global", and replacing all uses of gEgo with global[0].

Also, "publics" is the Companion equivalent of "exports" (in (version 2) syntax), except Companion requires a number in front of each export. So those need to be renamed.
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline troflip

Re: Brian's SCI1 Script Compiler
« Reply #3 on: December 12, 2015, 02:39:49 PM »
Here's a game.ini and src folder with some modifications. If you plop them into a LSL1 VGA game (which has the necessary class table, selector, vocab, etc... then you'll be able to compile some (most?) of them.

There are still a number of issues, in particular his use of asm labels to jump around the code in place of "proper" control structures. Companion doesn't support that.
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline MusicallyInspired

Re: Brian's SCI1 Script Compiler
« Reply #4 on: December 12, 2015, 04:49:49 PM »
I didn't realize that Companion could compile SCI1 scripts, that's why I was looking into Brain's compiler. I tried to alter something in a room in KQ5 and it did nothing, though the compile was "successful". I also tried compiling all scripts and that failed hard. But I guess that's to be expected.

I have been making some minimal attempts at an SCI1 template as well. Brian had released his scripts for his SCI1 template game, but it had come with no other resources.

I thought that it was just his VGA demo game only because I glaced at the room scripts and saw some similar text strings. I didn't delve too deeply, though.
« Last Edit: December 12, 2015, 04:54:31 PM by MusicallyInspired »
Brass Lantern Prop Competition

Offline troflip

Re: Brian's SCI1 Script Compiler
« Reply #5 on: December 12, 2015, 05:22:48 PM »
There's no reason it shouldn't be able to compile SCI1 scripts, other than I have some bugs :-)

I thought it might be nice to have a VGA game with a parser, so I've been trying to get the 1990 Christmas Card functional and compiling. I thought it would be quick and easy to do and someone else could take it and run with it, but I do have some bugs. Companion mid-detects the lofsa type because it doesn't have enough info. And it guesses wrong. Interestingly, ScummVM also outputs a message that it couldn't determine the lofsa type. Then it guesses right.

Working around that, I did manage to recompile *just* room 2, and add in code that handles a Said, and it worked. However, when I recompile the whole game, something else messes up. Luckily, that interpreter includes a debugger. Unfortunately, it seems flakey. I also tried ScummVM and the game just hangs, and eventually ScummVM just crashed as I was trying to debug it.

I did encounter something strange in the Sierra debugger... before it also hung while debugging, it showed this:

A c:\ prompt.... weird... never seen that before.
« Last Edit: December 12, 2015, 05:56:34 PM by troflip »
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline MusicallyInspired

Re: Brian's SCI1 Script Compiler
« Reply #6 on: December 12, 2015, 05:49:00 PM »
Interesting!
Brass Lantern Prop Competition

Offline OmerMor

Re: Brian's SCI1 Script Compiler
« Reply #7 on: December 12, 2015, 05:56:46 PM »
I thought it might be nice to have a VGA game with a parser, so I've been trying to get the 1990 Christmas Card functional and compiling

Have you seen this thread?
HWM and trodos already managed to write a script which uses the parser in this demo. Take a look.

Offline troflip

Re: Brian's SCI1 Script Compiler
« Reply #8 on: December 12, 2015, 06:41:25 PM »
Yes, that's what I'm using as a base. All they did was hex edit the script resource though (change a 0 to a 1, which enables the parser), it wasn't something that was actually usable, etc...
« Last Edit: December 12, 2015, 06:51:40 PM by troflip »
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Kawa

Re: Brian's SCI1 Script Compiler
« Reply #9 on: December 12, 2015, 07:10:37 PM »
I added a Said for hitting the Seasoned Pro a bit ago and posted pics. Remember that?

Offline troflip

Re: Brian's SCI1 Script Compiler
« Reply #10 on: December 12, 2015, 07:17:53 PM »
Vaguely, but I can never find old threads on these boards. How did you manage that? (I guess room 2 compiles successfully, actually).

[Spent five minutes searching, but could not find the thread....]

Ok, found it by looking for your attachments:
http://sciprogramming.com/community/index.php?topic=1534.msg7853#msg7853

« Last Edit: December 12, 2015, 07:22:05 PM by troflip »
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline troflip

Re: Brian's SCI1 Script Compiler
« Reply #11 on: December 12, 2015, 08:09:50 PM »
Well, by making a "bug fix" to the script resource generation code, I've been able to get all scripts but Game.sc and script 255 to compile (well, I can get them to compile, but they cause the game to crash).

If I compile Game.sc successfully, then game will freeze.
If I compile script 255 successfully, I get a "Freeway pather not available!" error displayed whenever I try to type something. No idea what that means...
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline lskovlun

Re: Brian's SCI1 Script Compiler
« Reply #12 on: December 12, 2015, 08:55:27 PM »
If I compile script 255 successfully, I get a "Freeway pather not available!" error displayed whenever I try to type something. No idea what that means...
That means that the mapping between kernel function names and numbers must be redone for the older interpreter. You are invoking the Intersections kernel call (which was never used in a released game IIRC, and was always a stub) instead of Said.
I can't remember whether the VOCAB.999 file is correct in this game... Sierra stopped updating it at one point.

Offline troflip

Re: Brian's SCI1 Script Compiler
« Reply #13 on: December 12, 2015, 11:30:30 PM »
I don't think it could be a kernel number mismatch, because I'm using the decompiled code. So even if the function name were wrong, the number would end up being the same. And Said is mapped properly, because that *does* work (i.e. if I only recompile script 002, and add some Said calls, they work correctly). But is "freeway path" related to Intersections? I'll look more at it tomorrow... [edit: yes, it appears to be... I get the same freeway message if I explicitly call it]

I appears to be related to generating a corrupt script resource though... so who knows what is getting called, or what's going on....


[edit:] Ugh, it was related to a hack I had put in years ago for SCI0 games that were missing the Joystick kernel in their kernel table. It was mapping all Joystick calls (should be kernel 109) to Intersections (113)
« Last Edit: December 13, 2015, 04:25:17 AM by troflip »
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline troflip

Re: Brian's SCI1 Script Compiler
« Reply #14 on: December 19, 2015, 12:17:37 AM »
Still trying to get this Christmas Card demo working properly as a kind of small side project. The scripts/decompilation seem to be working, but I can't get the vocab resources to function properly.

It's fine if you enter recognized words (I have responses for 'look' and 'look man' in the first room where the guy dances across the stage), but if you enter a non-recognized word, the game crashes, freezes or behaves weirdly.

I tracked it down to the Parse kernel call in User.sc. If I turn on the debugger (with (SetDebug)) before that call, and step over the call, I get the error message "vocab.912 not found". Again, this is only for non-recognized words.

Ok, so that means I need a vocab.912. I had been using 901/902 for the suffix/whatever vocab resources (I forget where I grabbed them from, but the 902 one looks like garbage). I tried putting them in slots 911 and 912, but that didn't work.

So instead, I grabbed 911 and 912 from KQ5 and plopped those in there. The Parse call now just hangs, or sometimes DOSBox crashes. Either those aren't compatible with the vocab.900 I'm using, or the interpreter doesn't like them, or I dunno what.

So basically, I'm trying to find a combination off vocab resources that work with this interpreter. I believe the necessary resources are 900 (dictionary), 911 (suffix) and 912 ("tree vocab"), but I haven't been able to get any to work.

I've attached the zipped up game if anyone wants to play around with it.

Note that you will always break into the debugger after typing in a line (Shift-Shift-D continues). Press tab a few times to get the Parse call, and tab again. If you've entered recognized words, everything will be fine (Shift-Shift-D to continue). Otherwise... BOOM.

Note: The current version of Companion I have out there may not compile some of the scripts correctly for this game, so things might start breaking if you compile any of them.
« Last Edit: December 19, 2015, 12:24:47 AM by troflip »
Check out my website: http://icefallgames.com
Groundhog Day Competition


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

Page created in 0.036 seconds with 23 queries.