Warcraft III resources & community, 2003–2006 · archived

an easy questiuon about detecting an attack

9 posts
#1

an easy questiuon about detecting an attack

if a unit isnt ordered to attack, but attacks cuz an enemy comes to close or anything, is it still an attack order? else how would the computer detect it? i need this cuz i have trebuchets and everytime it attacks i have to create a dummy at the attackpoint
#2
maybe give the trebuchets an acquisition range of 200 and a minimum range of 300? er if u can have minimum range. that way they won't attack automatically, problem solved.
#3
If the trebuchets on your map are placed by way of the object palette (eg. players cant build them and triggers don't spawn them after map initialization), you can create a trigger with the event: Unit - Specific Unit acquires a target. The only problem is, if you have a lot of trebuchets, you have to make a separate event for each of them, which would require a lot of copying and pasting :?
#4
maybe give the trebuchets an acquisition range of 200 and a minimum range of 300? er if u can have minimum range. that way they won't attack automatically, problem solved.


i alrdy tried that once, just giving them a acuisitionrange of 0, but then the real range of the trebuchet went from 10000 to 1600.. so that didnt work

If the trebuchets on your map are placed by way of the object palette (eg. players cant build them and triggers don't spawn them after map initialization), you can create a trigger with the event: Unit - Specific Unit acquires a target. The only problem is, if you have a lot of trebuchets, you have to make a separate event for each of them, which would require a lot of copying and pasting


yea i know, but the problem is they r being created by triggers :(
#5
Depending on why you want to detect the attack you could just make a trigger like this:

Events

Unit - A unit is attacked

Conditions

Unit-type of Attacking unit Equal to Trebuchet

Actions

*Whatever you want*

I don't know if this will be compatible with what you're doing. If it's not, post what you want your trigger to do after it has detected the attack and I might be able to offer more help.
#6
i dint have a trigger. well i order peons to build the trebuchets i a little cinematic, but after that they just attack by emselves. but actually ur trigger might work.. i always thought they attacked a point, but if they fire from themselves, they attack a unit and not the point under the unit right?
#7
if a unit's Range is > its Acquisition Range, Range will == Acquisition Range for all purposes in-game.

Ramza - It should detect AI attacks
#8
if they fire from themselves, they attack a unit and not the point under the unit right?


Yes, the trebuchets should attack units.
#9
er in the thread where he mentioned his trebuchets he said he didn't want them attacking on their own, you had to manually give the attack order. will that affect the range under those circumstances?