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

[Trigger] Where is the problem?

Status
Not open for further replies.
Level 9
Joined
Feb 20, 2014
Messages
409
When i kill a specific unit I want to have a "buff" that deals x dammage every 0.5 seconds to the units owned by neutral hostile in range of 512 of my hero.
Here is what I did :
Unit group - Pick every unit in (Units within 512.00 of (Position of Myhero) matching ((Owner of (Triggering unit)) Egal to Neutral Hostile)) and do (Units - Set life of (Picked unit) to ((life of (Picked unit)) - 50.00))
But it doesn't work...
 

Deleted member 219079

D

Deleted member 219079

Most likely the owner of trigger unit part (I did this mistake a lot in GUI lol).

Edit: I don't think your unit gets the kill score if that hp decrease kills the unit. If you want the aura wielder to be the killer, you need to use Unit - Damage Target.

Edit2: You should have a custom script that reads "set bj_wantDestroyGroup = true" above that group enumeration, so that you won't have leaks :)
 

Deleted member 219079

D

Deleted member 219079

You can place custom script in the midst of your GUI stuff! Go to the New Action - Dialog and search for "Custom Script".

If you're completely new to the scene, give us the whole trigger in [trigger]...[/trigger] - tags:
howtoposttrigger.jpg
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
You are checking if the owner of the unit who killed the specific unit you are talking about is Neutral Hostile. You should be checking if the units enumerated from your unit group function are owned by Neutral Hostile.

(Owner of (Triggering unit)) Egal to Neutral Hostile) > Owner of (Matching unit)

Also, please post triggers next time as how jondrean described it.
 
Level 9
Joined
Feb 20, 2014
Messages
409
  • Unit - A unit Meurt
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • Si - Conditions
      • (Unit-type of (Triggering unit)) Equal to conductivity shrine
    • Alors - Actions
      • Speciel effect - Create a special effect attached to the origin of Myhero using war3mapImported\LightningAura.mdx
      • Wait 0.50 seconds
  • Unit - Cause Myhero to damage circular area after 0.00 seconds of radius 500.00 at (Position of Myhero), dealing 100.00 damage of attack type Sorts and damage type Normal
  • Then I do "wait 0.5" sec and do the same action to deals x dammage every 0.5 seconds during the amount of time that I want.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Enumerate all units in a circular range of the position of your hero.
Then you iterate over the group, checking if their owner is equal to neutral hostile and check if they are alive.
If both are true, you deal targeted damage to the picked unit using the hero as source.

Make sure you dont leak the unit group and locations.
If you are unsure how to avoid those leaks, use google. (Warcraft 3 triggers group leak)

Waits are not really nice, and are unimaginably horrible when you use them in multiplayer without knowing exactly what they do.
Instead, you should set up a trigger that runs every 0.5 seconds of game-time and put your hero in a list that would be iterated over in that trigger to do the damage of the surrounding units.
However, that is part B of fixing your trigger ;)
 
Status
Not open for further replies.
Top