HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trigger: Mutliboard Custom Script Issues

09-08-2007, 05:23 PM#1
Hessgasoline
Alright everyone, I'm having a serious issue when it comes to my Multiboard display trigger. Unlike the tutorials I saw, they all had a triggering player of some sort, while I just run this script every once in a while in my code.

This code is actually written in the GUI, and worked fine until I added the custom scripts at the bottom, which are the IF statements highlighted in red.
(If Someone could explain how to get the Trigger /Trigger thing to properly work I could try posting that to see if would help someone else understand. =\

Now, I have another trigger that initializes the Multiboards, and it runs into the same problem is this trigger, and since it's worked before, I don't think it's my GUI code itself, as when I try to run this I get some error, "Expected a Name"

Now, I've tried putting udg_Temp_Integer, which is a variable created in the GUI interface thing with the little box with the fancy yellow X in it, but instead of working it crashes the entire world editor when it checks to see if the script is valid apon turning the trigger back on. Help would be appreciated. =)

Trigger:
Refresh Multiboard
Collapse Events
Time - Every 5.00 seconds of game time
Conditions
Collapse Actions
Collapse For each (Integer Temp_Integer) from 1 to 2, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Temp_Integer Equal to 1
Collapse Then - Actions
Collapse For each (Integer A) from 2 to ((Number of units in (Units owned by Player 1 (Red) matching (((Matching unit) is A Hero) Equal to True))) + 1), do (Actions)
Collapse Loop - Actions
Multiboard - Set the text for Multiboards_General[Temp_Integer] item in column 1, row (Integer A) to (Proper name of Unit_Generals_1[(Integer A)])
Multiboard - Set the text for Multiboards_General[Temp_Integer] item in column 2, row (Integer A) to (Name of Unit_Generals_1[(Integer A)])
Multiboard - Set the text for Multiboards_General[Temp_Integer] item in column 3, row (Integer A) to ((String(Unit_Group_1_Counter[(Integer A)])) + ( / + 12))
Multiboard - Set the text for Multiboards_General[Temp_Integer] item in column 4, row (Integer A) to (String((Level of Unit_Generals_1[(Integer A)])))
Multiboard - Set the width for Multiboards_General[Temp_Integer] item in column 1, row (Integer A) to 8.00% of the total screen width
Multiboard - Set the width for Multiboards_General[Temp_Integer] item in column 2, row (Integer A) to 12.00% of the total screen width
Multiboard - Set the width for Multiboards_General[Temp_Integer] item in column 3, row (Integer A) to 4.00% of the total screen width
Multiboard - Set the width for Multiboards_General[Temp_Integer] item in column 4, row (Integer A) to 2.00% of the total screen width
Collapse For each (Integer B) from 1 to 4, do (Actions)
Collapse Loop - Actions
Multiboard - Set the display style for Multiboards_General[Temp_Integer] item in column (Integer B), row 1 to Show text and Hide icons
Multiboard - Set the display style for Multiboards_General[Temp_Integer] item in column (Integer B), row (Integer A) to Show text and Hide icons
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Temp_Integer Equal to 2
Collapse Then - Actions
Collapse For each (Integer A) from 2 to ((Number of units in (Units owned by Player 2 (Blue) matching (((Matching unit) is A Hero) Equal to True))) + 1), do (Actions)
Collapse Loop - Actions
Multiboard - Set the text for Multiboards_General[Temp_Integer] item in column 1, row (Integer A) to (Proper name of Unit_Generals_2[(Integer A)])
Multiboard - Set the text for Multiboards_General[Temp_Integer] item in column 2, row (Integer A) to (Name of Unit_Generals_2[(Integer A)])
Multiboard - Set the text for Multiboards_General[Temp_Integer] item in column 3, row (Integer A) to ((String(Unit_Group_2_Counter[(Integer A)])) + ( / + 12))
Multiboard - Set the text for Multiboards_General[Temp_Integer] item in column 4, row (Integer A) to (String((Level of Unit_Generals_2[(Integer A)])))
Multiboard - Set the width for Multiboards_General[Temp_Integer] item in column 1, row (Integer A) to 8.00% of the total screen width
Multiboard - Set the width for Multiboards_General[Temp_Integer] item in column 2, row (Integer A) to 12.00% of the total screen width
Multiboard - Set the width for Multiboards_General[Temp_Integer] item in column 3, row (Integer A) to 4.00% of the total screen width
Multiboard - Set the width for Multiboards_General[Temp_Integer] item in column 4, row (Integer A) to 2.00% of the total screen width
Collapse For each (Integer B) from 1 to 4, do (Actions)
Collapse Loop - Actions
Multiboard - Set the display style for Multiboards_General[Temp_Integer] item in column (Integer B), row 1 to Show text and Hide icons
Multiboard - Set the display style for Multiboards_General[Temp_Integer] item in column (Integer B), row (Integer A) to Show text and Hide icons
Else - Actions
Custom script: if( GetLocalPlayer() == ConvertedPlayer( Temp_Integer) ) then
Multiboard - Hide Multiboards_General[Temp_Integer]
Custom script: if( GetLocalPlayer() == ConvertedPlayer( Temp_Integer ) ) then
Multiboard - Show Multiboards_General[Temp_Integer]

Collapse JASS:
function Trig_Mutliboard_Error_Func001Func001Func001002001001002 takes nothing returns boolean
    return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true )
endfunction

function Trig_Mutliboard_Error_Func001Func001C takes nothing returns boolean
    if ( not ( udg_Temp_Integer == 1 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Mutliboard_Error_Func001Func002Func001002001001002 takes nothing returns boolean
    return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true )
endfunction

function Trig_Mutliboard_Error_Func001Func002C takes nothing returns boolean
    if ( not ( udg_Temp_Integer == 2 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Mutliboard_Error_Actions takes nothing returns nothing
    set udg_Temp_Integer = 1
    loop
        exitwhen udg_Temp_Integer > 2
        if ( Trig_Mutliboard_Error_Func001Func001C() ) then
            set bj_forLoopAIndex = 2
            set bj_forLoopAIndexEnd = ( CountUnitsInGroup(GetUnitsOfPlayerMatching(Player(0), Condition(function Trig_Mutliboard_Error_Func001Func001Func001002001001002))) + 1 )
            loop
                exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
                call MultiboardSetItemValueBJ( udg_Multiboards_General[udg_Temp_Integer], 1, GetForLoopIndexA(), GetHeroProperName(udg_Unit_Generals_1[GetForLoopIndexA()]) )
                call MultiboardSetItemValueBJ( udg_Multiboards_General[udg_Temp_Integer], 2, GetForLoopIndexA(), GetUnitName(udg_Unit_Generals_1[GetForLoopIndexA()]) )
                call MultiboardSetItemValueBJ( udg_Multiboards_General[udg_Temp_Integer], 3, GetForLoopIndexA(), ( I2S(udg_Unit_Group_1_Counter[GetForLoopIndexA()]) + ( " / " + "12" ) ) )
                call MultiboardSetItemValueBJ( udg_Multiboards_General[udg_Temp_Integer], 4, GetForLoopIndexA(), I2S(GetUnitLevel(udg_Unit_Generals_1[GetForLoopIndexA()])) )
                call MultiboardSetItemWidthBJ( udg_Multiboards_General[udg_Temp_Integer], 1, GetForLoopIndexA(), 8.00 )
                call MultiboardSetItemWidthBJ( udg_Multiboards_General[udg_Temp_Integer], 2, GetForLoopIndexA(), 12.00 )
                call MultiboardSetItemWidthBJ( udg_Multiboards_General[udg_Temp_Integer], 3, GetForLoopIndexA(), 4.00 )
                call MultiboardSetItemWidthBJ( udg_Multiboards_General[udg_Temp_Integer], 4, GetForLoopIndexA(), 2.00 )
                set bj_forLoopBIndex = 1
                set bj_forLoopBIndexEnd = 4
                loop
                    exitwhen bj_forLoopBIndex > bj_forLoopBIndexEnd
                    call MultiboardSetItemStyleBJ( udg_Multiboards_General[udg_Temp_Integer], GetForLoopIndexB(), 1, true, false )
                    call MultiboardSetItemStyleBJ( udg_Multiboards_General[udg_Temp_Integer], GetForLoopIndexB(), GetForLoopIndexA(), true, false )
                    set bj_forLoopBIndex = bj_forLoopBIndex + 1
                endloop
                set bj_forLoopAIndex = bj_forLoopAIndex + 1
            endloop
        else
        endif
        if ( Trig_Mutliboard_Error_Func001Func002C() ) then
            set bj_forLoopAIndex = 2
            set bj_forLoopAIndexEnd = ( CountUnitsInGroup(GetUnitsOfPlayerMatching(Player(1), Condition(function Trig_Mutliboard_Error_Func001Func002Func001002001001002))) + 1 )
            loop
                exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
                call MultiboardSetItemValueBJ( udg_Multiboards_General[udg_Temp_Integer], 1, GetForLoopIndexA(), GetHeroProperName(udg_Unit_Generals_2[GetForLoopIndexA()]) )
                call MultiboardSetItemValueBJ( udg_Multiboards_General[udg_Temp_Integer], 2, GetForLoopIndexA(), GetUnitName(udg_Unit_Generals_2[GetForLoopIndexA()]) )
                call MultiboardSetItemValueBJ( udg_Multiboards_General[udg_Temp_Integer], 3, GetForLoopIndexA(), ( I2S(udg_Unit_Group_2_Counter[GetForLoopIndexA()]) + ( " / " + "12" ) ) )
                call MultiboardSetItemValueBJ( udg_Multiboards_General[udg_Temp_Integer], 4, GetForLoopIndexA(), I2S(GetUnitLevel(udg_Unit_Generals_2[GetForLoopIndexA()])) )
                call MultiboardSetItemWidthBJ( udg_Multiboards_General[udg_Temp_Integer], 1, GetForLoopIndexA(), 8.00 )
                call MultiboardSetItemWidthBJ( udg_Multiboards_General[udg_Temp_Integer], 2, GetForLoopIndexA(), 12.00 )
                call MultiboardSetItemWidthBJ( udg_Multiboards_General[udg_Temp_Integer], 3, GetForLoopIndexA(), 4.00 )
                call MultiboardSetItemWidthBJ( udg_Multiboards_General[udg_Temp_Integer], 4, GetForLoopIndexA(), 2.00 )
                set bj_forLoopBIndex = 1
                set bj_forLoopBIndexEnd = 4
                loop
                    exitwhen bj_forLoopBIndex > bj_forLoopBIndexEnd
                    call MultiboardSetItemStyleBJ( udg_Multiboards_General[udg_Temp_Integer], GetForLoopIndexB(), 1, true, false )
                    call MultiboardSetItemStyleBJ( udg_Multiboards_General[udg_Temp_Integer], GetForLoopIndexB(), GetForLoopIndexA(), true, false )
                    set bj_forLoopBIndex = bj_forLoopBIndex + 1
                endloop
                set bj_forLoopAIndex = bj_forLoopAIndex + 1
            endloop
        else
        endif
        if( GetLocalPlayer() == ConvertedPlayer( Temp_Integer ) ) then
        call MultiboardDisplayBJ( false, udg_Multiboards_General[udg_Temp_Integer] )
        if( GetLocalPlayer() == ConvertedPlayer( Temp_Integer ) then
        call MultiboardDisplayBJ( true, udg_Multiboards_General[udg_Temp_Integer] )
        set udg_Temp_Integer = udg_Temp_Integer + 1
    endloop
endfunction

//===========================================================================
function InitTrig_Mutliboard_Error takes nothing returns nothing
    set gg_trg_Mutliboard_Error = CreateTrigger(  )
    call TriggerRegisterTimerEventPeriodic( gg_trg_Mutliboard_Error, 5.00 )
    call TriggerAddAction( gg_trg_Mutliboard_Error, function Trig_Mutliboard_Error_Actions )
endfunction
09-08-2007, 05:35 PM#2
TaintedReality
Neither of those if statements have endifs. And for the trigger thing, right click on your trigger's name in the "Trigger Functions: " frame, then click copy as text. It is now on your clipboard, so paste it here and then surround it with trigger tags.
09-08-2007, 05:46 PM#3
Hessgasoline
Ahah, wow, twice now you've helped me figure out my problem. =)

I tried changing the Temp_Integer back to the udg format like you're supposed to, and threw in a Custom Script: endif, and it let me enable the trigger. Didn't know that had to be included, don't remember seeing it anywhere in the other Multiboard topics, Oh well.

Now I just have to test it to make sure that it works properly. I guess this thread can be closed, or locked or whatever, since the problem has been solved.

I would give Rep, but you're the last person I've given it to recently. I'll remember to get you some though =)
09-09-2007, 06:19 AM#4
Pyrogasm
We don't really lock threads here; only if someone raises an incredibly old one from the dead.
09-09-2007, 11:30 AM#5
Silvenon
Omg I hate JASS multiboards, there isn't a way (as far as I know) to make it more efficient than in GUI, everything is full of bloody BJs.

Just like replacing CinematicModeBJ with natives, a living hell :)