Aller au contenu

Photo

Heartbeat script to check companions


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

#1
Laugh out loud

Laugh out loud
  • Members
  • 109 messages

How do you write a heartbeat script that checks the rest of the players companions in the party for a starting condition after checking the controlled PC?

 

The command checks the PC using: object oPC = GetFirstPC(FALSE); to check the highlighted character.

 

What command should I use to check the rest of the companions in the party; object oPC = GetFirstPC(TRUE);?, GetNextPC?, GetNextInFaction?



#2
4760

4760
  • Members
  • 1 207 messages

You'd have to use GetFirst/GetNext instructions and a loop:

object oMember = GetFirstFactionMember(GetFirstPC(),FALSE);
while (GetIsObjectValid(oMember))
{
	if (YOUR_CONDITIONS_HERE)
	{
		WHAT_HAPPENS_IF_CONDITIONS_ARE_MET_HERE
	}
oMember = GetNextFactionMember(GetFirstPC(),FALSE);
}


  • kamal_ aime ceci

#3
Laugh out loud

Laugh out loud
  • Members
  • 109 messages

 

You'd have to use GetFirst/GetNext instructions and a loop:

object oMember = GetFirstFactionMember(GetFirstPC(),FALSE);
while (GetIsObjectValid(oMember))
{
	if (YOUR_CONDITIONS_HERE)
	{
		WHAT_HAPPENS_IF_CONDITIONS_ARE_MET_HERE
	}
oMember = GetNextFactionMember(GetFirstPC(),FALSE);
}

Thanks, I will give it a try.