Exit not appearing when made visible?

Ozymandias
04 Aug 2016, 22:05

I wanted to have a hidden exit leading down into a tunnel, so I created a push crate verb to move a crate that was covering the hole, I then attempted to make the exit visible after that command is done but its not showing up.

'''

  </pushoutofway>
</object>
<exit name="Crate_Covering_Fighting_Shack" alias="down" to="The Fighting Shack">
  <inherit name="downdirection" />
  <visible type="boolean">false</visible>
  <lockmessage>That way is covered by a crate.</lockmessage>
  <runscript type="boolean">true</runscript> '''

EDIT: I've now tried it with switches and I can get the messages to print but the exit still wont appear.


Pertex
05 Aug 2016, 05:42

Could you post your push crate verb code ?


Melarnos
18 Aug 2016, 13:51

Hi Ozymandias,

I made a little script solving your problem.
2 littles things :

  • First of all, I don't think you should lock the exit, or put a "lock message" : if the exit is indeed invisible, the player cannot directly interact with it in any way, so the "lock message" seems useless ;)
    Anyway, in this case, it could be locked or invisible, but not both.
  • When the exit turns visible, it should appear in "places and objects". It does not appear in the room description since this only occurs when you enter the room. If you want a text saying the exit is now visible, you have to do it manually (see what I did with the very convenient {command:go (alias of the exit):(text)}.

Here's the script, you should be ok now :)

"</game>
  <object name="room">
    <inherit name="editor_room" />
    <description type="string"></description>
    <object name="player">
      <inherit name="editor_object" />
      <inherit name="editor_player" />
    </object>
    <object name="crate">
      <inherit name="editor_object" />
      <push type="script">
        MakeExitVisible (toending)
        msg ("You can now {command:go to the last room:access the last room}!!")
      </push>
    </object>
    <exit name="toending" alias="to the last room" to="last room">
      <scenery type="boolean">false</scenery>
      <visible type="boolean">false</visible>
      <locked type="boolean">false</locked>
    </exit>
  </object>
  <object name="last room">
    <inherit name="editor_room" />
    <description>Yay you win!</description>
  </object>
</asl>