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!
I need a function for curved motion on the Z axis for missiles.
In my post there is an attached picture of the function i would need.
Also a function for a curve motion for x/y axis's is optional.
I don't care wheter it's a simple calculation or a JASS function as long as it works.
It is called ... Leaks don't mind that it is an old topic in HIVE so i think it will help even to find if it leaks or not
Here it is i hope it helps u
If ur having any trouble with this BIG triger and confusing i can send u my own MUI version but it is not as good as this triger it will go to the target location very well but in the return well it's very very bad.
Make a 2d grade equation and change x to z and y to x.
then make a loop with a small wait increasing the z value eaxh step.
It's a bit hard to explain, but let's say we use x=-p/2+-√(p/2)² -q
then we can make a dummy unit with the former x value as flying height, and use y as x.
So lets say we have the equation y = x² -6x -5.
when the trigger runs a dummy missile is created and a loop started, and every 0.10 sec the units flying height is changed to the input x value wich increases every time the loop passes. the first x point (the x-q(wich is 5) should be the height from where the missile is shot.
Or well.. you would also like to find the vertex's relation to the lower x value, and when i think of it, this might be a little tricky. Still worh a try.
EDIT: I would still go for a function where y is in relation to x/distance between origin and target.
Ir order to make the dummy missile hit, you use something like this:
Code:
function doDamage takes unit u, unit caster, real dmg returns nothing
local location loc = GetUnitLoc(u)
local group g = CreateGroup()
local unit temp
loop
exitwhen IsUnitAliveBJ(missile) == false
call RemoveLocation(loc)
set loc = GetUnitLoc(u)
call GroupEnumUnitsInRangeOfLoc(g, loc, 80., null)
set temp = FirstOfGroup(g)
call DamageUnit(GetOwningPlayer(caster), dmg, u)
call GroupRemoveUnit(g, temp)
call TriggerSleepAction(0.10)
endloop
call DestroyGroup(g)
set g = null
call RemoveLocation(loc)
set loc = null
set temp = null
endfunction
I'm not expecting you to use this in specific, i just copied and slightly changed a code i use for another feature, this actually damages everything that comes in contact with the missile. You would do better making your own.
About like a half jump, example it will go up but won't go down or it will go down but it won't go up again, do you understand?
Something like a half jump parabola.
function JumpParabola takes real dist, real maxdist,real curve returns real
local real t = (dist*2)/maxdist-1
return (-t*t+1)*(maxdist/curve)
endfunction
function JumpParabola takes real dist, real maxdist,real curve returns real
local real t = (dist*2)/maxdist-1
return (-t*t+1)*(maxdist/curve)
endfunction
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.