"Before printing" rule not reading properties correctly

So, we’re making a game where things can be “important” (like a key puzzle item) or “not important” (like a crafting ingredient or something), and we want this to display in a different color when named depending on that.

Now, we have (confirmed functional) macros for the color, however the rule we’re using seems to not always know what it’s referring to…?

Before printing the name of a thing:
	If the thing is important, say "[keyitem]";
	Otherwise say "[b]".

Currently, it prints as if everything is important.
If we put “noun” instead of “thing” on the second line, though, it’s almost… random? (important items are supposed to be orange, unimportant items are blue)

To be clear, the only item here we’ve marked as important is the rusty key.

Any clue what we’re doing wrong here? We’re new to inform still so we’re kinda stumped, it’s probably something silly.

2 Likes

The term ‘the thing’ isn’t really defined, and ‘the noun’ only refers to the noun of the last action.

So you need to use the way of defining parameter variables used for rules:

Before printing the name of a thing (called printee):
    if printee is important, say "[keyitem]";
    otherwise, say "[b]";
2 Likes

That worked, thank you!!

We ended up going with this:

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 "[/]"

which works exactly how we want it to.

3 Likes