How to make a switchable torch

So I make a cellar room dark. In the starting room I make a torch that is switchable. If I go to the cellar with the torch, it is too dark to see. Switching on the torch does nothing and now I can't exit the cellar either. How do I exit the cellar if it is too dark and how do I make a switchable on/off light source? The webpage for handling light and dark in Quest makes no sense. https://docs.textadventures.co.uk/quest/handling_light_and_dark.html It's like it's referring to a different version of the software. Thank you.


The webpage for light is correct.
Here is a short example how to use lightsources:

<asl version="580">
  <include ref="English.aslx" />
  <include ref="Core.aslx" />
  <game name="teste">
    <gameid>fd8c7ef1-a807-493f-902f-ce67fcb63edd</gameid>
    <version>1.0</version>
    <firstpublished>2022</firstpublished>
    <feature_lightdark />
  </game>
  <object name="room">
    <inherit name="editor_room" />
    <isroom />
    <description>This is the first room</description>
    <object name="player">
      <inherit name="editor_object" />
      <inherit name="editor_player" />
    </object>
    <exit name="test" alias="south" to="room2">
      <inherit name="southdirection" />
      <visible />
    </exit>
    <object name="torch">
      <inherit name="editor_object" />
      <inherit name="switchable" />
      <feature_switchable />
      <feature_lightdark />
      <lightsource type="boolean">false</lightsource>
      <lightstrength>strong</lightstrength>
      <take />
      <onswitchon type="script">
        this.lightsource = true
        ShowRoomDescription
      </onswitchon>
      <onswitchoff type="script">
        this.lightsource = false
      </onswitchoff>
    </object>
  </object>
  <object name="room2">
    <inherit name="editor_room" />
    <dark />
    <exit alias="north" to="room">
      <inherit name="northdirection" />
    </exit>
    <object name="apple">
      <inherit name="editor_object" />
      <alias>Apple</alias>
    </object>
  </object>
</asl>

Log in to post a reply.

Support

Forums