HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

multiboard bug

08-13-2008, 07:20 PM#1
Razernok
I'm working on a multiboard for my new rpg. Problem is that the width won't change.
For example, row 1 column 1 was set to a width of 20 and it didn't even change in size.
I've posted my code below:
Collapse JASS:
function multiboard_setup takes nothing returns nothing
    local integer i = 0
    local integer r = 1
    local integer t = 1
    call TriggerSleepAction( 0.00 )

    loop
        exitwhen i > 10
        set udg_CombatLog[i] = CreateMultiboardBJ( 1, 10, "Combat Log" )
        set udg_CharacterInfo[i] = CreateMultiboardBJ( 4, 25, "Character Info"+I2S(i))
        loop
            exitwhen r > 10
            call MultiboardSetItemStyleBJ( udg_CombatLog[i], 1, r, true, false )
            call MultiboardSetItemWidthBJ( udg_CombatLog[i], 1, r, 20 )
            set r = r + 1
        endloop

        set r = 1
        set t = 1
        loop
            exitwhen r > 4
            loop
                exitwhen t > 25
                call MultiboardSetItemStyleBJ( udg_CharacterInfo[i], r, t, true, true )
                set t = t + 1
            endloop
            set r = r + 1
        endloop

    //Sets width for Character Info
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 1, 1, "Name")
    call MultiboardSetItemWidthBJ( udg_CharacterInfo[i], 1, 1, 20)

    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 1, 2, "Level")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 1, 3, "Class")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 1, 4, " ")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 1, 5, "Strength")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 1, 6, "Agility")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 1, 7, "Stamina")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 1, 8, "Intellect")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 1, 9, "Spirit")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 1, 10, " ")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 1, 11, "Melee")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 1, 12, "Damage")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 1, 13, "Speed")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 1, 14, "Power")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 1, 15, "Hit Rating")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 1, 16, "Crit Chance")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 1, 17, "Expertise")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 1, 18, " ")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 1, 19, "Spell")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 1, 20, "Bonus Damage")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 1, 21, "Bonus Healing")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 1, 22, "Hit Rating")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 1, 23, "Crit Chance")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 1, 24, "Haste Rating")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 1, 25, "Mana Regen")

    //Resistances
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 3, 5, "Arcane")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 3, 6, "Fire")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 3, 7, "Nature")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 3, 8, "Frost")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 3, 9, "Shadow")

    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 3, 10, " ")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 3, 11, "Ranged")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 3, 12, "Damage")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 3, 13, "Speed")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 3, 14, "Power")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 3, 15, "Hit Rating")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 3, 16, "Crit Chance")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 3, 17, " ")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 3, 18, " ")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 3, 19, "Defenses")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 3, 20, "Armor")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 3, 21, "Defense")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 3, 22, "Dodge")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 3, 23, "Parry")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 3, 24, "Block")
    call MultiboardSetItemValueBJ( udg_CharacterInfo[i], 3, 25, "Resilience")
//######################################################################

        call MultiboardDisplayBJ( false, udg_CombatLog[i] )
        call MultiboardDisplayBJ( false, udg_CharacterInfo[i] )
        set i = i + 1
    endloop

    set i = 0
    loop
        exitwhen i > 10
        if ConvertedPlayer(i) == GetLocalPlayer() then
            call MultiboardDisplayBJ( true, udg_CharacterInfo[i] )
        endif
        set i = i + 1
    endloop
endfunction
08-13-2008, 07:34 PM#2
Blubb-Tec
did you already try other things? like changing the width of other items, or changing the width to something smaller/bigger than 20?
Also you might try using 20.0 (or only 20. ) instead of 20, but since the function MultiboardSetItemWidthBJ takes a real as an argument it should be converted anyway.. still, trying it won't hurt you =)
08-13-2008, 07:55 PM#3
Troll-Brain
If you use the BJ function a 0 parameter will be apply for all column/row.
Did you try to minimize / enlarge the multiboard after the change, i dunno if it change something, just test yourself.
08-13-2008, 08:16 PM#4
Razernok
I've tried values bigger and smaller then 20 and I've also tried doing them in the form of 20.0 and 20.00
08-13-2008, 08:29 PM#5
Strilanc
Try hiding and re-showing the multiboard.
08-13-2008, 08:33 PM#6
Razernok
If you didn't notice, it hide and re-shows the board at the end of the function.
08-13-2008, 09:26 PM#7
Strilanc
Oh, I apologize then.

Keep in mind you don't need that loop to do it. You just need:
Collapse JASS:
call MultiboardDisplayBJ(true, udg_CharacterInfo[GetConvertedPlayerId(GetLocalPlayer())])

You need a set r = 1 before that first loop involving r.
You need a set t = 1 before that inner loop with exitwhen t > 25 [it's currently before the r-loop, which is incorrect].

I'm also pretty sure there are weird constraints on width when all the rows don't have the same total width. Make sure each row adds up to the multiboard's width.
08-14-2008, 12:45 AM#8
Razernok
I'm still unable to get it to work right.
08-14-2008, 01:47 AM#9
Ammorth
Sometimes you have to minimize and then maximize the board for the widths to take effect. I believe there are functions to do so.

Its amazing really, I know of 3 multiboard errors off the top of my head, and yet multiboards want to be one of the most versatile objects in warcraft 3.
08-14-2008, 01:52 AM#10
Razernok
In case you didn't notice it in my code. I hide the multiboard then show it.
08-14-2008, 02:06 AM#11
Ammorth
Quote:
Originally Posted by Razernok
In case you didn't notice it in my code. I hide the multiboard then show it.

Collapse JASS:
function MultiboardMinimizeBJ takes boolean minimize, multiboard mb returns nothing
    call MultiboardMinimize(mb, minimize)
endfunction

Use either the BJ or the direct, you're option. This doesn't hide the board, only minimizes and maximizes (via true/false).
08-14-2008, 03:09 AM#12
Darthfett
Collapse JASS:
    set i = 0
    loop
        exitwhen i > 10
        if ConvertedPlayer(i) == GetLocalPlayer() then
            call MultiboardDisplayBJ( true, udg_CharacterInfo[i] )
        endif
        set i = i + 1
    endloop
endfunction


That should be:

Collapse JASS:
    set i = 0
    loop
        exitwhen i > 10
        if Player(i) == GetLocalPlayer() then
            call MultiboardDisplayBJ( true, udg_CharacterInfo[i] )
        endif
        set i = i + 1
    endloop
endfunction

Otherwise the first time around, the loop starts with Player(-1) (which would probably crash WCIII).