No damage

pride2518

New Member
Reaction score
4
I want to make it so that the unit type Exterminator can't damage any unit type other than fiend, but I can't seem to get it right.

Here's my trigger...

Trigger:
  • RestrictExterminator
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Exterminator
      • (Unit-type of (Attacked unit)) Not equal to Fiend
    • Actions
      • Unit - Set life of (Attacked unit) to ((Life of (Attacked unit)) + (Damage taken))
 

the_ideal

user title
Reaction score
61
The problem is that "Unit is Attacked" fires the trigger before damage is dealt.

Try using "A Unit takes damage" instead. (And yes, you're going to have to add the event manually to the trigger for every exterminator that enters the map.)
 

Tyman2007

Ya Rly >.
Reaction score
74
I suggest getting the GUI Friendly Damage Detection under the Systems, Triggers, and Demo Maps section.

The thing is, that trigger won't work because a unit can be attacked, but that doesn't necessarily mean that he took damage.
 

Moridin

Snow Leopard
Reaction score
144
Actually the problem is that there's no "Damage taken" in this trigger.

You don't need a GDD (Damage detection system) for this. It's actually better to use unit - a unit is attacked. If you use GDD to detect damage and heal the damage, fatal attacks will still be fatal.

Pride2518:

Easy solution is this. Use the same trigger except for the actions, use this instead:

Unit - Pause (attacking unit)
Unit - Order (attacking unit) to Stop
Unit - Unpause (attacking unit)
 

Tyman2007

Ya Rly >.
Reaction score
74
I never said you needed GDD, I just suggested it.

The problem with your trigger moridin is that if you interrupt the attack, the cooldown has not been set, so he is free to attack directly after being unpaused. If it's a chance that there will be no damage, then that damage that is fatal will just have to be fatal. There is no way beyond that except to create a new unit or find some sort of ability, but it's just how it is.

WC3's current capabilities are limited. Let's just wait for starcraft and see what it has to offer shall we? :p
 

Moridin

Snow Leopard
Reaction score
144
The problem with your trigger moridin is that if you interrupt the attack, the cooldown has not been set, so he is free to attack directly after being unpaused. If it's a chance that there will be no damage, then that damage that is fatal will just have to be fatal. There is no way beyond that except to create a new unit or find some sort of ability, but it's just how it is.
I didn't get that :S. Could you explain what you mean by cooldown? :S
 

Bogrim

y hello thar
Reaction score
154
Are you using your Suicidal classification? If not, you can use an ability like Demolish and make the ability completely reduce the damage caused (0.01) and able to target only non-suicidal units, then add the suicidal classification to your other unit. Update: Check out this post.
 

Moridin

Snow Leopard
Reaction score
144
Alternatively, you could prevent the damage caused with a GDD event using the same trigger structure as your example.
I still don't understand why everyone is suggesting GDD..? He doesn't want the attack to happen in the first place, so won't it be better to detect the attack instead of the damage? If you detect the damage then fatal attacks won't be healed....

Really confused about this.
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
Are you using your Suicidal classification? If not, you can use an ability like Demolish and make the ability completely reduce the damage caused (0.01) and able to target only non-suicidal units, then add the suicidal classification to your other unit.

Alternatively, you could prevent the damage caused with a GDD event using the same trigger structure as your example.

i would say go with bogrims solution but slightly different. use critical strike with negative damage multiplier (damage will be set to 0.00 then) and 100% hit chance. hide this ability in an invisible spellbook, and make it target only "sapper" or "ancient" units. now you just have to add the classification "sapper" or "Ancient" to all your "fiend" units.
 

Bogrim

y hello thar
Reaction score
154
I still don't understand why everyone is suggesting GDD..? He doesn't want the attack to happen in the first place, so won't it be better to detect the attack instead of the damage? If you detect the damage then fatal attacks won't be healed....

Really confused about this.
Maybe you should expand on my first suggestion and make the unit only able to attack suicidal units.

"A unit is attacked" doesn't detect the attack. The event should be called, "A unit is target by an attack swing" because that's what the event really does. If you stop a unit that's about to swing, it will just swing again and result in a never-ending loop that will crash the game.
 

Moridin

Snow Leopard
Reaction score
144
"A unit is attacked" doesn't detect the attack. The event should be called, "A unit is target by an attack swing" because that's what the event really does. If you stop a unit that's about to swing, it will just swing again and result in a never-ending loop that will crash the game.
I understand what "A unit is attacked" does :p. I didn't know this infinite loop thing though. Gonna test it out and see...I thought if you paused the unit it worked :S.
 

Moridin

Snow Leopard
Reaction score
144
Easy solution is this. Use the same trigger except for the actions, use this instead:

Unit - Pause (attacking unit)
Unit - Order (attacking unit) to Stop
Unit - Unpause (attacking unit)

Tested. My solution works flawlessly :). You don't need GDD :p.
I used this trigger:

Trigger:
  • Attack Stop
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Peasant
      • (Unit-type of (Attacking unit)) Equal to Paladin
    • Actions
      • Unit - Pause (Attacking unit)
      • Unit - Order (Attacking unit) to Stop
      • Unit - Unpause (Attacking unit)


...and my Paladin could attack a footman and a knight but couldn't touch enemy peasants. No half-swing or anything, he just wouldn't attack when the target was a peasant. The solution worked for an attack order, a smart order and no order (where the paladin auto-attacked nearby peasants, he would run upto them but not attack).
Edit: I still don't get what you meant by the infinite loop thing bogrim :S.
 

Moridin

Snow Leopard
Reaction score
144
you dont need to pause the unit.
You might be right. I didn't test it without the pause. I faintly remember something bugging if you don't do the pause, but that might be false memory or outdated information. It's easy enough to change anyway :).
 

Bogrim

y hello thar
Reaction score
154
Edit: I still don't get what you meant by the infinite loop thing bogrim :S.
Two units stand next to each other, enemy to each other. One unit makes a swing. It's ordered to stop. It stops. It then re-assumes its normal AI behavior, and begins to attack again. It's ordered to stop again, and it goes on infinitely.

The AI isn't going to register the trigger when it chooses an attack target, and each time you order the unit to stop with a trigger you interrupt whichever orders the unit currently has. That makes the unit both hard and annoying to control.

I tested out the solution I posted, and it works just fine. Place a Footman, a Knight and a Goblin Sapper on a test map. Change the Footman's allowed targets to Suicidal only. The Footman will only be able to attack the Sapper, and it will be unable to attack the knight. No triggers needed.
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
but therefor you need precious classifications which can be used for so many other things. did you really try the triggered solution? last time i did it worked pretty fine.
 

Bogrim

y hello thar
Reaction score
154
Actually classifications are best used for something like AI behavior, where spells and abilities are much easier to trigger.
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
whatfor classifications are best used is decided by what kind of map you are making and how complex it is going to be.
by default i would say try to use as little custom value and classifications of units in open systems as possible cause these can be used for many other deeds.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/
  • The Helper The Helper:
    I think we need to add something to the bottom of the front page that shows the Headline News forum that has a link to go to the News Forum Index so people can see there is more news. Do you guys see what I am saying, lets say you read all the articles on the front page and you get to the end and it just ends, no kind of link for MOAR!
  • The Helper The Helper:
    Happy Wednesday!
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1

      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