Turn off all inventory verbs?

It depends what you want to do.

1. If you want to remove the inventoryverbs attribute

You could put a script in your start script:

foreach (object, AllObjects()) {
  object.inventoryverbs = NewStringList()
}

but that won't stop it displaying generated verbs (the ones on the "Verbs" tab) for objects in the inventory.

2. If you want to hide the verb buttons below the inventory pane in the sidebar


You could just remove them from the UI. In your UI Initialisation script, you'd put something like:

JS.eval("$('#inventoryAccordion .verbButtons').remove();")

This removes the verb buttons container from the inventory pane. This removes the buttons rather than the inventoryverbs, so there will still be a menu of verbs if the player clicks on an object link to an object in the inventory.

3. If you want to hide all verbs for objects in the inventory (for both the inventory pane and object links)


This method only works on the desktop editor, as you need to modify a line in one of the core functions:

  <function name="GetDisplayVerbs" parameters="object" type="stringlist">
    if (Contains(game.pov, object)) {
      return (NewStringList())
    }
    else {
      baselist = object.displayverbs
    }

    if (not game.autodisplayverbs or GetBoolean(object, "usestandardverblist") or not HasAttribute(game, "verbattributes")) {
      return (baselist)
    }
    else {
      if (HasAttribute(object, "generatedverbslist")) {
        verbs = object.generatedverbslist
      }
      else {
        verbs = NewStringList()
        foreach (attr, GetAttributeNames(object, false)) {
          if (ListContains(game.verbattributes, attr)) {
            cmd = ObjectDictionaryItem(game.verbattributeslookup, attr)
            if (HasString(cmd, "displayverb")) {
              displayverb = CapFirst(cmd.displayverb)
            }
            else {
              displayverb = CapFirst(attr)
            }
            if (not ListContains(baselist, displayverb)) {
              list add (verbs, displayverb)
            }
          }
        }
        object.generatedverbslist = verbs
      }
      if (GetBoolean(object, "useindividualverblist")) {
        return (verbs)
      }
      else {
        return (ListCombine(baselist, verbs))
      }
    }
  </function>

This is the function that Quest uses to determine which verbs to display for an object, checking all the different options for how verb lists are generated. Making it so that it returns an empty list for objects in the inventory at the start means that no verb list will be displayed at all for inventory objects.

If this isn't quite what you need, I'm sure that it will be possibly to get what you want by modifying this function in some way. I'd be happy to help if you can explain in more detail what you need.


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

Support

Forums