• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Miss for certain type of unit

Status
Not open for further replies.
Level 25
Joined
Sep 26, 2009
Messages
2,379
You use damage detection system (dds) and null damage taken by unit. Additionally you show "Miss" via floating text.

In your case, you would make trigger that fires a DDS event "unit takes damage" and check if the damaged unit as well as damager are of certain unit types. If yes, null damage taken.
 
Level 22
Joined
Feb 6, 2014
Messages
2,466
You use damage detection system (dds) and null damage taken by unit. Additionally you show "Miss" via floating text.

In your case, you would make trigger that fires a DDS event "unit takes damage" and check if the damaged unit as well as damager are of certain unit types. If yes, null damage taken.

How can you null a damage? By increasing the hp with the exact amount of the damage taken? what if the damaged unit has full hp? The nulling will not work.
 
Level 22
Joined
Feb 6, 2014
Messages
2,466
I recommend getting to know this system. It might answer your question.

I used a simple damage detection system using the Event, a unit is damaged so i do not understand how the DDS with variables in the event work. Can you just tell me how if its not too complicated explaining here?
But by the looks of it, it looks like the system can change the damage the unit will take thus setting PDD_amount to zero does not damage the unit while setting it to -50 heals the unit and does not damaged it.
 
Level 11
Joined
Jan 23, 2015
Messages
788
  • Miss
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Unit-type of (Attacked unit)) Equal to Hippogryph Rider 8) or (((Unit-type of (Attacked unit)) Equal to Dragonhawk Rider 15) or (((Unit-type of (Attacked unit)) Equal to Harpy Queen 22) or ((Unit-type of (Attacked unit)) Equal to Red Drake 29)))
      • (Unit-type of (Attacking unit)) Equal to Sniper Tower Level 1
    • Actions
      • Set MissChance = (Random integer number between 1 and 100)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MissChance Equal to (Random integer number between 1 and 60)
        • Then - Actions
          • Unit - Set life of (Attacked unit) to ((Life of (Attacked unit)) + (Damage taken))
          • Floating Text - Create floating text that reads Miss above (Attacking unit) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
          • Set Miss = (Last created floating text)
          • Floating Text - Hide Miss for (All players)
          • Floating Text - Show Miss for PlayersIngame
          • Floating Text - Set the velocity of Miss to 30.00 towards 90.00 degrees
          • Floating Text - Change Miss: Disable permanence
          • Floating Text - Change the lifespan of Miss to 4.50 seconds
          • Floating Text - Change the fading age of Miss to 3.00 seconds
        • Else - Actions
          • Do nothing
I made this simple trigger, it's about a chance of missing on air units.. isn't it enough?
 
Level 25
Joined
Sep 26, 2009
Messages
2,379
No, it's not enough. The event "Unit - A unit is attacked" fires when the attacking unit starts the attack (i.e. when footman starts swinging his sword). That means there is no damage taken at that time. Also, this event can be abused by pressing the "stop" button on the units list as it will attempt to attack closest unit again, once again firing the event.
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
I used a simple damage detection system using the Event, a unit is damaged so i do not understand how the DDS with variables in the event work. Can you just tell me how if its not too complicated explaining here?
But by the looks of it, it looks like the system can change the damage the unit will take thus setting PDD_amount to zero does not damage the unit while setting it to -50 heals the unit and does not damaged it.

Essentially the system does 3 things:
*Creates a "unit takes damage" event for every unit
*Gives each unit a 200% magic damage reduction ability, making spell damage always be negative. This makes it possible to know if damage was from a basic attack(or cleave) or if it was a spell(or poison).
*Whenever a unit takes damage and the damage is modified, gives it an ability that increases max health by a lot. This avoids any possible problems with the unit dying before the health change applies.

After those steps it checks if the damage amount was changed. Since the system remembers how much health the unit had right before taking damage, then it can set it to the right value afterwards.
 
Level 22
Joined
Feb 6, 2014
Messages
2,466
Essentially the system does 3 things:
*Creates a "unit takes damage" event for every unit
*Gives each unit a 200% magic damage reduction ability, making spell damage always be negative. This makes it possible to know if damage was from a basic attack(or cleave) or if it was a spell(or poison).
*Whenever a unit takes damage and the damage is modified, gives it an ability that increases max health by a lot. This avoids any possible problems with the unit dying before the health change applies.

After those steps it checks if the damage amount was changed. Since the system remembers how much health the unit had right before taking damage, then it can set it to the right value afterwards.

Ok I get it now, the unit's max health is increased temporarily so damage nulling is possible. +rep

RobertMKD, you need a damage detection system as mentioned by Nichilus. If you wanna keep things simple, use
  • Events
  • Unit - a Unit takes damage.
But you have to add the units in the map to the event using
  • Trigger - Add Event to Trigger
 
Last edited:
Level 22
Joined
Feb 6, 2014
Messages
2,466
You have to manually add units that will evade using this

  • Trigger - Add to thisTrigger the Event
If you want to add all units, create a new trigger
  • Events
  • Unit - a unit enters Playable Map Area
  • Conditions
  • Actions
  • Trigger - Add to Miss the event (Unit - Triggering Unit takes damage)
the "Miss" trigger does not contain an event initially.

  • Miss
    • Events
    • Conditions
      • ((Unit-type of (Triggering Unit) Equal to Hippogryph Rider 8) or (((Unit-type of (Triggering Unit)) Equal to Dragonhawk Rider 15) or (((Unit-type of (Triggering Unit)) Equal to Harpy Queen 22) or ((Unit-type of (Triggering Unit)) Equal to Red Drake 29)))
      • (Unit-type of (Damage Source)) Equal to Sniper Tower Level 1
    • Actions
      • Set MissChance = (Random integer number between 1 and 100)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MissChance Equal to (Random integer number between 1 and 60)
        • Then - Actions
          • Unit - Set life of (Triggering Unit) to ((Life of (Triggering Unit)) + (Damage taken))
          • Floating Text - Create floating text that reads Miss above (Damage Source) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
          • Set Miss = (Last created floating text)
          • Floating Text - Hide Miss for (All players)
          • Floating Text - Show Miss for PlayersIngame
          • Floating Text - Set the velocity of Miss to 30.00 towards 90.00 degrees
          • Floating Text - Change Miss: Disable permanence
          • Floating Text - Change the lifespan of Miss to 4.50 seconds
          • Floating Text - Change the fading age of Miss to 3.00 seconds
        • Else - Actions
Note that this will not work if the unit that supposed to evade has full hp.
 
Status
Not open for further replies.
Top