Hello everyone, I have a problem with a system.
To explain, I have units with icons models, which pretend to be buttons in a full-screen menu, so I need to represent the items of the hero of a particular hero, in these units-icons. I am looking for the way to be able to link or bind a type of object, so that it corresponds to a particular type of unit, such that, for example, the Mana Potion Object, is represented by a unit that is modeled on the Object icon Mana Potion.
I tried to somehow store the item in slot 1 of inventory, and by means of previously configured variables, assign a unit-icons to a number, and somehow bind them but I can not solve it. I tried the following method but I am looking for some alternative form that does not occupy the Item Level:
To explain, I have units with icons models, which pretend to be buttons in a full-screen menu, so I need to represent the items of the hero of a particular hero, in these units-icons. I am looking for the way to be able to link or bind a type of object, so that it corresponds to a particular type of unit, such that, for example, the Mana Potion Object, is represented by a unit that is modeled on the Object icon Mana Potion.
I tried to somehow store the item in slot 1 of inventory, and by means of previously configured variables, assign a unit-icons to a number, and somehow bind them but I can not solve it. I tried the following method but I am looking for some alternative form that does not occupy the Item Level:
Code:
function Trig_SET_SLOT_1_Actions takes nothing returns nothing
set udg_NAME_SLOT1 = GetItemLevel(UnitItemInSlotBJ(udg_HERO, 1))
set udg_UNIT_ITEMTYPE[1] = 'Hpal'
set udg_UNIT_ITEMTYPE[2] = 'Hamg'
set udg_UNIT_ITEMTYPE[3] = 'Hblm'
call CreateNUnitsAtLoc( 1, udg_UNIT_ITEMTYPE[udg_NAME_SLOT1], Player(0), GetRectCenter(GetPlayableMapRect()), bj_UNIT_FACING )
endfunction
//===========================================================================
function InitTrig_SET_SLOT_1 takes nothing returns nothing
set gg_trg_SET_SLOT_1 = CreateTrigger( )
call TriggerAddAction( gg_trg_SET_SLOT_1, function Trig_SET_SLOT_1_Actions )
endfunction