|Posted By: Tully (2003-05-12 20:06:48) |
I slipped a 1.0 feature in the 0.981 patch release accidentally so I thought I would tell everyone before they start asking about it.
If you look on the waypoint detail screen there is a slot now for scripts on waypoints. You can now set scripts to run on waypoints. There is also a new callback unitArrived( Tile unit ) that gets called on scripts running on waypoints when a unit reaches the waypoint. The unitArrived method gets called before the waypoint sets the state of the unit that has touched it. So if you want to change what the unit is doing from the script change the actions on the waypoint not on the unit.
Using this you can do some pretty cool things like create sorting waypoints. The script could check the unit type arriving and then change where it sends units to by calling setMoveType to waypoint and setWaypointTarget to different waypoints.