Full Version : Set waypoint to the waypoint closest..
xmlspawner >>Q&A >>Set waypoint to the waypoint closest..


<< Prev | Next >>

godfood- 03-29-2006
I'm working on a dungeon, and I'm going to have the monsters travel back forth through a long winding tunnel. I'd like to ba able to use the x1_y1 and x2_y2 to let the monsters spawn anywhere in the dungeon. but if I use the built in waypoint feature in the props menu they will spawn somewhere and just try to get to the first waypoint.

Any ideas?

Secondly, does anyone know of an easy way to chain together numerous waypoints?

ArteGordon- 03-30-2006
well, one way that I can think of doing it is to have your waypoints numbered, like

HallWaypoint1
HallWaypoint2
...
HallWaypoint10

and then when you spawn a creature, randomly select a waypoint name and use it to set both the location of the mob and it the mobs waypoint. So you could have these entries all in a subgroup

SETVAR,Waypointname/HallWaypoint{RND,1,10}
orc/location/GET,{GETVAR,Waypointname},waypoint,location/currentwaypoint/GET,{GETVAR,Waypointname},waypoint,serial


This makes use of a temporary variable named Waypointname to select the waypoint, and then looks up the location and serialno of the waypoint object with that name using the GET keyword, and then assigns the Location and CurrentWaypoint properties of the mob using those values.

As for chaining, do you mean an easier way that just doubleclicking the waypoint and targeting the next waypoint in the chain?