[Trigger] Index missing for array variable

Status
Not open for further replies.
Level 3
Joined
Mar 1, 2015
Messages
53
How to fix it?
JASS:
function Trig_Rupture_Loop_Func001Func001Func001Func007Func001C takes nothing returns boolean
         local integer array = udg_RuptureTiempo
   local integer array = udg_Rupture_Loop
 if ( not ( udg_RuptureTiempo[udg_Rupture_Loop] == 8 ) ) then
        return false
    endif
    return true
endfunction

error:
Line 24695: [maa???] Index missing for array variable udg_Rupture_Loop
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,272
local integer array = udg_RuptureTiempo
local integer array = udg_Rupture_Loop
These statements are not legal. They will throw a syntax error.

It is also not legal to re-declare a global variable name as a local (name overload). It used to be but some patched stopped that.

You might want to try...
JASS:
    local integer array RuptureTiempo
    local integer array Rupture_Loop
Remember to update all references to the variables.
 
Level 3
Joined
Mar 1, 2015
Messages
53
Well it deleted one of the problems, I wanted to start code over again because the previous one was a mess.
So I converted GUI trigger into a custom text, copy pasted it and now I am getting:
Debug Compiling:
PJASS ERROR(S) FOUND!Unexpected Code Exception!
Unrecognized PJASS (syntax) error
jasshelper error: pid 5756 exit 1

I don't understand, I did the same as before and I was getting only those variables errors, now I dont even know whats wrong
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
JASS:
//***************************************************************************
//*
//*  Global Variables
//*
//***************************************************************************

globals
    // User-defined
    integer                 udg_a                      = 0

    // Generated
    trigger                 gg_trg_Melee_Initialization = null
    trigger                 gg_trg_qwe                 = null
endglobals

function InitGlobals takes nothing returns nothing
    set udg_a = 0
endfunction

function Trig_qwe_Actions takes nothing returns nothing
endfunction

//===========================================================================
function InitTrig_qwe takes nothing returns nothing
    local integer udg_a = 5
    set gg_trg_qwe = CreateTrigger(  )
    call TriggerAddAction( gg_trg_qwe, function Trig_qwe_Actions )
endfunction

fully valid 1.26a editor code, which will normally run(tried). As you can see output is missing things, but this is because I used the vanilla editor
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,272
Jasshelper accepts and parses it into valid jass.
I hate that program some times...

So it loops through all 8192 indexes and bulk copies it to the local (expected correct behaviour)? Or does it inline the global as the local (strange but possible behaviour)?


fully valid 1.26a editor code, which will normally run(tried). As you can see output is missing things, but this is because I used the vanilla editor
Looks fine to me, however it does not involve declaration setting an array to another array.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
I was reffering to

It is also not legal to re-declare a global variable name as a local (name overload). It used to be but some patched stopped that.

Yes, I think 1.21 stopped it, but then they somehow reintroduced it, because as you see, my Jass code is fully valid and is in 1.26a, and does actually shadow global variable
 
Status
Not open for further replies.
Top