Adding other verbs to default commands?

OurJud
30 Oct 2016, 01:35

I want to add 'gather' and 'collect' to a location where firewood can be collected. I tried adding these verbs to the Verb tab on the 'firewood' object, but it didn't work (I just get a blank response)?

I could add them as separate commands at the location, but then I'd have to run a script to add the firewood to the player's inventory.


hegemonkhan
30 Oct 2016, 06:21

Pixie's guide links on using Verbs will probably be more helpful than my post's content further below, lol:

http://textadventures.co.uk/forum/samples/topic/4953/how-to-use-verbs
http://textadventures.co.uk/forum/samples/topic/5023/how-to-use-display-verbs-and-inventory-verbs-effectively


you could go into the built-in stuff (Filter -> Show Library Elements) and find the 'take' Command (click on its 'copy' button to be able to edit it), and in/for its 'pattern' Attribute/box, you just add semicolons and what patterns you want, for example:

the built-in patterns:

take #object#; get #object#; pick up #object#

then add in your own patterns, so it looks like this

take #object#; get #object#; pick up #object#; gather #object#; collect #object#

if you don't want to mess with 'take' Command...


then create your own 'gather/collect' Verb(s):

the easiest is to just add the Verb(s) to your 'firewood' Object, as quest will do all the required coding for Verbs for you:

'firewood' Object -> 'Verbs' Tab -> Add -> Name: gather; collect /* interestingly, the GUI/Editor's 'name' field/text-box here is actually what it uses for its 'pattern' and 'attribute'. Also, only one word can be shown as the label for the hyperlink/button during game play (which it'd just use 'gather' as it's first), but during game play, you can type in 'gather firewood' or 'collect firewood' and it'll move it into your inventory */ -> [run as script] -> add new script -> 'objects' section/category -> 'add to inventory' Script -> [firewood] // this is just the simpliest method, let me know if you want/need something else

you can then see all the required stuff it does for you, by in the "tree of stuff" looking at the newly created/added 'Verb: gather; collect' Verb under/within 'Verbs' ('Objects' -> 'game' -> 'Verbs' -> your_new_verb), and you can fill in the 'name' text box here to give it a name such as for example 'my_verb' instead of its ugly pattern for its name.

so, now you can see how to create/add Verbs yourself, you do so under the 'Verbs' in the "tree of stuff" and fill in the stuff

also, as can be seen, you could find a built-in Verb to use, and add in the 'gather/collect' into its pattern via using the semicolon, though there may be more work depending on how the built-in Verb works... how it does whatever scripting that it does...


otherwise, you can create a Command instead of using Verbs


OurJud
30 Oct 2016, 14:24

Thanks, Hege. I like the first option - does anyone happen to know which particular library element 'take' is under?

I already did the second option (I initially forgot to add a response which is why it showed up blank when I used them in the game). The only problem here is that because I gave 'firewood' three alias ('wood', 'twigs' and 'branches'), it means I get "You are carrying: Wood; Twigs; Branches" when I check inventory. Not a biggie as it kind of makes sense, but the semi-colons are ugly.