• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] multiboarditem?

Status
Not open for further replies.
Level 7
Joined
Mar 22, 2010
Messages
228
hey guys im making a multiboard with jass but im having some trouble here..

creation of multiboard:

JASS:
function Trig_board_Actions takes nothing returns nothing
    local multiboard m
    local multiboarditem mm
    call DisplayTextToPlayer(Player(0), 0, 0, "GAME")
    set m = CreateMultiboard()
    call MultiboardDisplay(m, true)
    call MultiboardSetColumnCount(m, 1)
    call MultiboardSetRowCount(m, 1)
    call MultiboardSetItemIcon(mm, "ReplaceableTextures\\PassiveButtons\\PASBTNStatUp.blp")
    call MultiboardSetItemValue(mm, "|c00959697|||||||||||||||||||||||||||||||||||||||||||||||||||r")
    call MultiboardSetItemWidth(mm, 15.00)
    call MultiboardSetTitleText(m, "|cffffcc00Experties Points|r")
    set udg_multi = m

    
endfunction

//===========================================================================
function InitTrig_board takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    call TriggerRegisterTimerEvent(t, 0.00, false)
    call TriggerAddAction( t, function Trig_board_Actions )
endfunction

the value changer(where error occurs):
JASS:
function Trig_score_Actions takes nothing returns nothing
    local integer i2 = 0
    local integer i
    local multiboard m = udg_multi
    set udg_ep = udg_ep + 1
    set i = udg_ep
    
    
    loop
        if i == 1 then
            call MultiboardSetItemValue(, "|c000042FF||r" + "|c00959697||||||||||||||||||||||||||||||||||||||||||||||||||r")
//my problem is the "m" there, it says cannot convert multiboard to multiboard item
//but how im going to track a multiboarditem??
//as far as i know multiboarditem can only be made is in locals
        endif
        if i == 2 then
            call MultiboardSetItemValue(m, "|c000042FF|||r" + "|c00959697|||||||||||||||||||||||||||||||||||||||||||||||||r")
        endif
        if i == 3 then
            call MultiboardSetItemValue(m, "|c000042FF||||r" + "|c00959697||||||||||||||||||||||||||||||||||||||||||||||||r")
        endif
        set i2 = 1
        exitwhen i2 == 1
    endloop

endfunction
 
JASS:
    local multiboarditem mb = MultiboardGetItem(MyMultiboard,0,3)
    call MultiboardSetItemValue(mb,"myValue")
    call MultiboardReleaseItem(mb)
    set mb = null

If you are lazy like I am, and hate multiboards and dealing with items, just use this function:
JASS:
function MultiboardSetValue takes multiboard board, integer row, integer column, string value returns nothing
    local multiboarditem mi = MultiboardGetItem(board,row,column)
    call MultiboardSetItemValue(mi,value)
    call MultiboardReleaseItem(mi)
    set mi = null
endfunction
 
Level 7
Joined
Mar 22, 2010
Messages
228
so whats with the realeaseitem?
why nulling them?

how to set the item icon to none? i mean no icon at all..
 
Last edited:
MultiboardGetItem() creates a handle. MultiboardReleaseItem() is to remove the handle when you are done using it. Setting the variable to null will allow its handle id to be recycled.

For the icon:
JASS:
native MultiboardSetItemStyle           takes multiboarditem mbi, boolean showValue, boolean showIcon returns nothing

So, you would use:
JASS:
call MultiboardSetItemStyle(mi,true,false)

Or, for all the items:
JASS:
native MultiboardSetItemsStyle          takes multiboard lb, boolean showValues, boolean showIcons returns nothing
JASS:
call MultiboardSetItemsStyle(board,true,false)
 
Status
Not open for further replies.
Top