Community

SCI Programming => SCI Development Tools => Topic started by: ZvikaZ on January 17, 2021, 04:56:08 PM

Title: Changing message - fails
Post by: ZvikaZ on January 17, 2021, 04:56:08 PM
I'm trying to change something in a message file, and it fails.

It's QFG1VGA, with Game->Properties->"Manage resources as patch files" turned on.
I've opened Message.206, Noun 3, Verb 11 (food ration), and just changed it to "food ration1".
Clicked "Commit", and then saved with Ctrl+S.

Now, in the SCICompanion Explorer, under "Status", it says "Resource load failed", and the size of 206.msg file is only 6 bytes...
If it matters, those 6 bytes are:
8F 00 E4 0C 00 00

Have I done something wrong?

Thanks
Title: Re: Changing message - fails
Post by: ZvikaZ on January 18, 2021, 06:20:04 AM
It seems much like a reported bug: https://github.com/icefallgames/SCICompanion/issues/22
:-(
Title: Re: Changing message - fails
Post by: Daventry on January 19, 2021, 01:47:22 AM
ZvikaZ
I think there are three possible solutions to the problem.
1. Use the Enrico Rolfi's utility to edit messages.
2. Change message.cpp
At least uncomment the line
//MessageWriteTo_3411(message, byteStream);
Add a function MessageWriteTo_3411() and recompile SCIcompanion.
3. Write your own message editor or export to a message file.
Title: Re: Changing message - fails
Post by: Daventry on January 20, 2021, 12:35:17 AM
Version 3000 (number inside a specific message file >= 3000 < 4000).
Block 1 - file header, size = 10 bytes
Offset  Size (in byte) Description
00 .......... 2 ....... Message file ID, equal to 0x8F or 0x0F
02 .......... 4 ....... Version of msg file (0x00000d53 = 3411, optionally, for example, in QfG1vga. I've noticed 3300, 3340, 3400)
06 .......... 2 ....... A pointer to the first byte AFTER the text data, the beginning of block 4 ("address" = "this value" + 8 bytes).
In fact, this is the size of the file WITHOUT comments
08 .......... 2 ....... Number (count) of messages in the file

Block 2 - message addresses, size = 10 bytes
Offset Size Description
00 .......... 1 ....... Noun (on which object the action is performed, the list is located in the corresponding one .hep file)
01 .......... 1 ....... Verb  (what action, ie. what icon is selected in a menu or an item from inventory)
02 .......... 1 ....... Case (state, condition)
03 .......... 1 ....... Sequence (the order may be invoked multiple consecutive message boxes)
04 .......... 1 ....... Talker (Who is talking)
05 .......... 2 ....... Message address ("real adr." = " this adr." + 2)
07 .......... 3 ....... Unknown

Block 3 - the messages themselves
Offset      Size           Description
00 .......... variable ... Message in text format, ends with 0

Block 4 - Developer comments (most likely missing)
In theory, it should be, but I really did not meet the files of version 3000 with comments

Correction.  File 815.msg from the official patch QFG1VGA has comments.
Title: Re: Changing message - fails
Post by: Kawa on January 20, 2021, 09:06:38 AM
My SCI Companion supports all three versions now, unless I messed up.
Title: Re: Changing message - fails
Post by: Daventry on January 21, 2021, 08:21:55 AM
Kawa
Thank you very much. It works correctly.
Title: Re: Changing message - fails
Post by: Kawa on January 21, 2021, 06:18:58 PM
Thanks. I only tested in QFG1, assuming the three mystery bytes were just padding with random leftover data for contents, and I couldn't think of a game with the first format that only has nouns and verbs so I'm just hoping for the best.
Title: Re: Changing message - fails
Post by: Daventry on January 22, 2021, 12:16:45 AM
Kawa
The version of messages 2000 is used in Ecoquest1 floppy.
These three unknown bytes in version 3000 can be anything. This can be reserved for future use. For example, for reference noun, verb, case. Or it can be a far link to audio resources. Or it's a timestamp to mark when a message was edited.
Title: Re: Changing message - fails
Post by: Kawa on January 22, 2021, 06:06:13 AM
I find the reference idea unlikely. For version 4000+, every entry without a reference has the reference bytes set to zero, and all entries that do use a reference have blank text. But in QFG1, the mystery values are non-zero.

If it's an audio link, I suppose the values should be preserved. What game would you suggest I test that on?

And if it's timestamps (in three bytes?) that'd mean that's the only version of the Message resource that has those. And personally I think it'd make more sense to put that sort of metadata at the end, in the Comments section.