Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Matrix? (https://forums.graalonline.com/forums/showthread.php?t=42141)

HoudiniMan 01-21-2003 04:11 AM

Matrix?
 
I'm making a little game based on "DDR". For those unfamiliar with it you hit buttons coodinated with shapes that rise towards the top of the screen and you try to time it right...

Is there a way i could use a matrix or some other type of thing so that if i had say, 3 shapes to pick from i could organize it this way:

1=there 0=not there

0,1,0
0,0,0
0,0,0
0,1,1
0,0,0
1,0,0
0,0,0
1,0,1
1,1,0


etc...
i could use a string for each... but what would be the easiest way for the npc to interact with it and to put a shape there when needed by reading it? (also, i would want it to read 1 whole set of 3 at once)

Python523 01-21-2003 04:26 AM

Re: Matrix?
 
Quote:

Originally posted by HoudiniMan
I'm making a little game based on "DDR". For those unfamiliar with it you hit buttons coodinated with shapes that rise towards the top of the screen and you try to time it right...

Is there a way i could use a matrix or some other type of thing so that if i had say, 3 shapes to pick from i could organize it this way:

1=there 0=not there

0,1,0
0,0,0
0,0,0
0,1,1
0,0,0
1,0,0
0,0,0
1,0,1
1,1,0


etc...
i could use a string for each... but what would be the easiest way for the npc to interact with it and to put a shape there when needed by reading it? (also, i would want it to read 1 whole set of 3 at once)

you could do
for(i=0;i<arraylen(this.array);i+=3){
this.shape1 = this.array[i];
this.shape2 = this.array[i+1];
this.shape3 = this.array[i+2];
}
o_O

Python523 01-21-2003 05:12 AM

Quote:

Originally posted by Kaimetsu
Perhaps an easy way would be to have three arrays. One representing the status of elements for the left column, one for the middle and one for the right. Both would work, it's just down to the kind of thing you need to do to the data.
true...hmm which reminds me, I should ask stefan for true matrix support

tlf288 01-21-2003 05:18 AM

Quote:

Originally posted by Python523

I should ask stefan for true matrix support

That would be nice. How would that work though? I've never seen it done in a programming language before.....

Python523 01-21-2003 05:27 AM

Quote:

Originally posted by tlf288


That would be nice. How would that work though? I've never seen it done in a programming language before.....

php does it like
var[index][index]
first index being the x, second being the y

tlf288 01-21-2003 05:40 AM

Quote:

Originally posted by Python523

php does it like
var[index][index]
first index being the x, second being the y

Oh, Now that I see the code for it I can see all kinds of possibilities. I think Stefans really needs to add this.

MasterNuke 01-21-2003 06:34 AM

c++ does it like
vartype varname [index] [index];
and if you want to go insaine with dimentions and example...
int insaine [99] [99] [99] [99] [99] [99]; //6 dimentional matrix

and referenced like...
insaine [12] [34] [56] [78] [90] [27];

but all a matrix is is an array of arrays... but it does add a new 'dimention' of possibilities XD

heh... hi im Ed... and this is my first post in the Scripting boards

but anyway... it'd be easier to use an array for each column... a string would get you involved with those annoying string segment codes that mess with yer head

Jeremy-P2P- 01-22-2003 05:54 PM

:D
 
oo i love DDR :D
I love DDRMAX2 and I got 5 steps into MAXX UNLIMITED then I failed =(
That would be leet if you made it :D


All times are GMT +2. The time now is 04:26 PM.

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