Unit-type Problem

sevensc

New Member
Reaction score
8
I have a trigger that replaces a unit using the line:
Code:
call ReplaceUnitBJ( tempUnit, 'n00D', bj_UNIT_STATE_METHOD_ABSOLUTE )

But whenever I try and use a variable in the place of 'n00D', the unit doesn't get replaced - it simply disappears.

I've tried using variable types "unit-type" and "integer', both with the same result.

Should I be using a different variable type? Is there some trick to unit type variables? Thanks for any help.
 

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
Code:
function Example takes nothing returns nothing
    local unit uTrigger   = GetTriggerUnit()
    local integer rawCode = [B]GetUnitTypeId(uTrigger)[/B]
    call ReplaceUnitBJ( bj_lastCreatedUnit, rawCode, bj_UNIT_STATE_METHOD_ABSOLUTE )
endfunction

The ReplaceUnitBJ takes unit whichUnit, integer newUnitId and integer UnitStateMethod as arguments. Technically, unit-type variables are integer variables.

Try using an integer variable again. Make sure the rawcode actually exists you are trying to input.
 

sevensc

New Member
Reaction score
8
How is it that I'm even supposed to enter 'n00D' as an integer?

And yes, the rawcode exists. 'n00D' works.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top