Divinity Banner
Previous Thread
Next Thread
Print Thread
Character management via dialog #655374
09/09/19 05:41 PM
09/09/19 05:41 PM
Joined: Oct 2018
Posts: 14
Vieux Offline OP
stranger
Vieux  Offline OP
stranger

Joined: Oct 2018
Posts: 14
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.
Re: Character management via dialog [Re: Vieux] #655383
09/09/19 08:48 PM
09/09/19 08:48 PM
Joined: Dec 2013
Posts: 871
Windemere Offline

old hand
Windemere  Offline

old hand

Joined: Dec 2013
Posts: 871
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
Re: Character management via dialog [Re: Windemere] #655404
10/09/19 06:47 PM
10/09/19 06:47 PM
Joined: Oct 2018
Posts: 14
Vieux Offline OP
stranger
Vieux  Offline OP
stranger

Joined: Oct 2018
Posts: 14
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.

Re: Character management via dialog [Re: Vieux] #655406
10/09/19 08:18 PM
10/09/19 08:18 PM
Joined: Dec 2013
Posts: 871
Windemere Offline

old hand
Windemere  Offline

old hand

Joined: Dec 2013
Posts: 871
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
Re: Character management via dialog [Re: Windemere] #655407
10/09/19 09:44 PM
10/09/19 09:44 PM
Joined: Oct 2018
Posts: 14
Vieux Offline OP
stranger
Vieux  Offline OP
stranger

Joined: Oct 2018
Posts: 14
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.

Re: Character management via dialog [Re: Vieux] #655409
10/09/19 11:41 PM
10/09/19 11:41 PM
Joined: Dec 2013
Posts: 871
Windemere Offline

old hand
Windemere  Offline

old hand

Joined: Dec 2013
Posts: 871
Great! Thanks for the update and happy modding.


DOS2 Mods: Happily Emmie After and The Noisy Crypt

Steam Workshop
Nexus Mods

Powered by UBB.threads™ PHP Forum Software 7.6.2