Schwee
Member
I am planning out an inventory system and I am still getting used to best practices with Gamemaker but my understanding is making use of enums and ds_grids seems to generally be the best approach. Originally I was considering one enum with properties such as name, description, etc. However, I realize that some item types will require unique properties. For example, ranged weapons could have specific accuracy, ammo capacities, reload times, etc. None of those properties apply whatsoever to say a consumable potion or even a melee weapon.
So, I am considering a second grid in addition to my 'all items' grid. This second grid would contain the 'type specific' properties for a given item type.
Example...
enum e_item_props {
name,
display_name,
description,
};
Then a ds_grid called 'all_items' that has 3 columns and one row per item. The x coordinate representing the "item_id".
enum e_ranged_weapon_props {
item_id
accuracy,
atk_power,
...
}
Then a ds grid with essentially the same setup.
So I guess my question is...does this make sense? Does it make THE MOST sense? Thanks as always!
So, I am considering a second grid in addition to my 'all items' grid. This second grid would contain the 'type specific' properties for a given item type.
Example...
enum e_item_props {
name,
display_name,
description,
};
Then a ds_grid called 'all_items' that has 3 columns and one row per item. The x coordinate representing the "item_id".
enum e_ranged_weapon_props {
item_id
accuracy,
atk_power,
...
}
Then a ds grid with essentially the same setup.
So I guess my question is...does this make sense? Does it make THE MOST sense? Thanks as always!