Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   2 dimensional arrays (https://forums.graalonline.com/forums/showthread.php?t=68287)

wild8900 08-22-2006 07:02 PM

2 dimensional arrays
 
How do I create and use 2 dimensional arrays? I know how to use normal arrays in graal but how would I do something along the lines of this:
this.array={{1,2,3,4,5,6},{11,22,33,44,55,66}};
And I would access it with something like:
message #v(this.array[0][1]);
which return the value 22

would something like this work like how I want it above?
this.arrayy1={1,2,3,4,5,6}
this.arrayy2={11,22,33,44,55,66}
this.array={this.arrayy1,this.arrayy2};

xXziroXx 08-22-2006 07:04 PM

That should work.

wild8900 08-22-2006 07:12 PM

Im having trouble tracking the number in the sub arrays (this.arrayy1 and this.arrayy2). How do I track those while tracking the this.array? Right now I use a 'for()' event to do the this.array.

xXziroXx 08-22-2006 07:20 PM

Before I continue; are you trying to do this in gs1? IS gs2 enabled on whatever server you are trying this on?

wild8900 08-23-2006 03:27 AM

Im doing this in gs1 in the level editor for an arcade game but Im trieing to make a tile based arcade game that uses 2 dimensional arrays. I know how arrays work, just I dont how to get them to work in gs1 or gs2.

ForgottenLegacy 08-23-2006 03:48 AM

Multidimensional arrays don't work in GS1. Period.

xXziroXx 08-23-2006 06:20 AM

Quote:

Originally Posted by ForgottenLegacy
Multidimensional arrays don't work in GS1. Period.

Was about to say the same thing.

wild8900 08-23-2006 07:06 AM

bummer =[
What about gs2?

xXziroXx 08-23-2006 02:38 PM

gs2 would work like you said.

i.e. chat = this.var[0][4];


etc. etc.


All times are GMT +2. The time now is 12:18 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.