Ekxan
E
Ekxan
hi, i am having trouble with my waypoint trigger
it orders units that reach their WP to move to the next one
and units that are stopped to move again
the problems:
it is verry ineficient, when the number of units it checks is above 100 the games performance decreases
another thing is the leaks with location when(i think its here) Unit_Rally_Point is set to the next waypoint. if i try to remove the location all other units that are moving to the same WP have the location removed also and stop. i added a comment where i put the RemoveLocation
i'm using the original world editor, but you can suggest JASS, i don't know JASS if needed i can look into it
edit: added hidden tag for a cleaner post
it orders units that reach their WP to move to the next one
and units that are stopped to move again
the problems:
it is verry ineficient, when the number of units it checks is above 100 the games performance decreases
another thing is the leaks with location when(i think its here) Unit_Rally_Point is set to the next waypoint. if i try to remove the location all other units that are moving to the same WP have the location removed also and stop. i added a comment where i put the RemoveLocation
i'm using the original world editor, but you can suggest JASS, i don't know JASS if needed i can look into it
-
Waypoint Move
-

Events
-

Conditions
-

Actions
-


Set i_Wave_Created = i_Wave_Creating
-


For each (Integer For_West[0]) from 0 to i_Wave_Created, do (Actions)
-



Loop - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






(Unit_Array[For_West[0]] is alive) Equal to True
-
-





Then - Actions
-






Set Temp_Pos = (Position of Unit_Array[For_West[0]])
-






Set Unit_Distance_Array[For_West[0]] = (Distance between Temp_Pos and Unit_Rally_Point[For_West[0]])
-






Custom script: call RemoveLocation(udg_Temp_Pos)
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








Unit_Distance_Array[For_West[0]] Less than 200.00
-
-







Then - Actions
-








If (Unit_Current_Waypoint[For_West[0]] Greater than 87) then do (Unit - Remove (Triggering unit) from the game) else do (Do nothing)
-








Set Unit_Current_Waypoint[For_West[0]] = (Unit_Current_Waypoint[For_West[0]] + 8)
-








-------- Custom script: call RemoveLocation( udg_Unit_Rally_Point[udg_For_West[0]] ) --------
-








Set Temp_Pos = (Position of Unit_Array[For_West[0]])
-








Set Unit_Rally_Point[For_West[0]] = Waypoints[Unit_Current_Waypoint[For_West[0]]]
-








Set Unit_Distance_Array[For_West[0]] = (Distance between Temp_Pos and Unit_Rally_Point[For_West[0]])
-








Custom script: call RemoveLocation(udg_Temp_Pos)
-








Unit - Order Unit_Array[For_West[0]] to Move To Unit_Rally_Point[For_West[0]]
-
-







Else - Actions
-
-
-





Else - Actions
-
-
-
-


Wait 0.10 seconds
-


For each (Integer For_West[0]) from 0 to i_Wave_Created, do (Actions)
-



Loop - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






(Unit_Array[For_West[0]] is alive) Equal to True
-
-





Then - Actions
-






If (Unit_Current_Waypoint[For_West[0]] Greater than 87) then do (Unit - Remove (Triggering unit) from the game) else do (Do nothing)
-






Set Temp_Pos = (Position of Unit_Array[For_West[0]])
-






Set Unit_Distance_Array2[For_West[0]] = (Distance between Temp_Pos and Unit_Rally_Point[For_West[0]])
-






Custom script: call RemoveLocation(udg_Temp_Pos)
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








Unit_Distance_Array2[For_West[0]] Less than 200.00
-
-







Then - Actions
-








If (Unit_Current_Waypoint[For_West[0]] Greater than 87) then do (Unit - Remove (Triggering unit) from the game) else do (Do nothing)
-








Set Unit_Current_Waypoint[For_West[0]] = (Unit_Current_Waypoint[For_West[0]] + 8)
-








-------- Custom script: call RemoveLocation( udg_Unit_Rally_Point[udg_For_West[0]] ) --------
-








Set Temp_Pos = (Position of Unit_Array[For_West[0]])
-








Set Unit_Rally_Point[For_West[0]] = Waypoints[Unit_Current_Waypoint[For_West[0]]]
-








Set Unit_Distance_Array2[For_West[0]] = (Distance between Temp_Pos and Unit_Rally_Point[For_West[0]])
-








Custom script: call RemoveLocation(udg_Temp_Pos)
-








Unit - Order Unit_Array[For_West[0]] to Move To Unit_Rally_Point[For_West[0]]
-
-







Else - Actions
-








If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-









If - Conditions
-










Unit_Distance_Array[For_West[0]] Equal to Unit_Distance_Array2[For_West[0]]
-
-









Then - Actions
-










Unit - Order Unit_Array[For_West[0]] to Move To Unit_Rally_Point[For_West[0]]
-
-









Else - Actions
-
-
-
-
-





Else - Actions
-
-
-
-


Trigger - Remove (This trigger) from the trigger queue
-
-
Last edited by a moderator:






