Hi,

What you can do is create a struct with all the data of the item type (including the item name as string, bmap, sounds etc).
Now for every item type (e.g. Club, Bow) you can create a struct which holds the data for the item type.

MY_ITEM_STRUCT data_club;

And than set all the values for it in some startup function.

Code:
void struct_startup() {
 data_club.name = str_create("Club");
data_club.attack = 6;
...
}



Now you just have to store somewhere what type of item(s) each player/entity has and add that to player/entity the stats. E.g. in an other struct or in the entity skills or such.
There is alot of possibilities with structs and I recommend also read the pieces about struct array which are also very usefull (e.g. to store data for each seperate item or e.g. for each player).

Last edited by Reconnoiter; 10/13/17 21:09.