Custom naming rule breaks when plural

We have custom say actions we want before and after the name of objects. This code mostly works:

Before printing the name of a thing (called printee):
	If printee is important:
		say "[keyitem]";
	Otherwise if the printee is not the player:
		say "[b]".
		
After printing the name of a thing (called printee):
	If printee is not the player:
		say "[/]"

…except when there’s multiple objects with the same name.

Observe the following:


Note that “herb” is in blue (the intended behavior), but “herbs” isn’t.

We’re probably missing something about how the naming rules work, but it seems like we might be dealing with the plural printing rule either not triggering or overriding our own code here. How would we fix this?

1 Like

In the line of output that says:

two herbs

the word “herbs” is being printed by a different activity, the printing the plural name of something activity.

You’ll want to set up the same type of logic for both activities, or invoke the same rules from both.

3 Likes

Excellent, that fixed it!

Here’s the code we used, does this look okay?

To color the name of (printee - thing):
	If printee is important:
		say "[keyitem]";
	Otherwise if the printee is not the player:
		say "[b]".

To suffix the name of (printee - thing):
	If printee is not the player:
		say "[/]"

Before printing the name of a thing (called printee):
	Color the name of the printee.

Before printing the plural name of a thing (called printee):
	Color the name of the printee.
		
After printing the name of a thing (called printee):
	Suffix the name of the printee.

After printing the plural name of a thing (called printee):
	Suffix the name of the printee.
1 Like

Seems fine to me given what you’ve said.