Thank you, kevL_s! Now I understand a lot better! I always thought the FactionLeader in this case was the true faction leader, aka the PC, and not one of the companions, but apparently it can be the PC or one of the companions in this case.
The comment is pretty strange yes, and that comment was copied from the author of the original script (which I don’t remember who it was). It’s taken from a discussion here on the forums probably from about half a year ago or something, but I can’t find it at the moment. That original script’s intention was somewhat different from what I’m trying to do so maybe that’s why the description seems off.
Then the if (GetIsPC(oEnter) && GetIsOwnedByPlayer(oEnter)) is what I would want here. However, when doing some more testing I noticed that in this case it doesn’t matter. When the conversation starts the game automatically switches back to the PC. I found that when controlling a companion and entering the trigger, what made it fail was the oEnter = SetOwnersControlledCompanion(oEnter); (I think) as it then switched back to the PC, and then when the cutscene started a millisecond later the PC wasn’t near the companion to start the conversation, and all was screwed up and the game froze. It also might have been the SetCutsceneMode that should have come later in the script.
I remade the script like this, and now it seems to be working as I want:
const string sROSTER_ILIR = "valerie"; // note: this needs to be the *roster* string-id
const string sROSTER_MEAH = "meah";
const string sROSTER_GARDOK = "gardok";
const string sROSTER_SNOFWIN = "snofwin";
const string sROSTER_TYN = "tyn";
//const string sROSTER_VALERIE = "valerie";
object oPC1 = GetEnteringObject();
if (!GetIsPC(oPC1)) return;
if (GetIsInCombat(oPC1)) return;
if (!GetLocalInt(OBJECT_SELF, "Done"))
object oEnter = GetEnteringObject();
object oIlir = GetObjectFromRosterName(sROSTER_ILIR);
object oGardok = GetObjectFromRosterName(sROSTER_GARDOK);
object oSnofwin = GetObjectFromRosterName(sROSTER_SNOFWIN);
object oTyn = GetObjectFromRosterName(sROSTER_TYN);
object oMeah = GetObjectFromRosterName(sROSTER_MEAH);
//object oValerie = GetObjectFromRosterName(sROSTER_VALERIE);
if (GetIsObjectValid(oIlir) && GetFactionEqual(oIlir, oEnter)) // Ilir is valid and in pc-party.
SetLocalInt(OBJECT_SELF, "Done", TRUE);
SetCutsceneMode(oEnter); // this needs to be cleared by the dialog's End/Abort dialog handlers.
AssignCommand(oIlir, ActionStartConversation(oEnter, "ignii_room_conv1", FALSE, FALSE, FALSE, FALSE));
I still find it odd that oDeivana in my other script on the OnEnter of the SpeakTrigger didn’t respond to ActionJumpToObject. Do you have any thoughts about that, kevL_s? Is it because of the variables in the SpeakTrigger that in this case tells the oDeivana to run to the trigger? I thought that the ActionJumpToObject would override that.
Edit: Just to be clear, I do use the CreateIpSpeaker often! It was you who told me about this about a year ago (or something along the line), @andysks, and I’ve used it many times since. When I find that to be the most effective is when the trigger won’t run at all for some reason, then the IpSpeaker tries again and again. So if I have a problem with a trigger not triggering I use that all the time.