Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - AGKorson

Pages: 1 [2] 3 4 ... 14
16
AGI Syntax Help / Re: Max characters in a single logic file?
« on: April 11, 2022, 02:13:46 AM »
Hi klownstein, sorry to hear you had some troubles with WinAGI. There was a limit of approximately 32K characters in the logic editor at one point (I can't remember the exact version where I fixed that, but I think it was around 2.1.1). If you check the readme.txt file that is in your WinAGI program directory it should tell you if it's a version that has that limit.

With all the testing I've done, I have had a couple times where the rich text window (which is used by the logic editor) has done some weird stuff - usually it has just frozen, where it seems to ignore all input, but the text is actually being updated even though you can't see it) but that has been extremely rare- no more than once a year or so. And I've never been able to duplicate it. I feel comfortable blaming that on Windows...

I strongly encourage you to upgrade to the most recent version of WinAGI. And if you have this happen again, best suggestion I have is to save your work in progress, quit WinAGI and restart it. If that still doesn't fix it, try a reboot (OMG, I sound like a Help Desk Tech!) and then restart WinAGI.

And if you ever happen to have something happen that you're able to duplicate, please let me know so I can track down whatever might be causing it.



17
AGI Syntax Help / Re: Some Logics have blank messages?
« on: April 11, 2022, 01:44:55 AM »
Or you could look at the full decompilation of Gold Rush that I posted in this thread.

Logic 42 in GR (rm.SternShipInterior) does have messages that go up to #134. But several of them (42, 47, 48, 53, 56, 67, 73-76, 87, 96-112, 121, 132) have invalid pointers. Specifically, they have an offset value of zero.

This happens a lot in Sierra logics. It's a result of how their original compiler handles messages that are not defined when a logic was compiled.

The message section of a logic is formatted as follows (where X is offset to last byte of command data):
Code: [Select]
offset(bytes)       data
X+1         | highest index of messages in the logic
X+2, X+3    | word offset to last byte of actual text data (measured from start of message section, X+1)
X+4 - X+4+Z | message text offset table, equals highest index value times 2 (i.e. two bytes per message)
              Z = (highest message index * 2) - 1
X+Z+1 - EOR | message text, encrypted with 'Avis Durgan'

The values in the offset table are relative to the location of the offset to last byte of actual text data, i.e. X+2. What this means is to calculate the start of a message, you add the value from the offset table to X+2.

For logic 42 in GR, X = 4671, so the message section starts at 4672. The reference point for calculating offsets (and pointer to end of text data) is at 4673. The message text offset table starts at 4675 and runs through 4942 (268 bytes for 134 messages). The text data starts at 4943.

The offset values for the invalid messages listed above are all zero. Which means if you tried to use them in a logic, they would point to 4673 (X+2). This is because when Sierra's compiler (CG.EXE) creates a logic, it defaults to a value of zero for message text offsets, and only updates it if a message was assigned in source code using the #message command.

Note that if a null string was assigned, the compiler would add a zero length string (a single \x00 byte), and adjust the message table offset value accordingly. So invalid messages are not the same as null messages.

Also, the interpreter actually checks for cases where a logic tries to access a message that hasn't been defined; if the offset of a message passed in a command is zero, AGI will raise trappable error 14 (the WinAGI Help file contains a detailed description of that error code). So you can't access an undefined message. This is one of the rare instances where AGI actually validates data used in AGI commands.


While original Sierra source files do use a separate, included file for messages, it was not required. But unlike modern compilers, messages could only be referenced in commands by their number, i.e. 'm1', 'm2'; you couldn't compile messages in line (i.e. this would NOT compile in CG.EXE):
Code: [Select]
print("sample message");
The original AGI specs describe a convention for AGI source syntax that AGI Studio and WinAGI both conform to.( I also added additional features to WinAGI that aren't in AGI Studio - if interested, see the WinAGI help file or ask me for details.)

The syntax rules for original Sierra compiler can be found in the agiwiki, or in this post. They are derived from a full disassembly of CG.EXE. There are several significant differences between original Sierra syntax rules and what the AGI Specs consider 'canon'. But since the specs have been around for so long, and most non-Sierra compilers are based on the AGI Specs, there doesn't seem to be much reason to change. I am considering adding a 'CG.EXE compatible' mode to WinAGI at some point just for nostalgia, which would allow it to compile original Sierra source with no modifications. But it would only be for nostalgia, and wouldn't be of much practical use.

18
AGI Development Tools / Re: AGI extended character support
« on: April 09, 2022, 08:09:37 PM »
Glad to hear you found it helpful!

Since I posted that, I've continued working on the code for that hack, and can now add extended character support (and a ton of other features) to any MSDOS version of AGI by just running a special logic at the start of the game.  I plan on releasing a full set of logic scripts (I'm calling it the AGI Power Pack) very soon that anyone can just drop into a game to open up a whole new world of capabilities for AGI games.

In the meantime, if you need any help with the extended character script, feel free to PM me and I'd be happy to help.

19
AGI Development Tools / Re: AGI extended character support
« on: April 05, 2022, 10:36:38 AM »
One thing that always annoyed me about NAGI was that the window close button did not work. You didn't perhaps fix that, did you?

LOL, no I didn't. But I wish I had. I was doing some checks last night to make sure it does what it's supposed to, and I know I silently cursed that 'feature' at least ten times...

20
To compile logics, you can do it individually for each logic (using Compile Logic on the Resource menu), or you can do them all by using Compile Game on the Game menu. Compile Dirty Logics also works. The difference between the two is that Compile Game will recompile ALL logics, but Compile Dirty Logics only compiles those logics that have been modified and don't match what's in the VOL files.

I don't have a lot of experience with SCUMMVM. I think it has some built in file checks that prevent it from running modified Sierra games, unless you get them registered somehow. Or something like that. Hopefully someone with more knowledge of SCUMMVM will weigh in.


21
AGI Development Tools / Re: AGI extended character support
« on: April 05, 2022, 03:08:15 AM »
Good observation ZvikaZ. ScummVM might be the best way to go.

The original NAGI (version 2.06 for windows/2.07 for Linux IIRC) does not support extended characters.  If a message has an extended character, NAGI prints garbled data.

Nick made the source code for NAGI publicly available, so back in 2006, I ported it to VC7, and modified it to support extended characters and changing color palettes. It was actually pretty easy to get support for extended characters (changing the font file loader to load 256 characters instead of 128) and then modifying the font files (*.nbf) that are included with the executable. I'm attaching NAGI v2.09 here if anyone is interested. (I also tried to recompile it in VS 2019, but I can't get it to work; if anyone wants to try that, I'd be happy to share my source to see if you can figure it out.)

If you don't like the glyphs that I include in NAGI v2.09, you can edit them. I created an app called NFEdit that you can use to easily modify the font files. I explain it in another thread (https://sciprogramming.com/community/index.php?topic=1766.msg11533#msg11533) if you are interested.




22
Extended character support in AGI is complicated. Getting the kind of results you are hoping for is doable, but is extremely difficult and I mean EXTREMELY DIFFICULT.

The WinAGI help file provides detailed information that explains the limitations of AGI in handling fonts. But to summarize, AGI can display the extended characters when in text mode without any problems, but in the graphics mode, extended characters will only display properly if the background color is black. Also, there is no way to edit the font that AGI uses - it comes from the built in MSDOS font.

That means you can't use extended fonts for the 'regular' messages that get printed in black text on a white background with the traditional red border.

Unfortunately, this limitation can't be modified using 'normal' AGI programming techniques. But there are some advanced programming techniques you can use that will modify the AGI program as it is running to get extended characters to work. I described the technique in this post:
https://sciprogramming.com/community/index.php?topic=1881.0

If you only use interpreter version 2.917, then the solution in that post will work for you. But if your game uses any other version, it won't. You could create a new logic that duplicates the technique, but you would need to understand assembly language and know how to disassemble the original interpreter.

Sorry I couldn't be of more help, but that's just the way AGI works. It was not designed to be supportive of extended characters.

23
That makes sense! I never thought of that.

24
For distribution you can use a binary difference patch between the original DIR and VOL files and your modified versions. NSIS includes VPatch you can use to create one with an installer to apply it.

I have never used that tool, so am not exactly sure how it works. Since you have to recompile your game to create new DIR and VOL files anyway, what's the value in then using NSIS/VPatch tool? Why not just use your new DIR/VOL files as is? Am I misunderstanding how it works?

25
I followed your method and I managed to visualize my image in French in the game. It's a pleasure! :D
http://www.image-heberg.fr/files/16487943161734719613.png
I will continue my tests with a Logics file now...
Looks good! glad it's working for you now.

If I understand correctly, it is impossible to make a translation patch like for SCI games. The game must be complete to view the translation? That's right ?
Correct. In AGI there is no such thing as a patch file. The game files themselves (the DIR files and the VOL files) have to be modified to make a change. But with WinAGI, that's easy enough to do!


26
Hi AGKorson  :)
For the moment I am testing with the new WinAGI version on Space Quest I. I find it hard to understand and I'm a bit confused when it comes to understanding a tool that I don't know. I francized the view111 and I exported the file to my desktop. It is called View111.agv. I put the file in the main directory of my game, but the game does not see it and the image remains in English in the game! Can you tell me where is my mistake?

http://www.image-heberg.fr/files/16487399264151709859.png

*I think I will have the same problem with Logics/scr files and pictures files...

Thank you for your help!

I think I can help. When you make changes to a view, sound, or picture resource that is part of a game in one of the resource editors, you need to Save it using the Save menu item on the Resource Menu, or by clicking the Save icon on the main toolbar (the large computer diskette icon), or by pressing CTRL+S. This saves the resource into your game and automatically updates the game's DIR and VOL files.



The Export option does not save the resource in your game. It saves a copy to a file. You might do that if you wanted to use it in a different game for example.

Since you did export it, you can now easily bring it back into your game, to replace the current View111. (That way you won't have to redraw it.)
To do that, open View111 for editing. Then, use the Import Resource menu item and import your saved View file. A message box will appear, asking if you want to replace the view you are editing. Select 'yes'. Then save your view (as described above). Voilą!

Saving pictures and sounds works the same way. Logics are a bit different. When you make edits to the source code for logics, the DIR and VOL files are not automatically updated. You need to compile the logics to convert the source code to do that.

When you get to that point, feel free to start another topic with any questions you might have and I and the folks on this forum will be glad to help you out.

If you are still having trouble, let me know. I'll walk you through it.

27
OK, good. I was worried that there were still bugs in my code.


28
I've just finished my decompilation for King's Quest I! While WinAGI gives a warning about the absence of sound 34, this can be safely ignored.

The decompiled version is 2.0F, as that is the version being sold through digital storefronts. Now it's ready for testing.
Looks like you're making a lot of progress. Regarding the sound 34 issue, is that the only warning you got when you first imported it? I have KQ1 version 2.0F, and I get four invalid sound resource (34, 35, 36, 37) when I import it.

Also, the warning should say "WARNING: Sound34 has an invalid location (134703) in the VOL file(VOL.2)", which means there is an entry in the SNDDIR file, but it doesn't point to a valid resource in the VOL file. Is that the warning you got? Or did it say the resource was missing or absent? I just want to make sure WinAGI is working correctly and not giving the wrong warnings.

29
Yeah, no worries. I took one semester of French in college, but that was 30 years ago. Trust me, your English is much better than my French.

If you do find someone who can sit for a video chat, let me know.

30
Hello AG Korson!
Is there a manual or tutorial or video for WinAgi? I have no experience with your tool and I want to translate Space Quest I and II into French.

Thank you for your advice and congratulations on the update, it is thanks to people like you that players around the world can translate the games of their youth :)

Thank you for the compliment! I really do appreciate it.

Other than the Help file, I haven't created any manual or tutorial for WinAGI. I doubt any one else has either. But, I'd be happy to do a video chat with you to walk through how to use it. If you are interested, PM me and we can work out a time to meet.

Pages: 1 [2] 3 4 ... 14

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

Page created in 0.146 seconds with 21 queries.