Aller au contenu

Photo

How can I check the whole party without checking each companion by tag?


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
andysks

andysks
  • Members
  • 1 650 messages

Like a circle through all party. Example, if I would make an encounter to play based on if the survival skill is not enough. Is there a way to do this by circling through the party and checking everyone's skill rank, then if no-one has above 15 let's say it fires?

 

Thanks.



#2
kevL

kevL
  • Members
  • 4 061 messages

here's a standard method for cycling party-faction

 

object oPC = // define PC

object oFM = GetFirstFactionMember(oPC, FALSE); // FALSE includes companions & associates
while (GetIsObjectValid(oFM))
{
//  if (GetAssociateType(oFM) != ASSOCIATE_TYPE_NONE) continue; // use this to exclude associates.

    // if getSkillRank(oFM) > 15
    // {
    //     set a variable, return TRUE, etc etc.
    //     break;
    // }


    oFM = GetNextFactionMember(oPC, FALSE);
}

  • andysks aime ceci

#3
AGhost_7

AGhost_7
  • Members
  • 62 messages

Just do a faction loop:

 

object oPC = GetEnteringObject();// or some other event... Lets say its a trigger.
int bPassesCheck = FALSE;
object oFactionMember = GetFirstFactionMember(oPC, FALSE);
while(GetIsObjectValid(oFactionMember))
{
   if(GetSkillRank(SKILL_SURVIVAL, oFactionMember) > 14)
   {
      bPassesCheck = TRUE;
      break;
   }
   oFactionMember = GetNextFactionMember(oPC, FALSE);
}


if(bPassesCheck)
{
   // ...
}
else
{
   // ...
}
You could even make a more generic function which would have the following signature:
 
int CheckMinSkillParty(int nSkillConst, int nMinSkill, int bPCOnly);

  • andysks aime ceci