Having trouble with the "look" feature for a room description

I made an object/room for the hallway. I do not want to overburden the player by entire room descriptions (to me the "room description" is what is shown on screen after typing "look" or "look hallway" when playing). I do however want them to have the chance to explore the area further by typing "look hallway" for instance. So it would look like this upon entering a room.

[You are in the hallway.

You can see Jane and a potted plant.

You can go to Jane's room, kitchen or bathroom.]

But if you typed "look hallway" now it would reveal-

[This is a long hallway with a soft carpet and picture frames covering the walls.] this part will not show until "look(ed)". People know what a hallway is, so why clutter the screen with details at first?

I have played around with the Room Descriptions tab under the Game section. Unchecking both the "Automatically generate room descriptions" and "Show room description upon entering a room" will hide everything, but typing "look" will give the room description I am after. If I uncheck only "Automatically generate room descriptions", but leave "Show room description upon entering a room" checked, than the room description I am after shows up from the beginning, but everything else is hidden. If I only uncheck "Show room description upon entering a room", but leave "Automatically generate room descriptions" checked, then everything is left blank until I type "look" and then I get-

[You are in the hallway.

You can see Jane and a potted plant.

You can go to Jane's room, kitchen or bathroom.]

to show up. But no way to now get the actual room description.

Same with if I tweak the Room Detail Layout. I can change the room description to 0, but it wont show it how I want it and trying to check and uncheck the previous boxes does just that, tweaks it, but not to my satisfaction.

For my sanity's sake I will leave it as it is, so the room description shows from the start, but I would really prefer to hide it until called upon and I would assume there is a simple check box somewhere to do that, but I am missing it. Thank you.


I can think of two ways to do this.

Option 1: Checking the current command

In each room's description, you could add {either game.pov.currentcommandpattern = look: at the beginning, and } at the end. This will cause the description to only be shown if the current command is look.

If you have a room whose description is a script, you would do the same thing, just putting the whole thing inside an if block testing the condition game.pov.currentcommandpattern = look.

This is simple enough, but you need to do it for every room. Could be time consuming if your game is large.
On the other hand, using this method you could put something in the 'else' block, if you want to display a shorter description when the player enters some rooms.

Option 2: Modifying the 'look' command

I can change the room description to 0, but it wont show it how I want it

This is a useful idea. If you set the room description to 0, but then modify the "look" command so that it changes this setting before showing the description, it could do what you want.

If you find the "look" command (the desktop editor allows you to show hidden elements from libraries and edit them, but I'm not sure how), you will see that its script is simply:

ShowRoomDescription

You can change this to:

game.autodescription_description = 1
ShowRoomDescription
game.autodescription_description = 0

So then the actual description is element 1 in the room description when the player is looking around, and 0 the rest of the time.

In this case, if you have a room where the description contains something the player would immediately notice, you could put game.autodescription_description = 1 in the "before first enter" script for the room, game.autodescription_description = 0 in the "on enter" (so that it doesn't stay as 1 when they move to another room) and then use the method described in option 1 above.


I use first time/ otherwise scripts a lot in room descriptions. No coding involved ( I can’t do coding)and if the otherwise is set as another first time you can extend it to several different descriptions of the same room.( or object)
I usually put the bigger description first as this is the player’s first overall impression of the room. A shorter description after that ( seen that, just passing through).


I tried to make the Room an Object instead, since it has the built in "look at" feature, but the game simply refuses to allow me to look at it, instead telling me "I can't see that." All other objects in the game allow me to look at them. Why not this hallway? I have not tried the coding yet, just not understanding why the game will acknowledge some things as an object and others as not. Is it because it already has exits to them?

Or because I had initially set it up as a Room and even though I have later changed it to an Object, the game still thinks it is a Room? I know when I had initially changed it, it was still giving me the automatic room description, even though all my lines were blank- as in the In-room description and the "Look at" object description. And the tab for Room was no longer available, because it was now an object. But when I switched it back to a Room, it showed in the Room tab for it's description was still there.

Why would it still be there if I had already changed it's "type". Because I had not saved first? Even after the fact it still wont let me "look at" the hallway like any other object, which I assume would fix the issue simply enough, although for all I know keeping a room an object may create other problems down the road...


I tried to make the Room an Object instead, since it has the built in "look at" feature, but the game simply refuses to allow me to look at it, instead telling me "I can't see that." All other objects in the game allow me to look at them. Why not this hallway? I have not tried the coding yet, just not understanding why the game will acknowledge some things as an object and others as not. Is it because it already has exits to them?

Is the object you're trying to look at in the same room as the player?
If you want to be able to look at the room you're in, you need to modify the scope so that the room itself is considered visible.
The easiest way to do this is to add an attribute to the game element named changecommandscope. It should be a script, which does:

list add (items, game.pov.parent)

This will allow the player to use commands on the room they are in. But all of the built-in commands apart from lookat will probably tell the player that they can't do that, because the room isn't reachable.


I just made a whole new object in the hallway called hallway and gave that a description, so when people want to look at hallway there is something that the game sees and tells the player what I need it to. I also made sure it was scenery so it wont show up to the player. It seems to work, although just odd to do it that way. When I get a chance I will try to do the code part as you suggested, but I am just trying to get this thing in a reasonable working condition with all basics first and then I can try and fine tune it.


In case anyone else has the same issue and finds this post, some of the options I presented above can be replicated in the web editor just by putting a piece of code in the start script (so you're not messing around with stuff the web editor doesn't let you edit).

To hide the description except when using the "look" command:

game.lookdescription_description = game.autodescription_description
game.autodescription_description = 0
look.script => {
  game.autodescription_description = lookdescription_description
  ShowRoomDescription
  game.autodescription_description = 0
}

Or to put the room in scope, so that you can make a room an Object/Room and use its 'look' description when the player types "look hallway":

lookat.changecommandscope => {
  list add (items, game.pov.parent)
}

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums