- Joined
- Aug 13, 2013
- Messages
- 1,696
Here: It is now working but it doesn't decrease the instances.. if the instances is not decreased or reduced then the loop trigger will turn on everytime :///. Need help I don't need if you find leaks because this will not be submitted in the spell section I just want to know why it does not decrease the instances.. I'll gonna show the triggers and Debug Msgs to the game screen..
Here is the debug msg the show me... It doesn't decrease the instances by 1 :/. It is just showing me the number of instances used... That's why the trigger is now turn off when the spell cast is end. Anyway In this trigger I want the missile to be moved in the targeted unit and checks their distances. If the targeted unit and missile unit are in the 75 range the missile unit will destroy and the targeted unit will be knockbacked in 3 seconds then I'll reduce the isntances by 1 if the timer is less than or equal to 0.00 . As you see I reduce the timer by 0.03.
Here is the instances showed in the screen that's why there's a problem with my trigger. Anyway I need a real answer.
If you see this way of Indexing unknown then I'm using Unit Indexer.
-
Function Loop
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Temp_Ability
-
Actions
- Unit - Create 1 Temp_DummyType for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
- Set Temp_Dummy = (Last created unit)
- Set UI_UDexID = (Custom value of Temp_Dummy)
- -------- Debug Ball TIme --------
- Unit - Add a 10.00 second Generic expiration timer to Temp_Dummy
- Set UI_Target[UI_UDexID] = (Target unit of ability being cast)
- Set Temp_Point2 = (Position of UI_Target[UI_UDexID])
- Set UI_Caster[UI_UDexID] = (Triggering unit)
- Set Temp_Point = (Position of UI_Caster[UI_UDexID])
- Set UI_Angle[UI_UDexID] = (Angle from Temp_Point to Temp_Point2)
- Set UI_Timer[UI_UDexID] = 3.00
- -------- Missile --------
- Set UI_Stage[UI_UDexID] = 1
- Set UI_Instance = (UI_Instance + 1)
- Custom script: call BJDebugMsg("Instances : " + I2S(udg_UI_Instance))
- Unit Group - Add Temp_Dummy to Temp_Group
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- UI_Instance Equal to 1
-
Then - Actions
- Trigger - Turn on Function Periodic Loop <gen>
- Else - Actions
-
If - Conditions
- Custom script: call RemoveLocation(udg_Temp_Point)
- Custom script: call RemoveLocation(udg_Temp_Point2)
-
Events
-
Function Periodic Loop
-
Events
- Time - Every 0.03 seconds of game time
- Conditions
-
Actions
-
Unit Group - Pick every unit in Temp_Group and do (Actions)
-
Loop - Actions
- Set Temp_Dummy = (Picked unit)
- Set UI_UDexID = (Custom value of Temp_Dummy)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- UI_Stage[UI_UDexID] Equal to 1
-
Then - Actions
- Set Temp_Point3 = (Position of Temp_Dummy)
- Unit - Move Temp_Dummy instantly to (Temp_Point3 offset by 15.00 towards UI_Angle[UI_UDexID] degrees)
- Set Temp_Point2 = (Position of UI_Target[UI_UDexID])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Distance between Temp_Point3 and Temp_Point2) Less than or equal to 75.00
-
Then - Actions
- Set UI_Stage[UI_UDexID] = 2
- Else - Actions
-
If - Conditions
- Custom script: call RemoveLocation(udg_Temp_Point3)
- Custom script: call RemoveLocation(udg_Temp_Point2)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- UI_Stage[UI_UDexID] Equal to 2
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- UI_Timer[UI_UDexID] Greater than 0.00
-
Then - Actions
- Unit - Kill Temp_Dummy
- Set Temp_Point2 = (Position of UI_Target[UI_UDexID])
- Unit - Move UI_Target[UI_UDexID] instantly to (Temp_Point2 offset by 10.00 towards UI_Angle[UI_UDexID] degrees)
- Set UI_Timer[UI_UDexID] = (UI_Timer[UI_UDexID] - 0.03)
-
Else - Actions
- Set UI_Instance = (UI_Instance - 1)
- Unit Group - Remove Temp_Dummy from Temp_Group
- Custom script: call BJDebugMsg("Instances : " + I2S(udg_UI_Instance))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- UI_Instance Equal to 0
-
Then - Actions
- Custom script: call BJDebugMsg("Removed")
- Trigger - Turn off (This trigger)
- Else - Actions
-
If - Conditions
-
If - Conditions
- Custom script: call RemoveLocation(udg_Temp_Point2)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
Loop - Actions
-
Unit Group - Pick every unit in Temp_Group and do (Actions)
-
Events
Here is the instances showed in the screen that's why there's a problem with my trigger. Anyway I need a real answer.
If you see this way of Indexing unknown then I'm using Unit Indexer.
Last edited: