How can I simulate Matrixes in V2?
Displaying 1-6 of 6 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
Nabucodonosor

Yes, I want to use matrixes, like in Qbasic, where you put something like Dim a (2, 4). It's very important to to this in my game (specially with magics and items), and I can't figure the code out. Maybe using a returnable int, but I can't think too much on it.



Posted on 2000-12-29 14:13:35

Lunarbeam

Yeah, I've been having the same problem...can Verge do multidimensional arrays or not? Please respond....



Posted on 2000-12-29 15:25:33

andy

The best way to do it right now is to wrap it up with accessor functions. For example, here's how I did the equip system in Sully Pi:

#define MAXCHARS 5
#define EQUIPSLOTSPERCHAR 5
// since array sizes must resolve to a constant integer, we have this next one. It MUST be equal to MAXCHARS*EQUIPSLOTSPERCHAR
#define TOTALEQUIPSLOTS 25

int equipment[TOTALEQUIPSLOTS];

int GetEquipAt(int who,int where)
{
// bounds checking
return equipment[who*EQUIPSLOTSPERCHAR+where];
}

void SetEquipAt(int who,int where,int what)
{
// more bounds checking
equipment[who*EQUIPSLOTSPERCHAR+where]=what;
}

tada!



'Never confuse a single defeat with a final defeat.' -F. Scott Fitzgerald

Posted on 2000-12-29 15:38:00

el_desconocido

¿



-Pontifex
"How many rocks are there, in the whole world?"

Posted on 2000-12-29 20:06:40

Nabucodonosor

thanks...



Posted on 2000-12-29 20:49:25

andy

*nt™* but it wouldn't fit.



'Never confuse a single defeat with a final defeat.' -F. Scott Fitzgerald

Posted on 2000-12-29 21:12:51


Displaying 1-6 of 6 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.