• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

how to lock the missile unit flying height?

Status
Not open for further replies.
Level 17
Joined
Nov 13, 2006
Messages
1,814
i got a problem, i make a dummy unit with arrow model but idk how to lock his height.

i tryed this but dont work:

(acctually i calculate the next point height)

uc = missile unit
z1 = 256

JASS:
        set loc = GetUnitLoc(uc)
        set z = GetLocationZ(loc)
        call SetUnitPosition(uc, x, y)
        call SetUnitFlyHeight(u,(90.00+z1-z),0)
    call DisplayTextToForce( GetPlayersAll(), "z="+ R2S(z) + "    z1="+ R2S(z1) )

but arrows allways going to 90 height even text show z=0 and z1=256

main goal is if i fire out the arrow from a hill example then keep it in that height and dont fall down
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Set dummy's movement type to none and movement height to 0 in object editor.

When you create the dummy, Add/remove Strom Crow ability to/from the unit. The raw code is 'Arav'. Also set the flying height to desired height.

In the looping part:
loc1 = oldPos
loc2 = newPos
Set flying height of unit to Current height - (newZ-oldZ)
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
Set dummy's movement type to none and movement height to 0 in object editor.

When you create the dummy, Add/remove Strom Crow ability to/from the unit. The raw code is 'Arav'. Also set the flying height to desired height.

In the looping part:
loc1 = oldPos
loc2 = newPos
Set flying height of unit to Current height - (newZ-oldZ)

ok now arrow falling down then flying up when i cast it from cliff to water direction

i uploaded the demo map, there paladin - phoenix wings ability
 

Attachments

  • a_new_spellPack.w3x
    74.4 KB · Views: 52
Level 17
Joined
Nov 13, 2006
Messages
1,814
If it is for your own project then I recommend not using cliffs, they don't look that good.

If you really want to use cliffs, then compensate the cliff height when the unit is above water, as the method works correctly on non-water cliffs.

A cliff is 128 tall.

i tryed this but still have problem when unit is on edge of cliff before enter to water area, also when he coming out

if GetTerrainCliffLevel(GetUnitX(uc), GetUnitY(uc)) == 0 then
set z1 = z1 + 32//i tryed more number
endif

for miscdata.txt hieght trick dont need cliff? i mean to that where u can make mountaints and huge slopes (idk if this is the right word)
 
Status
Not open for further replies.
Top