I have some duplicates in a room unavailable to the player called the Closet: 3 suits of chain mail, 5 suits of leather armor, 100 arrows, etc.
In a showcase in the Emporium, I have SLeatherArmor which is used for display purposes. It contains weight, cost, quantity, and a description in the Emporium. The quantity property should reflect the number of leather armor suits in the Closet.
When I buy (or sell) a suit of leather armor, I move it to the player from the Closet (or move it to the player from the Closet) and adjust the quantity property of SLeatherArmor. It should be simple to count the number of duplicates in the Closet, but I haven’t figured out how. I thought it might involve number of entries in multiple objects list somehow.
Does anyone know how I count these items to include as a property of something else.
It’s just “number of leather armors in closet”:
Store is a room. Closet is a room.
Leather armor is a kind of thing.
Ten leather armors are in closet.
A leather armor called the display armor is in Store. The description is "We're selling these fine leather armors! Only [number of leather armors in closet] left in stock!"
2 Likes
Great! That looks like exactly what I want!
How does the display armor play into this?
1 Like
That was just an example I created to show how the property worked – sounds like you already have the other pieces set up, so you’d just plug in the “number of …” text where it’s supposed to go.
I’ve made an extension (for documentation only) that explains how to handle duplicates in operational and declaration space. It explains a few of Inform’s counter-intuitive rules regarding this topic. I think it makes the muddy waters much clearer and simpler. If anyone is interested, I can post it—except I don’t know how to make my extension public.
Can someone help here?