So the main problem as I see it is that you want to make it specific to the character as to who was involved so that increases the complexity.

This could be some sort of baseline
Code
INIT:
DB_KillableCharacters(CHARACTER_Camp_Boss,"KilledCampBoss");
DB_KillableCharacters(CHARACTER_Travelling_Salesman,"KilledTraveling");

KB:
//checks notes the combat ID of all combats for every character.  
//possibly re-write to limit this to just players for DB size sake.
IF
CharacterEnteredCombat(_Char,_CombatID)
THEN
DB_InCombat(_Char,_CombatID);


//Check when someone leaves combat.  Also could make this NPC only.
IF
CharacterLeftCombat(_Character,_CombatID)
THEN
ProcCombatCheck1(_Character,_CombatID);  //passes the combat id and character to the PROC.


//Checks if a character who has left combat is dead.  Compares it with the DB of the players involved in that combat.
PROC
ProcCombatCheck1((CHARACTER)_Character,(INTEGER)_CombatID)
AND
CharacterIsDead(_Character,1)
AND
DB_KillableCharacters(_Character,_VarString)
AND
DB_InCombat(_Player,_CombatID)
AND
_Player.isPlayer()
THEN
CharacterSetVarInteger(_Player,_VarString,1);  //adds character flag for each character that was in the combat where a killable NPC died.
DebugBreak("Testing if this works");



I did a baseline quick test just to see if it worked, It did. The flag was set.

Depending on what you are trying to accomplish it might have to be tweaked. The way I have it would be good for checking in dialogs. So you could have Player 1 talk to an NPC with the conditional character flag "KilledCampBoss" and check it for the character doing the talking.

You also have the pre-define the flags for each character (or group of characters) you want consequences for.

If you can give me an idea of what you have in mind for consequences that might help.


EDIT:
Thinking about it some more, the PROC might need to check if the NPC is hostile or not. If you don't then it will set the flag for any NPC that dies in combat with your player so it would think that you murdered your ally.

So maybe add:
AND
CharacterGetFaction(_Character,"Evil NPC")

But that assumes you are actually switching their faction. If you aren't the solution will have to be more creative.



EDIT: #2
Okay this might be better than the faction one, checking attitude. D:OS automatically sets -45 attitude to anyone you fight according to "useful osiris systems". So assuming that's accurate you can add:

CharacterGetAttitudeTowardsPlayer(_Character,_Player,_Attitude)
AND
_Attitude < 44

It seemed to work for me but I only did a quick check.

Last edited by SniperHF; 09/12/15 10:32 PM.