HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Waypoints

06-23-2004, 01:53 PM#1
Killerfloh
Hey!
I have a quite stupid Question: How do I give a unit a list of waypoints (the shift+click function in game). I don't find the order in the editor.
Thx a lot!
06-23-2004, 03:48 PM#2
TheReaper
Well i think that there is no way you can do that. Cuz there are no such functions in the editor like waypoint. Maby it's becouse blizzard just puttet thos waypoint so that no one would think that they cant do that or, i duno. But you cant make thos waypoints in the editor.
06-23-2004, 05:35 PM#3
SirSalute
Quote:
Originally Posted by TheReaper
Well i think that there is no way you can do that. Cuz there are no such functions in the editor like waypoint. Maby it's becouse blizzard just puttet thos waypoint so that no one would think that they cant do that or, i duno. But you cant make thos waypoints in the editor.
Even if you can, how are you going to tell the units where to go? The traditional way are to use regions, though it affect quite a number of units.
06-23-2004, 08:29 PM#4
-={tWiStÄr}=-
Well, its actually easy once you know HOW you are going to issue the waypoints. if its a click or a ward thing you get the location of the ward being summoned, OH in fact a ward would be cool because then you could make its model a flag and they could actually see the waypoints but thats besides the point. when the ward is summoned make a location at the location of the ward and add it to an array: Waypoints[1] then when they use another one check to see if Waypoints[1] is equal to null and if it isnt then you move on to waypoints[2] etc. then whenever a unit gets to one of the locations set it to "null". Then also in your first function check to see if waypoints[12] is null and if it isnt then you check waypoints[1] and if waypoint 1 isnt null then you give them a message like "you have used all of your waypoints" (you need a max they cant issue like amillion waypoints) Ill make a rough skeleton of the trigger.
Code:
vars: 
location array Waypoints size = 12// or maximum number of waypoints you want
location Waypointremove
location WaypointOrder

Trigger IssuePoint
Events: 
Unit is summoned
Conditions: 
Unit being summoned = Waypoint Ward
Actions:
If Waypoints[12] doesnt equal "null" Then
    Display text "You can't add any more waypoints" to Owner of summoning unit
    Skip remaining actions
Else
    Do Nothing
Loop 1 to 12
    If Waypoints[ForIndexA] doesnt equal "null" Then
        Do Nothing
    Else
        Set Waypoints[ForIndexA] = Location of summoned unit
endloop

Trigger Order waypoint 
Events:
every 1 second
Conditions:
Actions:
Loop 1 to 12
    If Waypoints[ForIndexA] equal "null" Then
        Do Nothing
    Else
        set WaypointOrder = Waypoints[forindexA]
endloop
Order TheUnit to attack-move to WaypointOrder
set WaypointOrder = null
edit: oh and as of now its in a really wierd form like half jass half GUI half crap.. but i also bet it leaks like heck, this is just the idea. also some stuff i left out is the actual unit info. You would most likely want to use a double array [2D] instead for WaypointsOrder so like Waypoints order[1[forindexA]] and the first number would be the player or unit while the second is the actual index of the point. It would be a lot easier to explain on Aim tho..
twistar9999
06-25-2004, 04:31 PM#5
Killerfloh
*Damn* -- nearly EVERYTHING is in this editor, but such a simply game function is missing. Anyway, thx a lot for you help and for the nice trigger =)