- 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.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
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
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
You must use Bribe's
Bribe's Damage Engine
Where can i get that?
Damage

Events


Game - DamageEvent becomes Equal to 1.00

Conditions

Actions
Damage

Events


Game - DamageEvent becomes Equal to 1.00

Conditions


(Unit-type of DamageEventTarget) Equal to Footman

Actions
Damage

Events


Game - DamageEvent becomes Equal to 1.00

Conditions


(Unit-type of DamageEventSource) Equal to Footman

Actions
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)
now the variable which detects the amount of damage is DamageEventAmount.
if you want to specify the attacked unit, then..
the footman is the unit that receive the damage.
Damage
Events
Game - DamageEvent becomes Equal to 1.00
Conditions
(Unit-type of DamageEventTarget) Equal to Footman
Actions
if you want to specify the attacking unit, then...
the footman is the unit that deals the damage.
Damage
Events
Game - DamageEvent becomes Equal to 1.00
Conditions
(Unit-type of DamageEventSource) Equal to Footman
Actions
remember to turn off the trigger first before you deal damage.. or else it will create an infinite loop..
pretty easy, right ?
(Unit-type of (Damage source)) Equal to Footman
Can't find DamageEventSource nor DamageEventTarget in condition triggers. :/ I only found this
That system is kinda hard to grasp.
(Unit-type of (Damage source)) Equal to Footman
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...
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
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...
Set GS_Dmg_Rec = (Damage taken)
Trigger - Add to Temp 2 <gen> the event (Unit - (Triggering unit) Takes damage)
to answer your question for En_Tropy, you can find this actions
in the 'Trigger - Add New Event', when you click on this, it will display :
Trigger - Add to Temp 2 <gen> the event (Unit - (Triggering unit) Takes damage)
Add to (this trigger) the event Event
don't quote before i finish editing my post ! you're too fast !
you can see the answer on my last post...
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
Time - Elapsed game time is 1.00 seconds
Unit - A unit enter Playable Map Area
not that, but this :
Time - Elapsed game time is 1.00 seconds
Unit - A unit enter Playable Map Area
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
(Damage source) Equal to GS_Hero
you have to make sure that the trigger meet it's condition, in your case it's :
who is GS_Hero ?
(Damage source) Equal to GS_Hero
It's a summoned hero when Time - game elapsed 1 second of game.
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)
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
hmmm, could you post the map or send them via PM ?
