Untouchable Before phrases?

I have a thing, a perfectly ordinary thing, but the player cannot take it. No reason why. It violates the “can’t take a thing rule” with “That’s not something you can take.” (!) it doesn’t matter what the thing is in this room. I can add other things which can also not be taken. Here is the code for Why can’t the player take the amulet?

[Amulet of St Cuthbert]
An amulet is a thing. The amulet is wearable. 
Description is "The pendant holds a 3-inch golden amulet on a golden chain. One side of the amulet shows a bas relief etching of a man shielding his eyes from a bright light shining from above. The other side is inscribed with the words 'St Cuthbert's Chapel of Blinding Light'. You feel a tingle as you handle it.". 
Understand "pendant" as Amulet.
The amulet is on wooden table.
The plotz is on wooden table.

After examining amulet:
	now printed name of amulet is "Amulet of St Cuthbert".

Before going from backroom when player is briefed:	
	say " 'Wait!' Barak calls out to you. 'I almost forget. Wear this at all times to protect you from any dark forces you may encounter.' He places a golden pendant on the table.";
	now the amulet is on the wooden table;
	stop the action;	

The amulet can be examined, so it is visible and touchable. The plotz also cannot be taken, for unknown reason. Even more mysteriously, other things on the table CAN be taken?!
What’s going on here?

Note the redundancy: the amulet starts on the table in the room. Under a certain condition (player trying to leave), it will appear on the table for taking. Neither of these allow the player to take the amulet (or the test plotz).

Is it possible you have two “table” containers? Try TREE.

Focusing just on the item definitions, they seem pretty takable. I would guess it has something to do with the definition of the room or table. Or, perhaps, something triggered by the “briefed” state.

e: you also might want to share the results of a “SHOWME AMULET” entered in the story pane.

I made a couple of shortcuts to match state. The table wasn’t in the room, and I added “for the first time” so the amulet isn’t reset.

(1) I tried removing the Before going from backroom when player is briefed block, and it did nothing different.
(2) Per your request, here is the SHOWME AMULET data. Not that the amulet is portable and wearable, and on the wooden table in the backroom.

The wooden table was defined in the backroom in a much earlier piece of code. If that wasn’t there, I wouldn’t have been able to pull other things from it either.
You sample code showed me that it is not the amulet, but some context. Am I right?

I’m not sure what you mean. How do I try TREE? What does that mean?

Oh, I typed that in. Was not familiar with that! Now I have a ton of data to examine. :wink:

If I understand this output right, then the amulet is on the correct wooden table in the backroom. It’s with the platter of food, which is correct.
Screen Shot 2023-07-05 at 1.20.23 PM

I moved the Amulet code to the front of my code, and to the bottom of my code. Same results. I’m not sure context is the problem now.

From the sample you provided, I had to add stuff in to make it work for the example. The code you provided seems fine with my workarounds. In your original, you’ve got the amulet on the table before the NPC pops in, so if the PC takes it before leaving, that Before rule when it fires will pull the amulet off the PC and put it back on the table. And since the Before rule wasn’t limited (in my example with “for the first time” but you could also check if the player holds the amulet), it kept firing and stealing the amulet so the player could never leave the room with it. That might be a factor based on your other code.

I made an assumption that you didn’t want the amulet on the table until the plot point that the NPC puts it there for the player.

1 Like

Yes, since it’s possible to copy/paste the items in a generic, empty room with a wooden table (these are not in the sample code), I am guessing the problem is with the table or room.

(since you said you have the problem without the Before rule)

The amulet was originally nowhere and put on the table when player tries to leave the room using the BEFORE block. The NPC never had it. (I tried that too though.) I now have the amulet in the room without any conditional action, and STILL can’t take it.

And yes, your assumption is correct.

can you SHOWME AMULET to see if it’s on the correct table or if you’ve perhaps made another off-stage table inadvertently?

Have you perhaps accidentally made it “part of” the table if it’s there? What happens if you specify “the amulet is portable”?

There’s already a SHOWME of the amulet above, but maybe we need a showme of the table. Or of the room (just showme with no modifier/object)

1 Like

Can you turn ACTIONS on and do a transcript in your actual game and paste it here?

Is there anything else in the game involving a rule that checks taking or taking-it-from that might be inadvertently affecting the table?

1 Like

OK, Here are the relevant commands with the actions on. I found no new discoveries with this.

I can’t figure out why the amulet is not something I can take.

If you can, now do RULES and try TAKE AMULET.

(I’m assuming “golden pendant” is a synonym and not an inadvertent duplicate of the item?)

Also can you PURLOIN AMULET? (test code which should grab any item in the world regardless of scope or portability) If you PURLOIN it and have it in inventory, then drop it, can you take it again?

I think I have a clue, to all you I7 detectives:
I added the block:

Before taking the amulet:
	now player is wearing the amulet;
	stop the action.

The result put the amulet on the player. If I change the action, I can have the player taking the amulet too. Doesn’t that mean that there is a blocking rule that this Before rule overrules?

Try turning on RULES and then TAKE AMULET. Hopefully whichever rule is blocking the take should be listed right before the refusal message (hopefully.)

You can also try commenting out the paragraphs where you define the amulet (put square brackets [ ]around the code) and see if Inform complains there’s no such object or if there’s a different one hiding.

Great idea, but Inform was not born yesterday. I can purloin it and drop it, but when I try to take it, it says “That’s not something you can take.” The turn rules on but the output was too long for me to snapshot and upload.