Hiya!
[rant=“lots of code”][code]“thing that does not work like i want it to” by Wes Lesley
section make it work
Use MAX_STATIC_DATA of 500000.
section looking toward
Understand “look [direction]” as facing.
Facing is an action applying to one visible thing.
Carry out facing:
let the viewed item be the room noun from the location;
if the viewed item is not a room, say “You can’t see anything promising that way.” instead;
try looking toward the viewed item;
Understand “look toward [any adjacent room]” as looking toward. Understand “examine [any adjacent room]” as looking toward.
Looking toward is an action applying to one visible thing.
Carry out looking toward:
say “You make out [the noun] that way.”;
section where to go
Definition: a direction (called thataway) is viable if the room thataway from the location is a room.
after printing the name of the room while not constructing the status line:
say roman type;
say line break;
let count of exits be the number of viable directions;
if the count of exits is 0, say “Exit unknown.” instead;
if the count of exits is 1, say “Exit [list of viable directions].”;
otherwise say “Exits are [list of viable directions].”;
When play begins:
now left hand status line is “Nearby: [if a room is adjacent][the list of adjacent rooms][end if][if a room is adjacent and a door is visible] and [end if][if a door is visible][the list of visible doors][end if]”;
now right hand status line is “”;
After printing the name of an adjacent room (called the target) while constructing the status line:
let aim be the best route from the location to the target;
say " ([aim])";
Rule for printing the name of a direction (called the aim) while constructing the status line:
choose row with a heading of the aim in the Table of Abbreviation;
say “[shortcut entry]”;
Table of Abbreviation
heading shortcut
north “N”
northeast “NE”
northwest “NW”
east “E”
southeast “SE”
south “S”
southwest “SW”
west “W”
up “U”
down “D”
inside “in”
outside “out”
section locations
There is a room called Town Square.
There is a room called West Street.
There is a room called East Street.
There is a room called North Street.
There is a room called South Street.
There is a room called Second Avenue East.
There is a room called First Avenue East.
There is a room called First Avenue West.
There is a room called Second Avenue West.
There is a room called Bascule Bridge.
There is a room called South Bridge Operation Booth.
There is a room called North Bridge Operation Booth.
There is a room called Lighthouse.
There is a room called Dockyard.
There is a room called Power Station.
There is a room called Dockyard Maintanance.
There is a room called Docks.
There is a room called Customs Office.
There is a room called Cave.
North of Town Square is North Street.
South of Town Square is South Street.
East of Town Square is East Street.
West of Town Square is West Street.
East of North Street is First Avenue East.
West of North Street is First Avenue West.
East of South Street is Second Avenue East.
West of South Street is Second Avenue West.
East of Second Avenue East is North Bridge Operation Booth.
Southeast of Second Avenue East is Bascule Bridge.
Southeast of Bascule Bridge is Dockyard.
East of South Bridge Operation Booth is Dockyard.
Southwest of Lighthouse is Dockyard.
North of Dockyard is Customs Office.
East of Dockyard is Dockyard Maintanance.
Southeast of Dockyard is Docks.
Southwest of Dockyard is Power Station.[/code][/rant]
Questions:
- If you “look [direction]”, it will wreck the line by mentioning the exits - but it should only do that when printing the name of the player’s location. It’s because of the “after printing the name of the room while not constructing the status line:” but I don’t know how else to phrase it.
- I want to bind this into a command that goes “look around” and then it will give you the overview of what room is where (and where which doors lead). Any help there would also be welcome.
- This isn’t the actual full room list. However, the upper code is what I will be using (of course). Thing is, in my real, huge map, the “nearby:” starts with an empty space, then a comma, then the real list. I don’t know why. The error does not appear here and the map is already so huge that it will spoil a lot of fun things by just listing the location names… so I’d prefer not to show off those things. And I’d love to get rid of that empty space and the comma. Or just the comma.