OK, here is another couple of issues with waypoints. It does require a custom script which is at the end of this post. What I am trying to do is have an npc stop in front of the player and speaks to him (player disabled until this happens). Once the player moves away from the npc, the npc activates another npc near by and the npc will walk a waypoint. I destroy the first npc. However, it is not destroyed here because I want to show the first issue with save/load.
The first image shows the npc at the end of the waypoint he had followed. This is where he will talk to the player.
The next image shows the second npc when the player is at a determined distance from the first. You notice that the back of the first npc is toward the player as it should be and that the second npc is now spawned and walking toward the player. It is following a NEW (different) waypoint.
Now the next (third) image shows the two issues. I saved the game sometime after the second image. Now I load the game and the third image shows the problems. The first npc is now sideways rather than having his back to the player. In other words he has rotated. The biggest issue is that the second npc has totally disappear. However, you can hear the footsteps of the invisible npc as it continues to walk the waypoint.
Here is an image of the map and you can download the fpm with the download button.
The script follows for the first npc. The second npc uses the
follow.fpi:
;Artificial Intelligence Script
;Header
desc = Follow Waypoint to player and stop
;Triggers
;Set globalvar #1 to Letter A = 1
:state=0:state=1
:state=1,waypointstate=0:animate=2,waypointstart
:state=1,waypointstate=3:animate=2,waypointnext
:state=1,waypointstate=5:animate=1,state=5,waypointstop
:state=5:settargetname=thug_spawn,state=6
:state=6:settarget,state=7
:state=7,plrdistfurther=150:activatetarget=1
;End of Script
The past has a lot of memories to hold onto; but, today is chock full of new adventures, and, the future shouts out, "The best is yet to come!" -- TerryC