Dialogue files

NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Locked
Jon Miller

Dialogue files

Post by Jon Miller »

Hi, first off, let me say that this seems like a really cool project. I haven't actually tried Exult yet, having just finshed U7 1 & 2 the old way, before I found out about this bolstered version. But I'm eager to mess around with the map editor when it's done...

Anyway, I was wondering how you guys were able to access the dialogue. Is there a U7 file that contains it, that one can have a look at? And does the same go for SI?

Thanks for your help, and best wishes in further developing Exult.
nadir
Site Admin
Posts: 407
Joined: Thu May 14, 2020 1:34 pm

Re: Dialogue files

Post by nadir »

The file is called usecode and lives in the static directory. Exult has some tools that can decompe the binary usecode file into a somewhat more readable format. Beware that delving inside the complex world of usecode may cause insanity and mental instability. Ask DrCode about it... :)
artaxerxes
Site Admin
Posts: 1310
Joined: Thu May 14, 2020 1:34 pm

Re: Dialogue files

Post by artaxerxes »

Jon:

what I use on Linux is the utility called 'strings' on the file called 'usecode'.
So it gives something like that:

$ pwd
/home/me/ultima/blackgate
$ strings usecode | more
[lots of text coming from the usecode file]

It took me a while to read the whole thing but I got to learn a few interesting piece, like the text that Cantra is supposed to say once she is supposed to be cured.

See ya

Artaxerxes
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Dialogue files

Post by drcode »

0000: 48 push eventid
0001: 1F 01 00 pushi 0001H ; 1
0004: 22 cmpeq
0005: 05 37 00 jne 003F
0008: 42 CB 01 pushf flag:[01CB]
000B: 05 01 00 jne 000F
000E: 3F abrt

...er, like Nadir said:-)
Jon Miller

Re: Dialogue files

Post by Jon Miller »

Thanks, guys, for your help. I found the file, but my word processor won't open it, and the simpler wordpad or whatever it is will read the file, but it is messy indeed. Though the text is there, if I wade through all the symbols.

Does anyone know if Windows has a counterpart to that Linux strings utility, which I'm assuming extracts only the text strings? Also, could I ask you what the general organization of the code is like? It sounds like every text string is there for all time, but activated or deactivated based on what flags have been set or reset. Is that it?

I ask cause, like a lot of people, I'd like to write a game. I wouldn't be able to program it, at least not yet, but I like thinking about the underlying structure. I'd like to take U7's conversation system and refine it, so that, say, characters in the first town wouldn't still be talking about the same early quest, months down the road. Or maybe you could get a little more recognition for the acts you've performed as the hero. You'd know there wasn't any plot-important information to be gleaned, but you could kill time that way, and it would feel more immersive.

Anyway, thanks again for taking the time to help me out.
Jon Miller

Re: Dialogue files

Post by Jon Miller »

P.S. It is cool to read Cantra's recovery speech. An unsatisfying loose end, that was. Any other suprise text worth finding?
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Dialogue files

Post by drcode »

I don't think our 'tools' are distributed with the Windows binary. But in the 'tools' directory of the source, we build a program called 'wud' (I think it's Wody's Usecode Disassembler, and was written by Wody Dragon). It will disassemble all of the Serpent Isle usecode file if you run 'wud -s -a usecode', and produce about 10 MB of the sort of text I pasted in my previous post. This will include all the conversation text.

Fortunately, you won't have to write that stuff to create new scripts, but you'll use a high-level language instead. We don't know what Origin's looked like, but we've been creating our own. That 'island' patch in our downloads section has an example of this (although it's no longer quite correct). Once we release the Exult Beta, I'll start working on it some more.
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Dialogue files

Post by Dominus »

Oh, you can by the way download the tools at our download section. These are Win32 binaries so if you run anything else you have to compile it yourself.
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
artaxerxes
Site Admin
Posts: 1310
Joined: Thu May 14, 2020 1:34 pm

Re: Dialogue files

Post by artaxerxes »

Hi all:

I have prepared a zip file containing the result of 'strings usecode' for both serpent isle and black gate.

If you are interested, I could send you this file by email.

Simply drop me a line at aurey@linux.ca

See ya

Artaxerxes
Max aka Moscow Dragon

Ha! My good old UCDUMP tool...

Post by Max aka Moscow Dragon »

...written Sep 1999 IIRC.

The thing is that U7 game logic is written in a bytecode language like Basic or Java. All talks are in this bytecode. So are all spells.

The real executable code is only the graphics/shape sorting/combat engine, the game plot is in bytecode. USECODE file is the bytecode. Pseudo-assembler executed by some entity inside U7.EXE. The behavior of all things is coded there - all talks, all spells, all double-click handlers for everything and such.

I was IIRC one of two guys (the other is U7Wizard author) who managed to determine the USECODE file structure and wrote the disassembler for it. Wody Dragon joined later. Looks like this tool is included in Exult as "strings" tool.
wjp
Site Admin
Posts: 1708
Joined: Thu May 14, 2020 1:34 pm

Re: Ha! My good old UCDUMP tool...

Post by wjp »

'strings' is a standard linux tool that just extracts all alphanumeric sequences longer than 4 chars from any given file.

We do include a (modified) version of ucdump in exult, but it's still named 'ucdump'.
Locked