Description displaying twice?

I am sure this question has been asked before, but I came by here on the forums just to ask, simply because while going through the list of script commands and settings, I couldn't find anything that supported what I'm trying to do.

I'm trying to create a description for a room, that when you first enter/spawn into a room, it gives you an in-depth description, and then afterwards only displays a short summary of the room.

I thought I had it figured out with the room's "before/after first visit" options under the scripts tab, but it displays both the "first visit" and short message description for other visits, at the same time.

Is there some way I can set up a multi-purpose script that detects if the player has been in any room before, and then triggers the appropriate description? Or do I have to create an individual script, tracker, or other command to do that?


The room is lit by torches. {once: Large wooden beams run across the ceiling. Tables are placed in a row.}
Add the above to the room description either in the text box or in a script.
The {once: whatever text} will only print the text in brackets once and the rest will show every time you enter the room.


Thank you for the help. So, it seems like for the starting room, I can't successfully use both the "after entering the room" and "after entering the room for the first time", since it displays both, but I could use the above code you gave me as a sort of work-around.

Do you know if that a preexisting issue with the Quest programming, or is it intentional?


You can use the visited attribute to check whether the room has already been entered.

if (player.parent.visited) then ...

Perhaps the best way is to overwrite and expanse the showRoomDescription function


Not sure if this is what you want, but, K.V. did come up with a library, 'verbosity', which allowed the adventure writer to display the room description in the following ways

Entering SUPERBRIEF or SHORT will not display any room descriptions (except for the room name, the objects list, and the exits list), even if you haven't visited the room.
Entering BRIEF will not display room descriptions in rooms you have visited before
Entering VERBOSE or LONG will display all room descriptions

http://textadventures.co.uk/forum/samples/topic/y-ykeodite2pubg28rd-_q/infocom-style-room-descriptions

I've checked the link on the page for the library, but it appears to be broken. If KV is around, maybe he can post the code.


This is version 2 of VerbosityLib. It was designed to work with Quest 5.7.2, and I can't remember if I tested it out with Quest 5.8.

In fact, Pixie was considering including this code in Quest 5.8, and I can't remember if he did that. (EDIT: I searched on GitHub, and I don't see this code in Quest 5.8. If there is an issue with 5.8, it will be something to do with my modified ShowRoomDescription().)

Basically, I can't remember anything! [Maniacal Laugh #5]


Anyway, here's the code (which will need to be pasted into a blank document, then saved as VerbosityLib.aslx"):

<!-- 
    VerbosityLib
    version 2
-->

<library>
  <function name="ShowRoomDescription"><![CDATA[
    if (not GetBoolean (game, "verboseonly ")){
      if (GetBoolean(game,"brief_descriptions")) {
        if (game.pov.parent.visited) {
          if ((player.currentcommand = "l") or player.currentcommand = "look") {
            if (not GetBoolean(game, "alwayslook")) {
              game.autodescription_description = 0
            }
            else {
              // Do nothing
            }
          }
          else {
            game.autodescription_description = 0
          }
        }
      }
    }
    isDark = CheckDarkness()
    if (isDark) {
      descriptionfield = "darkroomdescription"
    }
    else {
      descriptionfield = "description"
    }
    if (game.autodescription) {
      desc = ""
      for (i, 1, 4) {
        if (i = game.autodescription_youarein) {
          if (game.autodescription_youarein_useprefix) {
            youarein = game.pov.parent.descprefix
            desc = AddDescriptionLine (desc, youarein + " " + GetDisplayName(game.pov.parent) + ".")
          }
          else {
            desc = AddDescriptionLine (desc, "<b>" + CapFirst(GetDisplayName(game.pov.parent)) + "</b>")
          }
          if (game.autodescription_youarein_newline) {
            msg (desc + "<br/>")
            desc = ""
          }
        }
        if (i = game.autodescription_youcansee) {
          objects = FormatObjectList(game.pov.parent.objectslistprefix, GetNonTransparentParent(game.pov.parent), Template("And"), ".")
          desc = AddDescriptionLine(desc, objects)
          if (game.autodescription_youcansee_newline) {
            msg (desc + "<br/>")
            desc = ""
          }
        }
        if (i = game.autodescription_youcango) {
          exits = FormatExitList(game.pov.parent.exitslistprefix, GetExitsList(), Template("Or"), ".")
          desc = AddDescriptionLine(desc, exits)
          if (game.autodescription_youcango_newline) {
            msg (desc + "<br/>")
            desc = ""
          }
        }
        if (i = game.autodescription_description) {
          if (HasScript(game.pov.parent, descriptionfield)) {
            if (LengthOf(desc) > 0) {
              msg (desc)
              desc = ""
            }
            do (game.pov.parent, descriptionfield)
            if (game.autodescription_description_newline) {
              msg ("")
            }
          }
          else {
            desc = AddDescriptionLine(desc, GetRoomDescription())
            if (game.autodescription_description_newline) {
              msg (desc + "<br/>")
              desc = ""
            }
          }
        }
      }
      if (LengthOf(desc) > 0) {
        msg (desc)
      }
    }
    else {
      if (HasScript(game.pov.parent, descriptionfield)) {
        do (game.pov.parent, descriptionfield)
      }
      else {
        fulldesc = GetRoomDescription()
        if (LengthOf(fulldesc) > 0) {
          msg (fulldesc)
        }
      }
    }
    if (GetBoolean(game,"brief_descriptions")) {
      game.autodescription_description = game.autodescription_descriptionBak
    }
  ]]></function>

  <command name="brief_cmd">
    <pattern>brief</pattern>
    <script><![CDATA[
	  if (not GetBoolean (game, "verboseonly ")){
        if (not GetBoolean(game, "brief_descriptions")) {
          game.notarealturn = true
          game.brief_descriptions = true
          game.autodescription_description = game.autodescription_descriptionBak
        }
      msg ("Room Descriptions are now set to \"BRIEF\".  Room descriptions will only print if you haven't visited a room yet.<br/>")
	  }
	  else {
	    msg("This game does not support BRIEF or SUPERBRIEF settings.  Room descriptions will always print.<br/>")
	  }
    ]]></script>
  </command>

  <command name="superbrief_cmd">
    <pattern>superbrief;short</pattern>
    <script><![CDATA[
	  if (not GetBoolean (game, "verboseonly ")){
        game.notarealturn = true
        game.autodescription_description = 0
        msg ("Room Descriptions are now set to \"SUPERBRIEF\".  Room descriptions will not print (even if you haven't visited the room before).<br/>")
	  }
	  else {
	    msg ("This game does not support BRIEF or SUPERBRIEF settings.  Room descriptions will always print.<br/>")
	  }
    ]]></script>
  </command>

  <command name="verbose_cmd">
    <pattern>verbose;long</pattern>
    <script><![CDATA[
	  if (not GetBoolean (game, "verboseonly ")){
        game.notarealturn = true
        game.autodescription_description = game.autodescription_descriptionBak
        game.brief_descriptions = false
        msg ("Room Descriptions are now set to \"VERBOSE\".  Room descriptions will always print.<br/>")
	  }
	  else {
	    msg ("This game does not support BRIEF or SUPERBRIEF settings.  Room descriptions will always print.<br/>")
	  }
    ]]></script>
  </command>
  
  <editor>
	<tab>
	  <parent>_GameEditor</parent>
	  <caption>Verbosity Settings</caption>
	  <appliesto>game</appliesto>
	  <control>
		<controltype>checkbox</controltype>
		<caption>Always print room descriptions</caption>
		<attribute>verboseonly</attribute>
	  </control>
	  <control>
		<onlydisplayif>not GetBoolean(game,"verboseonly")</onlydisplayif>
		<controltype>checkbox</controltype>
		<caption>Always print room descriptions when player enters LOOK</caption>
		<attribute>verboseonly</attribute>
	  </control>
	</tab>
  </editor>
</library>

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

Support

Forums