• 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.

[JASS] Simple Math Question

Status
Not open for further replies.
Hello, I have a math question, that probably is kinda simple. Anyway, I'd like a math function that will make a bullet go straight and not like, bouncing up and down when the terrain-height changes.

I hope you understand what I'm looking for. Thanks!


bp.jpg

The example above is how it is now and the example under is how I want it to be.
 
Nop, trully that's the way do to so.
In case you do not use the MoveLocation() function, it would be like this:
  • Set Point1 = (Position of (Unit))
  • Custom script: set udg_Height = GetLocationZ (udg_Point1)
  • Animation - Set flying height of (Unit) to ((Flying Height of (Unit)) - Height) at 0.00
  • Custom script: call RemoveLocation (udg_Point1)
 
I have never heard of this, what is it doing? Anyway, it does not work... Still sliding at the ground and I have no idea why...

Even I've copied their function above...


Edit: Okey, I've remade it a little, it's working better now, but it still wobbles a little when the terrain height changes. Not extremely much. Atleast it's not sliding at the ground... :) Any help is appreciated to fix this.

Trigger:
  • Set TempPoint[0] = (Position of S_Unit[S_Index[3]])
  • Set TempPoint[1] = (TempPoint[0] offset by S_Speed[S_Index[3]] towards S_Angle[S_Index[3]] degrees)
  • Unit - Move S_Unit[S_Index[3]] instantly to TempPoint[1]
  • -------- -------------------- --------
  • Custom script: set h1 = GetLocationZ(udg_TempPoint[0])
  • Custom script: set h2 = GetLocationZ(udg_TempPoint[1])
  • Custom script: call SetUnitFlyHeight(udg_S_Unit[udg_S_Index[3]], 40.0, 0.0)
  • Custom script: call SetUnitFlyHeight(udg_S_Unit[udg_S_Index[3]], (GetUnitFlyHeight(udg_S_Unit[udg_S_Index[3]]) + h1) - h2, 0.0)
  • -------- -------------------- --------
  • Custom script: call RemoveLocation(udg_TempPoint[0])
  • Custom script: call RemoveLocation(udg_TempPoint[1])
 
Status
Not open for further replies.
Top