I have a generic script to force an NPC to "go home" at end of a conversation, where home is tag of a waypoint stored as local string (homeloc) on them.
I want the NPC to maybe run off in a direction for a couple steps before fading out and jumping, but because I am making this as generic as possible I can't just force movement towards a known object.
Any suggestions for having run in a random direction for a few seconds before fading out and jumping?
Here's the script
void main()
{
object oNPC = OBJECT_SELF;
// homeloc is string, with tag of their home waypoint
object oWP = GetObjectByTag(GetLocalString(oNPC, "homeloc"));
location locWP = GetLocation(oWP);
AssignCommand(oNPC, ActionJumpToLocation(locWP));
}





Retour en haut






