Jump to content

BG2 tokens not updated?


argent77

Recommended Posts

I've found a very strange behaviour of the game engine recently while writing a bunch of dialogs.

 

Whenever I kick out a party member, it messes up a bunch of internal states. The string tokens <PLAYER1-6> and possibly the object identifiers Player1-6 aren't updated correctly, leading to very strange behaviours when used in conversations.

For example, if you kick out your party member of slot 3, the token <PLAYER3> contains the character name of slot 2 (or sometimes empty space) afterwards and <PLAYER4-6> still contain the names of the former slots 4-6, even though there is no Player6 anymore. The only way to fix it was by saving and reloading. Do you know about this problem and are there ways to prevent it?

Link to comment

If the token for <PLAYER3> changes mid-game to the name of Player2 I don't understand it. But <PLAYER3> remaining empty and 2, 4-6 still used is logical, imho: If the game still refers to the NPCs being in the same slots for the same game. Meaning, if you take someone new into the group after kicking out <PLAYER3> (without reloading), he/she will occupy the Player3 slot, even if there were more NPCs in the party at that time.

I made such an experience for a game on multiplayer-mode where I kicked out a self-created NPC and took a joinable NPC in: upon next loading, the game NPC was not in slot 6 as I suspected (and it annoyed me, as it was Imoen who I wanted to be in the last place of the group order, but had to switch her by hand after every loading).

Which also means that the slot does not necessarily refer to the order the player put the NPCs in. So, the NPC in the last slot of the group arrangement could still be Player2 with the according <PLAYER2> depending on when he was taken into the group (this was not your question, but i wanted to point it out nontheless).

What I didn't know is the re-ordering of the player numbers upon reload, actually. This would mean e.g. Amber's Player2 romance would be messed up if Player2 is kicked-out of the party, the game saved and reloaded, and he then was taken back! (Although I don't know how the Player2 detection is handeled in the mod, so maybe that is covered).

Link to comment

Yes, after thinking about it I find this behavior logical too. Usually this is not a problem, but I have written an introduction dialog which adresses each party member (both Bioware NPCs and Mod/Multiplayer NPCs). I can detect how many party members are present very easily by using NumInParty(), but I can't safely tell which party slot is occupied unless I know the name of the character (which is impossible for Mod/Multiplayer NPCs).

 

I have solved the problem now, but the code is rather complex and about five times the original size.

Link to comment

It's a known issue, but there is no workaround afaik. I recall cmorgan having run into it once (somewhere on PPG forums), and iirc no solution has been devised.

 

As a wild guess, try adding ~See(PlayerX)~ or ~Range(PlayerX,30)~ triggers. I don't remember though if the PlayerX array is updated correctly.

 

PS Ah, I see you've found a solution. Good then.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...