Larian Banner
Previous Thread
Next Thread
Print Thread
Bug: Journal crashes when adding NPCs to party #640813
16/01/18 11:24 PM
16/01/18 11:24 PM
Joined: Dec 2013
Posts: 872
Windemere Offline OP

old hand
Windemere  Offline OP

old hand

Joined: Dec 2013
Posts: 872
So this took me some time to find but it appears that if you add some NPCs to your party and do not add them to the DB_IsPlayer() database, any attempt to read your journal will crash the game.

Steps to Reproduce:
1. Create a quest with shared journal entries. It doesn't seem to matter whether the broadcast level is character, party, or user.

2. Use the DB_QuestDef_State() API and then advance the state of the quest by setting the associated QuestUpdate_Quest_State flag.

3. Recruit an NPC into your party. Easiest thing is to use CharacterRecruitCharacter(), but I also tried permutations with CharacterMakePlayer()/CharacterAssignToUser()/CharacterAddToParty.

4. Open Journal

*boom*

This can be resolved by simply adding DB_IsPlayer() for the NPC when it gets recruited. This seems like a bug as it should not be strictly necessary to rely on DB_IsPlayer(), but that seems to be an unwritten rule in a lot of the Osiris APIs.

We should at least get this documented somewhere in relevant portions of the wiki if it can't be fixed easily.

thankyou in advance.


DOS2 Mods: Happily Emmie After and The Noisy Crypt

Steam Workshop
Nexus Mods
Re: Bug: Journal crashes when adding NPCs to party [Re: Windemere] #640844
17/01/18 08:18 AM
17/01/18 08:18 AM
Joined: Sep 2017
Posts: 162
Larian_JB Offline
member
Larian_JB  Offline
member

Joined: Sep 2017
Posts: 162
Hi Windemere,

This is likely because the journal uses player data, which is only assigned to characters which have the "Is Player" flag. I will make sure this bug gets reported but it will likely be low-priority.

Thanks for the report!

Re: Bug: Journal crashes when adding NPCs to party [Re: Windemere] #640851
17/01/18 05:44 PM
17/01/18 05:44 PM
Joined: Dec 2013
Posts: 872
Windemere Offline OP

old hand
Windemere  Offline OP

old hand

Joined: Dec 2013
Posts: 872
That makes sense.

Might be good to add some notes for CharacterMakePlayer about adding the character to DB_IsPlayer() for other systems to work properly, including journals and crimes. There may be other places in the wiki where it's good to highlight as well, maybe on the DB QuestDef State page.

Thanks again.


DOS2 Mods: Happily Emmie After and The Noisy Crypt

Steam Workshop
Nexus Mods

Powered by UBB.threads™ PHP Forum Software 7.6.2