Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-21-2003, 04:11 AM
HoudiniMan HoudiniMan is offline
Playerworld Administrator
HoudiniMan's Avatar
Join Date: Dec 2001
Location: Calfiornia - USA
Posts: 3,512
HoudiniMan will become famous soon enough
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)
__________________
-HoudiniMan (Chief Playerworld Administrator)
Compulsive Support Center Checker - 5 Years and Change
Graal Support Center

Reply With Quote
  #2  
Old 01-21-2003, 04:26 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
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
Reply With Quote
  #3  
Old 01-21-2003, 05:12 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
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
Reply With Quote
  #4  
Old 01-21-2003, 05:18 AM
tlf288 tlf288 is offline
Registered User
tlf288's Avatar
Join Date: Nov 2001
Location: new account: Trevor
Posts: 0
tlf288 is on a distinguished road
Send a message via AIM to tlf288 Send a message via Yahoo to tlf288
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.....
__________________
new account: Trevor
Reply With Quote
  #5  
Old 01-21-2003, 05:27 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
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
Reply With Quote
  #6  
Old 01-21-2003, 05:40 AM
tlf288 tlf288 is offline
Registered User
tlf288's Avatar
Join Date: Nov 2001
Location: new account: Trevor
Posts: 0
tlf288 is on a distinguished road
Send a message via AIM to tlf288 Send a message via Yahoo to tlf288
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.
__________________
new account: Trevor
Reply With Quote
  #7  
Old 01-21-2003, 06:34 AM
MasterNuke MasterNuke is offline
Ed
MasterNuke's Avatar
Join Date: May 2002
Location: Boca Raton, Florida
Posts: 1,473
MasterNuke will become famous soon enough
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
Reply With Quote
  #8  
Old 01-22-2003, 05:54 PM
Jeremy-P2P- Jeremy-P2P- is offline
Banned
Join Date: Jan 2003
Posts: 4
Jeremy-P2P- is on a distinguished road
:D

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


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:25 PM.


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