(Solved) Displaying scenery objects in a use menu
raindare
15 Jul 2019, 03:11Hello!
I am using the text adventure module of Quest to write a gamebook. As a result, the player does not have access to the parser.
I would like to make it so that by "using" items in a room, the player can select objects from a menu on which to use the item.
This function appears to do what I want:
https://i.vgy.me/KjCx3S.png
However, it will not allow the player to use the item in question on an object that is flagged as "Scenery" (such as a locked door, which would be redundant with the exit it blocks).
Is there a way to make it so that you can select a "Scenery" object from the use menu provided by an item's hyperlink?
mrangel
15 Jul 2019, 22:42If you're using the desktop version of Quest, you can override the built-in function CreateUseMenuList
.
I'm not sure if you can access the built-in function somehow to edit it, or if you just need to create a function with the same name. In any case, you should remove the indicated part of the function script:
<function name="CreateUseMenuList" parameters="object" type="objectlist">
objectlist = NewObjectList()
objectlist = ScopeReachableInventory()
objectlist = ListCombine (objectlist, ScopeReachableNotHeld())
excludelist = NewObjectList()
list add (excludelist, game.pov)
list add (excludelist, object)
candidates = NewObjectList()
candidates = ListExclude(RemoveSceneryObjects(objectlist), excludelist)
return (candidates)
</function>
The Pixie
16 Jul 2019, 06:44Instructions on how to override a function here:
http://docs.textadventures.co.uk/quest/overriding.html
raindare
19 Jul 2019, 06:48Thank you! This was very helpful.
mrangel
19 Jul 2019, 07:51(I do think that it would make more sense to be able to override this on a per-object basis; perhaps by having a string attribute called "scopeforuse" which takes the same format as a command's scope string. Including scenery objects on the menu seems such an obvious thing that it shouldn't require overriding a core function)