When the player is carried by an actor

Let’s say the protagonist is a pet, and sometimes its human companion needs to carry them somewhere. My code is generating a room description whenever the the pet is picked up. Judging by the (in bob) appended to the room name, I’m guessing this is treated as a new location?

How can I suppress this?

1 Like

Hmm, away from the IDE but my first thought is that you’d need to rewrite the room description heading rule to catch the case where the lowest-level container of the player is a person, and then rewrite the output. Looking at the rule, I see it has a special case for animals so I think it’s just a matter of adding a similar one for people.

(Just pasting the rule in here for reference:)

Carry out looking (this is the room description heading rule):
  say bold type;
  if the visibility level count is 0:
     begin the printing the name of a dark room activity;
     if handling the printing the name of a dark room activity:
        say "Darkness" (A);
     end the printing the name of a dark room activity;
  otherwise if the visibility ceiling is the location:
     say "[visibility ceiling]";
  otherwise:
     say "[The visibility ceiling]";
  say roman type;
  let intermediate level be the visibility-holder of the actor;
  repeat with intermediate level count running from 2 to the visibility level count:
     if the intermediate level is a supporter or the intermediate level is an animal:
        say " (on [the intermediate level])" (B);
     otherwise:
        say " (in [the intermediate level])" (C);
     let the intermediate level be the visibility-holder of the intermediate level;
  say line break;
  say run paragraph on with special look spacing.
1 Like

I would suggest a rule:

Carry out Bob taking Marbles:
	move marbles to bob, without printing a room description;
	rule succeeds. [halts carry out rule processing]

The built-in standard taking rule contains the line:

now the actor carries the noun;

This is translated in I6 to:

! [2: now the actor carries the noun]
MoveObject(noun,actor);

The MoveObject() routine has special code for when the item moved is the player:

...
if (going_mode == false) {
	if (F == player) { PlayerTo(T, opt); return; }
...

The PlayerTo() routine instigates a looking action unless told not to:

[ PlayerTo newplace flag L;
	L = LocationOf(newplace);
   	if (L == nothing) return RunTimeProblem(RTP_CANTBEOFFSTAGE);
	@push actor; actor = player;
	move player to newplace;
	location = L;
	real_location = location;
	MoveFloatingObjects();
	SilentlyConsiderLight();
	DivideParagraphPoint();
	if (flag == 0) <Look>;		! <-- HERE
	if (flag == 1) give location visited;
	if (flag == 2) AbbreviatedRoomDescription();
	@pull actor;
];

In this case, the opt argument provided by MoveObject() (which is mapped to the flag parameter for PlayerTo()) will be zero, and there’s no easy way to change that value. By creating a special-case rule that takes priority over the standard rule and prevents its processing, you can use the move ... to ... phrase, which will not print a room description if the proper phrase option is used.

EDIT: Corrected obvious mistake in the above. Sorry for any confusion.

2 Likes

This is 10.1.2, btw

I waded in there for a bit, but nothing I did seemed to change anything. Over my head, probably. But speaking of over my head!

I added this code to the project (plus a say for confirmation). It is running, but it isn’t stopping the printed description.

Carry out Bob taking Marbles:
	move marbles to bob;
	say "just checking to see if this fires";
	rule succeeds. [halts carry out rule processing]

I’m probably bungling your instruction somehow.

Output:

->listen

lab (in bob)

A room description.

just checking to see if this fires

I’ve added the rideable vehicles extension and designated the person as a rideable animal. I can make that work with a bit of flim-flam.

“Move the player to X” will still print a room description by default. Add “, without printing a room description” to set flag to 1.

3 Likes

Nope – I bungled the suggestion by forgetting the all-important phrase option. See corrected version above.

1 Like

OK, all’s well! Thanks to both of you.

1 Like