Sorry to just come here to beg for help, but…
I want to sum the massess of everything in a room. I’ve read section 15.17 of the Inform 7 documentation, but I run into an error when I use the [total mass of things in [location]] line, even though that’s directly lifted from the documentation. Here is the entirety of my code:
Mass is a kind of value. A thing has mass. 1.0kg specifies a mass.
The mass of the player is 70kg.
House is a room.
The hunk of lead and bag of feathers are in the house.
The mass of the hunk of lead is 10kg.
The mass of the bag of feathers is 0.5kg.
The gauge is in the house.
The mass of the gauge is 0.25kg.
The description of gauge is
“Current mass of everything in the house, summed inefficently: [mass of player + mass of hunk of lead + mass of bag of feathers + mass of gauge]
[line break]
Current mass of everything in the house, summed efficently: [total mass of things in the house].
[line break]
List of things in the house: [list of things in the house].”The player is in the house.
Here is what it outputs:
House
You can see a hunk of lead, bag of feathers and a gauge here.>look at gauge
Current mass of everything in the house, summed inefficently: 80.75kg
Current mass of everything in the house, summed efficently: 3.15914 × 10^-38kg.
List of things in the house: yourself, hunk of lead, bag of feathers and gauge.
Does anyone have an idea of why the sum is correct when I list the items in the house individually, and why it reads as basically zero when I use the “total mass of things in the house” line?
I’ve made it output a list of all the things in the house so I know that there’s nothing unsuspecting that’s getting added.
Thanks.