In the module I’m working on right now there are quite a number of companions in your party. When doing dialog the companions and the PC oftentimes don’t face the one the should be facing. Before I used ga_face_target which works well, but I thought I would do a script where all the potiential companions would face the right way. I thought it would work but when testing ingame it doesn’t seem to work that well:
#include "ginc_actions"
#include "ginc_param_const"
void main(string sTarget)
{
object oPC = GetPCSpeaker();
object oTarget = GetTarget(sTarget);
vector vTarget = GetPosition(oTarget);
int bLockOrientation = 0;
object oElvera = GetNearestObjectByTag("elvera",oPC);
object oTaik = GetNearestObjectByTag("taik",oPC);
object oAnto = GetNearestObjectByTag("anto",oPC);
object oCelestine = GetNearestObjectByTag("celestine",oPC);
object oLoreen = GetNearestObjectByTag("loreen",oPC);
//TAG OBJECT OVERRIDE PC Speaker
if(sTarget == "$PC")
{
object oSpeaker = GetPrimaryPlayer();
vector vTarget = GetPosition(oSpeaker);
AssignCommand(OBJECT_SELF, SetFacingPoint(vTarget,1));
}
if (GetIsObjectValid(oAnto) && (GetObjectByTag(sTarget)!= oAnto) && GetFactionEqual(oPC,oAnto))
{
AssignCommand(oAnto, ActionDoCommand(SetFacingPoint(vTarget, bLockOrientation)));
AssignCommand(oAnto, ActionWait(0.5f));
}
if (GetIsObjectValid(oElvera) && (GetObjectByTag(sTarget)!= oElvera) && GetFactionEqual(oPC,oElvera))
{
AssignCommand(oElvera, ActionDoCommand(SetFacingPoint(vTarget, bLockOrientation)));
AssignCommand(oElvera, ActionWait(0.5f));
}
if (GetTarget(sTarget)!= oPC)
{
AssignCommand(oPC, ActionDoCommand(SetFacingPoint(vTarget, bLockOrientation)));
AssignCommand(oPC, ActionWait(0.5f));
}
if (GetTarget(sTarget)!= oTaik)
{
AssignCommand(oTaik, ActionDoCommand(SetFacingPoint(vTarget, bLockOrientation)));
AssignCommand(oTaik, ActionWait(0.5f));
}
if (GetTarget(sTarget)!= oCelestine)
{
AssignCommand(oCelestine, ActionDoCommand(SetFacingPoint(vTarget, bLockOrientation)));
AssignCommand(oCelestine, ActionWait(0.5f));
}
if (GetTarget(sTarget)!= oLoreen)
{
AssignCommand(oLoreen, ActionDoCommand(SetFacingPoint(vTarget, bLockOrientation)));
AssignCommand(oLoreen, ActionWait(0.5f));
}
}