• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[JASS] Simple Math Question

Status
Not open for further replies.
Level 19
Joined
Aug 16, 2007
Messages
881
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.
 
Level 19
Joined
Aug 16, 2007
Messages
881
That's exactly how I do it, I can give you the actions.

  • Custom script: set h = GetLocationZ(udg_TempPoint[0])
  • Custom script: call SetUnitFlyHeight(udg_S_Unit[udg_S_Index[3]], (GetUnitFlyHeight(udg_S_Unit[udg_S_Index[3]]) - h) + 75, 0.0)
I have no idea why it won't work, and the bullet glides on the ground...
 
Level 19
Joined
Aug 16, 2007
Messages
881
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