| 08-21-2003, 08:27 PM | #1 |
OKay basicly what I'm lookin for here is an equation that'll help me figure out in seconds how long it takes for a missle shot from a unit traveling at XXX speed over x distance between two units. I need this for a spell I'm making where the timing needs to be precise. So far what I came up with is missle speed/distance between position of unit 1, and unit 2. This seems to work, but only up to a point. Like for instance if you're right up next to the target the results get fudged a bit, and the effect happens too late... Can any of you math gurus help me out there? |
| 08-21-2003, 09:38 PM | #2 |
If I knew the answer, I'd be a very happy camper =P Are you going to enable missle homing? Because that could throw things off, unless you make it compensate for moving targets. If you get an answer to this I'd be very very happy. |
| 08-21-2003, 10:11 PM | #3 |
I don't get the point of your question, you are saying a unit moving at XXX speed who shoots a projectile, well what does it change if he is moving? when he fires its the same as if he was stopped... the problem is when you are shooting AT a moving unit, is there homing? if you shoot on a unit, and then it moves, you will miss if the projectile speed isn't fast enough to do the distance between the caster and the target as the target is fast enough to move. Or do you want to calculate where to shoot if the target is moving? hmm ... cheers, desty |
| 08-22-2003, 02:02 AM | #4 |
You can play with vectors, or if the missile is a skill (which it seems it is) you can detect the order to cast the skill and then add the event "specific unit takes damage"(the unit being the one targetted) to a trigger which creates the special effects, and set some array or the custom value or something to 1/2/3 ect(if you have 3 missiles inc set it to 3) so you know that you have a missile headed that way. Then, when the unit takes damage from the missile hitting them it'll set off the takes dmg trigger which will create the special effect and do whatever else you need it to, along with setting that variable to 1 less... Of course, this does have the problem of them taking dmg from another source so you'll have to figure somethin' else out but it's an idea ;) |
