So, I have a situation that I haven’t been able to solve with my script. You enter a trigger with the party, and a conversation is supposed to start. However, as it is now, nothing happens. Thing is, I don’t know what companions the player will have in the party at this time, so I want to scroll through the companions and just take one of them to be the one owning the conversation. I thought I had come up with a good idea of how to solve this, but it turns out it’s not working. Here’s my attempt:
int YouHaveShovels()
{
object oPC1 = GetFirstPC();
object oFM = GetFirstFactionMember(oPC1, FALSE);
int bShovels = FALSE;
while(GetIsObjectValid(oFM))
{
if (GetIsObjectValid(GetItemPossessedBy(oFM,"shovelit")))
{
bShovels = TRUE;
}
oFM = GetNextFactionMember(oPC1, FALSE);
}
return bShovels;
}
void main()
{
object oPC = GetEnteringObject();
object oPC1 = GetFirstPC();
if(!GetIsPC(oPC)) return;
if(GetJournalEntry("q_treasure",oPC)<1) return;
if(!YouHaveShovels()) return;
SetCutsceneMode(oPC1);
object oCompanion = GetFirstFactionMember(oPC1,FALSE);
while(GetIsObjectValid(oCompanion) && !GetLocalInt(OBJECT_SELF,"FoundCompanion"))
{
if(oPC1 == oCompanion)
{
oCompanion = GetNextFactionMember(oPC1);
}
else
{
SetLocalInt(OBJECT_SELF,"FoundCompanion",1);
AssignCommand(oCompanion, ActionStartConversation(oPC, "c_i1_treasuredig", FALSE, FALSE, TRUE, FALSE));
}
}
}
So, how do you script this to make it work? Thanks for your time!