Visit the Ironworks Gaming Website Email the Webmaster Graphics Library Rules and Regulations Help Support Ironworks Forum with a Donation to Keep us Online - We rely totally on Donations from members Donation goal Meter

Ironworks Gaming Radio

Ironworks Gaming Forum

Go Back   Ironworks Gaming Forum > Ironworks Gaming Forums > General Discussion

Reply
 
Thread Tools Search this Thread
Old 06-07-2006, 07:20 AM   #11
Ilander
20th Level Warrior
 

Join Date: December 28, 2003
Location: Kentucky
Age: 38
Posts: 2,820
...You're right...just looked it up, and I'm hosed. I'll update when I figure something out...

Incidentally, doing it my way would probably require more RAM than anyone on this forum has.

[ 06-07-2006, 07:42 AM: Message edited by: Ilander ]
__________________

Is that what you really want to say?
Ilander is offline   Reply With Quote
Old 06-07-2006, 08:10 PM   #12
Vaskez
Takhisis Follower
 

Join Date: April 30, 2001
Location: szép Magyarország (well not right now)
Posts: 5,089
lol@ a 9d array. You only need 1d cos remember you can use the index and the value at each index to represent things. E.g. the array index reps the stat name and the value reps the stat value.
__________________
Too set in his ways to ever relate
If he could set that aside, there'd be heaven to pay
But weathered and aged, time swept him to grave
Love conquers all? Damn, I'd say that area's gray
Vaskez is offline   Reply With Quote
Old 06-07-2006, 10:11 PM   #13
Ilander
20th Level Warrior
 

Join Date: December 28, 2003
Location: Kentucky
Age: 38
Posts: 2,820
...well crap, I could just use nine, 1-d arrays, couldn't I? It'd be less efficient than "data structures" I guess, but I still haven't looked those up.
__________________

Is that what you really want to say?
Ilander is offline   Reply With Quote
Old 06-08-2006, 06:51 AM   #14
andrewas
Harper
 

Join Date: October 2, 2001
Location: Aberdeen, Scotland
Age: 42
Posts: 4,774
You could. Or you could use 1 2D array, and use the first dimension to seperate characters, and the second dimension to seperate stats within a character.

But data structures are powerful and you should learn to use them.

Define one as:
code:
struct MyStruct{
int number;
int anothernumber;
.
.
.
};
[/QUOTE], then declare a variable of type MyStruct:

code:
MyStruct data;
[/QUOTE]Then you can access its member fields via the dot notation, and do pretty much anything you could do with regular variables.

code:
int temp;
temp=data.number;
data.number=data.anothernumber;
data.anothernumber=temp;
[/QUOTE]
andrewas is offline   Reply With Quote
Old 06-08-2006, 10:18 AM   #15
Vaskez
Takhisis Follower
 

Join Date: April 30, 2001
Location: szép Magyarország (well not right now)
Posts: 5,089
you should learn how to use the standard template library vectors, lists and maps. Maps are the only tricky ones to use. The main difference is that they can change size at run-time whereas arrays can't.

e.g. a vector of ints:

code:
#include <vector>

vector<int> stats;

\\adding stuff:

stats.push_back(5);

\\then you can go through it by creating an iterator:

vector<int>::iterator it

\\and loop through:

for(it=stats.begin(); it != stats.end(); it++)
{
int i = *it;

}
[/QUOTE]can't remember other operations but I think you can erase like:

stats.erase(it); where it is the iterator pointing to a position in the vector

[ 06-08-2006, 10:20 AM: Message edited by: Vaskez ]
__________________
Too set in his ways to ever relate
If he could set that aside, there'd be heaven to pay
But weathered and aged, time swept him to grave
Love conquers all? Damn, I'd say that area's gray
Vaskez is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Programmers/Developers SilentThief Dungeon Craft - RPG Game Maker 20 06-24-2007 03:34 AM
OTS: Hackers and Programmers Please help Loumistro Wizards & Warriors Forum 4 01-20-2004 12:25 PM
Any Fellow Programmers might enjoy this harleyquinn General Conversation Archives (11/2000 - 01/2005) 15 02-07-2003 10:22 AM


All times are GMT -4. The time now is 03:32 AM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
©2024 Ironworks Gaming & ©2024 The Great Escape Studios TM - All Rights Reserved