Stuck in the middle of a trigger

AciD

New Member
Reaction score
1
[SOLVED]Stuck in the middle of a trigger

What I'm going to do is basically a lifesteal aura that works for ranged units.
What I will paste is a pseudoversion for testing, before adding the aura part, etc etc.
Anyways, disregard unit choises and crap:
My idea was to set the life of attacking unit to its current life plus the damage inflicted. Now, how to get the "damage inflicted"? I've tried several ways, none of them work correctly.

Here's my pseudo:

Code:
frfrf
    Events
        Unit - A unit Is attacked
    Conditions
        (Unit-type of (Attacking unit)) Equal to Rifleman
    Actions
        Unit - Set life of (Attacking unit) to ((Life of (Attacking unit)) + (Damage taken))
        Special Effect - Create a special effect attached to the overhead of (Attacking unit) using Abilities\Spells\Undead\VampiricAura\VampiricAuraTarget.mdl

Oh, and I'm using WE Unlimited for your information :).

This thread is now SOLVED. Thank you everyone for your cooperation.
 

Syndrome

You can change this now in User CP.
Reaction score
126
The Damage Taken action can only be used with the Unit Takes Damage Event

"Oh, and I'm using WE Unlimited for your information ."

... :eek:

Letme write you up a better one
 

Syndrome

You can change this now in User CP.
Reaction score
126
For this trigger to work, make an Aura first...
Code:
Events:
Every 0.01 Seconds of Game Time
Conditions:
None
Actions:
Pick Every Unit in the Playable Map with the Buff Arrow Drain and do Actions:
 Actions:
 Give [Modded Thorns Aura] to Picked Unit

The Modded Thorns Aura is based of Thorns Aura with a Negative Damage Percentage Return, make it 100%. Now, to remove the buff from units who don't have Aura buff...

Code:
Events:
Every 0.01 Seconds of Game Time
Conditions:
None
Actions:
Pick Every Unit in the Playable Map and do Actions:
 Actions:
 Remove [Modded Thorns Aura] from Picked Unit

This was freehanded and very basic, just to get you started.
 

Sil3nt

SUP?
Reaction score
134
I'd just like to point out that the special effect should probably be 'origin' or 'chest' not 100% sure which one
 

AciD

New Member
Reaction score
1
Thanks for all the help, but for the distribution (it's going to be an item skill) was going to be a null brilliance aura, and in the conditions it'd simply say:
"Conditions - Attacking unit has the buff Modded vamp aura"

But, the thing is:
A: I can't use the a unit takes damage event, it gives me an error and inactivates the trigger
B: Let's say I get it working. Can I still use "Attacking unit" for specification in that sort of trigger?

Thanks again for the help with the special effects. And, for now I'm going to try my way of distribution, but I'll try yours if it doesn't work. Now for the actual heal.

The reason I can't use the event is:

call AnyDamageEvent( gg_trg_Lifesteal_trigger )
(Life 433: Expected a function name)

EDIT AGAIN: Sorry, I had forgotten to edit the map with the WEU enhancer. Now, for problem B which I basically expected to appear: The "Attacking unit" specification doesn't work. How can I make the event target the unit who attacked the other unit?
Current version is like this:
Code:
Lifesteal trigger
    Events
        Advanced - Any unit takes damage
    Conditions
        (Unit-type of (Attacking unit)) Equal to Rifleman
    Actions
        Unit - Set life of (Attacking unit) to ((Life of (Attacking unit)) + ((Damage taken) / 3.00))
        Special Effect - Create a special effect attached to the origin of (Attacking unit) using Abilities\Spells\Undead\VampiricAura\VampiricAuraTarget.mdl
 

Almighty11

New Member
Reaction score
5
You just cant. The only way to do it the way you suggested would be
to get the attacking unit (Unit - A unit Is attacked) from this event
and heal acording to variable-based attack value from the attacking unit;
because you can't detect throught usual conditions what was the damage
taken in this event. But if there are different types of attacking units
or if they have upgrades or items attached, it would be hard to put all those
in variable; so I suggest you take Geoff.L's proposal.

Code:
Life steal
    Events
        Unit - A unit Is attacked
    Conditions
    Actions
        Set attack_unit = (Attacking unit)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Unit-type of attack_unit) Equal to Rifleman
            Then - Actions
                Unit - Set life of attack_unit to ((Life of attack_unit) + (1.00 x unit_attack))
            Else - Actions
 

AciD

New Member
Reaction score
1
You just cant. The only way to do it the way you suggested would be
to get the attacking unit (Unit - A unit Is attacked) from this event
and heal acording to variable-based attack value from the attacking unit;
because you can't detect throught usual conditions what was the damage
taken in this event. But if there are different types of attacking units
or if they have upgrades or items attached, it would be hard to put all those
in variable; so I suggest you take Geoff.L's proposal.

Code:
Life steal
    Events
        Unit - A unit Is attacked
    Conditions
    Actions
        Set attack_unit = (Attacking unit)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Unit-type of attack_unit) Equal to Rifleman
            Then - Actions
                Unit - Set life of attack_unit to ((Life of attack_unit) + (1.00 x unit_attack))
            Else - Actions

So, basically, it'd be too complex to be worth it to perform it that way (which was in fact what I was trying to do from start, before using the damage taken event)? That's a shame ;(

The thing is, I don't understand how to get his way to work. I've created the buff (As far as I understood it, I was supposed to change:
Code:
Data - Damage dealt to attackers
Data - Damage is Percent Recieved
to 100 respective False.
I've also created the triggers he specified.

...Then what?
 

vypur85

Hibernate
Reaction score
803
Code:
Lifesteal trigger
    Events
        Advanced - Any unit takes damage
    Conditions
        (Unit-type of (Attacking unit)) Equal to Rifleman
    Actions
        Unit - Set life of (Attacking unit) to ((Life of (Attacking unit)) + ((Damage taken) / 3.00))
        Special Effect - Create a special effect attached to the origin of (Attacking unit) using Abilities\Spells\Undead\VampiricAura\VampiricAuraTarget.mdl

There is no attacking unit. Change your 'Attacking unit' to 'Damage Source'. Not sure. I've never used WEU before so I don't know whether this works or not.
 

AciD

New Member
Reaction score
1
Code:
Lifesteal trigger
    Events
        Advanced - Any unit takes damage
    Conditions
        (Unit-type of (Attacking unit)) Equal to Rifleman
    Actions
        Unit - Set life of (Attacking unit) to ((Life of (Attacking unit)) + ((Damage taken) / 3.00))
        Special Effect - Create a special effect attached to the origin of (Attacking unit) using Abilities\Spells\Undead\VampiricAura\VampiricAuraTarget.mdl

There is no attacking unit. Change your 'Attacking unit' to 'Damage Source'. Not sure. I've never used WEU before so I don't know whether this works or not.
Damage source! That's exactly what I need, I had never noticed there was a unit specification like that.
Let me try it out.

Hmm, still nothing. What could be wrong?

Code:
Lifesteal trigger
    Events
        Advanced - Any unit takes damage
    Conditions
    Actions
        Unit - Set life of (Damage source) to ((Life of (Damage source)) + ((Damage taken) / 3.00))
        Special Effect - Create a special effect attached to the origin of (Damage source) using Abilities\Spells\Undead\VampiricAura\VampiricAuraTarget.mdl

EDIT 2:
By changing "Any unit takes damage" to a specific test unit, I got the trigger working. This means the malfunction was in fact in the WE: U event. I'm currently trying different ways to make this work with any target and not just my test unit. If anyone knows a way, I'd be happy for answers.

Code:
Lifesteal trigger
    Events
        Unit - Footman 0036 <gen> Takes damage
    Conditions
    Actions
        Unit - Set life of (Damage source) to ((Life of (Damage source)) + ((Damage taken) / 3.00))
        Special Effect - Create a special effect attached to the origin of (Damage source) using Abilities\Spells\Undead\VampiricAura\VampiricAuraTarget.mdl
 

N2o)

Retired.
Reaction score
51
WEU could be wrong? You could do it this way:
Code:
Events:Unit Enters Region (playable map area)
Conditions:
Actions: Trigger - Add Event: (Triggering Unit) takes Damage
Code:
Events

    Conditions
        (Unit-type of (Damage Source)) Equal to Rifleman
    Actions
        Unit - Set life of (Damage Source) to ((Life of (Damage Source)) + ((Damage taken) / 3.00))
        Special Effect - Create a special effect attached to the origin of (Attacking unit) using Abilities\Spells\Undead\VampiricAura\VampiricAuraTarget.mdl
        Special Effect - Destroy (Last Created Special Effect) [COLOR="Red"]<< For Leak[/COLOR]
 

AciD

New Member
Reaction score
1
WEU could be wrong? You could do it this way:
Code:
Events:Unit Enters Region (playable map area)
Conditions:
Actions: Trigger - Add Event: (Triggering Unit) takes Damage
Code:
Events

    Conditions
        (Unit-type of (Damage Source)) Equal to Rifleman
    Actions
        Unit - Set life of (Damage Source) to ((Life of (Damage Source)) + ((Damage taken) / 3.00))
        Special Effect - Create a special effect attached to the origin of (Attacking unit) using Abilities\Spells\Undead\VampiricAura\VampiricAuraTarget.mdl
        Special Effect - Destroy (Last Created Special Effect) [COLOR="Red"]<< For Leak[/COLOR]
Hey, that worked. What was left was the problem with initial non-buildings being targetable, but I fixed it. Thanks a bunch for the help, everyone.

THREAD SOLVED
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top