kind of thing with custom name printing rule vs. listing

Okay so we use a kind with quantity property…

[code]
concept is a kind of value.
monetary system is a concept.
knowledge relates various people to various concepts.
the verb to understand means the knowledge relation.

money is a kind of thing.
money has a number called quantity.[/code]

And an override rule for printing names…

[code]

rule for printing the name of money:
if the player understands monetary system:
say “[the quantity] clams”
otherwise:
say “round chunks of shiny metal and papery material”[/code]

[and I mess with understand for the in-game vocab but it’s not needed for the example]

Which is all fine until some room…

[code]Some-Place is a room with printed name “A Room”. “Some place.”.

[It’s possible two or more money things could wind up in a room.
eg: multiple actors donating to street performers in a room all at
once so I mimic that in this room via initial setting]

money called 5-clam coin is in Some-Place.
the quantity is 5.

money called 10-clam coin is in Some-Place.
the quantity is 10.[/code]

Then I get the problem:

look
A Room
Some place.

You can see: 2 moneys.

Is there a rule somewhere I may override to stop the “There are N s.” message?

I have a kind whose name rule varies the name and the 2 s message messes it up.

I have money that prints as “chunks of metal” (and does not show balance in status) when the viewpoint character does not understand the monetary system and having it show up in listings as 2 moneys defeats money’s name printing rule.

You can use a rule for writing a paragraph about a thing to override the you-can-also-see mechanism–if something’s name is printed in a rule for writing a paragraph about a thing it shouldn’t appear in the paragraphs at the end. So you can do this:

For writing a paragraph about money (called cash): say "There are [cash] here."

Unfortunately, this describes each piece of money separately, which is gross; first you get two separate “There are round chunks of papery material, etc.” and then you get “There are 5 clams here. There are 10 clams here.”

…OK, actually running your example, I get “You can see round chunks of shiny metal and papery material and round chunks of shiny metal and papery material here,” which is a problem, but it’s not the problem you’re describing. Can you make sure you have enough of the code (including the code messing with in-game vocab) to reproduce the exact problem? You can start a new project with a stripped-down example. And try copying the code straight from the IDE to the forum–you had some missing punctuation in your “rule for printing the name of money” (and also the spaces-instead-of-tabs didn’t copy-paste right).

The way you mess with “Understand” actually can affect the example, because it affects whether Inform decides to print “You can see 2 foos here” or “You can see [printed name of foo 1] and [printed name of foo 2] here.” If there’s no way for the player to refer to the two foos separately, then Inform will say “You can see 2 foos here,” I think.

OK, with this addition, a rule for writing a paragraph about can work by explicitly setting all the money to “mentioned”–that’s the property that prevents stuff from showing up in the you-can-also-see paragraph.

[code]Money is usually privately-named.
Understand “round” or “chunks” or “shiny” or “metal” or “papery” or “material” or “of” as money.
Understand “coin” as money when the player understands the monetary system.
Understand “clam” as money when the player understands the monetary system.
Understand the quantity property as describing money when the player understands the monetary system.

For writing a paragraph about money when the player does not understand the monetary system:
say “You can see some round chunks of shiny metal and papery material here.”;
now every money is mentioned.[/code]

I would also just eliminate the part of the printing the name rule that applies when the player understands the monetary system–“You can see a 5 clam coin and a 10 clam coin here” is much better than “you can see 5 clams and 10 clams here.” Also, you should perhaps just stick to coins–it could be a little disconcerting if the player sees a message that mentions papery material and then comes to understand the monetary system and there are only coins there. Or you could write a conditional check to see if any of the money that the location encloses is bills rather than coins and adjust your description accordingly.

ETA: Unfortunately, if the player then takes the money before understanding the system, they get “two moneys” in their inventory, because the rule for writing a paragraph about doesn’t apply to inventory. One thing to do would be to prevent them from taking the money–who cares about these round chunks of metal? Unfortunately, “grouping things together” rules, as in section 18.13 and 18.14 of writing with Inform, doesn’t seem to work, as Inform’s system for dealing with indistinguishable objects may override that. See here, and that thread reminds me that I don’t understand grouping at all. If you can keep the money out of the inventory, go for that!

It never shows up as clams (I pared that down for the example) since what is shown in the actual code (below) is a kind a value that has units for denominations so the printing rule will show the denominated amount. The name of the container may not always be useful since they may potentially recycled from NullenVoid or collapsed into a single money meaning the named 5-nyan piece or 10-nyan piece (whichever ends up taken into inventory first) winds up as 15-nyan in inventory though the name doesn’t change. In reality they are only named for the sake of the source and because inform complains about a kind being given specific role or location when they aren’t named. If a money is collapsed a few times by an actor picking up moneys then later dropping some money (going back to the actors periodically donating to street performers when in the room example). The name would have to somehow be changed to match the amount when money is dropped (and when collapsed).

As far as inventory listing goes I have a collapsing (instead of taking …) rule that merges multiple money grabs into a single item (by adding their amount properties then moving the extraneous money kinds no longer needed to a purgatory room). Thus the multiplicity problem is prevented in inventory listing. I’ve already had the joy that is not overriding the inventory listing rule to make emotions disappear in my emotion/feeling extension (as a property a kind is only ever a reference causing the “I cant set any value since none exist in the world” error so I had to make it a kind of thing to put in the world on every player to make an instance then make inventory lists not show it - but I digress). Long story short I wrote a collapsing rule instead so I wouldn’t have to touch inventory listing again. (Maybe inform needs a standard rules rulebook for determining the visibility of inventory items that would run prior to printing the list so that no one replacement has to override the entire inventory listing rule as it does now).

I suppose another approach is to use a property then override a taking rule so moneys taken end up summing in the property instead (and sent to NullenVoid for recycling). Dropping an amount would do the opposite and recycle a money from NullenVoid, set to the amount then placed in the room. Both approaches seem to have a degree of ugliness.

Playable example:

"money test" by Brian Jack

Section 1 - preqrequisite premable

a concept is a kind of value.
a concept is usually a dummy concept.
knowledge relates various people to various concepts.
the verb to understand means the knowledge relation.

NullenVoid is a room.
"Purgatory for 'out-of-play' things that still must exist somewhere in the world.".

unknown is a person. [a 'nobody' person]

Section 2 - money

monetary system is a concept.

currency is a kind of value. 10 nyan specifies a currency.
3 kiyan specifies a currency scaled up by 1000.
3 giyan specifies a currency scaled up by 1000000.

money is a kind of thing.
money is usually privately-named.
money has a currency called amount.
rule for printing the name of money:
	if the player understands monetary system:
		say "[the amount]";
	otherwise:
		say "round chunks of metal and papery material".
understand "round" or "chunks" or "metal" or "paper" or "papery" as money when the player does not understand monetary system.
understand "money" or "piece" as unknown when the player does not understand monetary system.
understand "money" or "piece" as money when the player understands monetary system.

instead of taking money when the number of money carried by the player > 0:
	let cy be entry 1 of the list of money carried by the player;
	let amt be the amount of the noun;
	now the amount of cy is the amount of cy plus amt;
	now the noun is in Nullenvoid;
	say "Taken.".

to decide what currency is money on (p - a person):
	let amt be 0 nyan;
	if the number of money carried by p > 0:
		let m be entry 1 of the list of money carried by p;
		let amt be the amount of m;
	decide on amt.

to decide what currency is the value of all money at (r - a room):
	let amt be 0 nyan;
	let entire-stash be the list of all money contained in r;
	repeat with stash running through entire-stash:
		now amt is amt plus the amount of stash;
	decide on amt;

rule for writing a paragraph about money:
	if player does not understand monetary system:
		if the number of money contained in location > 1:
			say "You can see round chunks of shiny metal and papery material scattered about here.";
		otherwise:
			say "You can see some round chunks of shiny metal and papery material here.";
	otherwise:
		if the number of money contained in location > 1:
			say "You see money scattered about (roughly [the value of all money at location] in total).";
		otherwise:
			say "You can see some money (worth [the amount]).";
	now every money is mentioned.

Section 3 - Test room

player is in Test location.

A room called Test location has printed name "A room".
"The obligatory room in the code for testing.".

A money called 5-nyan piece is in Test location.
the amount is 5 nyan.

A money called 10-nyan piece is in Test location.
the amount is 10 nyan.

Section 4 - Testing - Not for Release

concept-learning is an action applying to one concept.
understand "teach me [concept]" as concept-learning.
carry out concept-learning:
	now player understands the concept understood.
report concept-learning:
	say "[player]'s synapses zap with new-found knowledge of [the concept understood].".

test unknown with "take money / take chunks / i / l / take chunks / i / l / teach me monetary system / i / l".
test known with "teach me monetary system / l / take chunks / take money / i / l / take money / i / l".

Edit: the paragraph writing rule is in there also now.

PS: There’s a story argument for letting the player take the money things in a viewpoint character that doesn’t know what money is (getting caught stealing some useless pile of shiny metal could well be an interesting plot direction in some stories – especially considering my mood/feeling extension provides a Plutchik relation matrix about how each particular person feels about any others in the world).