I7: substituting one object over another

I have a skeleton object that I’m using to describe 3 other bone objects in one single initial appearance and description. For purposes of demonstration, let’s name the 3 other objects “skull,” “pelvis,” and “femur.” The effects I’d like to achieve include:

  1. allowing the player to examine the whole skeleton, then when taking it he would obtain the 3 bone objects;
  2. being able to examine each of the bone objects and change the skeleton’s initial appearance and description to match what’s left on the ground, for instance;
  3. any action on the skeleton (other than examining) would apply to all 3 bone objects, but doing them on, say, the pelvis, would only apply to the pelvis.

#1 and #3 should be doable on my own, but how about #2?

I’m thinking about implementing a “ground” object that’s both a supporter and scenery (is that possible?) so the bones on it could be listed off as a token of some sort. However, this might include the skeleton object as well…

Any ideas? Thanks in advance!

Finally got it working. Case closed.

Glad you got it working; I’m still in the process of going through the documentation from start to finish in an attempt to get a clear idea of what will be possible to implement and what won’t be - so I’m not going to be of much use to anyone at the moment.

I don’t expect to see your code, but can you give an indication of what you managed to do to achieve the desired result and, if using parts of the documentation, which sections were of the most help to you for this?

Cheers

Mxx

For #2, Jason Orendorff from RAIF pointed me to section 16.19. “Writing a paragraph about.”

For #1 and #3, well, I just hit a snag again when I ran the test script. Let me check on this first.

EDIT:
Nah, I still can’t make part of it work. Here’s the source text in question (spoilery bits snipped):

[code]Jail Cell is a room.

The ground is scenery in the Jail Cell.

The skeleton is a thing on the ground with the printed name “pile of bones”. The description of the skeleton is “All that’s left of the remains is [the list of things that are a part of the skeleton], with some parts covered in what appears to be moist earth and caked blood.” Understand “bones” or “skeleton” or “pile of bones” or “pile” as the skeleton.

A bone_obj is a kind of thing. A bone_obj can be a part of the skeleton. A bone_obj is usually a part of the skeleton.

The skull is a bone_obj.
The pelvis is a bone_obj.
The femur is a bone_obj.

Before taking the skull:
now the skull is not a part of the skeleton;
move the skull to the player.

Before taking the femur:
now the femur is not a part of the skeleton;
move the femur to the player.

Instead of taking the ribcage:
say “The ribcage seems to be stuck to the floor.”

Instead of taking the skeleton:
now the skull is not a part of the skeleton;
now the humerus is not a part of the skeleton;
try taking the skull;
try taking the ribcage;
try taking the humerus;
remove the skeleton from play.[/code]
What happens is, I can take the skeleton, and obtain the femur and the skull without problems. When taking either the skull or the femur, I get the “You can’t see any such thing.” message instead.

I looked at the Index and saw all three bones (skull, pelvis, femur)
were initially out of play. How come I’m able to get them when I take
the skeleton, and yet not get them individually?

Any help here is appreciated. Thanks again!

Finally got it working the way it should.

I don’t have the code with me, but essentially, the relation between the skeleton and the 3 bone parts had to be established. I changed the skeleton into a container, and put all 3 bone parts in it.

I thought players were allowed to detach parts; after checking section 3.23 (“Parts of things”) in the I7 manual, it can’t be done.

Now even if I take 1 or 2 bone parts, the listing in the skeleton’s description is more consistent.

Here’s Emily’s much more elegant solution:

[code]Jail Cell is a room.

The ground is scenery in the Jail Cell.

The skeleton is a thing on the ground with the printed name “pile of
bones”. The description of the skeleton is “All that’s left of the
remains is [the list of things that are part of the skeleton], with
some parts covered in what appears to be moist earth and caked blood.”
Understand “bones” or “skeleton” or “pile of bones” or “pile” as the
skeleton.

A bone_obj is a kind of thing. Every bone_obj is part of the skeleton.

The skull is a bone_obj.
The pelvis is a bone_obj.
The femur is a bone_obj.

Procedural rule when taking a bone_obj:
ignore the can’t take component parts rule.

Instead of taking the pelvis:
say “The pelvis seems to be stuck to the floor.”

Instead of taking the skeleton:
try taking the skull;
try taking the pelvis;
try taking the femur;
remove the skeleton from play.

Report taking a bone_obj:
say “You collect [the noun].”;
rule succeeds.[/code]

EDIT: I added the “rule succeeds” line as it was showing this when I put into my WIP:

With “rule succeeds” present, the “Taken” message does not appear.