Multiplayer partywide plot-decision voting

I need some advice from PW or multiplayer scripters.

I’m trying to set up decision points to permit party voting on plot-advancing decisions in multiplayer-compatible modules. Decision points register player votes for the available options, and complete the vote and execute the script linked to the highest-voted decision once all PC party members in the area have voted.


Accounting for the possibility of multiple PC parties in a module, I don’t want a potential second party to be able to partially vote on a decision point, casting some votes but moving on without completing the decision, leaving a rigged vote for the other party. So the decision points should be recording the votes on a per-party basis, with the decision and it’s consequences not being attributed to players who weren’t involved in making the decision.

To say, if a party decides to murder some hostages, then party members who weren’t involved in making the decision to murder the hostages (having been elsewhere entirely) should not be liable to be prosecuted for the murder of the hostages. And if Party A casts decisions to murder the hostages, but moves on without completing the vote, and Party B later drops by and casts decisions to save the hostages, then Party B’s decision to save the hostages should not be endangered by Party A’s partial decision to murder the hostages, making Party B inadvertently murder the hostages despite all members of Party B having voted to save the hostages.

So I need a way to distinguish between different PC parties. If that’s a thing. Is that a thing? Lack of multiplayer experience is not coming in handy here.

The question(s):
Is it reliable to use the ObjectToString-ed faction leader to store the decision counter strings on the decision point placeable, or do I need to give all the PC party members a custom stamp signifying which party they’re a member of?

Can the faction leader change ingame? Can PCs change party membership ingame? Is there even such a thing as “multiple PC parties” in NWN? If the multiplayer session gets suspended, and restarted later, can the party leader be a different person, or a different object (in the ObjectToString() sense)?

Now registering all current party members of the decision point’s user, if the user is not already registered on the point, giving them a shared party ID stored on the decision point placeable. Only current party members that are in the area and have the matching party ID count during the “Has everyone voted?”-check, and are flagged as having participated in making the decision if the vote is completed.

If a new party member joins during an ongoing vote, and they do not activate the point, then they don’t count towards the vote (not being stamped for the decision point). If the new party member joins and activates the decision point, their entire party gets registered as a new party ID, for which their previous votes don’t count anymore, so they’d have to vote again.

If a party member leaves without having voted, they do not count towards the voter requirement anymore, so no problem. If a party member leaves after having voted, they do not count towards the voter requirement anymore, but their vote stays in (may want to try to do something about that? :thinking:).

Vote weights are randomized (100+(Random(99)), for tiebreaking.

Currently using GetPCPlayerName to register players. Uncertain whether this is desirable. Is it possible for two players in multiplayer to have the same player name?