NPC of doom

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

NPC of doom

Post by Karlos »

I created a new NPC via Studio in my new game world, but I am unable to click on her without crashing Exult. This occurs regardless of whether I click on her in game mode or editing mode. My debugging tells me that the actual crash occurs in libc, but is triggered from get_npc_name. I believe my NPC has a name ("Alica"), but there's no way to check now. Here's the actual line that causes the crash:

objnames.cc, line 755: if(strchr(name, '/') == 0)

If I try to print the name string from gdb prior to the crash, I get:

$1 = 0x11

I guess somehow Exult is passing a bad pointer to the strchr function? Any ideas on why this is happening with this NPC and how to fix it? Thanks in advance for any suggestions.


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

Re: NPC of doom

Post by drcode »

Sounds like an Exult bug involving setting the name. I'll try to duplicate this tonight.
Karlos
Posts: 149
Joined: Thu May 14, 2020 1:34 pm

Re: NPC of doom

Post by Karlos »

I did more testing, and discovered that this problem seems to depend on what shape I use. When I create an NPC with SI's shape #1015, I can duplicate this problem, but when I created one with shape #766 with the same name and properties, it worked fine.

More details just to confuse matters: I did the same experiment in SI itself, and couldn't duplicate the problem. Another possibly revevant factor is that object names do not show up in my custom game. E.g., in SI, if I click on the new NPC I just created, the caption says "woman". This doesn't happen for any of the objects in my custom game.

After writing this post, I went and tried something else: I created another NPC with shape #1015, but set the "met" flag. Clicking on the new NPC does not crash Exult, and the caption with her name shows correctly.

I guess it's a combination of the fact that the object name is null and something to do with the shape number that is triggering the crash.



-Karl
Karlos
Posts: 149
Joined: Thu May 14, 2020 1:34 pm

Re: NPC of doom

Post by Karlos »

I've summarized my findings in a bug report:

https://sourceforge.net/tracker/index.p ... tid=102335

This isn't a show-stopper for me, since I'm just usinga different shape number for now to avoid the problem.


-Karl
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: NPC of doom

Post by Dominus »

happy bug-searching. I'm happy someone is really working on and trying to make a game with ES. All those bugs need to be found and fixed.
great work!
--
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!
Karlos
Posts: 149
Joined: Thu May 14, 2020 1:34 pm

Re: NPC of doom

Post by Karlos »

Well, my job is the easier one, since I'm not the one who has to fix them. ;-)

Seriously though, I've had a lot of fun working on this project despite the bugs, and everyone has been quite helpful answering any questions I had along the way.


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

Re: NPC of doom

Post by drcode »

Here's a workaround: Double click the shape (1015) in the shape-viewer and give it a name; then save. That will cause the 'text.flx' to be updated (which was the problem). You might have to restart Exult.
Karlos
Posts: 149
Joined: Thu May 14, 2020 1:34 pm

Re: NPC of doom

Post by Karlos »

Okay, that worked. My problem was that the text.flx that I had copied from SI was in my static directory instead of my patch directory. Naming the object worked, as did copying the text.flx to the right place.


-Karl
Locked