Reviving this useful thread, thanks to SniperHF for the link! I wasn't aware of this great project.
I'm not familiar with using Osiris but I tried to get into it a little bit over the last days due to the _GLOBAL_Attributes and the _GLOBAL_Traits file which I absolutely need for my mod. Thank you, gentlemen, for sharing this!
Now: As mentioned above, using global events implies that every character in DB_CharacterToCount profits or suffers from the other character's attributes. And there doesn't seem to be a command in the script to clear the attribute events, yet (which would be important in case attributes change in the meantime).
I have tried to solve both issues and as far as I see I was successfull. I hope it's okay to post the modified _GLOBAL_Attributes script lines here. 99% is your work.
Some words on my changes first:
1) I used Dialog Character Events instead of global events, so the flags are personalized. The developers use this kind of event for storing the players' gender, reputation or attitude towards NPCs, for example.
2) Now there is a process that clears all dialog character events every time a dialog starts, before character events are set.
Now it's possible to have several characters in dialog, each with his own attribute flags.
The only problem may be that moment when another player character starts a dialog. All character flags get removed and re-generated for all characters in the CharacterToCount database. So there will be a very short moment other player characters (who already are in dialog) don't have attribute flags. I wasn't able to personalize clearing character events, too.
I hope the script is fine now. It's my first time with Osiris and testings in the editor deluded me once:
INITSECTION
DB_CharacterToCount(CHARACTER_Player1);
DB_CharacterToCount(CHARACTER_Player2);
DB_AttributeNames("Strength");
DB_AttributeNames("Intelligence");
DB_AttributeNames("Constitution");
DB_AttributeNames("Speed");
DB_AttributeNames("Perception");
DB_AttributeNames("Dexterity");
DB_AttributeValues(5,"5");
DB_AttributeValues(6,"6");
DB_AttributeValues(7,"7");
DB_AttributeValues(8,"8");
DB_AttributeValues(9,"9");
DB_AttributeValues(10,"10");
DB_AttributeValues(11,"11");
DB_AttributeValues(12,"12");
DB_AttributeValues(13,"13");
DB_AttributeValues(14,"14");
DB_AttributeValues(15,"15");
DB_AttributeValues(16,"16");
DB_AttributeValues(17,"17");
DB_AttributeValues(18,"18");
DB_AttributeValues(19,"19");
DB_AttributeValues(20,"20");
KBSECTION
IF
DialogStarted(_DialogName,_InstanceID)
THEN
ProcClearDialogEvents();
ProcTriggerAttributeCheck();
/*IF
DialogStartRequested(_Character1,_Character2)
THEN
ProcTriggerAttributeCheck();*/
/*With DialogStarted (only) the script got executed in both cases: dialog actively started by the player and started by script. So it's quite sure it works in all possible cases.*/
PROC
ProcTriggerAttributeCheck()
AND
DB_AttributeNames(_AttributeName)
AND
DB_CharacterToCount(_Character)
AND
CharacterGetAttribute(_Character,_AttributeName,_AttributeValue)
THEN
ProcGetValueAsString(_AttributeName,_AttributeValue,_Character);
PROC
ProcGetValueAsString((STRING)_Attribute,(INTEGER)_Value,(CHARACTER)_Character)
AND
DB_AttributeValues(_Value,_ValueAsString)
AND
StringConcatenate(_Attribute,_ValueAsString,_StringResult)
//AND
// NOT DB_EventSet(_StringResult)
/*-->not needed, I think; prevents the other players in the CharacterToCount database to get character flags if included.*/
AND
IntegerSubtract(_Value,1,_ValueMinusOne)
THEN
DialogSetCharacterEvent(_StringResult,_Character,0);
DB_EventSet(_StringResult);
ProcGetValueAsString(_Attribute,_ValueMinusOne,_Character);
/*-->forgot to add _Character to ProcGetValueAsString the last time, so no flags for attribute values below the character's exact value were generated.*/
PROC
ProcClearDialogEvents()
AND
DB_CharacterToCount(_Character)
AND
DB_EventSet(_Event)
THEN
DialogClearCharacterEvent(_Event,_Character,0);
It's not extensively tested. But attribute checks in dialog for different characters worked for me.