Recent Posts

Pages: [1] 2 3 ... 10
1
SCI Syntax Help / Re: SCI0: Issues implementing Trite Phrase Menu item
« Last post by lskovlun on Today at 08:12:19 PM »
Sluice's decompile has the menu item as switch 776. You define MENU_EXPLETIVE as $0309. 0x0309 is decimal 777, so presuming `^x is 776 this shouldn't trigger at all, right? You've said "If I use %s in my text file 290 1 it works but does not show a default Trite phrase when selecting it from the menu.".
But that's not what causes the crash (see my analysis in the other thread).
2
SCI Syntax Help / Re: SCI0: Issues implementing Trite Phrase Menu item
« Last post by doomlazer on Today at 02:49:12 PM »
Sluice's decompile has the menu item as switch 776. You define MENU_EXPLETIVE as $0309. 0x0309 is decimal 777, so presuming `^x is 776 this shouldn't trigger at all, right? You've said "If I use %s in my text file 290 1 it works but does not show a default Trite phrase when selecting it from the menu.".

Did you do that background? Pretty cool.
3
SCI Syntax Help / Re: SCI0: Issues implementing Trite Phrase Menu item
« Last post by robbo007 on Yesterday at 12:33:47 PM »
As you guys mentioned in the other post this error seems to be similar. If I add the trite phrase via the menu it will then crash when I change rooms.


4
Hi,
I have finished the first release of the mod for adding subtitles to King's Quest V CD Talkie English version (GOG edition).

I would like that some english speaker test the game in english under ScummVM and report issues or other behaviours of the mod. I tested the spanish part from begin to end and about 90% of texts without issues. But I think in english there are some transcripts different from floppy version. So,  it would be grateful to have them corrected. I used a webpage with transcription, but maybe I forget something.

The mod is a patch, and it is mandatory to use ScummVM 2.9.0 daily build because some feats of this game are very specific when we talk about language or localized texts and a fix has been provided to that version to make the localized texts work.

If anybody is interested, please, contact with me here.

Some samples (in spanish, but I will provide multilingual english version for testing):

h.t.t.p.s://youtu.be/8ghh08towI0

h.t.t.p.s://youtu.be/_8V5YVW38mo
5
@pmkelly: In my experience, it doesn't work. It's hard to make it generate any output at all, and the paradigmatic differences between AGI and SCI mean that it can't do a very good job. I'm sure they tried, but if you read the history of how KQ4 came to be, there was a lot of crunch time where external programmers had to be brought in.
6
Kawa, I was just browsing through the files in your SCI stash and in original/TOOLS.zip I found the following, which I was not aware of previously:

Code: [Select]
ATOS.EXE     - AGI to SCI source code translator
It seems to work when run against some of the original LSL1 files. Not sure if the resulting code compiles, but interesting to see that they actually had developed such a tool. I wonder what it was used for?
7
SCI Syntax Help / Re: SCI0: Varibles and changestates
« Last post by lskovlun on December 05, 2024, 09:55:37 AM »
Scripts can even dispose themselves. Sierra used this a lot. It's technically a use-after-free situation, so you must be careful what you do afterwards.
8
SCI Syntax Help / Re: SCI0: Varibles and changestates
« Last post by doomlazer on December 04, 2024, 11:41:38 PM »
I don't know how doomlazer connects this to a NULL gEgo, though.

I think there were two issues. Robbo fixed the ego problem you spotted, but the showState script was still fragmenting memory. I'm too lazy to read through everything again to check if that's right.

What is it doing and what is best practice here? Should I be adding other scripts here like my regions path script maybe? Does this free up heap space as I'm already skating on thin ice with that.

Essentially you've got scripts that always live in memory like main, game, etc.. Then you have scripts that are loaded when a room script uses them. On room change, everything that was loaded for that room needs to get disposed to keep memory unfragmented. Some stuff, like actor instances, get cleaned up automatically because the lsl3 (or template game) code was already written to do so.

When I looked at Sluicebox's lsl3 decompile, I couldn't find script 797, so I assumed you had imported this yourself, copied from the lsl3 source code. The game isn't going to automatically know to dispose new scripts you add. Since you are calling this new script from a room script, you need to be responsible for cleaning it up. You're using it across more than one room, so disposing in startRoom is an effective way to ensure it's cleaned up every room change. DisposeScript safely ignores any of the args that weren't loaded in a given room.

I'm guessing you're adding (use SHOW_STATE) to the top of each room script? Another way to call showState would be:

Code: [Select]
;(ShowState self newState 1 2)
((ScriptId SHOW_STATE 1) self newState 1 2)
(DisposeScript SHOW_STATE)

This loads script 979 then calls method index 1 (ShowState has been assigned 1 in the script's public methods). Once the method returns, it's cleaned up by the DisposeScript call. No need to add (use SHOW_STATE) to the room script and script 979 isn't taking up heap the entire time the player is in the room.

It gives you a bit more control over the heap, but in the case of SHOW_STATE it's probably better to leave it as you have it now. You need enough heap for the room + 979 when ScriptId gets called anyway.

I'm not clear what 'regions path' is, but regions are generally going to be disposed by newRoom automatically.

Here's some great info on heap fragmentation: https://sciprogramming.com/tutorial.php?entry=5402
9
SCI Syntax Help / Re: SCI0: Varibles and changestates
« Last post by lskovlun on December 04, 2024, 08:44:09 PM »
It's to avoid heap fragmentation (where there is lots of memory available, but you can't allocate a single block that's large enough for the task at hand). I don't know how doomlazer connects this to a NULL gEgo, though. BTW, there is a kernel call ShowFree that tells you how much heap is available. It may be useful if you're having problems with free heap.
10
SCI Syntax Help / Re: SCI0: Varibles and changestates
« Last post by robbo007 on December 04, 2024, 12:47:14 PM »
Amazing guys that did the job.

So I've added the show_state script 797 to my main.sc but I dont really understand what's happening and why would I need to add something there? What is it doing and what is best practice here? Should I be adding other scripts here like my regions path script maybe? Does this free up heap space as I'm already skating on thin ice with that.

Code: [Select]
(method (startRoom roomNum)
(DisposeLoad
NULL
FILEIO_SCRIPT
JUMP_SCRIPT
EXTRA_SCRIPT
WINDOW_SCRIPT
TIMER_SCRIPT
FOLLOW_SCRIPT
REV_SCRIPT
DCICON_SCRIPT
DOOR_SCRIPT
AUTODOOR_SCRIPT
WANDER_SCRIPT
AVOID_SCRIPT
DPATH_SCRIPT
SHOW_STATE ;script 797
)
(DisposeScript DISPOSELOAD_SCRIPT)
Pages: [1] 2 3 ... 10

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

Page created in 0.023 seconds with 16 queries.