Survival special effect (when units life is below 30%)

streng

Member
Reaction score
1
Hi guys. I want to create special effect which apear when unit life is below 30 % and remove these special effect when unit has more than 30%. I dont know how to triger it. I want to avoid periodic event "every 1 second of game and pick every unit in playable map area" because this event make game lag when many units are in map.
Any ideas ?
I used
Code:
Sur
    Events
        Unit - A unit Is attacked
    Conditions
        And - All (Conditions) are true
            Conditions
                ((Attacked unit) is A Hero) Equal to True
                (Percentage life of (Attacked unit)) Less than 30.00
    Actions
        Special Effect - Create a special effect attached to the origin of (Attacked unit) using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
        Special Effect - Destroy (Last created special effect)

But this only create special effect, I want to remove these special efect only when unit life are greather than 30%
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
If you only have a few units with the ability, you could use the Unit - Life becomes Less than X event.
 

streng

Member
Reaction score
1
And is it posible to make it with event " Unit - Life becomes Less than X" when i use hero tavern system. Hero units isnt placed in map , but you can chose it from tavern. How i can asign my heroes for this event ?
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
Trigger:
  • Trigger - Add to (This trigger) the event (Unit - (Sold unit)'s life becomes Less than (0.30 x (Max life of (Sold unit))))
 

Necrolytie

Member
Reaction score
0
add on this trigger the condiction.
Trigger:
  • Real - (Life of (Attacked Unit)) Less than or equal to ((Life of(Attacked unit))x 0,30)


on this way, only will works if the life of attacked unit is bellow 30%
 

streng

Member
Reaction score
1
KaerfNomekop

Can be more specific? Can you show me a sample with event-condition-action? because i trying to make something with
Code:
Trigger - Add to (This trigger) the event (Unit - (Sold unit)'s life becomes Less than (0.30 x (Max life of (Sold unit))))
but still not working
 

vypur85

Hibernate
Reaction score
803
I still believe periodic is your best bet for dynamic detection. The trigger adding method will give a static detection. Meaning if the unit levels up or picks up an item which affect the max life, the trigger will not be accurate anymore.
 

afisakov

You can change this now in User CP.
Reaction score
37
Here is the best way to do it that I could think of. It is periodic but I don't think it would create much lag due to the limited nit group size. I am of course assuming u want this kind of ability for only certain heroes, not every unit in an army.
I built it as 2 triggers, I adds a hero to the group to be checked, the other checks the units in the group.
Trigger:
  • add30group
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Archmage
    • Actions
      • Unit Group - Add (Triggering unit) to tg30

Trigger:
  • addremove30ability
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in tg30 and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Percentage life of (Picked unit)) Greater than or equal to 30.00
            • Then - Actions
              • If ((Level of Banish for (Picked unit)) Equal to 1) then do (Unit - Remove Banish from (Picked unit)) else do (Do nothing)
            • Else - Actions
              • If ((Level of Banish for (Picked unit)) Equal to 0) then do (Unit - Add Banish to (Picked unit)) else do (Do nothing)

Naturally u will replace archmage with the hero u want to have this ablity, like ebrserker or ichigo, etc. Banish should be replaced with an ability that only exists as part of this trigger, i.e. make a copy of an existing ability and don't have any units start with or learn it normally.
If you only want special effect then make it a version of devotion or endurance aura that only affects self and change the "targetart" to whatever special effect you want.

Hopefully this will be what you need
 

Necrolytie

Member
Reaction score
0
KaerfNomekop

Can be more specific? Can you show me a sample with event-condition-action? because i trying to make something with
Code:
Trigger - Add to (This trigger) the event (Unit - (Sold unit)'s life becomes Less than (0.30 x (Max life of (Sold unit))))
but still not working


Well, on the trigger you add this event, you let the event with nothing, let it clear.

On condigctions place this condiction add on this trigger the condiction.
Condctions:
Trigger:
  • Real - (Life of (Triggering unit)) Less than or equal to ((Life of(Triggering unit))x 0,30)

Actions:
Trigger:
  • Wait - Wait 1 second of the game

Trigger:
  • Special Effect - Creat a special effect attacked to the overhead of (Triggering unit ) using ( Your Survival Effects )
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top