| 06-11-2003, 11:51 PM | #1 |
possible? i.e Items[PlayerNum[Slot]]=Potion this would make things soo much easier. |
| 06-12-2003, 12:15 AM | #2 |
I don't think Jass supports 3 dimensionals.... try it. |
| 06-12-2003, 02:27 AM | #3 | |
First : Jass doesn't support arrays of more than one dimention. This doesn't mean you can't emulate a 2 or 3 dimension array, with a function taking 2 variables and returning one for instance. This said, the exemple you posted is nothing like a 2 or 3D array. Its a single dimention array : Quote:
Item[PlayerNumber[HostNumber[LevelNumber[IntegerA]]]] is still and also a single dimention array A 2D array has 2 indices : A[i , j] A 3D array has 3 indices : B[i , j , k] Regards |
| 06-12-2003, 03:23 AM | #4 |
Though a 2d array is an array of arrays, techincally, that's moreso like a nested array. Actually, since they both have depth, a nested array IS a multidimensional array, because they both work out the same way. Eh, the longer I think about it the more intertwined they become. So I'm gonna say that that is a multidimensional array. But I don't think War3 supports it. Ask a jass nerd. ;D |
| 06-12-2003, 03:48 AM | #5 |
well say you have a maximum of 100 things in this array you could go x*100+y and every combination would be unigue and it would work |
| 06-12-2003, 05:43 AM | #6 |
combatken : Like you kind of pointed, this was an array with a nested array as an indice. You can say it has many levels of nesting but you can't call that a multidimentionnal array as it uses a single indice. Note that once again, a multidimentionnal array uses multiple indices. This is really different. Oh and btw, i'm a jass 'Nerd' ^^ ChronOmega : Yes thats a good way to emulate multidimentionnal array. its a method based on bases ( lol sounds funny in english). All that is required is that the maximum value for the second indice is less than the base used. Regards |
| 06-12-2003, 08:43 AM | #7 |
ya lol... i dunno waht i was thinking when i said 3d... thats sad tho... looks like im going to have to stick to haveing like 25 arrays. hmm thx chrono omega that might work very well... ave to try it tho. if i understand you correctly you mean the arrayVariable[2003] would be imaginaryArray[20,03]... hmmm interesting. |
