D
DarthTenebris
Guest
Hello everybody,
I'm working on an inventory system for my game, and would like some ideas. I currently have an inventory for the player which is a ds_map, with 22 slots each also a ds_map. I plan on having several items, and am wondering what is the best way to approach it. The items are to be somewhat customizable, for example a piece of paper will have the same item name and texture, but it might contain different text (I'm planning on using the papers as the unofficial tutorial, to let the player explore the game by themselves and find clues along the way). Another example is a replica of Minecraft's recent addition of "suspicious stew", which is an item that gives the player a random (hidden) effect, depending on the ingredients the stew was made from. I would like to have a food item that heals a hidden amount of health. Basically I'm looking for the equivalent of Minecraft's NBT system it seems. Any idea on how I can do this?
Thank you for your time.
I'm working on an inventory system for my game, and would like some ideas. I currently have an inventory for the player which is a ds_map, with 22 slots each also a ds_map. I plan on having several items, and am wondering what is the best way to approach it. The items are to be somewhat customizable, for example a piece of paper will have the same item name and texture, but it might contain different text (I'm planning on using the papers as the unofficial tutorial, to let the player explore the game by themselves and find clues along the way). Another example is a replica of Minecraft's recent addition of "suspicious stew", which is an item that gives the player a random (hidden) effect, depending on the ingredients the stew was made from. I would like to have a food item that heals a hidden amount of health. Basically I'm looking for the equivalent of Minecraft's NBT system it seems. Any idea on how I can do this?
EDIT: Item.none doesn't exist, it's just a placeholder for an empty slot so the diagram doesnt look weird. An empty ds_map will not have a texture key for it, and thus my code defaults to drawing ItemTexture.none, an empty sprite (white box with alpha = 0).
This system feels tiring to use, as I have to create an item fresh from the start, writing down the id, texture, etc. I could write a script to automate it, but I think there might be a more elegant solution, worth exploring the problem more.
This system feels tiring to use, as I have to create an item fresh from the start, writing down the id, texture, etc. I could write a script to automate it, but I think there might be a more elegant solution, worth exploring the problem more.
Thank you for your time.