• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

do nested arrays not work how they used to?

Status
Not open for further replies.
Level 14
Joined
Oct 18, 2013
Messages
724
Code:
globals
string array Blu
integer array BUCKO
endglobals

//this function is called on Map Initialization
function BluInit takes nothing returns nothing

set Blu[1] = "Units\\human\\Rifleman\\Rifleman.mdl"
set BUCKO[3] = 0
endfunction

//me trying to create the rifleman...
local real x=0.
local real y=0.
local effect S= AddSpecialEffect(Blu[BUCKO[3]+1 ],x,y)
    call echo(Blu[BUCKO[3]+1] )
    call echo(I2S( BUCKO[3]+1 ))

Returns Units\human\Rifleman\Rifleman.mdl and 1 respectively, AND the effect is NOT created.

notes:
It seems to work when the string is set before the effect creation, or when the arrays are locals, probably because of the former? It works if I do this before making the effect, no fucking joke:
Code:
set Blu[1] = Blu[1]

..how?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,285
As far as I am aware Warcraft III JASS does not support nested arrays. It never has and probably never will. Lua supports table nesting which could be considered as a form of array nesting if the tables are used as lists.

As for the question, there might be other reasons why the effect is not being created.
 
Level 14
Joined
Oct 18, 2013
Messages
724
When I echo all 3 parameters used for the SFX creation, they all appear to be fine to me. I'm at somewhat of a loss in debugging something like this. Also, my bad on using the wrong term here.
Are you sure there are no variables with similar names? such as between globals and struct members, or globals and locals?
@AGD , this might be what is happening. Though it shouldn't be an issue? Pre 1.27, locals were interpreted as l__variable iirc. I don't *think* they had to change that to patch out the exploit for MemoryHack, but I don't have access to that patch anymore so I can't confirm it.

I am only able to cause this bug by using an integer array as the indice for the string array, but it should not be problematic in any sense imo.
 

AGD

AGD

Level 16
Joined
Mar 29, 2016
Messages
688
but it should not be problematic in any sense imo.
Yeah

Try removing the effect creation line and change it to
JASS:
local real x=0.
local real y=0.
local string model = Blue[BUCKO[3]+1]
    call echo(model)
    call echo(I2S( BUCKO[3]+1 ))
so that the first access to the array is printed directly, and see if it still prints the correct values. Maybe this will give more hint.
 
Level 14
Joined
Oct 18, 2013
Messages
724
It still prints the correct values, but with no spawn. When I am re-initializing the variable like I showed above, it works though! Do Custom Scripts have some kind of non-global scope applied to them? If so, then getting the model string wouldn't work...but it does. So why, then, would the model not be created if we have a valid string and valid coordinates?
 
Level 14
Joined
Oct 18, 2013
Messages
724
THIS is what the problem was, a ghost character that will not display ingame, and is so minute that I didn't even see it
"̎ vs "

Is it the opening parenthesis letter that is used never, but that some software may correct the first "" to? I've no idea how it got there .-. my notepad++ document doesn't have it, but I have noticed that the world editor likes to reinterpret characters as kanji and other strange symbols...never had it happen with strings until now though.

Reminds me of that prank to pull on your programmer friend where you swap out a symbol for one that looks exactly the same. World Edit is just 2021's best prankster.
 
Status
Not open for further replies.
Top