Saying the properties of parts?

I’m working on a project that has the body of all characters interpreted as parts of a certain kind, so as to allow me to handle local damage better. I am having slight difficulty, however. I can’t figure out how to actually display or interact with these values after the fact without having the player interact with it.

A bodypart is a kind of thing. 
A bodypart always has texts called armor, damage, and status. 
A torso, an arm, and a leg are kinds of bodypart.
a torso, arm, and leg are parts of every person.

Now the issue is, how do i reference that? The code works as intended otherwise, but I can’t figure out or find any documentation on how to change or display the property values of parts. Thanks!

I think you can say something like this–

now the armor of the torso of Brian is "dented";

As ‘armor’ is text, and it’s a value belonging to the torso of Brian.

Maybe you can display these properties of characters as part of their description for an ‘examine’. Or you can create an out-of-world command, like ‘status Brian’, and it will show his statistics without costing you a turn during combat…??

Just re-read the subject of your post–

You should be able to do this (for example)–

say "The condition of Brian's torso armor is [the armor of the torso of Brian].";

I hope this helps!

That’s what i initially thought too – however, it treats “the torso of Brian” as the name of a new noun instead of targetting the torso part of brian, which doesnt exist ofc.

Incidentally I kind of figured it out, at least to the point that i can continue on. You can target the armor property on brian’s torso using [the armor of brian’s torso].

I’ve also found that you can’t say [the armor of the player’s torso], you have to say [the armor of your torso], which is… interesting.

However… if you add another level to the heirarchy – skin for instance, it seems that you can’t simply chain ownership down to the target noun. [the bruising of Brian’s torso’s skin] yields the same ‘does not exist’ error that i was getting before, as does [the bruising of the skin of brian’s torso]. Any ideas?

There are a lot of things that can be causing trouble here, but Inform usually understands things like The armor of Brian's torso's skin.

This seems to work:

The Observatory is a room.

A bodypart is a kind of thing. 
A bodypart has texts called armor, damage, and status.
The armor of a bodypart is "none". The damage of a bodypart is "none". The status of a bodypart is "OK".

A torso, an arm, and a leg are kinds of bodypart.
A torso, arm, and leg are parts of every person.

A skin is a kind of bodypart.
A skin is part of every leg.

Joanna is a woman in the observatory. The description of Joanna is "You see [a list of bodyparts which are part of Joanna]."

The armor of Joanna's leg is "fully armored". The damage of Joanna's leg is "undamaged". The status of Joanna's leg is "excellent".

The armor of Joanna's leg's skin is "none". The damage of Joanna's leg's skin is "severe". The status of Joanna's leg's skin is "very bad indeed".

The description of a bodypart is "Armor: [armor of the item described], Damage: [damage of the item described], Status: [status of the item described]."
1 Like