Exult Studio question

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
artaxerxes
Site Admin
Posts: 1310
Joined: Thu May 14, 2020 1:34 pm

Exult Studio question

Post by artaxerxes »

Hi all,

I must say I lied a bit in my previous post. I do play a bit with Exult Studio to see what we can do with it.

My question is: I am trying to create a new book with my own text in it. I managed to create the book using the shape browser (Ctrl-B) and then create (Ctrl-C) but I want to choose myself which usecode function gets used when I dclick on the book. In Map Editing Mode, when I dclick on the book, ES shows me info like position and shape/frame number but no where do I find the usecode function to use when dclicking on the object.

Is it because the feature is not ready yet or because there is another way to do it that totally eluded me?

thx for the info

Artaxerxes
artaxerxes
Site Admin
Posts: 1310
Joined: Thu May 14, 2020 1:34 pm

Re: Exult Studio question

Post by artaxerxes »

Never mind I've got it... it is the field call "Quality" that does it.

On the other hand when I dclick on the spellbook, the gump pops up instead of showing the ES window.

Artaxerxes
artaxerxes
Site Admin
Posts: 1310
Joined: Thu May 14, 2020 1:34 pm

Re: Exult Studio question

Post by artaxerxes »

Well, not really in fact.... It automatically force the usecode function 0282. I suppose the Quality parameter is just the variable you add so that it knows what part of the usecode function 0282 to read. "0" loads the "Phil's Guide to Unfinished Usecode" part of 0282.

Artaxerxes
artaxerxes
Site Admin
Posts: 1310
Joined: Thu May 14, 2020 1:34 pm

Re: Exult Studio question

Post by artaxerxes »

It looks like the usecode function depends on the shape created.
shape 705 I think also is a book and when I dclick on it it is the usecode function 02C1 that is started.

As a matter of fact that is perfect. That way I can check if the translation usecode function works or not, which is not.

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

Re: Exult Studio question

Post by wjp »

The book usecode is a bit of a mess. Because the total size of the books was greater than 64Kb, it was split up into several functions. Which of these functions gets called is hardcoded into the engine. (in both the original U7 and Exult)
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Exult Studio question

Post by drcode »

And ExultStudio has no support for the spellbook or magic yet.

(Seems to me that with the 32-bit opcodes WJP added, books in new games won't need the hack that U7 requires. If you create a book shape as #0x17f, say, you can put all the text in one big function assigned to that number. But we'll have to provide a way to disable the hack.)
wjp
Site Admin
Posts: 1708
Joined: Thu May 14, 2020 1:34 pm

Re: Exult Studio question

Post by wjp »

We could do something like automatically disable the hack if the 'base' functions are 32 bit?
Locked