• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Take inflicted/received damage as variables?

Status
Not open for further replies.
Level 4
Joined
Dec 12, 2012
Messages
96
I'm kinda tired so i can't get this thing right. How do you take inflicted damage on unit or received damage from a unit as variables? Can anyone guide me? Thanks.
 
  • Temp
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • Trigger - Add to Temp 2 <gen> the event (Unit - (Triggering unit) Takes damage)
  • Temp 2
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Damage taken) Greater than 1.00
        • Then - Actions
          • Set DamageTakenVariable = (Damage taken)
        • Else - Actions
 
Level 4
Joined
Dec 12, 2012
Messages
96
  • Temp
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • Trigger - Add to Temp 2 <gen> the event (Unit - (Triggering unit) Takes damage)
  • Temp 2
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Damage taken) Greater than 1.00
        • Then - Actions
          • Set DamageTakenVariable = (Damage taken)
        • Else - Actions

Where can i find those action and condition triggers? Those are what I need.


You must use Bribe's

What?
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
Where can i get that?

Bribe's GUI Damage Engine v2.2.1.0

  • Damage
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
    • Actions
now the variable which detects the amount of damage is DamageEventAmount.

if you want to specify the attacked unit, then..

  • Damage
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Unit-type of DamageEventTarget) Equal to Footman
    • Actions
the footman is the unit that receive the damage.

if you want to specify the attacking unit, then...
  • Damage
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Unit-type of DamageEventSource) Equal to Footman
    • Actions
the footman is the unit that deals the damage.

if you want to deal damages back to the attacker, then...
  • Damage
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Unit-type of DamageEventSource) Equal to Footman
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Cause DamageEventTarget to damage DamageEventSource, dealing DamageEventAmount damage of attack type Spells and damage type Normal
      • Trigger - Turn on (This trigger)
remember to turn off the trigger first before you deal damage.. or else it will create an infinite loop..

pretty easy, right ?
 
Level 4
Joined
Dec 12, 2012
Messages
96
now the variable which detects the amount of damage is DamageEventAmount.

if you want to specify the attacked unit, then..

  • Damage
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Unit-type of DamageEventTarget) Equal to Footman
    • Actions
the footman is the unit that receive the damage.

if you want to specify the attacking unit, then...
  • Damage
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Unit-type of DamageEventSource) Equal to Footman
    • Actions
the footman is the unit that deals the damage.

remember to turn off the trigger first before you deal damage.. or else it will create an infinite loop..

pretty easy, right ?

Can't find DamageEventSource nor DamageEventTarget in condition triggers. :/ I only found this
  • (Unit-type of (Damage source)) Equal to Footman
That system is kinda hard to grasp.
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
Can't find DamageEventSource nor DamageEventTarget in condition triggers. :/ I only found this
  • (Unit-type of (Damage source)) Equal to Footman
That system is kinda hard to grasp.

Oh God Why ????

anyway, Bribe's GUI Damage Engine v2.2.1.0 is a system which you must import to your map if you want to use them (Damage Engine and Unit Indexer) and these system provide you some Variables (DamageEventSource, DamageEventTarget, DamageEventAmount, DamageEvent, DamageModifierEvent).

download the test map on the link provided on the thread and copy the Damage Engine and Unit Indexer trigger... also remember to copy the Cheat Death Ability + 500000 from the test map...

when you import the Damage Engine, some of the actions will be disabled, just double click on the disabled actions and press enter then everything should be good..

if you think this is hard to understand, then go to the thread and read the tutorials there...
 
Level 4
Joined
Dec 12, 2012
Messages
96
Oh God Why ????

anyway, Bribe's GUI Damage Engine v2.2.1.0 is a system which you must import to your map if you want to use them (Damage Engine and Unit Indexer) and these system provide you some Variables (DamageEventSource, DamageEventTarget, DamageEventAmount, DamageEvent, DamageModifierEvent).

download the test map on the link provided on the thread and copy the Damage Engine and Unit Indexer trigger... also remember to copy the Cheat Death Ability + 500000 from the test map...

when you import the Damage Engine, some of the actions will be disabled, just double click on the disabled actions and press enter then everything should be good..

if you think this is hard to understand, then go to the thread and read the tutorials there...

Thank you for the help, really appreciate it. But I'll consider this as a 2nd option since I think this wouldn't be easy for me. :)


Anyway here's my current trigger. It's plain simple. Though it's not working yet, i think it's halfway there. :)

  • Damage receives gives gold
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacking unit) Equal to GS_Hero
      • (Unit-type of (Damage source)) Equal to Footman
    • Actions
      • Set GS_Attacker2 = GS_Hero
      • Set GS_Receiver2 = (Attacked unit)
      • Set GS_Owner = (Owner of GS_Receiver2)
      • Set GS_Dmg_Rec = (Damage taken)
      • Set GS_Dmg_Rec_int = (Integer(GS_Dmg_Rec))
      • Player - Set GS_Owner Current gold to ((GS_Owner Current gold) - GS_Dmg_Rec_int)
      • Floating Text - Create floating text that reads (- + ((String(GS_Dmg_Rec_int)) + Gold)) above GS_Receiver2 with Z offset -10.00, using font size 10.00, color (100.00%, 100.00%, 0.00%), and 10.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
      • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
  • Set GS_Dmg_Rec = (Damage taken)
that variable will always be 0 because the event 'Unit - Unit is Attacked' is when the unit swings their weapon, therefore there is no damage yet on that time...

if you really want an easy way to achieve this, then follow En_Tropy's trigger, but i guess it's leaky because one after another event will be created when a unit enter (Playable Map Area)
 
Level 4
Joined
Dec 12, 2012
Messages
96
  • Set GS_Dmg_Rec = (Damage taken)
that variable will always be 0 because the event 'Unit - Unit is Attacked' is when the unit swings their weapon, therefore there is no damage yet on that time...

You're right. I just need to get that Inflicted damage into variable. But i don't know how. +rep for your help. :)
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
to answer your question for En_Tropy, you can find this actions
  • Trigger - Add to Temp 2 <gen> the event (Unit - (Triggering unit) Takes damage)
in the 'Trigger - Add New Event', when you click on this, it will display :

Add to (this trigger) the event Event

change (this trigger) into your second trigger, and the Event to 'Unit - Specific Unit Event'..

and then change the Unit to Triggering unit, and change the Dies into Takes Damage

you can find Takes Damage between Changes Owner and Gains a Level...
 
Level 4
Joined
Dec 12, 2012
Messages
96
to answer your question for En_Tropy, you can find this actions
  • Trigger - Add to Temp 2 <gen> the event (Unit - (Triggering unit) Takes damage)
in the 'Trigger - Add New Event', when you click on this, it will display :

Add to (this trigger) the event Event

Wait, i think i'm getting the idea. :D But what event should I set for 'Trigger- Add New Event' to start? Time elapsed?
 
Level 4
Joined
Dec 12, 2012
Messages
96
don't quote before i finish editing my post ! you're too fast !

you can see the answer on my last post...

Here's my trigger but still not working.

  • Damage Receives Prior
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Trigger - Add to Damage receives gives gold <gen> the event (Unit - (Triggering unit) Takes damage)

  • Damage receives gives gold
    • Events
    • Conditions
    • Actions
      • Set GS_Receiver2 = (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Damage source) Equal to GS_Hero
        • Then - Actions
          • Set GS_Attacker2 = GS_Hero
          • Set GS_Owner = (Owner of GS_Receiver2)
          • Set GS_Dmg_Rec = (Damage taken)
          • Set GS_Dmg_Rec_int = (Integer(GS_Dmg_Rec))
          • Player - Set GS_Owner Current gold to ((GS_Owner Current gold) - GS_Dmg_Rec_int)
          • Floating Text - Create floating text that reads (- + ((String(GS_Dmg_Rec_int)) + Gold)) above GS_Receiver2 with Z offset -10.00, using font size 10.00, color (100.00%, 100.00%, 0.00%), and 10.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
          • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
        • Else - Actions
 
Level 4
Joined
Dec 12, 2012
Messages
96
  • Time - Elapsed game time is 1.00 seconds
not that, but this :

  • Unit - A unit enter Playable Map Area

still not working


  • Damage Receives Prior
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • Trigger - Add to Damage receives gives gold <gen> the event (Unit - (Triggering unit) Takes damage)

  • Damage receives gives gold
    • Events
    • Conditions
    • Actions
      • Set GS_Receiver2 = (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Damage source) Equal to GS_Hero
        • Then - Actions
          • Set GS_Attacker2 = GS_Hero
          • Set GS_Owner = (Owner of GS_Receiver2)
          • Set GS_Dmg_Rec = (Damage taken)
          • Set GS_Dmg_Rec_int = (Integer(GS_Dmg_Rec))
          • Player - Set GS_Owner Current gold to ((GS_Owner Current gold) - GS_Dmg_Rec_int)
          • Floating Text - Create floating text that reads (- + ((String(GS_Dmg_Rec_int)) + Gold)) above GS_Receiver2 with Z offset -10.00, using font size 10.00, color (100.00%, 100.00%, 0.00%), and 10.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
          • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
        • Else - Actions
 
Level 4
Joined
Dec 12, 2012
Messages
96
could you show the trigger ?

  • Summon
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Unit - Create 1 Gold Stealer for Player 1 (Red) at (Center of TEST REGION <gen>) facing Default building facing degrees
      • Set GS_Hero = (Last created unit)
      • Special Effect - Create a special effect attached to the overhead of GS_Hero using war3mapImported\GeneralHeroGlow.mdx
      • Set GS_sfx = (Last created special effect)
Updated the trigger but still doesn't work.
  • Damage receives gives gold
    • Events
    • Conditions
    • Actions
      • Set GS_Receiver2 = (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Damage source)) Equal to Gold Stealer
        • Then - Actions
          • Set GS_Attacker2 = (Damage source)
          • Set GS_Owner = (Owner of GS_Receiver2)
          • Set GS_Dmg_Rec = (Damage taken)
          • Set GS_Dmg_Rec_int = (Integer(GS_Dmg_Rec))
          • Player - Set GS_Owner Current gold to ((GS_Owner Current gold) - GS_Dmg_Rec_int)
          • Floating Text - Create floating text that reads (- + ((String(GS_Dmg_Rec_int)) + Gold)) above GS_Receiver2 with Z offset -10.00, using font size 10.00, color (100.00%, 100.00%, 0.00%), and 10.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
          • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
        • Else - Actions
 
Status
Not open for further replies.
Top