vjass multi arrays

Homer

New Member
Reaction score
2
I keep getting a syntax error with Jass helper. I am using Newgen.

JASS:
globals
constant string GAMETITLE = "0096FF96"
constant string GAMEDESCRIPTION = "00C19D67"
constant string EVENT = "00FF7F00"
constant string HINT = "006969FF"
constant string GOOD = "0000FF00"
constant string BAD = "00FF0000"
texttag array g_ftext
string array g_ftext_str[20][20]
integer array g_ftext_size[20]
endglobals

function Trig_set_up_settings_Actions takes nothing returns nothing
local integer i =0
local integer imax=0
local location point = GetRectCenter(gg_rct_Setting_Spawn)
local location point2

set imax=0
call BJDebugMsg("test")
if (udg_settings_menu==0) then
set g_ftext_str[0][0]="Game Mode: "//[0] is always the prefix text. Do not use this in the loop.
set g_ftext_str[0][1]="test"
set g_ftext_str[0][2]="test2"
set g_ftext_size[0]=3
set udg_setting = 0
loop
exitwhen i>imax
set point2  = OffsetLocation(point, 0, I2R( i * -150 ))
//call CreateUnitAtLoc(Player(PLAYER_NEUTRAL_PASSIVE),'n005',point2,0)
set g_ftext[0] = CreateTextTag()
call SetTextTagPosBJ(g_ftext[0],point2,0)
call SetTextTagTextBJ(g_ftext[0],g_ftext_str[0][0]+g_ftext_str[0][1],1)

set i = i + 1
call RemoveLocation(point2)
endloop
endif
call RemoveLocation(point)

endfunction

//===========================================================================
function InitTrig_set_up_settings takes nothing returns nothing
    set gg_trg_set_up_settings = CreateTrigger(  )
    call TriggerAddAction( gg_trg_set_up_settings, function Trig_set_up_settings_Actions )
endfunction


I get the errors where i set the 2d array.
 
Reaction score
341
Jesus christ learn to indent your code....(TAB KEY).

Anyways, last i heard 2D Arrays were bugged, theres a way around it, though i forgot it.
 

Homer

New Member
Reaction score
2
darn(btw i dont really indent too often as i'm the only one looking at my code and i have no issue reading. However I indent in other programming. Anyways, ill try to search but if you can find something let me know.
 

Tom Jones

N/A
Reaction score
437
I don't have any problems declaring 2d arrays, nor assigning values to them. Sure you got the newest NewGen? Alternatively you could create your own:

JASS:
globals
    string array s 
    integer size = 2
endglobals

function ...
   ...
   set s[0*size] = "Test A1"
   set s[0*size+1] = "Test A2"
   set s[1*size] = "Test B1"
   set s[1*size+1] = "Test B2"
   ...
endfunction
 

Homer

New Member
Reaction score
2
i just downloaded the newest one. I thought I had it, not even sure if I had an older ver or not but. It seems to work now. Thanks alot.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top