Here's a way to test the situation I described (looping through PCs and not catching the DMs in possession):
- put this code in the module's onchat:
string sDMMsg = GetPCChatMessage();
object oDM = GetFirstPC();
while(GetIsObjectValid(oDM))
{
if( GetIsDM(oDM) || GetIsDMPossessed(oDM) )
SendMessageToPC(oDM, sDMMsg);
oDM = GetNextPC();
}
- Log in as a DM and possess a creature.
- Log in as a PC as well. Say something.
- The DM is not sent the message.
I am trying something else:
Area Enter Script (this would be the module enter area so you capture all new players):
//::///////////////////////////////////////////////
//:: area_enter
//:://////////////////////////////////////////////
/*
*/
//:://////////////////////////////////////////////
//:: Created: The Magus (2012 july 4)
//:://////////////////////////////////////////////
void main()
{
object oEnter = GetEnteringObject();
if (GetIsPC(oEnter))
{
object oMod = GetModule();
int nPCCount = GetLocalInt(oMod, "PC_COUNT")+1;
int nPCIndex = GetLocalInt(oEnter, "PC_INDEX_MOD");
if( nPCIndex
&& oEnter==GetLocalObject(oMod, "PC_OBJECT"+IntToString(nPCIndex))
)
nPCCount=0;
if(nPCCount)
{
SetLocalObject(oMod, "PC_OBJECT"+IntToString(nPCCount), oEnter);
SetLocalInt(oMod, "PC_COUNT", nPCCount);
}
}
}
Chat Script:
//::///////////////////////////////////////////////
//:: mod_chat
//:://////////////////////////////////////////////
/*
*/
//:://////////////////////////////////////////////
//:: Created: The Magus (2012 july 4)
//:://////////////////////////////////////////////
void main()
{
object oSpeaker = GetPCChatSpeaker();
string sSpkrName= GetName(oSpeaker);
string sMessage = GetPCChatMessage();
object oMod = GetModule();
int nPCCount = GetLocalInt(oMod, "PC_COUNT");
int nIt = 1;
object oPC, oAss;
while(nIt<=nPCCount)
{
oPC = GetLocalObject(oMod, "PC_OBJECT"+IntToString(nIt));
if(GetIsObjectValid(oPC))
{
SendMessageToPC(oPC, sSpkrName+": "+sMessage);
if(GetIsDM(oPC))
{
oAss = GetAssociate(ASSOCIATE_TYPE_NONE, oPC);
SendMessageToPC(oAss, "[Ass None] "+sSpkrName+": "+sMessage);
oAss = GetAssociate(ASSOCIATE_TYPE_DOMINATED, oPC);
SendMessageToPC(oAss, "[Ass Dom] "+sSpkrName+": "+sMessage);
}
}
else
{
SendMessageToPC(oSpeaker, "PC"+IntToString(nIt)+" is invalid.");
}
nIt++;
}
}
i am using this to test a way to capture the DM possessing a creature. So far I have found that the DM is still valid in my pseudo array, but this object is not the same as the Object Possessed by the DM. Thats what I need to find.