• 🏆 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!

Multiboard not showing?

Status
Not open for further replies.
JASS:
globals
multiboard NORMALMB
multiboard array STATSMB
endglobals

function Trig_GoblinEnterUpdate_Conditions takes nothing returns boolean
    return IsPlayerAlly(GetTriggerPlayer(), Player(0))
endfunction

function Trig_GoblinEnterUpdate_Actions takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local integer pi = GetPlayerId(GetOwningPlayer(u))
    local multiboarditem mbi
    local integer EXITWHEN = 0
    call ShowUnit(u, false)
    set mbi = MultiboardGetItem(STATSMB[pi], 1, 1)
    call MultiboardSetItemValue(mbi, "Name")
    call MultiboardSetItemStyle(mbi, true, false)
    call MultiboardReleaseItem(mbi)
    set mbi = MultiboardGetItem(STATSMB[pi], 1, 2)
    call MultiboardSetItemValue(mbi, "Slot")
    call MultiboardSetItemStyle(mbi, true, false)
    call MultiboardReleaseItem(mbi)
    set mbi = MultiboardGetItem(STATSMB[pi], 1, 3)
    call MultiboardSetItemValue(mbi, "Damage")
    call MultiboardSetItemStyle(mbi, true, false)
    call MultiboardReleaseItem(mbi)
    set mbi = MultiboardGetItem(STATSMB[pi], 1, 4)
    call MultiboardSetItemValue(mbi, "Cooldown")
    call MultiboardSetItemStyle(mbi, true, false)
    call MultiboardReleaseItem(mbi)
    set mbi = MultiboardGetItem(STATSMB[pi], 1, 5)
    call MultiboardSetItemValue(mbi, "Range")
    call MultiboardSetItemStyle(mbi, true, false)
    call MultiboardReleaseItem(mbi)
    //Item widths
    loop
        exitwhen EXITWHEN == 5
        set mbi = MultiboardGetItem(STATSMB[pi], EXITWHEN, 1)
        call MultiboardSetItemWidth(mbi, .25)
        call MultiboardReleaseItem(mbi)
        set mbi = MultiboardGetItem(STATSMB[pi], EXITWHEN, 2)
        call MultiboardSetItemWidth(mbi, .25)
        call MultiboardReleaseItem(mbi)
        set mbi = MultiboardGetItem(STATSMB[pi], EXITWHEN, 3)
        call MultiboardSetItemWidth(mbi, .1)
        call MultiboardReleaseItem(mbi)
        set mbi = MultiboardGetItem(STATSMB[pi], EXITWHEN, 4)
        call MultiboardSetItemWidth(mbi, .1)
        call MultiboardReleaseItem(mbi)
        set mbi = MultiboardGetItem(STATSMB[pi], EXITWHEN, 5)
        call MultiboardSetItemWidth(mbi, .1)
        call MultiboardReleaseItem(mbi)
        set EXITWHEN = EXITWHEN + 1
    endloop
    if GetLocalPlayer() == GetOwningPlayer(u) then
        call MultiboardDisplay(NORMALMB, false)
        call MultiboardDisplay(STATSMB[pi], true)
    endif
endfunction

function EnterUpdate_Init2 takes nothing returns nothing
    local integer LOOP = 0
    loop
        exitwhen LOOP == 11
        set LOOP = LOOP + 1
        set STATSMB[LOOP] = CreateMultiboard()
        call MultiboardSetColumnCount(STATSMB[LOOP], 6)
        call MultiboardSetRowCount(STATSMB[LOOP], 6)
        call MultiboardSetTitleText(STATSMB[LOOP], "Parts&stats") 
    endloop
endfunction

//===========================================================================
function InitTrig_GoblinEnterUpdate takes nothing returns nothing
    set gg_trg_GoblinEnterUpdate = CreateTrigger(  )
    call TimerStart(CreateTimer(), 0.01, false, function EnterUpdate_Init2)
    call TriggerRegisterEnterRectSimple( gg_trg_GoblinEnterUpdate, gg_rct_HeroChange_goblins )
    //call TriggerAddCondition( gg_trg_GoblinEnterUpdate, Condition( function Trig_GoblinEnterUpdate_Conditions ) )
    call TriggerAddAction( gg_trg_GoblinEnterUpdate, function Trig_GoblinEnterUpdate_Actions )
endfunction

Basically i've been just playing around, and this isn't working, it's not even displaying the multiboard.

Thanks.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
You don't need to use a 0.01 timer, you can just use a 0.00 non-repeating timer.

You haven't really given any information other than the multiboard doesn't display. Have you tried putting debug messages in your code to narrow down where the problem is coming from? Try putting one inside the GetLocalPlayer() if-statement, and see if that is even being executed.
 
Status
Not open for further replies.
Top