Author Topic: Script patch files  (Read 16727 times)

0 Members and 1 Guest are viewing this topic.

Offline doomlazer

Re: Script patch files
« Reply #60 on: September 30, 2021, 06:41:52 PM »
Or you could use my work. https://helmet.kafuka.org/sci/fonts/PxPlus%20CGA.fon

Works perfectly, thank you! I actually checked your font page yesterday, but I was reading the file names and missed the example text message on that one.


you can just copy and paste cel frames between AGI Studio and SCI Companion.

Great tip! VEW2VEW had a few issues, so I went back to doing things manually from SV to SC. I was exporting .bmp one at a time, so hopefully this speeds things up a bit in the future.

Offline doomlazer

Re: Script patch files
« Reply #61 on: October 01, 2021, 02:05:39 PM »
Is there a way to override the font for unexpected player input on a per room basis? It's a bit jarring for text to be in AGI font, then switch to the default font for messages like, "That isn't understood."

Offline doomlazer

Re: Script patch files
« Reply #62 on: October 01, 2021, 03:16:28 PM »
Why does looping within a script overflow the stack?

Code: [Select]
(1
  (if (< localVar 20)
    ;do something
    (self cue:)
  )
  (2
    (++ localVar)
    (self changeState: 1) ;stack overflow after several loops
  )
)

Offline Kawa

Re: Script patch files
« Reply #63 on: October 01, 2021, 03:30:16 PM »
Your stack pops because you're calling changeState from within changeState.

The proper way to go back to the previous state is to do (= state X) (= cycles Y) where X is the target state - 1, and Y is something nice and small but not zero. A single cycle will do for a near instant kick back to that earlier state.

Oh, and self cue: is Bad Form for the same reason, that just indirectly calls changeState from within changeState.

Also, your parenthesis seem to be broken.
Code: [Select]
(1
   ....
)
(2
   ....
)
« Last Edit: October 01, 2021, 03:53:56 PM by Kawa »

Offline doomlazer

Re: Script patch files
« Reply #64 on: October 01, 2021, 04:17:23 PM »
The parenthesis was just sloppy typing, but thank you for the correct way to loop. I'll have to go back and change all my (self cue:) calls to cycles! It appears several times decompiling KQ4, so I learned that bad habit from Sierra.


Is there a way to override the font for unexpected player input on a per room basis? It's a bit jarring for text to be in AGI font, then switch to the default font for messages like, "That isn't understood."

I'm thinking the way to handle this is to write my said spec, then claim anything that it didn't catch and print my own "not expected" message. Would that be right?

Edit: This works unless the parser doesn't recognize a word, then I'm unable to catch the event. Might just have to live with that.

Trivia: the skeleton in Lolotte's cell in the AGI version is named James
« Last Edit: October 01, 2021, 05:09:16 PM by doomlazer »

Offline Kawa

Re: Script patch files
« Reply #65 on: October 01, 2021, 06:59:48 PM »
Trivia: the skeleton in Lolotte's cell in the AGI version is named James
Not necessarily! Unless James has his own dedicated word group, the decompiler has very little choice but to use the alphabetically-first item in a group when converting a saidspec back to plain text: https://helmet.kafuka.org/logopending/2020/03/26/ball-road/

Offline doomlazer

Re: Script patch files
« Reply #66 on: October 01, 2021, 07:40:27 PM »
Your blog has some great stuff. Is the LSL2 source code in EO's archive?

I went back into SV and James is word group 92 with the only synonyms being skeleton/s. There are one and a half skeletons in the room, so which one is James we may never know.

Edit: the skeleton in the whales mouth is called James in SCI version. This is why it works in the cell.
« Last Edit: October 05, 2021, 10:40:00 PM by doomlazer »

Offline EricOakford

Re: Script patch files
« Reply #67 on: October 01, 2021, 08:05:34 PM »
Your blog has some great stuff. Is the LSL2 source code in EO's archive?

No, just the decompilation, which I think is close enough anyway. The only undecompilable code in that game was dyingScript, and I figured that out. I didn't feel it was necessary to change the said specs unless they didn't decompile properly, and I figured out the correct specs using SCI Viewer.

On another note, I found that KQ4 doesn't properly support the newer Avoider. This causes serious problems in the witches' cave. So it's back to the older Avoider, which not only works properly, it uses less heap space.
« Last Edit: October 01, 2021, 08:11:29 PM by EricOakford »
My SCI templates
SCI0 SCI0.1 SCI1.0 SCI1.1
SCI2.1 planned

Offline doomlazer

Re: Script patch files
« Reply #68 on: October 01, 2021, 11:55:40 PM »
That's great. Did you mention you needed testing? I can get through the game pretty quick now.

Offline EricOakford

Re: Script patch files
« Reply #69 on: October 02, 2021, 07:21:44 PM »
That's great. Did you mention you needed testing? I can get through the game pretty quick now.

Sure! I'll send you the link.

Also, I just got rid of the Timer class. It's not needed, since you can just set the seconds directly in each script state. This will free up more heap.

So far so good...
My SCI templates
SCI0 SCI0.1 SCI1.0 SCI1.1
SCI2.1 planned

Offline doomlazer

Re: Script patch files
« Reply #70 on: October 03, 2021, 12:38:00 PM »
Also, I just got rid of the Timer class. It's not needed, since you can just set the seconds directly in each script state. This will free up more heap.

In addition to the frog issues I pm'd, firing the bow at nothing will lock up the game.

This was most likely a sound driver issue on my end. I have a save game about 3 seconds before the game seizes up completely for some reason. I had left the lamp lit for about 20-30 minutes, because I couldn't remember if the lamp runs out of oil or not. In the save file, it will always lock up after a few seconds, even if I extinguish the lamp. It's too early for nightfall, but it might be a timer related issue of some kind. I'm going to start a new game and let it run without doing anything to see if it freezes. 
Edit: just letting the game run for 40 minutes didn't freeze, so I'll have to retrace my steps and see if it happens again. It's possible it's something else. I switched to the general midi driver and music doesn't loop in certain areas like the mine and dwarf house, but that happens in the vanilla version too. I'm switching back to sndblaster.DRV for the rest of testing since I'm not sure GM.DRV is officially supported in SCI0.
« Last Edit: October 03, 2021, 05:11:21 PM by doomlazer »

Offline Collector

Re: Script patch files
« Reply #71 on: October 03, 2021, 03:31:56 PM »
I'm switching back to sndblaster.DRV for the rest of testing since I'm not sure GM.DRV is officially supported in SCI0.

No, it is not. There is not even a MIDI track. And mismatched drivers can cause lockups. There is a fan made aftermarket GM driver by Ravi Iyengar, but it includes a few of the required game specific patches, none of which are for KQ4. The results are less than stellar. The soundtrack was written for Roland MT-32. You are far better off using the MT32.DRV with a Munt enabled build of DOSBox.
KQII Remake Pic

Offline doomlazer

Re: Script patch files
« Reply #72 on: October 03, 2021, 05:08:10 PM »
Thank you for clarifying. I was using GM.DVR since it switched to munt if available, but it's just causing problems.

I believe ADL.DRV (which ships with steam and GoG versions) is mono, so I'm assuming sndblast.drv or mt32.drv would be the two best choices for KQ4?


Offline EricOakford

Re: Script patch files
« Reply #73 on: October 03, 2021, 07:39:43 PM »
Also, I just got rid of the Timer class. It's not needed, since you can just set the seconds directly in each script state. This will free up more heap.

In addition to the frog issues I pm'd, firing the bow at nothing will lock up the game.

Oops, looks like the Timer class was needed after all. I brought it back, and tested firing arrows and wearing the crown. They work properly again. I also fixed a bug where Rosella would fall into the pool again after she's already fallen in.

I believe ADL.DRV (which ships with steam and GoG versions) is mono, so I'm assuming sndblast.drv or mt32.drv would be the two best choices for KQ4?

That's right. SNDBLAST.DRV not only has stereo sound, but digital audio as well, which I've added from the Amiga version. MTBLAST.DRV allows for both MT-32 music and digital audio.
LSL2 also has Amiga-specific sound effects.
My SCI templates
SCI0 SCI0.1 SCI1.0 SCI1.1
SCI2.1 planned

Offline Kawa

Re: Script patch files
« Reply #74 on: October 03, 2021, 08:03:29 PM »
There is not even a MIDI track.
I assume you meant to say there's no General MIDI tracks.


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

Page created in 0.042 seconds with 23 queries.