Note: This question is more of a curiosity than something I’d use in my game (unless the answer actually turns out to be “yes”).
I recently saw Zed’s mixmaster example, and a little later I noticed that there’s a default response to examining directions, so I decided I’d like to replace that default response in some rooms.
There are obvious, relatively simple ways to do this, like an Instead of examining west in the Atrium
for every case or maybe something like A room has some text called the west-view
for each of the possible directions.
But thanks to the aforementioned example, I came up with this possibly crazy approach:
Messy Restaurant is a room. "It's a huge mess, with broken plates and food everywhere. There must've been a big fight here recently."
A room has a relation of direction to text called viewpoint.
When play begins:
now the viewpoint of Messy Restaurant relates west to "You see some spaghetti over there.";
now the viewpoint of Messy Restaurant relates south to "Several cream pies are splattered all over the wall.";
now the viewpoint of Messy Restaurant relates up to "Gravy drips from the otherwise immaculate chandelier.";
now the viewpoint of Messy Restaurant relates outside to "The windows are streaked with mustard.".
Carry out examining a direction when the noun relates to a text by the viewpoint of the location:
say "[the text to which the noun relates by the viewpoint of the location][line break]" instead.
It totally works, but I was wondering if there was any way to set up those relations as static assertions rather than in begin play.
- I tried just using the same statement that was placed in now, but the compiler thought I was trying to define a relation rather than specify one.
- I tried adding
The verb to correspond means the universal relation
and usingcorresponds
instead ofrelates
, but that didn’t work either (I probably misunderstood what the “universal relation” actually is). - I also tried
The verb to overlook means the viewpoint property
, which (perhaps unsurprisingly) didn’t work, as it wanted me to write “<room> overlooks <relation>” which doesn’t seem to work for this purpose.
This does work:
The verb to overlook means the viewpoint property.
Zooming relates various directions to various text.
The verb to zoom means the zooming relation.
Messy Restaurant overlooks the zooming relation.
West zooms "You see some spaghetti over there.".
South zooms "Several cream pies are splattered all over the wall.".
Up zooms "Gravy drips from the otherwise immaculate chandelier.".
Outside zooms "The windows are streaked with mustard.".
But it obviously defeats the point of doing this if I have to define a separate relation and verb for every room using the feature.
This kind of situation already works for directions, so in theory I would think there was a way to do it… but then again, directions are presumably handled specially, so there’s no reason to expect anything that works on them to also work on a relation property.
The goal would be to be able to write statements like this:
West of Messy Restaurant resembles "You see some spaghetti over there.".
Side note: I do realize that (as shown in the mixmaster example) the when play begins
rules can also be made a little more palatable (even matching the above non-working assertion) with a phrase:
To (D - a direction) of (R - a room) resembles (T - a text):
now the viewpoint of R relates D to T.
When play begins:
west of Messy Restaurant resembles "You see some spaghetti over there.";
south of Messy Restaurant resembles "Several cream pies are splattered all over the wall.";
up of Messy Restaurant resembles "Gravy drips from the otherwise immaculate chandelier.";
outside of Messy Restaurant resembles "The windows are streaked with mustard.".
As noted at the top of the post, I probably won’t end up using this approach. I’m currently thinking of settling on the middle-ground of defining 4 or 6 properties for a room (the west-view, south-view, etc – I don’t expect to need this for inside and outside). But I’m still curious if there’s any palatable way for the relation approach to be set up statically… or if there’s any interest in adding a way to do this.