I have tried for a couple of hours to get the party in my single player module to face the right way when arriving in a new area. I have used functions provided by @kevL_s and @travus, and in other situations these script functions have worked really well. For some reason though, it doesn’t work for me here. I have checked the Script Assist together with the excellent EC_super_include script, that I think I got from kevL_s at some point, to find other functions to use to find other solutions to the problem, but nothing works.
When entering a conversation these functions in my script seems to work better for some reason, but in this particular situation, I don’t want a conversation, I just want them to face the right direction when arriving in the area.
This script I’ve put on the OnClientEnter. If anyone has a clue as what to do to get this working, I’m all ears (the “fstipspeak2” is a placeable iPoint):
#include "ginc_group"
#include "nw_i0_spells"
#include "x0_i0_petrify"
#include "ginc_cutscene"
#include "x2_am_inc"
void RemoveTheEffect(object oPC1)
{
SendMessageToPC(oPC1,"RemoveEffect is running");
object oFM = GetFirstFactionMember(oPC1, FALSE);
while (GetIsObjectValid(oFM))
{
RemoveEffectOfType(oFM, EFFECT_TYPE_CUTSCENEIMMOBILIZE);
oFM = GetNextFactionMember(oPC1, FALSE);
}
SetCutsceneMode(oPC1,FALSE);
}
void FaceParty(object oPC, string sFacee)
{
vector v = GetPosition(GetObjectByTag(sFacee));
object oFM = GetFirstFactionMember(oPC, FALSE);
SendMessageToPC(oPC,"FaceParty is running");
//object oFacee = GetObjectByTag("fstipspeak2");
//vector vTarget = GetPosition(oFacee);
while (GetIsObjectValid(oFM))
{
AssignCommand(oFM, ClearAllActions());
DelayCommand(GetRandomDelay(), AssignCommand(oFM, SetFacingPoint(v, TRUE)));
//AssignCommand(oFM, ActionDoCommand(SetFacingPoint(vTarget, TRUE)));
//AssignCommand(oFM,SetFacing(DIRECTION_EAST));
//AssignCommand(oFM,Face(oFM,oFacee));
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectCutsceneImmobilize(), oFM);
oFM = GetNextFactionMember(oPC, FALSE);
}
}
void PartyFacingDo(string sFacee, float fSpacing)
{
object oPC = GetFirstPC();
SendMessageToPC(oPC,"PartyFacingDo is running");
if (fSpacing < 0.8) fSpacing = 0.8f;
//vector v = GetPosition(GetObjectByTag(sFacee));
ResetGroup(PARTY_GROUP_NAME);
GroupAddFaction(PARTY_GROUP_NAME, oPC, GROUP_LEADER_FIRST, TRUE);
GroupSetBMAFormation(PARTY_GROUP_NAME, fSpacing);
GroupSetNoise(PARTY_GROUP_NAME);
GroupMoveToFormationLocation(PARTY_GROUP_NAME, GetLocation(oPC), MOVE_JUMP_INSTANT);
//GroupSetFacingPoint(PARTY_GROUP_NAME,v);
DelayCommand(0.1f, FaceParty(oPC, sFacee));
}
void fadetoblack(float fSpeed, float fFailsafe, int nColor)
{
object oPCh = GetEnteringObject();
if (IsFloatNearInt(fFailsafe, 0))
fFailsafe = 15.0f;
FadeToBlackParty(oPCh, 1, fSpeed, fFailsafe, nColor);
}
void main()
{
object oPC = GetEnteringObject();
object oPC1 = GetFirstPC();
fadetoblack(3.2,3.2,0);
if(GetLocalInt(OBJECT_SELF,"done")) return;
SetLocalInt(OBJECT_SELF,"Done",TRUE);
//AssignCommand(oPC1, ClearAllActions());
SetCutsceneMode(oPC1);
DelayCommand(0.5,FaceParty(oPC1,"fstipspeak2"));
DelayCommand(0.8,PartyFacingDo("fstipspeak2",1.0));
DelayCommand(1.1,RemoveTheEffect(oPC1));
}