Need condition: unit attacks destructible

Status
Not open for further replies.
Level 12
Joined
Mar 16, 2006
Messages
992
Event: Destructible Dies
Condition: Dying Destructible == or Destructible - Destructible is dead.

Same thing.
 
Level 3
Joined
Feb 13, 2008
Messages
65
  • Untitled Trigger 001
    • Events
      • Destructible - A destructible within REGION <gen> dies
    • Conditions
      • (Destructible-type of (Last created destructible)) Equal to Barrel
    • Actions
      • Do nothing

That wouldn't work; where exactly was this "Barrel" created from that it was the last created unit? That doesnt make any sense.

Maybe you meant this:
  • Untitled Trigger 001
    • Events
      • Destructible - A destructible within Region <Gen> dies
    • Conditions
      • (Destructible-type of (Dying Destructible)) Equal to Barrel
    • Actions
      • Do nothing
This one checks if the dying destructible was equal to the barrel, and if it was it will continue with the actions.
 
Level 8
Joined
May 25, 2008
Messages
125
That wouldn't work; where exactly was this "Barrel" created from that it was the last created unit? That doesnt make any sense.

Maybe you meant this:
  • Untitled Trigger 001
    • Events
      • Destructible - A destructible within Region <Gen> dies
    • Conditions
      • (Destructible-type of (Dying Destructible)) Equal to Barrel
    • Actions
      • Do nothing
This one checks if the dying destructible was equal to the barrel, and if it was it will continue with the actions.


yup i agree that too
 
Level 3
Joined
Feb 13, 2008
Messages
65
I think the majority (if not all) of you missed the point. He wants to detect when a destructible is attacked, not taken down.
I doubt it's possible.

It is possible, but it requires variables and two triggers.

Here is the only way I could think of doing it:

Trigger 1 (Initially On)
  • Events -
    • Time - Elapsed time is 1.00 seconds
  • Conditions
  • Actions -
    • Set DestructibleHealth = (Max life of Summer Tree Wall 0000 <gen>)
    • Trigger - Turn off (this trigger)
    • Trigger - Turn on (Trigger 2)

Trigger 2 (Initially off)
  • Events -
    • Time - Every 1.00 seconds of game time.
  • Conditions
  • Actions -
    • If (All conditions are true) then do (Actions) else do (Else Actions)
      • If (Conditions)
        • (Current Life of Summer Tree Wall 0000 <gen>) less than DestructibleHealth
      • Then (Actions)
        • Set DestructibleHealth = (Current Life of Summer Tree Wall 0000 <gen>)
          • -------- Rest of your actions for it being attacked --------
      • Else (Actions)
    • If (All conditions are true) then do (Actions) else do (Else Actions)
      • If (Conditions)
        • (Summer Tree Wall 0000 <gen> is dead) Equal to True
      • Then (Actions)
        • Trigger - Turn off (This trigger)
        • -------- Rest of your actions for it being killed --------
        • Else (Actions)

DestructibleHealth = Real Variable

Basically what these triggers do is: The first one sets DestructibleHealth to the maximum health of the destructible you want, then it turns itself off and turns on Trigger 2.

Trigger 2 checks, periodically (You can set this to however short or long you want) if the health of that destructible is less than the amount in DestructibleHealth. If it is true, it will set DestructibleHealth to the destructible's current HP and run the rest of the actions that you want to run if a destructible is attacked. This can repeat itself up until the destructible is dead, once which the trigger will turn off itself and you can add actions to that part if you wish.
 
Level 3
Joined
Feb 13, 2008
Messages
65
Don't you think that's awfully tedious for such a task? Plus, you can't catch which unit did the attacking.

Of course it's more tedious and limited than a regular "attacking/attacked unit" condition, but if it is for a special circumstance (An exploding tree!) or something, it can be done.

As for the unit, it is true that you cannot catch the unit that did the damage, but you can get the unit(s) within range of the destructible for an explosion damage effect or something along those lines.
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
That's a terrible idea! Every other unit or destructible related trigger or ability will have effect on them, or have the wrong effect. If you have an area of effect ability that only hits units and you cast it near the woods, your trees will die too even if you want to keep those up specificly.
 
Status
Not open for further replies.
Top