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

[Trigger] how to detect when destructible is attacked?

Status
Not open for further replies.
Level 9
Joined
Jan 14, 2008
Messages
366
i cant believe there is no such function! what the hell???

please say it is possible and easy to be done . . . . .

i dont know shit about jass would hate to have to recurr to it.

also how can you referr to the attack destructible?
is there such a thing as "triggering destructible" ?
 
Level 20
Joined
Jan 6, 2008
Messages
2,627
All you need to do is:

  • Events
    • Map Initalization
  • Conditions
    • Destructible Type ((Destructible equal to NAME)
  • Actions
    • If all things are true blah blah blah.
      • If Conditions
        • Destructible Health equals to equal or lower than 1 Less then Excact Hp!
      • Then Actions
        • Game - Automaticly timed message for all Players: DESTRUCTIBLES IS BEING ATTACKED!
      • Else Actions
        • Do Nothing
 

Rmx

Rmx

Level 19
Joined
Aug 27, 2007
Messages
1,164
Coz in the MAP INTI u just wasted the action nothing hapened MAP INTI means loading the map so no 1 can attack it's like 0.0000001 then stops . but cheking if the trees have their health damaged every 0.10 seconds would work and not stop .... TRY IT URSELF MAN !!!!
 
Level 22
Joined
Dec 31, 2006
Messages
2,216
There is another way. You could use the event
  • Unit - A unit Is issued an order targeting an object
and then you add this:
  • Actions
    • Set Destr = (Target destructible of issued order)
    • Custom script: if udg_Destr != null then
    • Custom script: endif
    • Custom script: set udg_Destr = null
Remember to put your actions between the two custom scripts "if udg_Destr != null then" and "endif".

Like this:
  • Events
    • Unit - A unit Is issued an order targeting an object
  • Conditions
  • Actions
    • Set Destr = (Target destructible of issued order)
    • Custom script: if udg_Destr != null then
    • Game - Display to (All players) the text: A destructible is under attack!
    • Custom script: endif
    • Custom script: set udg_Destr = null
That should work (Haven't tested it)
 
Level 7
Joined
Jul 20, 2008
Messages
377
First, what if I were to hit "Move" and then clicked on the destructible? It wouldn't be under attack, now would it?

Furthermore, that just says the destructible has been targeted, but not attacked. The OP wants something that detects when a destructible has been struck. I suggest doing what the second and third posts in this thread say.
 
Level 7
Joined
Jul 20, 2008
Messages
377
Again, that just says the destructible was targeted. What if my unit was on the opposite side of the map and I ordered it to attack the destructible?
 
Level 9
Joined
Jan 14, 2008
Messages
366
thanks alot everyone for your inputs!

both methods would probably work, even the one that fires upon "targeting" of the destructible. gonna try out wich one is more effective.
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
Rep-maniac ^^

But Soga- is probably right, you can target a destructible from the other side of the map, and the, when you check distance, it is NOT fired, but the unit can still walk to it, and attack it AFTER,,
So the 'every 0.10 secs' thing is probably the best,,
 
Status
Not open for further replies.
Top