Usecode Studio problem

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
Wizardry Dragon
Posts: 1241
Joined: Thu May 14, 2020 1:34 pm

Usecode Studio problem

Post by Wizardry Dragon »

Hey, it's me (not dead yet...)

Okay, still been working on my little project, even got Exult Studio and everything running fine, custom usecode and everything.

My problem is thus:

>> I add an NPC into the game, specify a usecode number, custom face, shape, etc.

>> I drop the NPC into the game. Everything works fine. Conversation works through all the options, the character says the random messages he's supposed to, follows his schedule, etc.

>> However, when I save the map and reload the game, Exult changes the Usecode function assinged to the character. So, for the character to work I have to reset the usecode number EVERY TIME I LOAD THE GAME. A tad annoying, that.

I am trying to set it to 0x564, but it keeps resetting it to different numbers (no apparent pattern in the number it assigns to).

Am I doing something wrong?

Patch in question:
http://crpgn.org/patch.zip

- Wizardry Dragon
U7: Giridion project
Cheers, Wizardry Dragon
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Usecode Studio problem

Post by Dominus »

I'm sure I stumbled over something like this before...

Some help please, where do I find this character?

Edit again: Forget, I'm too stupid to remember how to edit exult.cfg so it works :-)
--
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!
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Usecode Studio problem

Post by Dominus »

At first glance my suspicion is that it is caused by using an existing NPC and not having made a new NPC.

Second glance:
Created a really new NPC and expereinced the same problem. Curiosly it seems that there is a relation between NPC# and Usecode#. The created NPC had #0x8b and the usecode it wants to execute is always 0x48b.
In your patch the NPC # was 0x94 and the usecode it defaults to is 0x494.

Apart from that I wouldn't reassign NPCs (as it seems you hijacked one of the Skara Brae Ghosts).


Dr.Code any ideas?
--
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!
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Usecode Studio problem

Post by Dominus »

a little reference to the relation of NPC# and Usecode#:
http://exult.info/forum/viewtopic.php?p=12938#p12938
--
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!
Wizardry Dragon
Posts: 1241
Joined: Thu May 14, 2020 1:34 pm

Re: Usecode Studio problem

Post by Wizardry Dragon »

I used the "Create NPC" function in Exult Studio. Perhaps the problem lies there.

I see two possiblities:
>> Either Exult Studio is not creating "new" NPCs.
>> Or perhaps the values I entered messed it up somehow.

- Wizardry Dragon
Cheers, Wizardry Dragon
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
Wizardry Dragon
Posts: 1241
Joined: Thu May 14, 2020 1:34 pm

Re: Usecode Studio problem

Post by Wizardry Dragon »

Dominus - I'm afraid that didn't help much.

It would solve the first possibility if I were able to reassign or set at creation time the NPC number, but Exult Studio does not allow that.

- Wizardry Dragon
Cheers, Wizardry Dragon
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Usecode Studio problem

Post by Dominus »

how about setting usecode# accordingly to the 400+i (i=NPC#) rule?
--
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!
Wizardry Dragon
Posts: 1241
Joined: Thu May 14, 2020 1:34 pm

Re: Usecode Studio problem

Post by Wizardry Dragon »

That works, however that still leaves unresolved how the "Create NPC" option in Exult Studio grabbed a ghost from Skara Brae.

- Wizardry Dragon
Cheers, Wizardry Dragon
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
Wizardry Dragon
Posts: 1241
Joined: Thu May 14, 2020 1:34 pm

Re: Usecode Studio problem

Post by Wizardry Dragon »

D'oh. Just realized I titled this thread wrong.

- Wizardry Dragon
Cheers, Wizardry Dragon
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Usecode Studio problem

Post by Dominus »

That works, however that still leaves unresolved how the "Create NPC" option in Exult Studio grabbed a ghost from Skara Brae.
Yup, maybe Dr.Code can help.

Another thing I need to add to the Studio docs is that it is important people are using the same shape set. What I mean is that if the patch is done by BG+FoV it is quite possible that it will crash BG only games. We really need to remember that when releasing patches. (doesn't apply here, just as a rememberance)
--
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!
Wizardry Dragon
Posts: 1241
Joined: Thu May 14, 2020 1:34 pm

Re: Usecode Studio problem

Post by Wizardry Dragon »

Are there people that use plain BG? :-)

I just hope that wasn't an important ghost or something...
(which NPC did it grab, anyhow?)

- Wizardry Dragon
Cheers, Wizardry Dragon
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Usecode Studio problem

Post by Dominus »

#148
--
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!
Wizardry Dragon
Posts: 1241
Joined: Thu May 14, 2020 1:34 pm

Re: Usecode Studio problem

Post by Wizardry Dragon »

Which is...?

I don't memorize the NPCs by number after all :-)

- Wizardry Dragon

(sorry if I'm being a pain)
Cheers, Wizardry Dragon
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Usecode Studio problem

Post by Dominus »

he he, in Exult press F2, N, 148 and you see more informations on this NPC. Might be it is an unused NPC.
--
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!
Wizardry Dragon
Posts: 1241
Joined: Thu May 14, 2020 1:34 pm

Re: Usecode Studio problem

Post by Wizardry Dragon »

Must be unused.

I teleport to him and I end up under a mountain :-)

- Wizardry Dragon
Cheers, Wizardry Dragon
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
PanSola

Re: Usecode Studio problem

Post by PanSola »

Way back home I have 5 1/2 inch floppy plain version, complete with cloth map, of U7 (and same for SI)... And I'm keeping a tower that has a 5 1/2 inch floppy drive in my closet (right now it's just collecting dust though) d-:

I've only played FoV and SS from my copy of the Ultima Compedium.
Iceshard-
Posts: 36
Joined: Thu May 14, 2020 1:34 pm

Re: Usecode Studio problem

Post by Iceshard- »

I still have that map right beside me... With some highlighter stains from where my brothers highlighter broke. :)

P.S. - Sorry for hijacking the topic.
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Usecode Studio problem

Post by drcode »

Okay, just caught up, and I think what's going on is:

1. The usecode number for NPC #n must be 0x400 + n, as Dominik indicated. It's probably a bug that ExultStudio lets you fill in any #, so I'll take a look at this tonight.

2. One of the SkaraBrae ghosts wasn't really part of the game, but we used to have a bug where we created it anyway (the extra mayor, I think). So it's correct that ExultStudio makes this # available for a new NPC.
Wizardry Dragon
Posts: 1241
Joined: Thu May 14, 2020 1:34 pm

Re: Usecode Studio problem

Post by Wizardry Dragon »

I just worry that this may leave other NPCs to get gobbled up too. We don't need a "disappearing Lord British" bug :-)

- Wizardry Dragon


p.s.: or maybe we do? Hmm... (-:
Cheers, Wizardry Dragon
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Usecode Studio problem

Post by drcode »

Just looked at the code for setting usecode #, and the rule is:

1. if NPC # is between 0 & 255, then the usecode # is always 0x400 + n.
2. If NPC # is 256 or higher, than you can set it in ExultStudio.

I'll try to make EStudio follow this better.
Wizardry Dragon
Posts: 1241
Joined: Thu May 14, 2020 1:34 pm

Re: Usecode Studio problem

Post by Wizardry Dragon »

That would be much appreciated :-)

- Wizardry Dragon
Cheers, Wizardry Dragon
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
Wizardry Dragon
Posts: 1241
Joined: Thu May 14, 2020 1:34 pm

Re: Usecode Studio problem

Post by Wizardry Dragon »

You know what would really help to organize the Usecode would be the ability to break it down into seperate files.

- Wizardry Dragon
Cheers, Wizardry Dragon
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
SB-X
Posts: 980
Joined: Thu May 14, 2020 1:34 pm

Re: Usecode Studio problem

Post by SB-X »

You mean what `rip' does?
Wizardry Dragon
Posts: 1241
Joined: Thu May 14, 2020 1:34 pm

Re: Usecode Studio problem

Post by Wizardry Dragon »

No, I mean, the ability to compile UCC source code into Usecode from many different files, like C/C++/C#, Pascal, or almost any other programming language. :-)

- Wizardry Dragon
Cheers, Wizardry Dragon
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Usecode Studio problem

Post by drcode »

Wizardry: You're right about the separate files. Currently, you can use "#include", and you can specify "-I" (although I'm not sure if that's ever been tested).

Another untested possibility: I think if you compile separate usecode files, you can just 'cat' the outputs all together into one big "usecode".
Wizardry Dragon
Posts: 1241
Joined: Thu May 14, 2020 1:34 pm

Re: Usecode Studio problem

Post by Wizardry Dragon »

I'll go test that right now :-)

- Wizardry Dragon
Cheers, Wizardry Dragon
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
Wizardry Dragon
Posts: 1241
Joined: Thu May 14, 2020 1:34 pm

Re: Usecode Studio problem

Post by Wizardry Dragon »

Okay, include seems to work, but it seems to take significantly longer to compile, at least for me... (another five or six seconds, trivial for me, but it is quite a bit longer than before; before it was near instantaneous.)

Then again, this is a 70k of raw source I'm compiling ... :-)

- Wizardry Dragon
Cheers, Wizardry Dragon
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Usecode Studio problem

Post by drcode »

Odd; it shouldn't slow down that much. Maybe it's a bug.
Wizardry Dragon
Posts: 1241
Joined: Thu May 14, 2020 1:34 pm

Re: Usecode Studio problem

Post by Wizardry Dragon »

Perhaps, or perhaps the include# marco needs optimizing. Either way, it bears looking into. It is possible it is my machine, but I doubt it. I'm on a 2.8 gHz Intel Win XP Machine with 512 mb of ram.

- Wizardry Dragon
Cheers, Wizardry Dragon
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
Locked