HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

No symbols in strings?

09-11-2010, 08:19 PM#1
Ignitedstar
Is it just me or I can't put symbols like (, ), and % in strings? It seems to work fine at map start up, but it doesn't look like any of the symbols work as the string changes in-game. I find that strange.

Click image for larger version

Name:	Grid - Stat Board.JPG
Views:	32
Size:	17.2 KB
ID:	49604

That's how it looks like when at map start up. Of course, as I try to change the string even as the "%" symbol is there, it doesn't ever reappear. I know it's a small detail, but I want to know if there's confirmation on this? If it's something that I can't fix, I'll find another way to represent the same data.
Attached Images
File type: jpgGrid - Stat Board.JPG (17.2 KB)
09-11-2010, 11:28 PM#2
Anitarf
Can we see your code that sets up the initial values as well as the code that is supposed to change the values later?
09-12-2010, 12:31 AM#3
SanKakU
hmmm...could you use string suffix and prefix for that? keep the suffix and prefix whatever you need it as, and never change it, just change the actual value. i saw that in jBoard multiboard system...i can send you the code if you like...although...i think it's in my map that i pointed out to you. but of course i recruited that jBoard to a map that doesn't really need it, i guess...i just think it's easier to use than not use it :) in my other maps we'll see use of the suffix and prefix which i didn't use in TDHT i think...
09-12-2010, 09:29 AM#4
DioD
"%%" for "%"

"\" for "
09-13-2010, 01:17 AM#5
Ignitedstar
Sure, Anitarf. It's a basic function that calls and sets up everything for the multiboard.
Collapse JASS:
globals
    multiboard StatsBoard
    multiboard DamageBoard
endglobals

function Trig_Stats_Multiboard_Actions takes nothing returns nothing
    set StatsBoard = CreateMultiboard()
    call MultiboardDisplay(StatsBoard, true)
    call MultiboardMinimize(StatsBoard, true)
    call MultiboardSetTitleText(StatsBoard, "Unit Stats")
    call MultiboardSetRowCount(StatsBoard, 10)
    call MultiboardSetColumnCount(StatsBoard, 5)
    call MultiboardSetItemWidthBJ(StatsBoard, 0, 0, 1.1)
    call MultiboardSetItemWidthBJ(StatsBoard, 2, 0, 7.)
    call MultiboardSetItemWidthBJ(StatsBoard, 3, 0, 4.)
    call MultiboardSetItemWidthBJ(StatsBoard, 4, 0, 3.5)
    call MultiboardSetItemWidthBJ(StatsBoard, 5, 0, 3.)
    call MultiboardSetItemStyleBJ(StatsBoard, 1, 0, false, true)
    call MultiboardSetItemStyleBJ(StatsBoard, 2, 0, true, false)
    call MultiboardSetItemStyleBJ(StatsBoard, 3, 0, true, false)
    call MultiboardSetItemStyleBJ(StatsBoard, 4, 0, true, false)
    call MultiboardSetItemStyleBJ(StatsBoard, 5, 0, true, false)
    call MultiboardSetItemIconBJ(StatsBoard, 1, 1, "ReplaceableTextures\\CommandButtons\\BTNSelectHeroOn.blp")
    call MultiboardSetItemIconBJ(StatsBoard, 1, 2, "ReplaceableTextures\\CommandButtons\\BTNStatUp.blp")
    call MultiboardSetItemIconBJ(StatsBoard, 1, 3, "ReplaceableTextures\\CommandButtons\\BTNCommand.blp")
    call MultiboardSetItemIconBJ(StatsBoard, 1, 4, "ReplaceableTextures\\CommandButtons\\BTNDefend.blp")
    call MultiboardSetItemIconBJ(StatsBoard, 1, 5, "ReplaceableTextures\\CommandButtons\\BTNBrilliance.blp")
    call MultiboardSetItemIconBJ(StatsBoard, 1, 6, "ReplaceableTextures\\CommandButtons\\BTNSpellShieldAmulet.blp")
    call MultiboardSetItemIconBJ(StatsBoard, 1, 7, "ReplaceableTextures\\CommandButtons\\BTNMarksmanship.blp")
    call MultiboardSetItemIconBJ(StatsBoard, 1, 8, "ReplaceableTextures\\CommandButtons\\BTNEvasion.blp")
    call MultiboardSetItemIconBJ(StatsBoard, 1, 9, "ReplaceableTextures\\CommandButtons\\BTNSlippersOfAgility.blp")
    call MultiboardSetItemIconBJ(StatsBoard, 1,10, "ReplaceableTextures\\CommandButtons\\BTNTransmute.blp")
    call MultiboardSetItemValueBJ(StatsBoard, 2, 1, "Unit Name")
    call MultiboardSetItemValueBJ(StatsBoard, 2, 2, "Stats")
    call MultiboardSetItemValueBJ(StatsBoard, 2, 3, "Strength")
    call MultiboardSetItemValueBJ(StatsBoard, 2, 4, "Defense")
    call MultiboardSetItemValueBJ(StatsBoard, 2, 5, "Magic")
    call MultiboardSetItemValueBJ(StatsBoard, 2, 6, "Resistance")
    call MultiboardSetItemValueBJ(StatsBoard, 2, 7, "Accuracy")
    call MultiboardSetItemValueBJ(StatsBoard, 2, 8, "Evasion")
    call MultiboardSetItemValueBJ(StatsBoard, 2, 9, "Speed")
    call MultiboardSetItemValueBJ(StatsBoard, 2,10, "Luck")
    call MultiboardSetItemValueBJ(StatsBoard, 3, 1, "Class")
    call MultiboardSetItemValueBJ(StatsBoard, 3, 2, "Value")
    call MultiboardSetItemValueBJ(StatsBoard, 3, 3, "---")
    call MultiboardSetItemValueBJ(StatsBoard, 3, 4, "---")
    call MultiboardSetItemValueBJ(StatsBoard, 3, 5, "---")
    call MultiboardSetItemValueBJ(StatsBoard, 3, 6, "---")
    call MultiboardSetItemValueBJ(StatsBoard, 3, 7, "---")
    call MultiboardSetItemValueBJ(StatsBoard, 3, 8, "---")
    call MultiboardSetItemValueBJ(StatsBoard, 3, 9, "---")
    call MultiboardSetItemValueBJ(StatsBoard, 3,10, "---")
    call MultiboardSetItemValueBJ(StatsBoard, 4, 2, "Grid")
    call MultiboardSetItemValueBJ(StatsBoard, 4, 3, "+0")
    call MultiboardSetItemValueBJ(StatsBoard, 4, 4, "+0")
    call MultiboardSetItemValueBJ(StatsBoard, 4, 5, "+0")
    call MultiboardSetItemValueBJ(StatsBoard, 4, 6, "+0")
    call MultiboardSetItemValueBJ(StatsBoard, 4, 7, "+0")
    call MultiboardSetItemValueBJ(StatsBoard, 4, 8, "+0")
    call MultiboardSetItemValueBJ(StatsBoard, 4, 9, "+0")
    call MultiboardSetItemValueBJ(StatsBoard, 4,10, "+0")
    call MultiboardSetItemValueBJ(StatsBoard, 5, 2, "Bonus")
    call MultiboardSetItemValueBJ(StatsBoard, 5, 3, "+0")
    call MultiboardSetItemValueBJ(StatsBoard, 5, 4, "+0")
    call MultiboardSetItemValueBJ(StatsBoard, 5, 5, "+0")
    call MultiboardSetItemValueBJ(StatsBoard, 5, 6, "+0")
    call MultiboardSetItemValueBJ(StatsBoard, 5, 7, "+0")
    call MultiboardSetItemValueBJ(StatsBoard, 5, 8, "+0")
    call MultiboardSetItemValueBJ(StatsBoard, 5, 9, "+0")
    call MultiboardSetItemValueBJ(StatsBoard, 5,10, "+0")
    call MultiboardSetTitleText(DamageBoard, "Damage Window")
    call MultiboardSetRowCount(DamageBoard, 5)
    call MultiboardSetColumnCount(DamageBoard, 5)
    call MultiboardSetItemWidthBJ(DamageBoard, 0, 0, 1.1)
    call MultiboardSetItemWidthBJ(DamageBoard, 2, 0, 3.)
    call MultiboardSetItemWidthBJ(DamageBoard, 3, 0, 1.1)
    call MultiboardSetItemWidthBJ(DamageBoard, 4, 0, 3.)
    call MultiboardSetItemWidthBJ(DamageBoard, 5, 0, 1.1)
    call MultiboardSetItemStyleBJ(DamageBoard, 1, 0, false, false)
    call MultiboardSetItemStyleBJ(DamageBoard, 1, 1, false, true)
    call MultiboardSetItemStyleBJ(DamageBoard, 2, 0, true, false)
    call MultiboardSetItemStyleBJ(DamageBoard, 2, 1, false, false)
    call MultiboardSetItemStyleBJ(DamageBoard, 3, 0, false, true)
    call MultiboardSetItemStyleBJ(DamageBoard, 3, 1, true, false)
    call MultiboardSetItemStyleBJ(DamageBoard, 4, 0, true, false)
    call MultiboardSetItemStyleBJ(DamageBoard, 4, 1, false, false)
    call MultiboardSetItemStyleBJ(DamageBoard, 5, 0, false, false)
    call MultiboardSetItemStyleBJ(DamageBoard, 5, 1, false, true)
    call MultiboardSetItemValueBJ(DamageBoard, 1, 0, "---")
    call MultiboardSetItemValueBJ(DamageBoard, 2, 0, "---")
    call MultiboardSetItemValueBJ(DamageBoard, 4, 0, "---")
    call MultiboardSetItemValueBJ(DamageBoard, 5, 0, "---")
    call MultiboardSetItemIconBJ(DamageBoard, 3, 1, "VS")
    call MultiboardSetItemIconBJ(DamageBoard, 3, 2, "ReplaceableTextures\\CommandButtons\\BTNFlare.blp")
    call MultiboardSetItemIconBJ(DamageBoard, 3, 3, "ReplaceableTextures\\CommandButtons\\BTNArcaniteMelee.blp")
    call MultiboardSetItemIconBJ(DamageBoard, 3, 4, "ReplaceableTextures\\CommandButtons\\BTNMarksmanship.blp")
    call MultiboardSetItemIconBJ(DamageBoard, 3, 5, "ReplaceableTextures\\CommandButtons\\BTNCriticalStrike.blp")
endfunction

//===========================================================================
function InitTrig_Stats_Multiboard takes nothing returns nothing
    set gg_trg_Stats_Multiboard = CreateTrigger()
    call TriggerRegisterTimerEventSingle(gg_trg_Stats_Multiboard, 0.)
    call TriggerAddAction(gg_trg_Stats_Multiboard, function Trig_Stats_Multiboard_Actions)
endfunction
That sets up everything. This is the function that changes the values.
Collapse JASS:
    if GetOwningPlayer(GetTriggerUnit()) == Player(15) then
        set i = GetUnitTypeId(c) - 'n000'
        call MultiboardSetItemValueBJ(StatsBoard, 3, 1, GetUnitName(c))
        if STRT[i] > 0 then
            call MultiboardSetItemValueBJ(StatsBoard, 4, 3, "|cff33ff33+" + I2S(R2I(STRT[i])) + "%|r")
        elseif STRT[i] < 0 then
            call MultiboardSetItemValueBJ(StatsBoard, 4, 3, "|cffff3333" + I2S(R2I(STRT[i])) + "%|r")
        else
            call MultiboardSetItemValueBJ(StatsBoard, 4, 3, "+0%")
        endif
        if DEFT[i] > 0 then
            call MultiboardSetItemValueBJ(StatsBoard, 4, 4, "|cff33ff33+" + I2S(R2I(DEFT[i])) + "%|r")
        elseif DEFT[i] < 0 then
            call MultiboardSetItemValueBJ(StatsBoard, 4, 4, "|cffff3333" + I2S(R2I(DEFT[i])) + "%|r")
        else
            call MultiboardSetItemValueBJ(StatsBoard, 4, 4, "+0%")
        endif
        if MAGT[i] > 0 then
            call MultiboardSetItemValueBJ(StatsBoard, 4, 5, "|cff33ff33+" + I2S(R2I(MAGT[i])) + "%|r")
        elseif MAGT[i] < 0 then
            call MultiboardSetItemValueBJ(StatsBoard, 4, 5, "|cffff3333" + I2S(R2I(MAGT[i])) + "%|r")
        else
            call MultiboardSetItemValueBJ(StatsBoard, 4, 5, "+0%")
        endif
        if REST[i] > 0 then
            call MultiboardSetItemValueBJ(StatsBoard, 4, 6, "|cff33ff33+" + I2S(R2I(REST[i])) + "%|r")
        elseif REST[i] < 0 then
            call MultiboardSetItemValueBJ(StatsBoard, 4, 6, "|cffff3333" + I2S(R2I(REST[i])) + "%|r")
        else
            call MultiboardSetItemValueBJ(StatsBoard, 4, 6, "+0%")
        endif
        if ACCT[i] > 0 then
            call MultiboardSetItemValueBJ(StatsBoard, 4, 7, "|cff33ff33+" + I2S(R2I(ACCT[i])) + "%|r")
        elseif ACCT[i] < 0 then
            call MultiboardSetItemValueBJ(StatsBoard, 4, 7, "|cffff3333" + I2S(R2I(ACCT[i])) + "%|r")
        else
            call MultiboardSetItemValueBJ(StatsBoard, 4, 7, "+0%")
        endif
        if EVAT[i] > 0 then
            call MultiboardSetItemValueBJ(StatsBoard, 4, 8, "|cff33ff33+" + I2S(R2I(EVAT[i])) + "%|r")
        elseif EVAT[i] < 0 then
            call MultiboardSetItemValueBJ(StatsBoard, 4, 8, "|cffff3333" + I2S(R2I(EVAT[i])) + "%|r")
        else
            call MultiboardSetItemValueBJ(StatsBoard, 4, 8, "+0%")
        endif
        if SPDT[i] > 0 then
            call MultiboardSetItemValueBJ(StatsBoard, 4, 9, "|cff33ff33+" + I2S(R2I(SPDT[i])) + "%|r")
        elseif SPDT[i] < 0 then
            call MultiboardSetItemValueBJ(StatsBoard, 4, 9, "|cffff3333" + I2S(R2I(SPDT[i])) + "%|r")
        else
            call MultiboardSetItemValueBJ(StatsBoard, 4, 9, "+0%")
        endif
        if LCKT[i] > 0 then
            call MultiboardSetItemValueBJ(StatsBoard, 4,10, "|cff33ff33+" + I2S(R2I(LCKT[i])) + "%|r")
        elseif LCKT[i] < 0 then
            call MultiboardSetItemValueBJ(StatsBoard, 4,10, "|cffff3333" + I2S(R2I(LCKT[i])) + "%|r")
        else
            call MultiboardSetItemValueBJ(StatsBoard, 4,10, "+0%")
        endif
    endif
Hmm... So I have to do double % symbols? I'll try that out right now.

EDIT: Wow, it worked. Thanks DioD. <3<3
09-13-2010, 08:22 AM#6
Anitarf
Wait, you said the % worked fine at map startup, but your initialization function doesn't have any % in it at all.
09-14-2010, 02:35 PM#7
Ignitedstar
Oh, that. That function was before DoiD made his suggestion. I got rid of the percents because I didn't think there was any way to fix the string problem and it looked undesirable seeing percent symbols at first only to see them disappear on the next grid space you clicked on.