• 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] Curve Motion

Status
Not open for further replies.
Level 25
Joined
Jun 5, 2008
Messages
2,573
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.
attachment.php
 

Attachments

  • c_tmp.JPG
    c_tmp.JPG
    9 KB · Views: 368

Rmx

Rmx

Level 19
Joined
Aug 27, 2007
Messages
1,164
Try to search or google the code for Wild Axe i only found it in Jass but i forgot where it was from.

It's the ability WILD AXE in DOTA. it have the curves and everything EPIC.

EDIT : I just found it in GUI version but not MUI :(

http://www.hiveworkshop.com/forums/f269/memory-leaks-43343/

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.
 
Last edited:
I need Z curve motion not X/Y Rmx.
And i need it to be functional.

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.
 
Last edited:
Level 18
Joined
Oct 18, 2007
Messages
930
i love this parabola by shadow1500

JASS:
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

meh that one sucks :p

This owns
JASS:
private function ParabolaZ takes real h, real d, real x returns real
  return (4 * h / d) * (d - x) * (x / d)
endfunction

or with curve
JASS:
private function ParabolaZ takes real c, real d, real x returns real
  return (4 * c) * (d - x) * (x / d)
endfunction
 
Status
Not open for further replies.
Top