Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: Oct 2018
Vieux Offline OP
stranger
OP Offline
stranger
Joined: Oct 2018
Hi,

I'm currently working on a quest mod in which party management is very important.

I used this tutorial and it worked fine until Definitive Edition.

I didn't want to ask for help on this because I had bypassed (or so I thought) the problem via dialog flags.

The issue is this : When calling the CharacterMakePlayer procedure it effectively adds the NPC to the party but it is NOT added to DB_IsPlayer database.
This means that, when you check with sys_count how many players there is, it always returns 1.

The real problem is that when the user Player (the first player that wasn't recruited this way) is killed the game engine evaluates this as Game Over.

So I ask : How do I ensure that the DB_IsPlayer is updated correctly ?

Last edited by Vieux; 09/09/19 05:51 PM.
Joined: Dec 2013
old hand
Offline
old hand
Joined: Dec 2013
At the same time that you make the call to CharacterMakePlayer in your story, can't you make a call to DB_IsPlayer() with the same GUID?


DOS2 Mods: Happily Emmie After and The Noisy Crypt

Steam Workshop
Nexus Mods
Joined: Oct 2018
Vieux Offline OP
stranger
OP Offline
stranger
Joined: Oct 2018
Hi,
Thank you for taking the time to help me.

Yes I think I do right before CharacterMakePlayer I call DB_IsPlayer on the very same GUID. Or I don't know how to do it right

my code :

Quote

PROC
PROC_AddPlayerToParty((CHARACTERGUID)_Char, (CHARACTERGUID)_NPC)
THEN
DB_IsPlayer(_NPC);
CharacterMakePlayer(_NPC);
CharacterAddToParty(_Char, _NPC);


So it's similar to the original one but with this insignificant change of the last line.

Joined: Dec 2013
old hand
Offline
old hand
Joined: Dec 2013
Okay, I'm trying to clear the cobwebs a bit here. Your setting of DB_IsPlayer() looks fine. When I added NPCs to the party in my project, the only thing I did differently was to set the owning character at the same time when calling CharacterMakePlayer (see wiki link for notes). Example:

Code
CharacterMakePlayer(_NPC, _Char);
DB_IsPlayer(_NPC);


Where '_Char' is the player who owns control of the NPC. Note that the call to CharacterAddToParty is deprecated and not supported in DOS2.

I am hoping what happened is that your NPC was never associated with a particular user (human player), and therefore the game did not recognize any survivors when your main character died. I would modify your CharacterMakePlayer() to look like my example and see if that helps.


DOS2 Mods: Happily Emmie After and The Noisy Crypt

Steam Workshop
Nexus Mods
Joined: Oct 2018
Vieux Offline OP
stranger
OP Offline
stranger
Joined: Oct 2018
That was it ! It worked fine.

I'll try to remember how you debugged it next time I encounter a similar problem.

That's precious help you gave me here. Thank you.

Joined: Dec 2013
old hand
Offline
old hand
Joined: Dec 2013
Great! Thanks for the update and happy modding.


DOS2 Mods: Happily Emmie After and The Noisy Crypt

Steam Workshop
Nexus Mods

Moderated by  Larian_KVN 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5