Hi, I made this trigger as GUI but it needs a local variable because it has a conditional wait and it needs the units ID from the indexer after the wait. I never used JASS before so i have 2 questions about what i did.
the unit indexer i am using is GUI Unit Indexer 1.0.1.1 by Bribe
Question 1:
do i need to remove the local variable on the end of the function?
if yes, how to do it?
Question 2:
the original wait call also calls RMaxBJ, i removed it and it seems to work. but i don't know if what i did should be done.
before(original WE):
changed code:
im not sure RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, 0.10) is needed in this case. correct me if im wrong.
here are the TriggerSleepAction and RMaxBJ functions, i do not know the value of bj_WAIT_FOR_COND_MIN_INTERVAL
below is the original GUI version with no local variable(more than one unit enters the rect at once and Unit_ID_EL is overwritten):
I think I have a location leak at "exitwhen ( DistanceBetweenPoints(GetUnitLoc(udg_UDexUnits[Unit_ID_EL]), udg_Unit_Rally_Point[Unit_ID_EL]) < 200 )" but im not sure how to fix it because it is inside "exitwhen"
the unit indexer i am using is GUI Unit Indexer 1.0.1.1 by Bribe
Question 1:
do i need to remove the local variable on the end of the function?
if yes, how to do it?
Question 2:
the original wait call also calls RMaxBJ, i removed it and it seems to work. but i don't know if what i did should be done.
before(original WE):
JASS:
call TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, 0.10))
JASS:
call TriggerSleepAction(0.10)
here are the TriggerSleepAction and RMaxBJ functions, i do not know the value of bj_WAIT_FOR_COND_MIN_INTERVAL
JASS:
native TriggerSleepAction takes real timeout returns nothing
function RMaxBJ takes real a, real b returns real
if (a < b) then
return b
else
return a
endif
endfunction
below is the original GUI version with no local variable(more than one unit enters the rect at once and Unit_ID_EL is overwritten):
-
Left Rect
-
Events
- Unit - A unit enters East Left <gen>
- Conditions
-
Actions
- Set Unit_ID_EL = (Custom value of (Triggering unit))
- Wait until ((Distance between (Position of UDexUnits[Unit_ID_EL]) and Unit_Rally_Point[Unit_ID_EL]) Less than 200.00), checking every 0.10 seconds
- Set Unit_Current_Waypoint[Unit_ID_EL] = (Unit_Current_Waypoint[Unit_ID_EL] + 8)
- Set Unit_Rally_Point[Unit_ID_EL] = Waypoints[Unit_Current_Waypoint[Unit_ID_EL]]
- Unit - Order UDexUnits[Unit_ID_EL] to Move To Unit_Rally_Point[Unit_ID_EL]
-
Events
I think I have a location leak at "exitwhen ( DistanceBetweenPoints(GetUnitLoc(udg_UDexUnits[Unit_ID_EL]), udg_Unit_Rally_Point[Unit_ID_EL]) < 200 )" but im not sure how to fix it because it is inside "exitwhen"
-
Left Rect
-
Events
- Unit - A unit enters East Left <gen>
- Conditions
-
Actions
- Custom script: local integer Unit_ID_EL = GetUnitUserData(GetTriggerUnit())
- Custom script: loop
- Custom script: exitwhen ( DistanceBetweenPoints(GetUnitLoc(udg_UDexUnits[Unit_ID_EL]), udg_Unit_Rally_Point[Unit_ID_EL]) < 200 )
- Custom script: call TriggerSleepAction(0.10)
- Custom script: endloop
- Custom script: set udg_Unit_Current_Waypoint[Unit_ID_EL] = ( udg_Unit_Current_Waypoint[Unit_ID_EL] + 8 )
- Custom script: set udg_Unit_Rally_Point[Unit_ID_EL] = udg_Waypoints[udg_Unit_Current_Waypoint[Unit_ID_EL]]
- Custom script: call IssuePointOrderLocBJ( udg_UDexUnits[Unit_ID_EL], "move", udg_Unit_Rally_Point[Unit_ID_EL] )
-
Events