• 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.

Can we detect owner of killing doodad?

Status
Not open for further replies.
Level 13
Joined
Feb 5, 2018
Messages
567
As far as I know there is still no way to get the killer of the destructible. The event response simply won't work. At least not in GUI or Jass/VJass.

The reasoning is the killing unit references only to a unit killing a unit for example. Same is for damage target. I browsed some old posts and there was no conclusion on the manner.

However I thought of a simple workaroud, which should suit your needs. In the example the range is only 125 which is very low. So it should only check the actual unit that is killing the destructible. The more AoE we add the more it will be open to exploits. Tested and works, should copy make a huge AoE and give crazy xp just for the testing purposes :)

  • Doodad
    • Events
      • Destructible - A destructible within (Playable map area) dies
    • Conditions
      • (Destructible-type of (Dying destructible)) Equal to Summer Tree Wall
    • Actions
      • Set VariableSet TempLoc = (Position of (Dying destructible))
      • Set VariableSet TempGroup = (Units within 125.00 of TempLoc matching (((Matching unit) is A Hero) Equal to True).)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • Hero - Add 1 experience to (Picked unit), Hide level-up graphics
            • Else - Actions
      • Custom script: call RemoveLocation(udg_TempLoc)
 
Level 18
Joined
Jun 2, 2009
Messages
1,233
I was already did this just like this but i was wondering anything similar to my system. Alternatively i would like to ask this question.
I can detect cannibalize timer (how much unit eat corpses every second) can we do something like this?
Right click order is "smart" but it works only for the right click. That means when you click the doodad, it starts to gather and it works only 1 time. But it runs when you click the the repeatedly. If we can do this, maybe i can do something like "you will gain 1 exp every hit on trees"

  • agac1 Copy
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Destructible-type of (Target destructible of issued order)) Equal to Summer Tree Wall
    • Actions
      • Game - Display to (All players) for 1.00 seconds the text: (Name of (Target destructible of issued order))
      • I will set boolean true for the player in here.
All i need to detect when the unit stops harvesting tree. Any order about that? Or probably i can set variable and set false if unit takes any action. I solved 50% of by myself during the explanation. But how can i make another part of this trigger? I need all orders and i don't know all of them.

1-) Peon starts harvest from tree
2-) Peon decides to stop, or move, or attack someone (i need all events i think) and i will set this boolean false.

This one is not works properly. It says STOP immediately when i click the tree.

  • agac1
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Destructible-type of (Target destructible of issued order)) Equal to Summer Tree Wall
      • WoodCutting[(Player number of (Owner of (Triggering unit)))] Equal to False
    • Actions
      • Set WoodCutting[(Player number of (Owner of (Triggering unit)))] = True
      • Game - Display to (All players) for 1.00 seconds the text: (Name of (Target destructible of issued order))
  • agac1 Copy
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order with no target
    • Conditions
      • WoodCutting[(Player number of (Owner of (Triggering unit)))] Equal to True
    • Actions
      • Set WoodCutting[(Player number of (Owner of (Triggering unit)))] = False
      • Game - Display to (All players) for 1.00 seconds the text: STOP
 
Last edited:
Status
Not open for further replies.
Top