Users browsing this thread: 1 Guest(s)
What's the Most Efficient Way to Program This?
#11
I'm thinking of separate text files for each item class. For example, Knives.txt would contain all the information about each and every knife, categorized by id. Like this:
Code:
[0]
name=Knife
lvreq=1
power=3

[1]
name=Machete
lvreq=3
power=11

As for the method of storing, I think a single 2D array would work when set up like this:

Code:
/*
2D array for storing items.  First value represents the inventory slot
number of an item, the second represents specifics:

Second Value Meanings
00 = Is there an item here or not (boolean).
01 = Item class (0 = knives, 1 = swords).
02 = Item ID of the item class.
03 = Special Quality ID (used for equipment).
04 = Name of Item
05 = Level Requirement
06 = Power Modifier
07 = Fort Modifier
08 = Mystic Modifier
09 = Stamina Modifier
10 = Energy Modifier
11 = Sprite for the item in the HUD.
*/
global.inventory[25,10]=0;
[Image: tamerkoh.gif?9][Image: DevBanner.png][Image: Youtube.gif]DLBROOKS33
Thanked by:


Messages In This Thread
RE: What's the Most Efficient Way to Program This? - by Koh - 08-09-2013, 09:17 AM

Forum Jump: