Why wont this work =/

HailCommi

New Member
Reaction score
15
I didnt post this in the JASS forum cuz I dont think it has anything to do with it being JASS.

Code:
    local unit JumpUnitTemp
    local integer JumpCounterTemp
    set JumpUnitTemp = GetTriggerUnit()
    set JumpCounterTemp = 1
    call UnitRemoveTypeBJ( UNIT_TYPE_GROUND, JumpUnitTemp )
    call UnitAddTypeBJ( UNIT_TYPE_FLYING, JumpUnitTemp )
    loop
        exitwhen JumpCounterTemp > 25
        call SetUnitFlyHeightBJ( JumpUnitTemp, ( GetUnitFlyHeight(JumpUnitTemp) + 5.00 ), 0.00 )
        call TriggerSleepAction( 0.01 )
        set JumpCounterTemp = JumpCounterTemp + 1
    endloop

This portion of the trigger suppose to convert the triggering unit of a (begins the effect of an ability) event from a Ground type to a Flying type, then increase the fly height graphic at +5 per loop tick. However, when I try it out, nothing happens. I know the trigger is running because I've tried texting players from inside the loop and I saw it execute 25 times. So I'm wondering if any1 could shed some light on this.

btw, that TriggerSleepAction doesnt wait for 0.01. Seems like theres a minimum time that a TriggerSleepAction must wait for. Is there any way to go around this?


Thanks in advance
 

quraji

zap
Reaction score
144
I'm pretty sure the only way to reclassify a unit to 'flying' is to give it the 'Storm Crow' ability, then removing it.
 

PurgeandFire

zxcvmkgdfg
Reaction score
508
quraji is most-certainly right. There is no possible way to make a unit have a flying classification other than editing the field in the Object Editor or by adding the storm crow ability which I believe has the rawcode of "Arav". As in, A raven... lol I'm just guessing. :D

Do:
JASS:
call UnitAddAbility(JumpUnitTemp,'Arav')


The functions you are using don't even exist! I think...

-------

Also, locals can be set directly when they are created unless they are arrays. So this:
JASS:
local unit JumpUnitTemp
set JumpUnitTemp = GetTriggerUnit()


Can be this:
JASS:
local unit JumpUnitTemp = GetTriggerUnit()


Same with the other variables.

---------

The only way I know of to get past the extremely short TriggerSleepAction wait is to use a timer or PolledWait might do the trick. TriggerSleepAction has a minimum wait time of about 0.3 or 0.27. Timers can go down to like 0.0001 or something such as that. Try:
JASS:
call PolledWait(0.01)


Otherwise try the method PolledWait uses but get rid of some ugly unneeded functions.
 

HailCommi

New Member
Reaction score
15
aw thats going to be a lot of hassle. The functions I used do exist (they're converted from GUI), but I guess unit class and movement type are different things =/. So, is there any way to change the Z-offset of the graphic of a unit WITHOUT changing it to a flying unit? =/
 

PurgeandFire

zxcvmkgdfg
Reaction score
508
Just do this:
JASS:
call UnitAddAbility(JumpUnitTemp,'Arav')


And it should work. Just replace the "call UnitAddTypeBJ" and "call UnitRemoveTypeBJ" with the function above. Just in case, open the object editor, click the "Abilities" tab then click "CTRL + F". Then type "Storm Crow" and make sure it goes to the storm crow spell. Then click "EDIT - Display Fields as Rawcodes" or w/e it is. Then just make sure the ability's rawcode is 'Arav'. :)
 

HailCommi

New Member
Reaction score
15
but since storm crow is a morphing spell, I assume that I need to make a model for every unit that this thing's gonna work, cept the difference being they have flyer under movement type?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top