Getting a command to run a verb?

Someone mentioned this a while ago, I have an object that the character enters into like a room. I want the object to say when the player enters, you can do option1 or Option2
I want those options to be verbs, but I don't know how to hyperlink them in to the script message, then someone said use commands that activate the verbs. is this possible? And if not can I hyper link verbs?


Does this help?

<!--Saved by Quest 5.7.6695.2295-->
<asl version="550">
  <include ref="English.aslx" />
  <include ref="Core.aslx" />
  <game name="Booth">
    <gameid>1732bc46-24aa-41b6-943b-aa159d34d267</gameid>
    <version>1.0</version>
    <firstpublished>2018</firstpublished>
  </game>
  <verb name="enter_verb">
    <pattern>enter #object#;get in #object#;get into #object#</pattern>
    <property>enter_verb</property>
    <defaultexpression>"You can't enter "+object.article+"."</defaultexpression>
    <scope>notheld</scope>
  </verb>
  <object name="room">
    <inherit name="editor_room" />
    <isroom />
    <object name="player">
      <inherit name="editor_object" />
      <inherit name="editor_player" />
    </object>
    <object name="booth">
      <isroom type="boolean">false</isroom>
      <look>A small booth, with no door.</look>
      <attr name="enter_verb" type="script">
        MoveObject (game.pov, this)
      </attr>
      <enter type="script">
        game.suppressturnscripts = true
        s = "Please select an option."
        options = Split("Examine the metal rod;Bend the metal rod", ";")
        ShowMenu (s, options, false) {
          HandleSingleCommand (result)
          game.autodescription_youcango = game.autodescription_youcango_bak
          game.autodescription_youcango_bak = null
          pre = "You can go"
          list = ScopeUnlockedExitsForRoom(game.pov.parent)
          s = FormatExitList(pre, list, "or", ".")
          msg (s)
        }
      </enter>
      <beforeenter type="script">
        game.autodescription_youcango_bak = game.autodescription_youcango
        game.autodescription_youcango = 0
      </beforeenter>
      <displayverbs type="stringlist">
        <value>Look at</value>
      </displayverbs>
      <takemsg>It's much too large to take.</takemsg>
      <exit alias="out" to="room">
        <inherit name="outdirection" />
      </exit>
      <object name="metal_rod">
        <inherit name="editor_object" />
        <bend type="script">
          msg ("You bend it a little.")
          this.bent = true
        </bend>
        <look>A {if metal_rod.bent:bent }metal rod.</look>
        <alias>metal rod</alias>
        <take />
      </object>
    </object>
    <exit alias="in" to="booth">
      <inherit name="indirection" />
    </exit>
  </object>
  <verb>
    <property>bend</property>
    <pattern>bend</pattern>
    <defaultexpression>"You can't bend " + object.article + "."</defaultexpression>
  </verb>
  <function name="FinishTurn">
    if (GetBoolean(game,"suppressturnscripts")) {
      game.suppressturnscripts = false
    }
    else {
      RunTurnScripts
    }
    UpdateStatusAttributes
    CheckDarkness
    UpdateObjectLinks
  </function>
  <walkthrough name="main">
    <steps type="simplestringlist">
      look at booth
      enter booth
      event:ShowMenuResponse;Bend the metal rod
      look at metal rod
    </steps>
  </walkthrough>
</asl>

No not really? is that just all the information on a game file?


Yeah, it's pretty much everything you might need (maybe more).

Here's a link to download it:

https://gist.github.com/KVonGit/062663439cd1b1f140882dad79c19c8e/archive/e16776e5e917971168bc457414b6fe5b65d33cb3.zip

You can unzip that, then open booth.aslx. Once you have it opened in the editor, you will probably see what I've got going on.

(It all works together. That's why I'm dropping an entire example game on you. I use every thing you see in this code to make the magic happen.)

Open her up in Quest, then post whatever questions you have. We'll get you up and running.


I want those options to be verbs, but I don't know how to hyperlink them in to the script message, then someone said use commands that activate the verbs. is this possible? And if not can I hyper link verbs?

Yes, you can. Behind the scenes, verbs are scripts, so you just have the command run the verb script. If you have a "smash" verb, the script for the command will be:

do(object, "smash")

Sometimes the script name is not obvious, for example it is "speak" for TALK TO, but for new, one-word verbs it is the obvious.

For hyperlinks, the text is processed as though the player typed it, so verbs work just the same as commands.


Log in to post a reply.

Support

Forums