Augmenting 'printed name of things'

I want to change the printed name of a weapon from (e.g.) “short sword” to “short sword (wielded)” whenever the player (action name) WIELDS short sword. However, my statement below causes a stack overflow for Gulag.

Wielding is an action applying to one thing. Understand "wield [weapon]" as wielding.
Check wielding:
	if noun is not carried by the player:
		say "You don't have that to wield.";		
Carry out wielding:
	now noun is wielded;
Report wielding:
	say "You wield the [noun]";
	now printed name of noun is "[printed name of noun] (wielded)";

Gluxe ftal error: Stack access out of range (10004)

There should be a simple way to do this. Concatenation doesn’t seems to be available in INFORM. Any advice?

1 Like

There’s probably a more elegant way to do it, but I typically just do:

Let X be "[printed name of noun]";
Now the printed name of the noun is "[x], (wielded)";
1 Like

Yes, I used that as a workaround. I’ll mark this as a Solution, and hope someone finds something more elegant in the future. Thanks.

1 Like

This is how I’d do it.

After printing the name of a wielded thing: say " (wielded)".

Now you don’t have to worry about removing it again afterward.

6 Likes

I typically just do it as an if/otherwise with the object.

The printed name of Short Sword is "[if the Short Sword is not wielded]short sword[otherwise if the Short Sword is wielded]short sword (wielded)".

1 Like

Yes, that worked great. I removed several lines of code to append/remove the augmentation.