Should ucc be able to compile the output of ucxt?

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
eris
Posts: 20
Joined: Thu May 14, 2020 1:34 pm

Should ucc be able to compile the output of ucxt?

Post by eris »

I've just started playing with usecode and have been happily exploring and modifying SourceForge Island. But then I tried something different and hit a snag. I thought I'd try to modify an existing npc, so I disassembled the BlackGate (+FoV) usecode file using ucxt, changed Iolo's words at the opening of the game, and tried to recompile using ucc. It failed.

Is this a bug or is ucc not yet capable of recompiling the output of ucxt?

I ran ucxt as follows
ucxt -bg -fs -a -uc -ousecode.bg.uc

And I am trying to run ucc like this:
eris@luthien:~/games/ultima/exult/exult-1.4/install $ ucc -o usecode usecode.bg.uc
usecode.bg.uc:10: 'UI_get_item_flag_88' not declared
usecode.bg.uc:24: 'UI_in_gump_mode_81' not declared
usecode.bg.uc:26: 'UI_close_gumps_7E' not declared
usecode.bg.uc:72: 'UI_find_nearest_0E' not declared
usecode.bg.uc:74: 'UI_find_nearest_0E' not declared
usecode.bg.uc:76: 'UI_find_nearest_0E' not declared
usecode.bg.uc:80: 'UI_get_random_00' not declared
usecode.bg.uc:84: 'UI_item_say_40' not declared
usecode.bg.uc:86: 'exit2' not declared
usecode.bg.uc:97: parse error, unexpected '(', expecting IDENTIFIER

Any ideas? Pointers to a missed FAQ? Ideas where I should look in the ucc source? It really seems like I am missing some sort of include file, but I can't find anything that seems right.

Eris
wjp
Site Admin
Posts: 1708
Joined: Thu May 14, 2020 1:34 pm

Re: Should ucc be able to compile the output of ucxt?

Post by wjp »

They're not (yet) compatible.
SB-X
Posts: 980
Joined: Thu May 14, 2020 1:34 pm

Re: Should ucc be able to compile the output of ucxt?

Post by SB-X »

Blame Darke(Paw).
eris
Posts: 20
Joined: Thu May 14, 2020 1:34 pm

Re: Should ucc be able to compile the output of ucxt?

Post by eris »

OK. But that makes me wonder whether there is any way at all to change the existing usecode other than poking some new values into the usecode binary file. From what I've seen of the usecode machine so far, it looks like all you can do is replace one function with another, which isn't really what I want, of course, since I'd ideally like to be able to extend existing behavior.

I hate that I'm hitting this problem, but I am having fun with it, at least. I've never learned C++ (despite being only 35, I cut my teeth on Fortran) and reading the Exult source is really neat!

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

Re: Should ucc be able to compile the output of ucxt?

Post by drcode »

Not a bad idea (trying to modify the results of ucxt and recompile with ucc). I wonder how hard it will be to make this possible.

The errors involving the "UI_..." calls should be easy to fix with either program, but I'm not sure about the 'exit2' or parse error.

A couple questions:
1. Is ucxt fairly mature? In other words, does it work on all functions?
2. Is its output readable enough to work on?
Locked