All I am doing is making this heartbeat script (for a PW hence the custom heartbeat) for an NPC to move from point A to point B depending on the time of day, and then turn to face a specific dirrection. It worked fine before I added in the scripts to get the NPC to turn, now I get an UNKNOWN STATE IN COMPILER error on this line:
action aFacing = AssignCommand (oFisher, SetFacing(fDirection,FALSE));
Any help?
void main()
{
int iHB = GetLocalInt(OBJECT_SELF, "heartbeat");
if(iHB == 0)
{
SetLocalInt(OBJECT_SELF, "heartbeat", 1);
SetCustomHeartbeat(OBJECT_SELF, 350000);
//1000 is 1 second --> set this depending on how many minutes are in an hour on the PW
}
int iHour = GetTimeHour();
if(iHour == 20 || iHour == 21 || iHour == 22 || iHour == 23 || iHour == 0 || iHour == 1 || iHour == 2 ||
iHour == 3 || iHour == 4 || iHour == 5 || iHour == 6)
{
object oFisher = GetObjectByTag("c_ulgoth_fisherman");
location lWP = GetLocation(GetWaypointByTag("wp_npc_uloth_fisherman_night"));
AssignCommand( oFisher, ActionMoveToLocation( lWP , FALSE));
float fDirection = 150;
action aFacing = AssignCommand (oFisher, SetFacing(fDirection,FALSE));
float fDelay = 10;
DelayCommand(fDelay,aFacing);
}
else if(iHour == 7 || iHour == 8 || iHour == 9 || iHour == 10 || iHour == 11 || iHour == 12 ||
iHour == 13 || iHour == 14 || iHour == 15 || iHour == 16 || iHour == 17 || iHour == 18 ||
iHour == 19)
{
object oFisher = GetObjectByTag("c_ulgoth_fisherman");
location lWP2 = GetLocation(GetWaypointByTag("wp_npc_uloth_fisherman_day"));
AssignCommand( oFisher, ActionMoveToLocation( lWP2 , FALSE));
float fDirection = 150;
action aFacing = AssignCommand( oFisher, SetFacing(fDirection,FALSE));
float fDelay = 10;
DelayCommand(fDelay,aFacing);
}
}





Retour en haut







