function Parabola takes real h, real dr, real cdr returns real
return (4 * h / dr ) * ( dr - cdr ) * ( cdr / dr )
endfunction
/* How to call the function?? Parabola(height,distance,counterdistance)
It just needs height , distance , and the current distance.
Simply: If you are setting the unit fly height use this
Height : 300
Distance Range: 500
Current Distance: 0.00
Speed Plus: 18.00
In the looping trigger 0.03 adds the Current Distance to the Speed like this:
set Current Dist = Current Dist + Speed = 18.00 and so on...
( 300 ) ( 500. ) ( 18.00 )
call SetUnitFlyHeight(udg_YOUR_UNIT,Parabola(height,distance,currentdistance),0)
Simplify like this: 4 * height divided by distance equals 2.4 finished at the first procedure now go to 2nd.
2.4 * (500 - 18.) equal to 1182 go to 3rd or last procedure
1182 * (18. / 500) equal to 42.
*/
^ Use triggers Unit - Move (Instantly) ( Polar Projections ).
Polar projection (or "Point with polar offset) creates new point by using another point (let's call it S) as its epicenter. The new point is created by offsetting point S by range R towards angle A.I seem to be missing this function, specifically the polar projections part?
You just have to copy the system into your map. Those systems usually come with a ReadMe or something similar which explains how to set the whole thing up.After looking at a few projectile systems they all seem overly complicated, all I need is something simple that moves a projectile from the caster to the target point
Yes you are mistaken - if you want those systems to not bug, then they are a bit long (not overly if handled right). Also, if you want to shoot projectile that hits units in its path, then you can't really use parabola, because with parabola you hit units only nearby the point it hits (if you imagine what you want - a projectile that hits units in its path, it would make no sense - the arrow could hit units because their X and Y coordinates match, but their Z coordinates could differ greatly - the arrow would be far above the unit, but still hit it - that's not fair you know).Am I wrong in assuming this sort of ability could be created with one or two triggers requiring only a few actions each?
Projectile systems work by moving projectiles instantly to a point offset by little bit from their current position and doing it quickly - like every 0,03 second. That gives us the impression that they moves fluidly.if i'm not mistake wouldn't moving it instantly show no movement and simply make it appear elsewhere instantly?
This needs to be stored in a variable and cleared as you did with the position of picked.
- (MissileLoc offset by MissileSpeed[loopA] towards (Facing of (Picked unit)) degrees)
I'm not sure I understand the integer loop inside of the unit group though, that means for each unit the moving action will fire as many times as the integer MissleCount
pOke: Also Facing a direction over 0 still factors in turn rate so its potentially possible the unit will not be precisely facing the right direction the unit casted when the ability starts causing the projectile to be going the "wrong" way.
It can face the desired angle if the missile dummy is locust when creating units.
^ This is not needed if you already created unit in facing the desired angle direction IF the missile has ability locust
- Unit - Make (Triggering unit) face (Target point of ability being cast) over 0.00 seconds
^ Yes you should remove that line.
I think you DO need the facing, because you don't always have to be facing a point EXACTLY to cast a spell toward it, alternatively instead of making the missile face the Facing of Triggering make it face the angle between the point of ability being cast and position of triggering unit (temploc and temploc2) That way its the most likely to be going the "right way"
- Missile Cast
- Events
- Unit - A unit Begins casting an ability
- Conditions
- Actions
- For each (Integer loopA) from 1 to MissileCount, do (Actions)
- Loop - Actions
- if (All Conditions are True) then do (Then Actions) else do (Else Actions)
- if - Conditions
- (Ability being cast) Equal to MissileAbil[loopA]
- Then - Actions
- Set tmpLoc = target point of ability being cast
- Set tmpLoc2 = position of triggering unit
- Set TempReal = Angle Between tmploc and tmploc2
- Unit - Make (Triggering unit) face tmpLoc over 0.00 seconds
- Unit - Create 1 MissileModel[loopA] for Neutral Passive at tmpLoc2 facing TempReal degrees
- Unit - Add a MissileExpire[loopA] second Generic expiration timer to (Last created unit)
- Custom script: call RemoveLocation(udg_tmpLoc)
- Custom script: call RemoveLocation(udg_tmpLoc2)
- Else - Actions
You just need another variable for this:
- (MissileLoc offset by MissileSpeed[loopA] towards (Facing of (Picked unit)) degrees)
- Set MissileLoc2 = (MissileLoc offset by MissileSpeed[loopA] towards (Facing of (Picked unit)) degrees)
SoA minor side note, you might want to save Picked Unit to a variable, it will increase efficiency since you use it quite a few times. (Save it before your IF and use the variable anytime you want to refer to it after)
- Unit - Move (Picked unit) instantly to MissleLoc2 towards (Facing of (Picked unit)) degrees)