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

Metamorphosis/Bear form ability with paused unit problem

Status
Not open for further replies.
Level 17
Joined
Nov 13, 2006
Messages
1,814
[Solved]Metamorphosis/Bear form ability with paused unit problem

why dont transform the unit if i unpause at begining of function, order for metamorphosis and pause at end?

(unit is correct if i checked with GetUnitName and wrote to screen also if work well just unit dont make the order even i used call TriggerSleepAction(1) before pause back :/)
JASS:
function RemoveAttachment takes integer pl, integer opt returns nothing
    local unit u = udg_Hero[pl]
    local integer x = 10000 * pl
    local integer a = 'A00C'
    local integer a1 = 'A00D'
    local integer w = LoadInteger(udg_Stat_Table, x + 3, 99 )
    if udg_Camera_Lock[pl] then
      if IsUnitPaused(u) then
        call PauseUnit(u, false)
      endif
    endif
        //destroy few special effect

    call UnitAddAbility( u, a )
    call IssueImmediateOrder( u, "bearform" )
    call UnitRemoveAbility( u, a )

    if w>=900 and w < 950 then
        if ( GetUnitTypeId( u ) == 'H000' ) then
            call SetPlayerAbilityAvailable( Player( pl - 1 ), a1, true )
            call IssueImmediateOrder( u, "metamorphosis" )
            call SetPlayerAbilityAvailable( Player( pl - 1 ), a1, false )
        endif
    else
        if ( GetUnitTypeId( u ) == 'H001' ) then
            call SetPlayerAbilityAvailable( Player( pl - 1 ), a1, true )
            call IssueImmediateOrder( u, "metamorphosis" )
            call SetPlayerAbilityAvailable( Player( pl - 1 ), a1, false )
        endif
    endif

    if udg_Camera_Lock[pl] then
       call PauseUnit(u, true)
    endif
    set u = null
endfunction
 
Last edited:
how do you actually run this function? make sure it is run by a trigger, else TSA won't work (I believe)...

IDK, but maybe you can try to remove the disable ability line and see if it works...

if it's the bearform part, well you remove the ability so it's natural to fail, remember that the transformation is actually a passive effect... removing the ability stops the whole transformation thingy...
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
how do you actually run this function? make sure it is run by a trigger, else TSA won't work (I believe)...

IDK, but maybe you can try to remove the disable ability line and see if it works...

if it's the bearform part, well you remove the ability so it's natural to fail, remember that the transformation is actually a passive effect... removing the ability stops the whole transformation thingy...

i tryed that, it was funny coz normal unit form was paladin and alternate unit form was nightelf archer, when i removed the line then the result was the paladin, with paladin unit type but go shadowmeld (dont ask me how)

about removeing ability, it is used for instant destroy all special effect (like maker did in his demo map melee2ranged), u dont need to stay in alternate form just order, remove (=transform back to original unit type but without attachment) and for change melee too ranged we used metamorphosis trick with enable/disable

this is something like maker did just this isnt vjass.

about triggersleepaction, it worked coz text appeared later and i used in function what was in header and i called this function
 
now that's a really weird result... hmmmm... did the archer also have the metamorph ability on the OE??? it might be causing your problems...

and oh, if this is the passive transformation method, you don't really need to cast metamorph... afaik, you just disable the ability at map init, then add/remove it to toggle between the two units...
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
now that's a really weird result... hmmmm... did the archer also have the metamorph ability on the OE??? it might be causing your problems...

and oh, if this is the passive transformation method, you don't really need to cast metamorph... afaik, you just disable the ability at map init, then add/remove it to toggle between the two units...

i disabled the melee2ranged metamotphosis and if hero wear bow then enable/order/disable but for remove attachment i use bear form there i add/remove ability.

whatever, its work flawless if i use it when unit dont was unpaused in last 0.1 sec so kinda weird coz the result pretty different when i use same function :D

whatever now i made that way, when player click to exit full screen inventory then triggersleepaction 0.01 and remove all attachment/order/recreate attachment, what is better than do this remove/recreate attachment thing everytime when hero change equipment in full screen inventory.
 
Status
Not open for further replies.
Top