Not sure if I’m on the right path with this, but here’s what I’m trying to do:
I’m making a simulation of a “token cup,” where there is a container stocked with a bunch of different tokens, and an action can be taken to draw a random token from the cup and show what it is.
It works through simple built-in inform mechanics: there’s a shelf, and if you put the iron figurine on the shelf, then two iron tokens will appear in the cup, and if you put the quartz figurine on the shelf, ten quartz tokens appear, etc.
This part all works fine. What I’m trying to do now is make a way to label the figurines, and with that same action, name all of the associated tokens.
I have this code (borrowed from the Inform manual) for labeling the figurines:
Labeling it with is an action applying to one thing and one topic. Understand "label [something] [text]" as labeling it with. Instead of labeling a figurine with something: let N be "[the topic understood]"; replace the text "'" in N with ""; now the label of the noun is "[N]"; say "Okay, now [the noun] is labelled '[N].'"
A figurine is a kind of thing I’ve set up. So is a token. What I can’t figure out is how to make a relation between all the tokens and their matching figurine, and then add code so that when the figurine is labeled, so are all its tokens. (There are from two to forty tokens of each various type.)
Does this sound like a reasonable way to do this? And if so, any ideas on how to get it working?