unittype compile issue (probably really simple)

Darg

Administrator
Reaction score
49
ok, I'm tired, it's been a long day, and I can't figure out what the heck is wrong.

This trigger:

JASS:
function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
    local unittype someUnitType = udg_someUnitType
endfunction

//===========================================================================
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
    set gg_trg_Untitled_Trigger_001 = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Untitled_Trigger_001, function Trig_Untitled_Trigger_001_Actions )
endfunction


doesn't compile.

The error is "Type mismatch in assignment" for the local unittype declaration.

To double check if I was doing anything silly, I even copied and pasted a similar line from here:

http://www.thehelper.net/forums/showthread.php?t=84907&highlight=unittype

This line:

JASS:
local unittype MobSpawn = GetUnitTypeId(GetDyingUnit())

But this doesn't compile for me either !

Anyone see what might be wrong here ? If I comment out the unittype declaration then it compiles ok.
 

Trollvottel

never aging title
Reaction score
262
unittype is afaik the classification (UNIT_TYPE_HERO, UNIT_TYPE_STRUCTURE etc)

the GUI-unittype is in jass an integer number like 'h001' (rawcode)

to the link: what ghan wrote is wrong
 

Darg

Administrator
Reaction score
49
ok thanks, your advice helped.....I didn't realise that the GUI-based unit-type is really an integer....explains everything.
 
Reaction score
456
.. just use "integer" instead of "unittype". :)

>I think I *must* be tired
I totally agree.

EDIT//: Onoz just too late xP
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top