PC has a conversation with an NPC in Area 1, and following that conversation, the NPC should move to a waypoint in Area 2,
I put a waypoint by the exit door, and assigned command on NPC to force move to the exit waypoint.
Then using a delay, jump the NPC to her home waypoint in Area 2.
Feeding this with sDestination = tag of the waypoint in Area 2, and a delay of 10, the NPC will indeed run off towards, and disappear at, the "nwc_exit" waypoint.
But, if I go through the door to Area 2, she's not at her home waypoint. If I pass back to Area 1, she's standing in the door way of Area 1.
Does anything look wrong with this?
I'm always a little confused with using delay with Assign Command.
Thank you.
the below script is in the Action of the final line of conversation. I know the provided sDestination tag is correct for the WP.
void main(string sDestination, float fDelay)
{
object oExitWP = GetObjectByTag("nwc_exit");
location lDestWP = GetLocation(GetObjectByTag(sDestination));
object oTarget = OBJECT_SELF;
AssignCommand(oTarget, ActionForceMoveToObject(oExitWP,TRUE));
AssignCommand(oTarget, DelayCommand(fDelay, JumpToLocation(lDestWP)));
}





Retour en haut







