First Post!
I played most of the Infocom text games back in the 80s, and got the itch to try something myself.
I wanted to implement a more robust carrying capacity rule to have a fairly simple way of preventing larger items from fitting into smaller containers. But I’m stumped on a point. When I try to change the can’t drop if this exceeds carrying capacity rule, I get a problem - in the line “let the receptacle be the holder of the actor;”, Inform says it does not know the term “actor”. Which is weird since I copied it verbatim from the standard rules. There’s a bunch of other error messages, but I think they all link back to that. Using build 6M62.
Here’s the full example:
[spoiler]“Container and Supporter Encumbrance System” by RedShirtNo5
Everything has a number called an encumbrance. The verb to encumber means the encumbrance property. A thing usually encumbers 1.
This is the new can’t drop if this exceeds carrying capacity rule:
let the receptacle be the holder of the actor;
if the receptacle is a room, continue the action; [room floors have infinite capacity]
if the receptacle provides the property carrying capacity:
if the receptacle is a supporter:
if the total encumbrance of things on the receptacle plus the encumbrance of the noun is greater than the carrying capacity of the receptacle:
if the actor is the player:
now the prior named object is nothing;
say “[There] [are] no more room on [the receptacle].” (A);
stop the action;
otherwise if the receptacle is a container:
if the total encumbrance of things in the receptacle plus the encumbrance of the noun is greater than the carrying capacity of the receptacle:
if the actor is the player:
now the prior named object is nothing;
say “[There] [are] no more room in [the receptacle].” (B);
stop the action.
The new can’t drop if this exceeds carrying capacity rule substitutes for the can’t drop if this exceeds carrying capacity rule.
This is the new can’t insert if this exceeds carrying capacity rule:
if the second noun provides the property carrying capacity:
if the total encumbrance of things in the second noun plus the encumbrance of the noun is greater than the carrying capacity of the second noun:
say “There isn’t room for the [noun] in the [second noun].”;
stop the action [with library message inserting it into action number 7 for the second noun;].
The new can’t insert if this exceeds carrying capacity rule substitutes for the can’t insert if this exceeds carrying capacity rule.
This is the new can’t put if this exceeds carrying capacity rule:
if the second noun provides the property carrying capacity:
if the total encumbrance of things on the second noun plus the encumbrance of the noun is greater than the carrying capacity of the second noun:
say “The [second noun] doesn’t have enough room for the [noun].”;
stop the action [with library message putting it on action number 6 for the second noun].
The new can’t put if this exceeds carrying capacity rule substitutes for the can’t put if this exceeds carrying capacity rule.
Test Room is a room.
The player is in the Test Room. [The carrying capacity of the player is 3.]
A table is in the Test Room. The table is a supporter. The carrying capacity of the table is 4.
A book is in the Test Room. The book encumbers 1.
The barbells are in the Test Room. The barbells encumber 3.
A telephone is in the Test Room. The telephone encumbers 1.
A computer screen is in the Test Room. The computer screen encumbers 2.[/spoiler]
The new can’t insert if this exceeds carrying capacity rule and new can’t put if this exceeds carrying capacity rule seem to work fine.
Any suggestions would be appreciated.