I’m having problems restricting reachability.
Let’s say I want the player to be able to get to a window only if he first gets on a shelf under the window by pushing a crate near the window. The player shouldn’t be able to reach things which are on the floor if he’s on the shelf either.
I tried creating a shelfside
property for the crate to test whether it’s near the shelf, then I created an elevated
property to restrict access to the shelf, like so …
The Shed is a room. The description is "A window is above a shelf."
The doodad is in the Shed.
A supporter can be elevated. A supporter is usually not elevated.
A rule for reaching outside a supporter:
if the player is on an elevated supporter:
if the noun is on a not elevated supporter:
deny access;
otherwise: [the noun is on an elevated supporter]
continue the action;
otherwise: [player is on a not elevated supporter]
if the noun is on an elevated supporter:
deny access;
otherwise: [the noun is on a not elevated supporter]
continue the action.
The crate is in the Shed. The crate is enterable, a supporter, and elevated. The description is "It's heavy, and it looks wide enough and sturdy enough to support you." The crate can be shelfside. The crate is not shelfside.
Instead of pushing or pulling the crate:
if the crate is shelfside:
now the crate is not shelfside;
say "You push the crate away from the shelf.";
otherwise:
now the crate is shelfside;
say "You pull the crate over to the shelf.".
After entering the crate:
if the crate is shelfside:
now the crate is elevated;
continue the action;
otherwise:
continue the action.
After getting off the crate:
if the crate is elevated:
now the crate is not elevated;
continue the action;
otherwise:
continue the action.
The shelf is in the Shed. The shelf is enterable, a supporter, elevated, and not described. The description is "It's higher than your head, but it looks wide enough and sturdy enough to support you."
The window is on the shelf. The window is fixed in place.
And this is what happens:
Shed
A window is above a shelf.You can see a doodad and a crate here.
>get on the shelf
You get onto the shelf.On the shelf you can see a window.
>take the doodad
Taken.>get off the shelf
You get off the shelf.Shed
A window is above a shelf.You can see a crate here.
>get on the crate
You get onto the crate.>get on the shelf
(getting off the crate)
You get onto the shelf.On the shelf you can see a window.
>get off the shelf
You get off the shelf.Shed
A window is above a shelf.You can see a crate here.
>push the crate
You pull the crate over to the shelf.>get on the crate
You get onto the crate.>showme crate
crate - supporter
yourself - person
doodad
location: in the Shed
singular-named, improper-named; unlit, inedible, fixed in place; enterable, elevated; shelfside …
I thought this would work a little better than it is. What did I do wrong?