Ok, now that that is in hand… the next piece of this puzzle is to try to tackle giving the items themselves “dynamic” printed names and descriptions.
So, for example, when you make an item of a kind, by default you have to create a unique name for it, and then that unique name may or may not be nice to display to the player, so you have to create a printed name for it. Is there a better, less manual way to do this?
What I mean is, is there a way to create a specific item without having to explicitly type in a specific name or a printed name for it into the code each time? Why might this be desirable? Well, for one example, a game that generates random loot. If you have a “leather chest piece” kind, for example, and some other function is producing new instances of it programmatically, you can’t manually type in names for each… you have no idea how many will exist in a given game. It will matter which one is which, because the items might have other properties, like say, durability, so which one you pick up matters. I’m still not there on making complex number-based calculations and variables either, so I’m not going to put that into my example as such to distract from the question at hand, so I’m just going to use “adjectives” instead.
The below, quite obviously, doesn’t work, but maybe this pseudo code will help illustrate what I mean. This isn’t the auto-generate loot part, which is probably far more advanced and I’ll get to later, but just the part that would be responsible for naming said auto-generated loot (and all other things). This code is psuedo code, obviously some of it will not be correctly written, particularly as I am still trying to learn values syntax properly as well. Assume that somewhere else in the code, some mechanism for changing the durability of the items is occurring, and each item has a different durability, and that the armors are placed somewhere.
A durability is a kind of value. Durability are perfect, damaged, broken.
An armor is a kind of thing. An armor is wearable. An armor has a durability. An armor's durability is usually perfect.
A leather chest piece is a kind of armor.
[later on these would be generated programmatically, so I'm not sure how to display this properly]
leather chest piece 1 is a kind of armor.
leather chest piece 2 is a kind of armor.
leather chest piece 3 is a kind of armor.
The printed name of an armor is usually "a [durability] [the kind of armor]". The description of an armor is usually "a [durability] [the kind of armor]".
This should produce results like:
look leather chest piece
a damaged leather chest piece
I am aware it could also produce lots of ambiguities, like:
look leather chest piece
which do you mean, a damaged leather chest piece, a damaged leather chest piece, a perfect leather chest piece
(or something like that)
but that is something I’m hoping to resolve with further code, possibly with the extension Numbered Disambiguation Choices by Aaron Reed.
Is it possible to programmatically generate items and the descriptions and printed names for these items based on their kind and values associated with them?