How do I change the alias for a room?

Hi,

At the top of the screen, (Windows Desktop version) when you enter a room, it's alias will be stated. So, if the room is called AreaGame and it's alias is currently "The Capital City", how would I go about changing that to something like "The Sewer System"?

Using a:
Set Variable; AreaGame.alias = "The Sewer System"

Correctly changes the alias of AreaGame, but doesn't change the text on the top of the screen to "The Sewer System".

How would I change the top of the screen to reflect the new alias?


K.V.

Are you changing the alias while the player is in the room?


Change it before the player enters the room.


K.V.

Word. (What DL said.)

...or, if you're feeling really froggy:

JS.updateLocation(GetDisplayName(game.pov.parent))

That will update it to whatever Quest would print to the screen when referring to the room. (If an alias is set, it would print it.)

image


Now, if we do it DL's way, we need no JavaScript:

  <object name="room">
    <inherit name="editor_room" />
    <beforeenter type="script">
      // We change the alias before entering the room.
      room.alias = "The Quest Forum"
    </beforeenter>
    <usedefaultprefix type="boolean">false</usedefaultprefix>
    <object name="player">
      <inherit name="editor_object" />
      <inherit name="editor_player" />
    </object>

image


But what if we want to change the name of the room while inside of said room?

<!--Saved by Quest 5.7.6404.15496-->
<asl version="550">
  <include ref="English.aslx" />
  <include ref="Core.aslx" />
  <game name="Update the Location">
    <gameid>ac256a60-d4f8-44e1-8b62-464cca993c6b</gameid>
    <version>1.0</version>
    <firstpublished>2017</firstpublished>
  </game>
  <object name="room">
    <inherit name="editor_room" />
    <beforeenter type="script">
    </beforeenter>
    <usedefaultprefix />
    <description><![CDATA[<center><br/>To change the location name in the status bar:<br/><br/><br/>Enter:  room alias = "New Name"<br/><br/><br/>...then click:  {command:update location}</center>]]></description>
    <object name="player">
      <inherit name="editor_object" />
      <inherit name="editor_player" />
    </object>
  </object>
  <command>
    <script>
      game.pov.parent.alias = text
    </script>
    <pattern>room alias = "#text#"</pattern>
  </command>
  <command>
    <script>
      JS.updateLocation (GetDisplayName(game.pov.parent))
    </script>
    <pattern>update location</pattern>
  </command>
</asl>

image

image


K.V.

Ooh!

Here's a fun way to do change the room name:

<!--Saved by Quest 5.7.6404.15496-->
<asl version="550">
  <include ref="English.aslx" />
  <include ref="Core.aslx" />
  <game name="Update the Location">
    <gameid>ac256a60-d4f8-44e1-8b62-464cca993c6b</gameid>
    <version>1.0</version>
    <firstpublished>2017</firstpublished>
  </game>
  <object name="room">
    <inherit name="editor_room" />
    <usedefaultprefix />
    <description><![CDATA[<center><br/>To change the location name in the status bar:<br/><br/>  {command:CLICK THE LINK}</center>]]></description>
    <beforeenter type="script">
    </beforeenter>
    <object name="player">
      <inherit name="editor_object" />
      <inherit name="editor_player" />
    </object>
  </object>
  <command>
    <pattern>click the link</pattern>
    <script>
      names = Split("room1;room2;room3;room4;room5;room6;room7;room8;room9;room10", ";")
      game.pov.parent.alias = PickOneString(names)
      EndOutputSection (game.currentoutputsection)
      JS.updateLocation (GetDisplayName(game.pov.parent))
      HideOutputSection (game.lastturnoutputsection)
      ShowRoomDescription
    </script>
  </command>
</asl>

http://textadventures.co.uk/games/view/yshfuhddaewiol8joh_yrw/update-the-location


Thanks a ton. It works!


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

Support

Forums