i have a tree revival system but its not working right when a tree dies its suppose to come back to life when there no user-owed units near by it works when the trees die but if theres a unit near by then leaves it never comes back to life.
any help will be great!
+rep for anyone whos helps
any help will be great!
+rep for anyone whos helps
Trigger:
- TreeRevielStart
- Events
- Map initialization
- Conditions
- Actions
- Destructible - Pick every destructible in (Playable map area) and do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Or - Any (Conditions) are true
- Conditions
- (Destructible-type of (Picked destructible)) Equal to Fall Tree Wall
- (Destructible-type of (Picked destructible)) Equal to Ashenvale Tree Wall
- Conditions
- Or - Any (Conditions) are true
- Then - Actions
- Trigger - Add to ReviveTrees <gen> the event (Destructible - (Picked destructible) dies)
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- Destructible - Pick every destructible in (Playable map area) and do (Actions)
- Events
Trigger:
- ReviveTrees
- Events
- Conditions
- Actions
- Wait 5.00 seconds
- Set Temp_Point = (Position of (Dying destructible))
- Set Temp_Group = (Units within 500.00 of Temp_Point matching (((Owner of (Matching unit)) controller) Equal to User))
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Number of units in Temp_Group) Equal to 0
- Then - Actions
- Destructible - Resurrect (Dying destructible) with (Max life of (Dying destructible)) life and Show birth animation
- Else - Actions
- Trigger - Add (This trigger) to the trigger queue (Checking conditions)
- If - Conditions
- Custom script: call DestroyGroup (udg_Temp_Group)
- Custom script: call RemoveLocation (udg_Temp_Point)