• 🏆 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!

[Solved] This trigger kills the unit!!

Status
Not open for further replies.
Level 20
Joined
Jul 14, 2011
Messages
3,213
  • Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 400.00 at (Position of (Triggering unit)), dealing ((Real((Level of (Triggering unit)))) x 100.00) damage of attack type Hero and damage type Normal
Obviously: I want hero to deal AoE dmg when lvling up, and dmg dependant on his lvl, just as trigger says.... the thing is that it also damages allies =/ How can i prevent heroes from getting this damage, or work the lvl-up-dmg some other way?
 
Damage circular area ignore's user's preferences; it damages everything :)

You need to use a loop and enumerate units nearby:
  • Set Point1 = (Position of (Triggering unit))
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units within 400.00 of Point1 matching ((Matching unit) belongs to an ally of (Triggering player)) Equal to False) and ((Matching unit) is a Structure) Equal to False) and ((Matching unit) is alive) Equal to True) and do (Actions)
    • Loop - Actions
      • Unit - Cause (Triggering unit) to damage (Picked unit), dealing ...
  • Custom script: call RemoveLocation (udg_Point1)
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
I did one exactly as you said... i'ts... Logycal :) but, does this damage Neutral Passive units?

Couldn't I just do

Matching Unit Belong to (Neutral Hostile)?... All my hostile units, enemies, etc., are Neutral Hostile...


  • Unit Group - Pick every unit in (Units within 400.00 of Point1 matching (((Matching unit) belongs to an enemy of (Triggering player)) Equal to True)) and do (Actions)
    • Loop - Actions
  • ...
Wouldn't that work for Neutral Hostile?... They're not allies :D
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Mmm... So
  • Unit Group - Pick every unit in (Units within 400.00 of Point1 matching ((Matching unit) belongs to an ally of (Triggering player)) Equal to False) and ((Matching unit) is a Structure) Equal to False) and ((Matching unit) is alive) Equal to True) and do (Actions)
wouldn't work, because it would also damage Neutral Passive.

I think there's an ultra deep-hard-hi-tech-wise solution... Make all Passive Neutral units Invulnerable?, and set one player as a ally computer, in case i need some vulnerable unit (for quests and stuff), to avoid it taking damage
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
instead of "is ally" use "is an enemy"

The trigger says "it's an enemy of (player)", but Neutral Hostile isn't an Enemy Player, or Ally Player, that's why the trigger picks everything that's not Ally... i think? xD

The trigger is meant to pick everything that's not an ally, that's not an structure, and that's alive. It would then include: Neutral Passive and Neutral Hostile units, but, since All Neural Passive Units will be "Invulnerable", then it would only damage remaining units: Neutral Hostile.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
¡AWESOME! ¡Great! Now i don't have to make every neutral passive unit invulnerable (though i think most of them will be) :D Thanks... :D
 
Level 13
Joined
Mar 16, 2008
Messages
941
Coolty44: I like your suggestion!

Maker: i'll quote this:



That's why I have to exclude Passive manually
And Maker is right too as "enemy" includes enemies and I think neutral hostile. Neutral passive should be neither an ally nor an enemy while hostile is the last.
It's up to you what to use but "is an enemy" fits your purpose perfectly.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Ok :) I did it this way:

  • Unit Group - Pick every unit in (Units within 400.00 of Point1 matching (((Matching unit) belongs to an enemy of (Triggering player)) Equal to True)) and do (Actions)
    • Loop - Actions
      • Unit - Cause (Triggering unit) to damage (Picked unit), dealing ((Real((Level of (Triggering unit)))) x 100.00) damage of attack type Spells and damage type Normal
I learned a lot from you guys! Thanks for everything.
 
Status
Not open for further replies.
Top