• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

an easy questiuon about detecting an attack

Status
Not open for further replies.
Level 22
Joined
Jan 10, 2005
Messages
3,415
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
 
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.
 
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 :?
 
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 :(
 
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.
 
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?
 
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?
 
Status
Not open for further replies.
Back
Top