Hello again,
Well I continue to struggle on this problem. My latest effort is below;
[code]things can be listed or not listed. things are usually listed.
[below resets the not listed flag so all objects are described]
before printing the locale description of something (called the thingy):
now the thingy is listed;
rule for printing a locale paragraph about something (called the thingy):
let l be a list of things;
let levelcount be the visibility ceiling count calculated;
let ilevel be the visibility-holder of the player;
if thingy is ilevel and thingy is listed:
say “You are [the posture of the player]”;
let itter be 0;
repeat with ilevelcount running from 2 to the levelcount:
if itter is greater than 0, say " which is";
if ilevel is a supporter, say " on ";
if ilevel is a container, say " in ";
let first-desc be the initial appearance of ilevel;
if first-desc is not “”:
say “[first-desc in lower case]”;
otherwise:
say "a ", ilevel;
let ilevel be the visibility-holder of the ilevel;
increment itter;
add ilevel to l;
[try to display items on the same level as the players supporter/container]
now thingy is not listed;
repeat with dooda running through l:
if dooda is not location:
if dooda is a container:
say "In the ", dooda, “with you [a list of the things that are in the dooda]”;
if dooda is a supporter:
say "On the ", dooda, "beside the ", thingy, “[a list of the things that are on the dooda]”;
[/code]
This is (at last) getting there, but trips up when it trys to list the items that are at the same level the players supporter/container is.
For example if you are in a box and the box is on a bed and there is a pillow on the bed I want to say -
You are sitting in a box that is on a bed. On the bed beside the box is a pillow.
The first part works, but the second lists all the items on the bed -including the player, the box and anything in the box.
The problem is that I do not know how to exclude things in [a list of the things that are on the dooda] - saying [a list of the things that are on the dooda excluding the player] errors out moaning about not understaning the player.
I have tried filling a list - so I can remove the player and then just list the list - but can’t work out how to auto fill a list
let l be a list of things on the dooda;
Errors out.
Any help greatly appreciated.