• 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] Attack hits point once Target Reaches it

Status
Not open for further replies.
Level 10
Joined
Jan 21, 2007
Messages
576
Alright, first off yes that is a sloppy title... but I'm to tired to think of a better name so anyways:

Alright I have a hero unit whos attacks do not home in, so if you moving left to right in front of my hero he will miss most of the time. I have been rolling it over in my head for almost 2 hours now and I just don't know how I would do it.

I need the formula to issue an order targeting a point ahead of a target so that once the target reaches it the bullet will also hit that point simotaniously. You can just type it out but I will be using this trigger to issue the order:
  • Unit - Order (Attacking unit) to Attack Ground (Point offset by 256.00 towards 0.00 degrees)
Just for simplicity's sake here is a list of variables you can refer things as so everyones solution is more... interchangeable/understandable.

[A] = Position of Attacking Unit
= Position of Attacked Unit
[C] = Speed of Attacked Unit
[D] = Speed of Bullet
[E] = Distance Between Attacking unit and Attacked Unit

EDIT: For this formula you can assume the target unit is moving straight forward the whole time.
In addition, you can use variables that are not in the list above.
 
Level 10
Joined
Jan 21, 2007
Messages
576
I want it like this because then I can change how acurate the units attacks are depending on variables. so if they get a sniper rifle I can increase there accuracy.
 
Level 21
Joined
Aug 9, 2006
Messages
2,384
Dont use a order, use move unit instantly, its the best way for such a thing.

And such a bullet system is not hard. And just a straight fly with collision detection? Want me to do a spell like that for you? Want deacceleration or the bullet? want different impact strengths? piercing shots? whatever.

I could do a bullet system, not that hard. Only hard if you want a correct Z calculation.
 
Level 10
Joined
Jan 21, 2007
Messages
576
Well I can make a bullet system like that aswell, but how do you detect when the bullet collides witha unit/tree?
 
Status
Not open for further replies.
Top