# Restoring the printed name of any object...

On the face of it, it seems easy. But what if the object can be ANY object?

Here’s what I mean–

```Shrinktime is a number that varies. Shrinktime is 0. After shrinking something: say "Poof! Now you have a very tiny [noun]!"; choose row 1 of table 1; now the shrunkthing entry is the noun; now the printed name of the noun is "very tiny [noun]"; now shrinktime is 4.```

Simple, now I have an item that is very tiny, and it is entered into the one-entry table of items which have been shrunk. Please note that being shrunk is not a permanent condition, because in about 3-4 moves, the item returns to its normal size…(of course I wrote rules about dealing with the shrunken item while it is in that state, and check rules defining which kinds of things can/not be shrunk)…
Now…

```Every turn while shrinktime is greater than 0: now shrinktime is shrinktime minus 1; if shrinktime is 0: choose row 1 in table 1: say "Suddenly, your [shrunkthing entry] resumes its normal size!"; now the shrunkthing entry is the very tiny substitute.```

The only problem here is that I can’t seem to find a way to return the printed name of the ‘shrunkthing’ to its original name. I can’t seem to eliminate the ‘very tiny’ designation.

It would be very easy for me to simply say –

```Shrinktime is a number that varies. Shrinktime is 0. A very tiny nonentity is a thing. It is scenery. The descripition is "This is just a marker, the player can't really 'see' it." A mysterious box is a container. After shrinking something: say "Poof! The [noun] becomes so small that it blows out of your hand, and you can't seem to find it!"; now the very tiny nonentity is in the location of the noun; now the noun is in the mysterious box; now shrinktime is 4." Every turn while shrinktime is greater than 0: shrinktime is shrinktime minus 1; if shrinktime is 0: say "Now the [list of things which are in the mysterious box] suddenly reappears, as if by magic!"; now everything which is in the mysterious box is in the location of the very tiny nonentity; now the very tiny nonentity is nowhere.```

But I want to learn how to simply eliminate the words ‘very tiny’ from the printed name of the object, once I put them there. I have looked all over the manual and tried things like using ‘now word number 1 in the printed name of the shrunkitem entry is “”…’ etc.

Thanks

Instead of literally changing the printed name of the object, make a rule that adjusts the printed name on the fly, according to its status:

[code]A thing can be shrunken or normal-sized. A thing is usually normal-sized.

After shrinking something:
now the noun is shrunken.

Before printing the name of a shrunken thing:
say "very tiny ".[/code]

Here’s a working example of what you’re trying to do that might be a bit simpler:

[code]Test Chamber is a room.

A rock is in the Test Chamber. An apple is in the Test Chamber. A capybara is in the Test Chamber.

Shrinking is an action applying to one thing. Understand “shrink [something]” as shrinking.

A thing can be shrunken or normal-sized. A thing is usually normal-sized. [This lets you track the size-status of multiple objects, without storing them in a table or moving them to an off-stage container.]

A thing has a number called a shrink-timer. The shrink-timer of a thing is usually 4. [This lets you keep track of how long something’s been shrunken without using a global variable. It also lets multiple timers run independently, so that each thing pops back to normal-sized when its own timer is up.]

Check shrinking:
if the noun is shrunken:
say “You can’t shrink [the noun] any further.”;
stop the action.
[This rule makes sure you can’t shrink something that’s already shrunken.]

Carry out shrinking:
now the noun is shrunken.
[It’s usually a good idea to separate the actual mechanics (i.e., the game-affecting results) of your action into carry out rules…]

Report shrinking:
say “Poof! Now you have [a noun].”
[…and put the default response into a report rule.]

Before printing the name of a shrunken thing:
say "very tiny ".
[This adds “very tiny” to the printed name automatically if and only if it is shrunken.]

Every turn:
repeat with item running through shrunken things:
decrease the shrink-timer of the item by 1.
[This rule decrements all the timers.]

Every turn when there is a ready-to-grow thing (called the item):
if the item is visible:
say “Pop! [The item] suddenly grows back to normal size!”;
now the item is normal-sized;
now the shrink-timer of the item is 4.
[…and this rule restores items to normal size when their timer is up. Note, since it’s only possible to shrink one item at a time, you’ll never have more than one item popping back to normal size at a time, so you don’t have to mess with lists of items.]

Definition: a thing is ready-to-grow if it is shrunken and the shrink-timer of it is 0.

Test me with "shrink rock / shrink apple / shrink rock / look / z / z ".[/code]

If you wanted to get fancy, you could also add this line:

``Understand the shrunken property as describing a thing. Understand "very", "tiny", "small" as shrunken.``

…which lets the player refer to a shrunken thing as “shrunken”, “tiny”, “small”, “very tiny”, etc.

You may require a bit of finesse if you have any proper-named objects which can be shrunk. (You might want the shrunken version of Mr Magoo to be “the very tiny Mr Magoo” rather than just “very tiny Mr Magoo”.)

BTW If you’re wedded to changing the actual printed name property, you can chop off the "very tiny " quite easily with

``replace the text "very tiny " in the printed name of [shrunkthing entity] with "".``

Hey Mike,

Thanks so much. I always thought either-or(where an object can be, for example, pocketable or unpocketable) properties could never be reset, once they were set in the game(once pocketable, always pocketable)–and I didn’t know that numeric values attached to objects could be changed…?? But I appreciate how you laid all that out for me–I get the idea. You must have a game(s) where you make use of shrinking…?? Thanks for your time.

Jrb, thanks for the ‘replace’ idea–I thought I read that somewhere in the manual, maybe I missed it…?

It’s in 20.8 of Writing With Inform.