As I have allowed a player to choose to attack an NPC at any time, then I needed to design a system that would have other NPCs come to the aid of the one attacked if need be, and at the same time, not make it so the player could inadvertently cause a problem with turning everybody hostile to them, whether by deliberate aggression or by accident. I wanted to allow the player the opportunity to attack anybody at any time, so that it could be left to play a more evil role if they wanted to. Note, I don't actively encourage this sort of activity, but I also wanted to allow the player the freedom to try to play the game the way they want to. Of course, this does open a number of issues to ensure the game can still be completed, but I do have a solution in mind.
The Life System In Action
Suppose a player attacks a local male soldier. Immediately, the attacked soldier NPC will turn hostile to the party of PC's, and at the same time, any nearby allies (or defenders) of the soldier will come to the soldier's aid and attack the party as well. Note, however, the soldier's allies do not show as hostile, and the player must right-click select any of the allies to attack them. However, this has the added benefit that if the player chooses to ignore the soldier's allies and run away, then the allies will stop their attack. (They were simply trying to break up the fight.)
The original soldier (if still alive) will, however, remain hostile for a few more rounds and try to continue the fight. If, however, the party escape the soldier, he will eventually return to non-hostile within a few more rounds. The next time they see him, they can approach him as a non-hostile NPC. However, if they approach too soon after he has "cooled down" from being hostile, he will still not speak with them, as he will now be scorning them.
Scorning is part of the influence section of the Life System, and is one of a number of levels that determines how an NPC reacts to the party of PCs. Eventually (over a short period of time), the soldier will even have this level of his opinion of the PCs reduce to simply disliking the PCs, at which point, the PCs may be able to work in an apology (if they so desire) and re-establish some sort of communication with the NPC, even if the soldier's new opinion of the party still treats them frostily.
I hope to have this Life System in place for all NPCs and not just for companions. While companions can have a bit more flexibility with the Influence Section, the fact that other NPCs can use the same system saves me a great deal of time and worry when it comes to a player who may like to try attacking for the sake of it. So far, in testing, the system works well, and I hope it will make the environment of NPCs appear more realistic and alive. Hence its name: The Life System.
Party Conversation Interaction
On the back of this system, and with some other code, I have now also included the multi-PC interactive party conversation. Basically, even prior to SoZ, I had wanted to include a conversation system that allowed the player's best skilled PC's to be able to be involved with any conversation the party may have, so that the best skills can be used. (E.g. Diplomacy, Intimidate or Bluff.) Now, if a player has a conversation where these skills are required, the player will be able to let the PC in the party with the best skill speak the line. And although it does not show the actual PC in the cutscene, it does, however, allow the best stats for the PC used when a skill role has to be made. I have also taken into account whether the PC is capable and within range before allowing the PC to be able to comment.
This was something that I wanted to add, and was stumped at how to get the individual scrolls in place. Eventually, even after struggling to build the board itself, I got the final tips I needed from BGP Hughes Effects Editor Tutorial and looking at Merecraft's Wanted Poster.
The whole task was more complicated that I thought it was going to be, and I still think there is room for better tutorials in this area in general.