I check pathability in my resource Teeth so that each projectile doesn't continue if it collides with trees, ravines, cliffs, or destructibles.
View attachment 368146
And for destructibles
View attachment 368147
@Nastyan
I do not understand, perhaps posting your trigger would be more direct.
In your periodic try and make the conditions for a "dead-end", i.e. when the spell is going to fail and de-index, try to use only instance.
If you must use an additional "if then" block then use a variable that can act as a flag for de-indexing, in my Teeth resource I do this with the variable called TeNe_distance, if the projectile hits a tree I set the distance to 0.00 instead of adding another de-indexing block, because when the loop fires a second time the de-index condition will catch that distance is 0.00 and know to de-index that instance.
The result allows your trigger to be readable, not only to others but yourself, and that leads to a cleaner thought process.
- Example
- Events
- Time - Every 0.03 seconds of game time
- Conditions
- Actions
- For each (Integer Your_Loop) from 1 to Your_Index, do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Your_Unit_Variable is dead) Equal to False
- Your_distance_Variable Greater than 0.00
- (Terrain pathing at Your_Point_Variable of type Walkability is off) Equal to False
- Then - Actions
- -------- -- --------
- -------- -- --------
- -------- -- --------
- -------- -- --------
- -------- -- --------
- -------- Your actions --------
- -------- -- --------
- -------- -- --------
- -------- -- --------
- -------- -- --------
- -------- -- --------
- Destructible - Pick every destructible within Your_Collision_Variable of Your_Point_Variable and do (Actions)
- Loop - Actions
- Set VariableSet Your_distance_Variable = 0.00
- Else - Actions
- -------- -- --------
- -------- -- --------
- -------- -- --------
- -------- De-Index block --------
- -------- -- --------
- -------- -- --------
- -------- -- --------
Also if you haven't, check out this tutorial.