Units Z axis

envenger

Active Member
Reaction score
3
Hi guys... im back to worldeditor after a long time i have forgotten a lot of things

Can the height(z axis) of a non flying unit be set.
If so how?
 

Sgqvur

FullOfUltimateTruthsAndEt ernalPrinciples, i.e shi
Reaction score
62
You need to give the unit an ability in order to make it able to fly. I think it was called 'Amrf'.

JASS:
globals
LocationZ = Location(0.0, 0.0)
endglobals

function GetUnitZ takes unit u returns real
    call MoveLocation( LocationZ ,GetUnitX(u),GetUnitY(u) )
    return GetLocationZ(LocationZ) + GetUnitFlyHeight(u)
endfunction

function SetUnitZ takes unit u,real z returns nothing
    // UnitAddAbility(u, 'Amrf') 
    call MoveLocation( LocationZ ,GetUnitX(u),GetUnitY(u) )
    call SetUnitFlyHeight(u,z-GetLocationZ(LocationZ),0)
    // UnitRemoveAbility(u, 'Amrf')
endfunction


After googling a bit I found those from http://www.wc3c.net/showthread.php?t=96302, also there it was mentioned that those should be inlined but anyways. Welcome back I guess =).

PS: GetLocationZ can cause a desync.
 

envenger

Active Member
Reaction score
3
Thanks...
Im not on pc, i would see it.
What is desync? Btw


edit.....

What would happen if the ability is given then, unit is lifted to a height then the flying ability is removed?
 

Sgqvur

FullOfUltimateTruthsAndEt ernalPrinciples, i.e shi
Reaction score
62
>What would happen if the ability is given then, unit is lifted to a height then the flying ability is removed?

Once you give the ability you can't take it away even with UnitRemoveAbility so you only need to give it once to each unit to make it fly[able].

>What is desync
Basically the game disconnects the players and only the "host" is left playing in it which is probably not what he wants.
 

NeuroToxin

New Member
Reaction score
46
Give a unit Crow Form, remove it, and then set the flying height as desired, its a bug with World Editor, its Medev's crow form also.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top