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

How to: Attack Detection last

Status
Not open for further replies.
Level 11
Joined
Jul 28, 2007
Messages
920
I created attack detection but i dont have idea how to create it work properly, when unit attacks or is attacked, it must be activated, and 30 seconds after must be deactivated ( to disable some stuffs when activated ), but if unit is attacked/is attacking like 10 seconds after detection is activated it doesnt stacks... i dont have idea how to fix that... liek we have time line ( start 0 sec - end 100 sec ) and now at 10 sec unit is attacking or being attacked, detection is activated and will turn off at 40, but unit is attacking again at 30 so detection wont be deactivated at 40 but will at 60.

I hope i make my self clear...
Anyone idea ?
 
Level 11
Joined
Jul 28, 2007
Messages
920
I dont get the thing with the dummy.....

...................here's the idea........................
Action:
When unit is attacked
Cond:
Attacked unit is enemy of attacking unit
Act:
set = decetion on ( integral or whatever )

-AND NOW I DONT KNOW HOW TO SET THAT TRANSLATION FROM HERE TO AFTER 30 SECONDS-

wait 30 seconds <== but this time must be adaptable, or maybe not in the same trigger...

set = decetion off ( integral or whatever )

........and must go like this.......
Action:
When unit is attacked
Cond:
Attacked unit is enemy of attacking unit
Act:
set = decetion on ( integral or whatever )

wait 30 seconds
=15 expired=
now its 15th sec adn trig is activated again so it will wait 30 sec not 45

wait 30 seconds
=30 expired=
set = decetion off ( integral or whatever )

detection must not be deactivated whole 45 seconds...


I think that with timer should work, i will try it now.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
  • Untitled Trigger 001
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • Countdown Timer - Pause Timer[(Player number of (Owner of (Attacking unit)))]
      • Countdown Timer - Start Timer[(Player number of (Owner of (Attacking unit)))] as a One-shot timer that will expire in 30.00 seconds
      • Countdown Timer - Resume Timer[(Player number of (Owner of (Attacking unit)))]

Not sure if that Pause/Unpause is needed.


  • Untitled Trigger 002
    • Events
      • Time - Timer[1] expires
    • Conditions
    • Actions
      • Actions

The only annoying thing is that you'll probably need to make seperate trigger for each player.
 
Level 11
Joined
Jul 28, 2007
Messages
920
yup i did just like that, only i didnt pause it, i restarted it, and i was just wanted to ask if there is any condition for timers.. but wupose it isnt... so i can put all timer is one trigger... under event. i forget all aobut timers at the begining, long time havent using them so :) tnx ppl :)
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
Dummy is some unit you cant see(no model)-hit(has invulnurability or locust). and it casts spell on some unit
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Not neceserily (or however you type that).

Its just a unit that nomaly won't be in the game, and is usually created via spell usage and does something.

You can call a unit that looks like a fire ball a dummy unit for example.

It could also be (it usually is) a invisible/invurnable unit that casts spells, as Need_O2 said.
 
Status
Not open for further replies.
Top