Possible To Suppress Room Descriptions??

Is it possible to display the room description the first time Player enters room, but on subsequent enterings only display it if he types "Look??"

Seems like that should be pretty easy, but I can't find a way in the GUI. If you click on "Game" at left of window and then "Room Descriptions," you can uncheck the box, "Show room descriptions when entering a room." But then the description doesn't appear even first time Player enters room.

Probably possible to accomplish that in code, but I have no idea how.


{Once:This is the room you just entered.}

After that, you won't see the room description.
(Yea, simple, I know... BUT, when you don't know, it's impossible.)


If you still want the "You can see:" and "You are in:" lines to appear when entering a room subsequent times, DarkLizerd is right. You can use {once: for text descriptions, or firsttime for scripts, to make them only appear the first time. However, if you have two rooms with the same descriptions, using {once: will only show the description for the first one.

If you want to the whole description including the automatically generated parts to only show the first time, you can turn off "Show room descriptions when entering a room." and show it once using the roomenter script ("script when entering a room:" on the game's "Scripts" tab). You use that script to display the description if the room hasn't already been entered. You can do this by checking the visited attribute.

So the script would be something like:

if (not GetBoolean (game.pov.parent, "visited")) {
  ShowRoomDescription
}

Dark Lizerd and Mr. Angel, I appreciate you taking time to help me. Unfortunately, it's just not working for me. DL's suggestion of using "once" in the descriptions does indeed prevent the description from appearing on second and later visits to the room. Prevents it too well - Typing "look" doesn't do anything. I wanted to give Player the option of reading the room description again if he wanted to.

Regarding Mr. Angel's idea, I've tried every variation I can think of, but "ShowRoomDescription" always gets an error message. Maybe I don't know the proper punctuation and/or syntax. Or maybe I just don't WHERE to put that expression.

Well, I'm going to move on. I've noticed that other Quest games, including ones with stellar reviews, print the entire room description every time Player enters the room. Story, vivid characterization, and plot more important than technical details.


but "ShowRoomDescription" always gets an error message. Maybe I don't know the proper punctuation and/or syntax. Or maybe I just don't WHERE to put that expression.

I could have made a mistake answering off the top of my head, but I'm pretty sure I got the syntax right.

What is the error message?


I tested that code now. It seems to work fine; although I found it a little counterintuitive having no output at all after entering a command. So I came up with this alternate version which shows just the "You are in the kitchen." line when revisiting a previous room:

if (GetBoolean (game.pov.parent, "visited")) {
  msg (CapFirst (game.pov.parent.descprefix) + " " + GetDefiniteName (game.pov.parent) + ".")
}
else {
  ShowRoomDescription
}

Or this slightly more elaborate one, which shows "You are in the kitchen." but provides the player a link they can click to see the full description (it's a commandlink pointing to the "look" command. The two JS lines are optional; they just cause the link to be disabled when the player leaves the room):

JS.eval ("$('.commandlink.looklink').addClass('disabled').data('deactivated',1);")
if (GetBoolean (game.pov.parent, "visited")) {
  msg (CapFirst (game.pov.parent.descprefix) + " {command:look:" + GetDefiniteName (game.pov.parent) + "}.")
  JS.eval ("getCurrentDiv().find('.commandlink').last().addClass('looklink')")
}
else {
  ShowRoomDescription
}

Mr. Angel, here is the entire code I have so far. I don't expect you to read through the whole thing, but you can see where I pasted the code you give above, and maybe you can tell me if I have it in the right place.

<asl version="580">
  <include ref="English.aslx" />
  <include ref="Core.aslx" />
  <game name="House II">
    <gameid>4a25e660-6bc4-4572-ad25-be2128aa7bcc</gameid>
    <version>1.0</version>
    <firstpublished>2021</firstpublished>
//    <showdescriptiononenter /> ---- _Commented out this line._
JS.eval ("$('.commandlink.looklink').addClass('disabled').data('deactivated',1);")
if (GetBoolean (game.pov.parent, "visited")) {
  msg (CapFirst (game.pov.parent.descprefix) + " {command:look:" + GetDefiniteName (game.pov.parent) + "}.")
  JS.eval ("getCurrentDiv().find('.commandlink').last().addClass('looklink')")
}
else {
  msg ("Yo") // I never see this so code must not ever get to this line.
  ShowRoomDescription
}

    <attr name="autodescription_youarein_useprefix" type="boolean">false</attr>
    <attr name="autodescription_description" type="int">2</attr>
    <autodescription />
    <attr name="autodescription_youcango" type="int">4</attr>
    <attr name="autodescription_youcansee" type="int">3</attr>
    <attr name="autodescription_description_newline" type="boolean">false</attr>
    <menufontsize type="int">10</menufontsize>
    <appendobjectdescription type="boolean">false</appendobjectdescription>
    <roomenter type="script">
    </roomenter>
  </game>
  <object name="porch">
    <inherit name="editor_room" />
    <isroom />
    <alias>Front Porch</alias>
    <descprefix type="string"></descprefix>
    <description><![CDATA[You are standing on the front porch of a seedy, ramshackle house. It lists a bit on its foundation. Obviously, no one has maintained this property for years. What little grass you can see is pretty much swallowed up by weeds, overgrown shrubs, and dirt.<br/><br/>The boards under your feet have some give to them. In other words, the wood is rotten. Termites, moisture, and neglect have taken their toll. <br/><br/>As you take in the filthy windows (Some of them patched with masking tape) and peeling, chipped paint, you sigh in resignation and despair ... Because this dilapidated, decrepit domicile is your home.]]></description>
    <usedefaultprefix type="boolean">false</usedefaultprefix>
    <exitslistprefix>You can open the front door and go </exitslistprefix>
    <dropdestination type="object">porch</dropdestination>
    <enter type="script">
    </enter>
    <object name="player">
      <inherit name="editor_object" />
      <inherit name="editor_player" />
      <alias>Bubba</alias>
      <attr name="pov_look"><![CDATA[Um ... You can't exactly <i>examine</i> yourself, {player.external_alias}. An Infocom game would say something snarky, like "That's difficult unless your eyes are prehensile." But we're not gonna rip off Infocom. If you feel compelled to gaze upon your narcissistic person, find a mirror.]]></attr>
    </object>
    <exit alias="north" to="Foyer">
      <inherit name="northdirection" />
    </exit>
  </object>
  <object name="Foyer">
    <inherit name="editor_room" />
    <isroom />
    <usedefaultprefix type="boolean">false</usedefaultprefix>
    <description>You are just inside the front door of your house, at the north end of a dim,  dingy, dirty hallway. One wall is covered with graffiti, and muddy footprints mar the floor.</description>
    <dropdestination type="object">Foyer</dropdestination>
    <enter type="script">
    </enter>
    <exit alias="south" to="porch">
      <inherit name="southdirection" />
    </exit>
    <object name="graffiti">
      <inherit name="editor_object" />
      <scenery />
      <alt type="stringlist">
        <value>wall</value>
      </alt>
      <drop type="boolean">false</drop>
      <not_all />
      <read type="script">
        read wall
      </read>
      <look type="script">
        read wall
      </look>
    </object>
    <object name="footprints">
      <inherit name="editor_object" />
      <inherit name="plural" />
      <scenery />
      <alt type="stringlist">
        <value>footprint</value>
        <value>print</value>
      </alt>
      <look><![CDATA[<i>Why the bleep can't people wipe their bleeping feet</i>?? Well, what does it matter at this point??]]></look>
    </object>
    <exit alias="north" to="hallway bend">
      <inherit name="northdirection" />
    </exit>
  </object>
  <object name="hallway bend">
    <inherit name="editor_room" />
    <description>You're at the north end of a dimly-lit hallway. It makes a ninety degree bend to the west. There's a door to the east.</description>
    <dropdestination type="object">hallway bend</dropdestination>
    <exit alias="south" to="Foyer">
      <inherit name="southdirection" />
    </exit>
    <exit alias="east" to="bathroom">
      <inherit name="eastdirection" />
    </exit>
  </object>
  <object name="bathroom">
    <inherit name="editor_room" />
    <isroom />
    <alt type="stringlist">
      <value>rest room</value>
      <value>restroom</value>
      <value>necessary room</value>
    </alt>
    <drop type="boolean">false</drop>
    <not_all />
    <description>{once:This bathroom smells like ... Well, it ain't perfume. Just be grateful the sink, toilet and shower all work properly, even if none of then are particularly clean. A medicine cabinet with a mirror is above the sink.}</description>
    <exit alias="west" to="hallway bend">
      <inherit name="westdirection" />
    </exit>
    <object name="bathmat">
      <inherit name="editor_object" />
      <alt type="stringlist">
        <value>bath mat</value>
        <value>mat</value>
      </alt>
    </object>
  </object>
  <function name="read wall">
    msg ("Over the years, roommates and visitors have scribbled on, and even carved into, this wall. You see many variations on the `F' word and a lot of other profanity. Near the bottom is a large heart in red crayon. Inside is an arrow and the words, `Cooter + Felina.'")
  </function>
</asl>

No.

I previously said to put the script in the game.roomenter script attribute, which you can find by going to the game object → "Scripts" tab → "Script when entering a room:" and put the code in that box.

If you really want to do it in full code view, it would go between <roomenter> and </roomenter>.

So it would look like this:

<asl version="580">
  <include ref="English.aslx" />
  <include ref="Core.aslx" />
  <game name="House II">
    <gameid>4a25e660-6bc4-4572-ad25-be2128aa7bcc</gameid>
    <version>1.0</version>
    <firstpublished>2021</firstpublished>
    <showdescriptiononenter type="boolean">false</showdescriptiononenter>
    <attr name="autodescription_youarein_useprefix" type="boolean">false</attr>
    <attr name="autodescription_description" type="int">2</attr>
    <autodescription />
    <attr name="autodescription_youcango" type="int">4</attr>
    <attr name="autodescription_youcansee" type="int">3</attr>
    <attr name="autodescription_description_newline" type="boolean">false</attr>
    <menufontsize type="int">10</menufontsize>
    <appendobjectdescription type="boolean">false</appendobjectdescription>
    <roomenter type="script">
      JS.eval ("$('.commandlink.looklink').addClass('disabled').data('deactivated',1);")
      if (GetBoolean (game.pov.parent, "visited")) {
        msg (CapFirst (game.pov.parent.descprefix) + " {command:look:" + GetDefiniteName (game.pov.parent) + "}.")
        JS.eval ("getCurrentDiv().find('.commandlink').last().addClass('looklink')")
      }
      else {
        msg ("Yo")
        ShowRoomDescription
      }
    </roomenter>
  </game>
  <object name="porch">
    <inherit name="editor_room" />
    <isroom />
    <alias>Front Porch</alias>

…remaining code unchanged…

Thank you, Mr. Angel. Have finally got code working. Game displays room description when Player enters first time, and thereafter displays in only when he types "Look."

One thing: You said, "If you really want to do it in full code view ..."

I didn't have any desire at all to do it in full code view, but when I tried to copy code to box in the game.roomenter script as you suggested, I could only copy the first line to the box. The others disappeared. Maybe I didn't know what to select from the script menu.


I didn't have any desire at all to do it in full code view, but when I tried to copy code to box in the game.roomenter script as you suggested, I could only copy the first line to the box. The others disappeared. Maybe I didn't know what to select from the script menu.

You don't need to choose a script.

There should be a button next to each script block that opens code view just for that script. On the web editor it is a button that says "Code View"; but I believe the desktop editor has an icon for it.


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

Support

Forums