I can't get Exult Studio to save the usecode number or name

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

I can't get Exult Studio to save the usecode number or name

Post by Malignant Manor »

It always changes to something different whenever I reload. I have the problem in SI. BG might have the same problems.
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: I can't get Exult Studio to save the usecode number or n

Post by drcode »

I'll take a look tonight. Are you saving everything (including the current game) before you exit?
Malignant Manor
Site Admin
Posts: 985
Joined: Thu May 14, 2020 1:34 pm

Re: I can't get Exult Studio to save the usecode number or n

Post by Malignant Manor »

I use the save all command on Exult Studio. It seems to do a quick save at the same time, and the npc is in the game when I load it. I've only tried it with new npcs.
Donfrow
Posts: 308
Joined: Thu May 14, 2020 1:34 pm

Re: I can't get Exult Studio to save the usecode number or n

Post by Donfrow »

Hmm I posted a response earlier but it seems to have been eaten by the internet gods.

Anyway, when you say you can't save the usecode number do you mean where you set their function? Is it grayed out before you change it? I had the first few new NPC's usecode box grayed out. I could change it and save in ES but when I came back in it didn't save.

What I ended up doing was just creating their usecode with that number and it worked fine. After a few new NPC's the box was no longer grayed out and changing/saving it in ES worked as it should.
marzo
Site Admin
Posts: 1925
Joined: Thu May 14, 2020 1:34 pm

Re: I can't get Exult Studio to save the usecode number or n

Post by marzo »

Anyway, when you say you can't save the usecode number do you mean where you set their function? Is it grayed out before you change it? I had the first few new NPC's usecode box grayed out. I could change it and save in ES but when I came back in it didn't save.
Indeed, the first 256 NPCs have their usecode functions "hard-coded" to be 0x400 + NPC number. If ES is letting you edit the function number for these NPCs, it shouldn't.
------
Marzo Sette Torres Junior
aka Geometrodynamic Dragon
[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
Malignant Manor
Site Admin
Posts: 985
Joined: Thu May 14, 2020 1:34 pm

Re: I can't get Exult Studio to save the usecode number or n

Post by Malignant Manor »

The one NPC I have saved this time is Number 0xE9. The usecode it changed to after reloading is 0x4E9. The NPC finder is showing it as 233 which means that it is indeed setting the NPC to a hard-coded function. I think that it is because the NPC is labeled as unused and it just overwrites the first unused NPC number. Exult Studio isn't allowing me to change NPC numbers so I can't do anything to fix this other than create a dead area with all of the NPC numbers that are hard-coded. It doesn't allow you to select the number when you create a NPC either.
marzo
Site Admin
Posts: 1925
Joined: Thu May 14, 2020 1:34 pm

Re: I can't get Exult Studio to save the usecode number or n

Post by marzo »

0xE9 = 233 (you can use the calculator in Windows to convert back and forth between hex and decimal).
I think that it is because the NPC is labeled as unused and it just overwrites the first unused NPC number.[...]It doesn't allow you to select the number when you create a NPC either.
That is correct; ES starts overwriting unused NPCs as it finds them, and does so sequentially. For those NPCs which are in the 'hard-coded' range, you can define, in usecode, a function with the correct number (0x400 + NPC number) and it will be called; it is how Laurianna and Zauriel work in the Keyring mod.
------
Marzo Sette Torres Junior
aka Geometrodynamic Dragon
[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
Donfrow
Posts: 308
Joined: Thu May 14, 2020 1:34 pm

Re: I can't get Exult Studio to save the usecode number or n

Post by Donfrow »

Off topic... yet on it at the same time... does ES have a limit of NPC's it can create? I posted a thread awhile ago about it crashing when creating a new NPC and I noticed now that I'm at 350 or 355 in NPC numbers.
marzo
Site Admin
Posts: 1925
Joined: Thu May 14, 2020 1:34 pm

Re: I can't get Exult Studio to save the usecode number or n

Post by marzo »

It shouldn't have a limit anymore, no. You will not be able to create NPCs in the 356-359 range (as in ES will not let you -- the reason is that in usecode, -356 = avatar, -357 = entire party, -359 = wildcard for shape, quality and/or frame), but they will continue normally at NPC #360 and up.
------
Marzo Sette Torres Junior
aka Geometrodynamic Dragon
[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
Locked