- Joined
- Jun 15, 2012
- Messages
- 20
ok so i have been messing around with a trigger for 3 days now and have done a lot of research on different ways of doing it and so far this seems the best way because as far as i know your not "upgrading the unit" so i am assuming the the ability effect can be taken away.
so basically the trigger grants a unit a custom "shadow orb ability" which is located under abilities>items in the object editor. but what fails to happen is after a duration of time (even if the player/unit decides not to attack back) after it gains the ability i want it to lose the "shadow orb ability" and go back to only being able to attack ground units. normally the if/then/else statement would have just been a different event trigger so i do not know if i should go back to having 2 triggers that sort of overlap each other or squish everything into one trigger like i am showing now.
so in summary if a ground unit is attacked by a flying unit then the ground unit is permitted to retaliate but is only able to retaliate back for a short time and loses the ability to retaliate against flying units unless it is attacked again by a flying unit. my trigger adds the ability but never removes it. i have taken a ground unit and a flying unit and have them both attack each other. i have then taken the ground unit and both continued to attack/kill flying unit and had the units back off. both tests after 5 seconds show the shadow orb ablility model animation spinning around the ground unit. i have also taken that ground unit and attacked a different flying unit ,after backing off from the first one, while the different flying unit stayed stationary. five seconds after this and the unit still had the shadow orb animation spinning around the unit.
sorry if i am not clear about everything and hopefully i can clear up any questions.
so basically the trigger grants a unit a custom "shadow orb ability" which is located under abilities>items in the object editor. but what fails to happen is after a duration of time (even if the player/unit decides not to attack back) after it gains the ability i want it to lose the "shadow orb ability" and go back to only being able to attack ground units. normally the if/then/else statement would have just been a different event trigger so i do not know if i should go back to having 2 triggers that sort of overlap each other or squish everything into one trigger like i am showing now.
so in summary if a ground unit is attacked by a flying unit then the ground unit is permitted to retaliate but is only able to retaliate back for a short time and loses the ability to retaliate against flying units unless it is attacked again by a flying unit. my trigger adds the ability but never removes it. i have taken a ground unit and a flying unit and have them both attack each other. i have then taken the ground unit and both continued to attack/kill flying unit and had the units back off. both tests after 5 seconds show the shadow orb ablility model animation spinning around the ground unit. i have also taken that ground unit and attacked a different flying unit ,after backing off from the first one, while the different flying unit stayed stationary. five seconds after this and the unit still had the shadow orb animation spinning around the unit.
sorry if i am not clear about everything and hopefully i can clear up any questions.
-
Events
- Unit - A unit Is attacked
-
Conditions
- ((Attacking unit) is A flying unit) Equal to True
- ((Attacked unit) is A flying unit) Equal to False
-
Actions
- Unit - Add Retaliation Ability FINAL? to (Attacked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Attacking unit) is A ground unit) Equal to True
-
Then - Actions
- Wait 5.00 seconds
- Unit - Remove Retaliation Ability FINAL? from (Attacking unit)
-
Else - Actions
- Do nothing
-
If - Conditions
Last edited: