• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Strange error

Status
Not open for further replies.
Level 4
Joined
Jul 3, 2005
Messages
100
JASS:
//***************************************************************************
//*
//*  Global Variables
//*
//***************************************************************************

globals
    // User-defined
    boolean array           udg_Player_A
    boolean array           udg_Player_D
    boolean                 udg_Game_On                = false
    multiboard              udg_Fatboard               = null
    unit array              udg_Player_Ogre
    dialog                  udg_Voting                 = null
    button array            udg_Vote_Button
    integer                 udg_Max_Fatness            = 0
    integer array           udg_Votes

    // Generated
    rect                    gg_rct_Fat_Ogre            = null
    rect                    gg_rct_Fat_Ogre_2          = null
    rect                    gg_rct_Fat_Ogre_3          = null
    rect                    gg_rct_Fat_Ogre_4          = null
    rect                    gg_rct_Fat_Ogre_5          = null
    rect                    gg_rct_Fat_Ogre_6          = null
    rect                    gg_rct_Climatiic           = null
    camerasetup             gg_cam_View                = null
    camerasetup             gg_cam_Cinematic_1         = null
    sound                   gg_snd_PeasantPissed5      = null
    sound                   gg_snd_OgrePissed5         = null
    trigger                 gg_trg_Fatboard_1          = null
    trigger                 gg_trg_Fat_A               = null
    trigger                 gg_trg_Fat_D               = null
    trigger                 gg_trg_Movie               = null
    trigger                 gg_trg_Modes_Voting        = null
    trigger                 gg_trg_Modes_Votes         = null
endglobals

function InitGlobals takes nothing returns nothing
    local integer i = 0
    set i = 0
    loop
        exitwhen (i > 6)
        set udg_Player_A[i] = false
        set i = i + 1
    endloop

    set i = 0
    loop
        exitwhen (i > 6)
        set udg_Player_D[i] = false
        set i = i + 1
    endloop

    set udg_Game_On = false
    set udg_Voting = DialogCreate()
    set udg_Max_Fatness = 0
    set i = 0
    loop
        exitwhen (i > 4)
        set udg_Votes[i] = 0
        set i = i + 1
    endloop

endfunction

function Trig_Modes_Votes_Func001C takes nothing returns boolean
    if ( not ( GetClickedButtonBJ() == udg_Vote_Button[1] ) ) then
        return false
    endif
    return true
endfunction

function Trig_Modes_Votes_Func002C takes nothing returns boolean
    if ( not ( GetClickedButtonBJ() == udg_Vote_Button[2] ) ) then
        return false
    endif
    return true
endfunction

function Trig_Modes_Votes_Func003C takes nothing returns boolean
    if ( not ( GetClickedButtonBJ() == udg_Vote_Button[3] ) ) then
        return false
    endif
    return true
endfunction

function Trig_Modes_Votes_Actions takes nothing returns nothing
    if ( Trig_Modes_Votes_Func001C() ) then
        set udg_Votes[1] = ( udg_Votes[1] + 1 )
        call DisplayTimedTextToForce( GetPlayersAll(), 4,00, ( "Votes for FFA : " + I2S(udg_Votes[1]) ) )
    else
        call DoNothing(  )
    endif
    if ( Trig_Modes_Votes_Func002C() ) then
        set udg_Votes[2] = ( udg_Votes[2] + 1 )
        call DisplayTimedTextToForce( GetPlayersAll(), 4,00, ( "Votes for 2vs2vs2 : " + I2S(udg_Votes[2]) ) )
    else
        call DoNothing(  )
    endif
    if ( Trig_Modes_Votes_Func003C() ) then
        set udg_Votes[3] = ( udg_Votes[3] + 1 )
        call DisplayTimedTextToForce( GetPlayersAll(), 4,00, ( "Votes for 2vs2vs2 : " + I2S(udg_Votes[3]) ) )
    else
        call DoNothing(  )
    endif
endfunction

//===========================================================================
function InitTrig_Modes_Votes takes nothing returns nothing
    set gg_trg_Modes_Votes = CreateTrigger(  )
    call DisableTrigger( gg_trg_Modes_Votes )
    call TriggerRegisterDialogEventBJ( gg_trg_Modes_Votes, udg_Voting )
    call TriggerAddAction( gg_trg_Modes_Votes, function Trig_Modes_Votes_Actions )
endfunction

That's a script i made ( in GUI , but i got the italian version of WE , and most of you can't read it , so the only possible lenguage is JASS ) that gives me an error .

What the crap is wrong with it ?! I wasnt be able to figure it out .
 
Last edited by a moderator:
Level 11
Joined
Jul 12, 2005
Messages
764
Here...
JASS:
    if ( Trig_Modes_Votes_Func002C() ) then
        set udg_Votes[2] = ( udg_Votes[2] + 1 )
        call DisplayTimedTextToForce( GetPlayersAll(), 4,00, ( "Votes for [U]2vs2vs2[/U] : " + I2S(udg_Votes[2]) ) )
    else
        call DoNothing( )
    endif
    if ( Trig_Modes_Votes_Func003C() ) then
        set udg_Votes[3] = ( udg_Votes[3] + 1 )
        call DisplayTimedTextToForce( GetPlayersAll(), 4,00, ( "Votes for [U]2vs2vs2[/U] : " + I2S(udg_Votes[3]) ) )
    else
        call DoNothing( )
    endif
endfunction

...you dsiplay "2vs2vs2" in both. Isn't that your problem?
 
Last edited by a moderator:
Level 4
Joined
Dec 14, 2004
Messages
85
Yeah you should have posted an error message, would have saved alot of time on this thread. You're lucky i noticed it pretty quick.

The error is that you're displaying the text for a time of 4,00 but you can't do that with a comma. You need to change your times to 4.00.

the 4,00 in this should be 4.00

JASS:
call DisplayTimedTextToForce( GetPlayersAll(), 4,00, ( "Votes for 2vs2vs2 : " + I2S(udg_Votes[3]) ) )
 
Status
Not open for further replies.
Top