HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Problem with arrays

10-19-2006, 09:56 AM#1
Mathias
I have 2 questions about arrays:
- How to make 2D arrays? I can't simulate a 2D array because of the limit of 8192.
- Can i return a array in a function? Have tried function <name> takes nothing returns array integer, but it does not seem to work:(
10-19-2006, 10:32 AM#2
zen87
use game cache

http://jass.sourceforge.net/doc/api/...amecache.shtml
10-19-2006, 01:07 PM#3
Mathias
Gamecache is unfortunaly way too slow:(
10-19-2006, 01:08 PM#4
Vexorian
Not that slow.
Quote:
- How to make 2D arrays? I can't simulate a 2D array because of the limit of 8192.

How much space do you need? I am afraid that if you need a lot of space gamecache is the only way.
10-19-2006, 01:21 PM#5
iNfraNe
you could ofcourse use 2 arrays and functions like Get(x,y) and Set(x,y)..
10-19-2006, 01:28 PM#6
Vexorian
That depends, what are the dimensions you want?
10-19-2006, 01:43 PM#7
Thunder_Eye
I don't think it matters if something runs 0.0034 faster. Aslong as it isn't noticable for the player it's ok.
10-19-2006, 04:19 PM#8
PipeDream
Single or multiplayer?
10-19-2006, 05:16 PM#9
Mathias
I use it to make a maze:
bolArray[width*heigt][4*3]
width could be 100 and height 30
But the problem is solved if i could make a function which returned a array.
10-19-2006, 05:18 PM#10
Captain Griffen
100*30 = 3000. No problem. Need more space, have a few parallel arrays using get/set functions.
10-19-2006, 05:27 PM#11
Vexorian
he wants [3000][12]

You can just make it [12][3000] and use 12 arrays, there is no function that returns arrays but with just if then else and wrappers you get really good speed