Can an object be renamed?

Okay… another question…

Can an object be renamed so the new name is listed in inventory once it has been taken and examined?

Example:

Player sees a shiny disk on the ground. If examined game says “A shiny disk”.

It is taken.

Inventory now says: “Shiny disk”

It is examined.

Description given is “A small medallion with runes inscribed on it.”

Inventory now says: “A small medallion with runes inscribed on it.”

I have tried lots of things… I know I can use ‘Understand… as…’ for user input, but I want to totally rename the object, so even if dropped a “Look” will say “on the ground is a small medallion with runes inscribed on it.” Or at least an examine of the object would say that, as long as it was already known that it was a small medallion with runes inscribed on it and not just a shiny object.

Okay, the ‘even if dropped’ part is less important than the inventory description, but both would be nice.

Thanks for your help. This is fun… and very addicting. I think I am hooked. :wink:

You want the “printed name” property, chapter 8.5.

Thanks for the quick reply!

But how do I tie this to it having already been examined?

I know this will change the description if examined when carried:

The description of shiny disk is “[if not carried]It looks like a small disk on a chain near the edge of the railing.[end if][if carried]It is a silver pendant on a chain with a deep blue stone in the center surrounded by strange runes.”

And this will change the printed name:

The printed name of shiny disk is “[if not carried]small disk on a chain near the edge of the railing[end if][if carried]silver pendant on a chain with a deep blue stone in the center surrounded by strange runes.”

But the first does not change name in inventory, and the second changes it before it has been examined, it just has to be taken. And if dropped, it reverts to the original name.

I guess I am looking for an “If examined change printed name always” rule. I tried that, it didn’t work. :slight_smile: And even if not after being dropped, at least I would like the change of name to wait until after the item has been examined in inventory.

I know I can work around this with creative wording… and just assuming if a player takes something they will examine it immediately. But I was hoping to hide some details until they actually look deeper, and not just give it to them.

Maybe there is no way… and I will just have to live with it. But I was hoping.

Edit to add: And not just examined… at a distance the details would not be seen. It has to be carried, and examined before the name changes.

Is this what you’re looking for?

[code]“Disk Testin’” by Karl Parakenings

The Test Chamber is a room. “A vast and motionless space.”

The shiny disk is in the Test Chamber. The description of the shiny disk is “A silver pendant on a chain.”

Before examining the shiny disk for the first time:
now the printed name of the shiny disk is “silver pendant”.

Test me with “take shiny disk/i/examine disk/i”[/code]

YES! Thank you. That seems to work just the way I wanted.

Hmmmm… well except they don’t have to take it first. But this is closer. Is there a way to say:

Before taking and examining the shiny disk for the first time:
now the printed name of the shiny disk is “silver pendant”.

Sort of rolling in a [if carried] kind of clause to it? Still, this is much closer.

Edit: Okay… I thought it was closer… I think I was reading wrong… in inventory I still get “silver pendant”, not “A silver pendant on a chain.” after examining.

[code]“Disk Testin’” by Karl Parakenings

The Test Chamber is a room. “A vast and motionless space.”

The shiny disk is in the Test Chamber. The description of the shiny disk is “A silver pendant on a chain.”

Before examining the shiny disk while the shiny disk is held by the player:
now the printed name of the shiny disk is “silver pendant on a chain”.

Test me with “x disk/l/take shiny disk/i/examine disk/i/drop disk/l”[/code]

Better? I’m sure this isn’t the most elegant way to do it, as it changes the property every time the disk is examined while held, but then I’m only a couple days into learning Inform.

You can always test if something is “handled”. Things get handled as soon as they are taken and remain handled even if dropped. Inform keeps track of this automatically.

In this case, however, you want some properties to change the first time you examine an object but only if you are holding it.

You can do it thus:

The printed name of the shiny disk is "shiny disk".
The initial appearance of the shiny disk is "A small shiny disk lies near the edge of the railing."
The description of the shiny disk is "It looks like a small disk on a chain."

Before examining the shiny disk when the shiny disk is held:
	if the printed name of the shiny disk is not "silver pendant":
		now the printed name of the shiny disk is "silver pendant";
		now the description of the shiny disk is "It is a silver pendant on a chain with a deep blue stone in the center surrounded by strange runes."

Test me with "x disk/take disk/i/drop disk/x disk/take disk/i/x disk/i/drop disk/x disk"

(Since you test what the printed name of the disk is, you had better give it a printed name from the start, or you will get a run time error.

The disk can be dropped anywhere, before it’s examined; therefore it’s a bad idea to let the printed name contain a reference to the edge of the railing.

“Held” means “carried or worn”. The chain suggest that the thing can be worn. If a player puts it around his neck before he examines it, I guess you want the text properties to change, even though he wears it rather than carries it. If instead you write “when the shiny disk is carried”, the text properties won’t change if the player examines the disk while wearing it, only when he carries it in his hands.)

Thanks Felix, that does it!

This is going to be a useful method to know. I can see using it for several other items I plan on using.

And you are right about using ‘near the edge of the railing’ in the printed name. I didn’t think about that, but it was obvious the first time I tested your code and everything worked.

Thanks again!

The only problem I can see after trying every combination of scenarios is that it can still only be referred to as disk, or shiny disk.

If you say ‘drop silver pendant’ the reply is ‘You can’t see any such thing’. Even after examining it, it can only be called ‘disk’, not ‘silver pendant’ even though that is how it is now described. So if you drop it, and want to pick it up later, the player has to remember even though it is called ‘silver pendant’ if he wants to pick it up again, he has to call it disk.

Any way around this?

You can attach conditions to understand statements, like:


Understand "silver pendant" as the shiny disk when the shiny disk has been held.     

eta: see 16.17 in the docs, “Context: understanding when”

DOH! That is what I had tried to do before and it didn’t work for my main purpose. So I deleted that line. I forgot you can stack these rules on top of each other.

Thanks for clearing up my brain fart. :smiley:

I wonder why?

Why, after both examining the object and picking it up, do I have to examine it again to discover the runes on it? It seems strange and something that’d be likely to get me (not exactly a master of puzzle-solving) stuck.

Sometimes it takes a closer look, and taking the time to do it that shows the finer details. How many times do you pick something up (in real life) and not really look closely at the details? Details that couldn’t be seen if not in your hand and looking closely… for example… how many coins are in your pocket? Do you know what year they were made, or which “version” of that coin they are? To do that, you would have to pick them up and look closely. A disk is just a disk unless you look at the other side and see there is writing etched on it. I don’t want to take a persons observation skills for granted. Years of DM’ing in D&D have influenced this decision. Don’t just give it to the player. Require them to think and ask for more.

True; still I feel that Trumgottist has a point. I think there should be some hint that the player has not examined a thing as carefully as possible unless he holds it in his hands.

In a DM’ing situation the players may casually ask something like “So, what’s that shiny thing, then?” or he may tell you straight from the beginning that “I go over to the railing and take a close look at that shiny disk I saw there”. And as DM you would give rather different responses to those rather different actions.

But in an IF situation both of these actions map onto the X DISK command!
The player may very intend to be taking a real close look at an object when X’ing it, and if he can’t do that unless he picks it up, I think it’s only fair that the object’s description should at least suggest that he hasn’t as yet performed a thorough examination of it:
“From here you can only see that it’s a small disk on a chain.”
“A casual glance only reveals a small disk on a chain.”
“The disk is fastened to a chain. The visible side of it is quite plain.”
or something to a similar more or less obvious effect.

(Adverbs are so rarely used in IF that hardly anyone’s gonna try X DISK CLOSELY. I wouldn’t recommend going that way.)

The thing people actually use for “x closely” is “search”; but disks aren’t the sort of thing that they will search. I agree that most players will reasonably expect that once they’ve examined something, they’ve seen what there is to see about it, unless they get a pretty good hint that it needs to be reexamined under different circumstances. For instance, there are some games where the initial examination of an object hints that you need to examine it again in better light. In live DMing it may be easier to convey the difference between a casual glance and a good look.

Oh, I completely agree that a hint should be given. For another object I say “It looks like blah blah blah…but it is hard to tell from a distance.”

I like “A casual glance only reveals a small disk on a chain.” Thanks Felix. I hope you don’t mind if I use it. :wink: Although “The disk is fastened to a chain. The visible side of it is quite plain.” is pretty good too.

I am not trying to frustrate the player, just make them think to look at things and to take them if they might be useful later. And it is very much a ‘tongue in cheek’ game… so sometimes when they look closer it will just be a humorous response to get a laugh.

I don’t want them to miss any important clues or my bad jokes. So a gentle nudge in the right direction was my plan.

There are some games where examining an object reveals components that may themselves be examined.

That is great! I hadn’t even thought I could take it to that level. What game(s) is that used in so I can see an example of the coding?

Thanks… for the help, and the laugh. :smiley:

Errrr… I’m not sure what games have levels of detail like that, but probably someone else around here does…

In I7 that sort of thing is usually implemented with parts:

[code]An inscription is part of the disc. The description of the inscription is “Made you look!”

Instead of examining the inscription when the disc is not held: say “You can’t make it out from here…”[/code]

That was pretty much my guess. A separate part of the object, attached to it, using similar code to what was discussed above in the thread will all of its variations.

Damn. Do you people know what you are doing to me? Crack is less addicting. This just keeps getting better and better. I am just trying to keep up.

Thanks dude/dudette (hey, I can’t assume anything from a nic unless I pick him/her up and examine it closely… and my fiance might not approve). :laughing:

And just in case anyone is wondering… I am a dude… and that is a recent picture of me in Petergof. :wink: Though I doubt anyone cares. But if you are going to code me into a game, I hope you get it right.