• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[General] Bug with "Takes Damage" - Event

Level 11
Joined
Sep 11, 2013
Messages
327
Greetings!
I found a weird problem with my test map.
I tried to make a unit which deal 0 damage to a particular building(tower) and then the tower must use a special effect(heal)
The problem is: this "Takes Damage" - Event will activate the special effect of the trigger even when i don't attack anything. I just move my skeleton around towers and my trigger just activate random. I found that this bug appear only when my tower is a building, but i don't want it to be a unit.

Can someone solve this bug with the tower as a building?

The help will be appreciated!
 

Attachments

  • Experiment Turn.w3m
    18.9 KB · Views: 2

Uncle

Warcraft Moderator
Level 65
Joined
Aug 10, 2018
Messages
6,688
You're using the wrong Event Response. (Attacked unit) and (Attacking unit) are used with the Event:
  • Unit - A unit is attacked
Damage Events use the (Damage Source) and (Damage Target) Event Responses.

Also, you're using some odd math to Set the Damage, here's a fixed up trigger:
  • Damage
    • Events
      • Unit - A unit Takes damage
    • Conditions
      • (Unit-type of (Damage Target)) Equal to Scout Tower
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Damage source)) Equal to Skeleton Archer
        • Then - Actions
          • Event Response - Set Damage of Unit Damaged Event to 0.00
          • Special Effect - Create a special effect attached to the overhead of (Damage Target) using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
          • Event Response - Set Damage of Unit Damaged Event to 1.00
Archers will deal 0 damage to the tower while every other unit will deal 1 damage.

But that aside, I did notice the bug, which is REALLY weird. However, the problem should go away if you create a new map.

I think your current map is haunted :p
 
Last edited:
Level 11
Joined
Sep 11, 2013
Messages
327
Hi! Thank you for telling me how to make this trigger properly! The trigger works great and indeed the bug has disappeared after i put this trigger in a new map, but then i started to test again to find out what couse the problem in the first place and i found something really strange.

If you go in Scenario - player properties - and add for example one computer on player blue and that user has few blue towers on the map, the problem appear.
If i put NONE on player 2, the problem dissaper again

It work even in a new map
 
Last edited:
Top