Giving instructions over a radio

Well, that’s very interesting. I don’t immediately see how you can be asked for disambiguation between two things neither of which are in scope unless the parser is trying to match an ‘[any …]’ type of grammar token (for which scope doesn’t apply). Do you have any [any …] grammar tokens defined?

Also, obviously Tony and his body should both be in scope when you’re trying to talk to him on the radio, so there must be something wrong with the conditions you’ve set for bringing Tony into scope. See what happens if you just bring him into scope without any conditions:

After deciding the scope of the player:
	place Tony in scope;

Finally, when Tony and his body ARE in scope, what are they called when you type ‘scope’?

EDIT: this is what I get when the radio is switched on to bring Tony into scope:

scope
1: yourself (589615)
2: your body (589647)
3: a gold ring (589711)
4: a radio (589743)
5: a gold crown (590031)
6: Tom (589807)
7: a gold ingot (589839)
8: Tom’s body (589999)

tom, drop the ingot
Tom puts down the gold ingot.

(no disambiguation required)

Ah, yes. The commanding player can happily refer to anything that’s in scope for the person they’re commanding. Inform assumes complete awareness on the part of the player of the other person’s surroundings.

Only the person the player is commanding is tested for the player’s scope. All other objects are tested for the other person’s scope. So there’s no point removing objects from the player’s scope- to restrict what the other person can be commanded to do (through scope, at least) you’d need to remove them from the other person’s scope.

And then deal with the consequent unwanted ‘Answer NPC that…’ action, perhaps via a Before rule…

1 Like

Despite “Puff of Orange Smoke” I think your life would be much easier if you created two things: Tony, the person, and Tony’s body, the thing, and you just swapped the latter for the former when Tom died.

1 Like

Perhaps, but I’m intrigued as to why things aren’t working as they are. They work fine in my little test scenario. I have to agree that despite the neat philosophical idiom of separating the spirit from the body it incorporates at the moment of death and sending it off to the ethereal spirit-world, I’m not sure of the practical advantage of modelling this body-spirit duality in the story. What would one want to implement with the living body that one couldn’t implement with it’s pre-deceased disembodied spirit?

Ain’t that the case! Truth is, though, I don’t want to start mucking around with rules that other actions depend on unless I really have to.

If I remove the regex check, Tony Bleet and Tony Bleet’s body are now in scope when I type “scope”. But I still have the parser problem.

With the regex check in place, I can specifically move Tony Bleet’s body to nowhere when adding Tony Bleet to scope and then everything is fine; there is no parser problem.

I’m wondering if there are rules dedicating to figuring out who is being addressed. Oh, I should mention I have Inanimate Listeners active (by Emiliy Short).

Is there a way to remove something from scope?

Ah. I’ve hit on it. If the person is named Tony Bleet, then his body is named Tony Bleet’s body, and therefore ‘Tony’ matches the names of both objects. If Tony is just called Tony, than his body is named Tony’s body and ‘Tony’ doesn’t match ‘Tony’s body’.

You could fix this in an ‘After reading a command’ rule by substituting ‘Tony Bleet’ for all occurrences of ‘Tony’ or ‘Bleet’ in the player’s command (‘Tony Bleet’ will then match ‘Tony Bleet’, but won’t match ‘Tony Bleet’s body’.

1 Like

Hey, you’re a genius! I just verified your hypothesis: if I type “Tony Bleet, do something” there is no ambiguity.

When I fix, I can repost just the few rules that relate to the original problem (after deciding the scope for the player, ditto for Tony, and reaching side Tony’s location) in case anyone else has a similar issue.

And the deciding the scope of something activity doesn’t even come into play. And you even get the “You can’t reach into (the NPC’s location)” message if you tell the NPC to act on something off-stage! Oi.

Okay, so this is how I was able to enable communication via a radio so the player can issue commands to someone in another location. I left the persuasion rules out because they are irrelevant.

Put any allowable interlocutors in scope:

After deciding the scope of the player when the player is carrying the short-wave radio and Defending Lab from Church is happening and the setting of the radio dial is 3 and the location of the player is not the location of Tony Bleet:
	if the player's command matches the regular expression "^\s*tony bleet\,", case insensitively:
		place Tony Bleet in scope.

Put any objects the interlocutor can interact with in that character’s scope:

After deciding the scope for Tony when the player is carrying the short-wave radio and Defending Lab from Church is happening and the setting of the radio dial is 3 and the location of the player is not the location of Tony Bleet:
	if the player's command matches the regular expression "^\s*tony bleet\,", case insensitively begin;
		if the noun is something and the noun is known and the noun is in PlazaRegion begin;
			place the noun in scope;
		end if;
		if the second noun is something and the second noun is known and the second noun is in PlazaRegion begin;
			place the second noun in scope;
		end if;
	end if.

Allow the player to reach into interlocutors’ locations:

Rule for reaching inside Vendor Row Plaza when the player is carrying the short-wave radio and Defending Lab from Church is happening and the setting of the radio dial is 3 and the location of the player is not the location of Tony Bleet and the location of Tony Bleet is Vendor Row Plaza:
	if the player's command matches the regular expression "^\s*tony bleet\,", case insensitively:
		allow access.

This rule provides a response that fits the story when the player uses objects in the command that are not in scope.

Instead of answering Tony that when the player is carrying the short-wave radio and Defending Lab from Church is happening and the setting of the radio dial is 3 and the location of the player is not the location of Tony Bleet:
	say "You can hear the exasperation in Tony[']s voice even through the short-wave radio. 'Stop joking around!'";

I had to use the full name of the characters due to circumstances specific to my story.

Hope this helps someone else as much as Dr. Bates and Zed helped me!

1 Like

I have to echo the others and ask: what’s the benefit of having the body be on-stage at all while he’s alive? Why not just bring it into play when he dies, and not need to worry about the player referring to it?

When I first started learning Inform 7 and was writing my first game, I just copied the example given in 7.5. Combat and Death without thinking through what it was doing. I was still involved with the basics.

The world-building rules (of which these are part) are grouped together and copied from game to game, and I’m currently on the second game.

The only advantage I can see in terms of game-play is that the player can refer to a person’s body distinctly from the person. You also don’t have to specifically name each body; they get a logical name automatically. With respect to the goal of allowing a dead person to leave a body behind, I suppose it’s better (In terms of running afoul of Inform’s internal mechanics) to use the relation of person to body to swap the body for the person when they die.

Not to criticize the people who create those examples for people like me who were just starting out. Those example made Inform accessible without having to pour through technical material. So I’m thankful that whoever authored that example did so.

Indeed, I think this particular example is a really neat proof-of-concept (and therefore quite valid as an example text) without necessarily having an obvious practical use. In practice, (as altered slightly by you to make bodies containers so that they can receive the deceased’s possessions) it’s as if a person spends their pre-death life wandering around with a big, invisible, open, empty box nailed to the top of their head that no-one can mention, called their body, which is left behind with all their possessions packed into it when they die.

Interestingly your extension of it does illustrate a weird anomaly in Inform, recently discussed on this forum, whereby although during setup you can’t state that a container wears or carries something (these relations being restricted to persons) , during play you can write ‘now (a-container- in this case a dead body) wears something/carries something’ and Inform is happy to transfer said thing to the container- albeit it ends up contained, rather than carried or worn (see code for what happens when a person dies).

1 Like

This behavior is exactly what I wanted, as it fits the games perfectly. The characters in these two games I’ve been working on are caricatures, and the items they carry are usually useful to the player.

I should probably change the “departing this world” action so all carried items and wearables are put in the container, as I agree it doesn’t make sense for a container to carry or wear anything.

Don’t worry, the container doesn’t carry or wear them- Inform half-ignores your instruction to ask it to do these things it can’t do and just puts them in the container.

1 Like

Yep, Inform only has two fundamental ways for one object to be encompassed by another: “part of” and “carried/supported/contained/worn”. (A bit of extra information is stored to distinguish between carrying and wearing.)

This is why the same object can never be both a container and a supporter, and why trying to make a container support something will cause it to contain the thing instead.

Dialog has shown perhaps a better way to do this, which would allow for container-supporters, but the current model is baked into Inform at a very fundamental level which makes it extraordinarily difficult to change.

For anyone interested following this thread, see here for a detailed explanation :wink:

1 Like

Even if you’re going a different way, I’ll note that there’s a straightforward way to automatically have bodies created per person. The body-things exist but would be out of play unless the story explicitly moved them on-stage. And both your code and the player (if it were in scope) could refer to, e.g., Tom’s body.

Embodiment relates one person to one thing.
The verb to embody means the embodiment relation.
Every person embodies a thing (called its body).
1 Like