| 07-26-2009, 12:55 PM | #1 |
JASS:set nH = ParabolaZ(.ho+.SL,.EL+.ho,.maxheightK,.distance,.movedistance) call SetUnitFlyHeight(.target, nH-.SL,0) // .ho is the inital height of the unit before the knockback //.sl is starting location height // .el is ending location height For example I just tested a green drake that has a initial height of 280 and it ended up around 256. |
| 07-26-2009, 01:27 PM | #2 |
Aren't you passing too many arguments to the ParabolaZ function? |
| 07-26-2009, 01:34 PM | #3 |
JASS:library ParabolicMovement2 function ParabolaZ2 takes real y0, real y1, real h, real d, real x returns real local real A = (2*(y0+y1)-4*h)/(d*d) local real B = (y1-y0-A*d*d)/d return A*x*x + B*x + y0 endfunction endlibrary There is another verison which takes into initial z position and end z position. |
| 07-26-2009, 01:47 PM | #4 | |
Yeah, but you're not calling that function, you're calling the original. Quote:
|
| 07-26-2009, 01:59 PM | #5 |
I renamed it to ParabolaZ as I had no ParabolaZ2 in my script. |
| 07-26-2009, 02:11 PM | #6 |
*sigh* Anyway, your problem is this: JASS:call SetUnitFlyHeight(.target, nH-.SL,0) |
| 07-26-2009, 02:31 PM | #7 | |
Let me test it but I read his script and it said Quote:
And y0 is initial z point. EDIT: Still not the correct height. |
| 07-26-2009, 07:35 PM | #8 |
Well, are you sure that the last time you update it, .movedistance equals .distance? |
| 07-27-2009, 06:25 AM | #9 |
Yes. |
| 07-27-2009, 02:43 PM | #10 | |
Quote:
|
| 07-28-2009, 06:45 AM | #11 |
Flat terrain is a litttle off still. I am moving it on a periodic timer. The final location should be at the target spot as i used kinematics. Even if it didn't, tried on flat ground and also failed. movedistance seems to be a little off and so is the unit's height For example, .movedistance = 1170 .distance = 1150 initial height = 280 end height = 290 It's just that off. Calculation for .movedistance is .movedistance = .movedistance + .velocity.getLength() * TIME |
| 07-30-2009, 02:02 PM | #12 |
bump |
| 07-30-2009, 02:16 PM | #13 |
Well, if movedistance is off at the end of the movement, you can't expect the height to be correct. The function will give you the correct endheight only if x equals d. |
