• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[General] +1 exp on each tree

Status
Not open for further replies.
Level 13
Joined
Sep 11, 2013
Messages
467
Greetings!
How can i made this possible?
If a hero from team 2(or any hero) kill a tree, he must receive +1 exp (must applies for all trees).

1.I found this event, but only the first 64 will be registered
2.i don't know how to add the exp

64.JPG


Can anyone help me with a trigger for this?
Thanks in advance!
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,867
You can do it using 2 triggers. The first trigger adds Events to the second trigger which is where you would put your actions:
  • Setup Tree Dies
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Destructible - Pick every destructible in (Playable map area) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Destructible-type of (Picked destructible)) Equal to Summer Tree Wall
            • Then - Actions
              • Trigger - Add to Tree Dies <gen> the event (Destructible - (Picked destructible) dies)
            • Else - Actions
  • Tree Dies
    • Events
    • Conditions
    • Actions
      • -------- This is just an example of how you would interact with the (Dying destructible) --------
      • Special Effect - Create a special effect at (Position of (Dying destructible)) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
But keep in mind that it's impossible to detect which Unit killed a Tree since there's no Event Response like (Destructible Killing Unit) and without a Killing unit there is no Killing player.

What people have done in the past:
1) If you destroy the Trees using a targeted Ability like War Club then you can detect the (Killing unit) by using a Spell Event and (Casting unit).
2) You can use Pick Every Unit to find units near the Tree when it dies, but this isn't guaranteed to work since multiple units can be nearby.
 
Last edited:
Level 24
Joined
Jun 26, 2020
Messages
1,928
Thanks for the answer, but with what trigger i should add +1 experience to unit that kills the tree?
But keep in mind that it's impossible to detect which Unit killed a Tree since there's no Event Response like (Destructible Killing Unit) and without a Killing unit there is no Killing player.

What people have done in the past:
1) If you destroy the Trees using a targeted Ability like War Club then you can detect the (Killing unit) by using a Spell Event and (Casting unit).
2) You can use Pick Every Unit to find units near the Tree when it dies, but this isn't guaranteed to work since multiple units can be nearby.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,867
Thanks for the answer, but with what trigger i should add +1 experience to unit that kills the tree?
To clarify, there is no Event Response for detecting which unit killed a destructible. Unfortunately, you can only get the (Dying destructible).

However, there are some tricks that can be used to possibly work around this limitation and I listed 2 of them. The first solution requires an Ability which is probably not what you wanted and the 2nd solution is not a 100% guarantee since even the closest unit to the dying destructible may not be the killer.

Edit: Tree Dies would be the trigger where you put your Actions like +1 experience. But like I said, that's not going to be so easy.
 
Last edited:
Status
Not open for further replies.
Top