Shop commands the player can use at any time?

So I want to make a murder-mystery type story that involves forensic knowledge. I am aware that not everyone has forensic knowledge. I want the player to start with coins that can be spent on "books" that tell the player what they need to know about a topic. This way, the player can decide whether they want to utilize this, or they can decide that they want to play the game without the "hints". The coins will not be spent on anything else throughout the game, but I want the "shop" option thing to be able to be accessed at any point in the game.

Is this possible? If so, how?

I would like to note that I understand how coding works, but I'm new to Quest, so I don't really know where to put things. If someone could explain it to me like I'm a toddler, that would be great and very much appreciated.


Been a while but...
You should be able to add a command under the “game” section in the tree of stuff on the left. If you name the command “shop”, you should be able to be able to type “shop” in any location in your game and then you can run any scripts you plan on running for the shop.

I assume this is a Text Adventure and not a choose your own adventure?


any 'Command' Element that are not held within an 'Object' Element (parent = null, which actually means: it is a direct child held within the 'asl' GAME OBJECT), are global (during game play, a global 'Command' Element can be activated anywhere, with its pattern input)

any 'Command' Element that is held within an 'Object' Element, are local (only able to activated within that 'Object' Element during game play and in typing in the command pattern), and take priority over a global 'Command' Element with the same pattern

https://docs.textadventures.co.uk/quest/elements/

https://docs.textadventures.co.uk/quest/elements/command.html

<asl version="550">

  <include ref="English.aslx" />
  <include ref="Core.aslx" />

  <game name="NAME_OF_GAME">
  </game>

  <object name="room">

    <inherit name="editor_room" />

    <command name="example_local_command">

      <pattern>example</pattern>

      <script>

        msg ("EXAMPLE LOCAL COMMAND")

        player.parent = room2

      </script>

    </command>

  </object>

  <object name="room2">

    <inherit name="editor_room" />

  </object>

  <object name="player">

    <inherit name="editor_object" />
    <inherit name="editor_player" />

    <attr name="parent" type="object">room</attr>

  </object>

  <command name="example_global_command">

    <pattern>example</pattern>

    <script>

      msg ("EXAMPLE GLOBAL COMMAND")

    </script>

  </command>

</asl>

Log in to post a reply.

Support

Forums