Proper syntax for do(this) script?

XanMag

I have a 'rub; smear; put; place; apply' verb on a plant that requires another object (a plank). The result coats the wood in plant oils.

I want to accommodate a 'rub plank with plant' as well. I want to avoid a regular expression because verbs are easier in this case. So, what is the proper way to use the do(this) script? =/


hegemonkhan

do (NAME_OF_OBJECT, "NAME_OF_SCRIPT_ATTRIBUTE/VERB")

the 'NAME_OF_OBJECT' can be the special 'this' keyword/keycommand, if the scripting is contained (directly or indirectly) within an Object

there's also a third parameter that involves dictionary usage for 'do' Function, but I don't understand what it's for or how it's used. Pixie or Jay will have to help with that if it's needed for what you want to do:

http://docs.textadventures.co.uk/quest/scripts/do.html


in the GUI/Editor, you'd choose the 'call function' Script, type in 'do' for the name text box, and add in the 'name of the verb/script attribute' for its 'add' parameter box, not sure if it needs double quotes or not.


XanMag

So I did this under the plank verbs: rub; smear; place; put; apply; use

do (Dictamnus albus, "rub; smear; place; put; apply; use")

and I have this under the Dictamnus albus verbs: rub; smear; place; put; apply; use

msg ("You rub the Dictamnus albus on the wooden plank and the oil coats the wood.  Your hands are awfully sticky though.  Hopefully you won't need to shake hands with a fire!")

The 'rub albus with planks' works fine. My 'do' script returns this - Error running script: Object reference not set to an instance of an object. There is problem #1. Not sure why it won't do it! lol

Also, I noticed that ONLY 'rub albus with planks' works. I would like to be able to substitute 'with' with 'on', 'over', 'onto', etc and get it to work. 'Rub albus on planks' makes a LOT more sense than 'rub albus with planks'!

Thanks in advance!


hegemonkhan

you may need to create a Command for it to work for the alternative names as well as being able to create a pattern for its parameters (different objects/text the person can type in for its pattern).

but, in the meantime, you can otherwise try this:

do (Dictamnus albus, "NAME_OF_VERB/SCRIPT_ATTRIBUTE")

// you can NOT do a string chain (of your 'alt' alternative Stringlist Attribute for your Verb/Script Attribute): "rub; smear; place; put; apply; use"

// as it's looking for the name of your Script Attribute (Verbs are the same as a Script Attribute, with just a bit more extra coding for underlying quest to handle it properly as such).


also, maybe it's having trouble with the space within your Object's 'name' too... generally you shouldn't use spaces due to possible issues with quest's parsing.


The Pixie

The verb script is probably called "rub", so:

do (Dictamnus albus, "rub")

All the synonyms are stored in a verb object, under the game object, which also specifies the attribute name.


XanMag

Still getting:

rub planks with albus
Error running script: Object reference not set to an instance of an object.

rub albus with planks
You rub the Dictamnus albus on the wooden plank and the oil coats the wood. Your hands are awfully sticky though. Hopefully you won't need to shake hands with a fire!


XanMag

Okay... revisiting this because it has come up again and I still don't have a solution.

I have tie as a verb on a rope object. I have fasten; secure; loop as another verb set on the rope. In the fasten; secure; loop script I have this: do (rope, "tie")

and for the tie verb I require another object (twice) - once with the boulder and once with the player object - and for each I run a couple scripts. If I choose to fasten/secure/loop I get the same message I do with the plant and plank above: Error running script: Object reference not set to an instance of an object. If I do tie rope... it works fine. Help please?

Thanks.


crystalwizard

get rid of all of those verbs and just use the word "use". Then, depending on what the player does, generate messages with verb specific words in them:

use rope boulder - you tie the rope around the boulder
use rope me - you lash the rope around your waist
use rope planks - you tie the planks together

and so on


XanMag

True, but as you've said before, if I only use "use" then a player may try tie and that not work. Tie rope to boulder seems more like a natural response than use rope with boulder. If I could make the do(rope,"use") code to work with the tie verb, I think all my problems would be solved. I think if I only use "use" it feels less real and increases the odds of a player playing guess the right verb game. Right?

Just trying to account for common player inputs.


Silver

Set up commands:

Tie #object# on #object#
Fasten #object# on #object#

Etc etc?

Or set up specific ones that check inventory and location etc?


XanMag

I can do that but I originally started them out as verbs. Reworking it will be a pain in my ass. But in the end (no pun intended) it may be easier than solving my verb problem.


Dcoder

They should just get rid of verbs in Quest and focus solely on commands, which generally are more functional/powerful. Having verbs in Quest just sucks people into creating a bunch of them, only to find out later that commands would have worked better. At least, that was my experience. I converted almost all of my verbs to commands and only use them now. And it was a pain in the ass : )


XanMag

For the record, I think I may have it figured out. For the common/built-in verbs, like 'tie', you need to find it in the library. For the uncommon verbs you just need to go under the verb tab under game in the tree of stuff and add whatever object separators you want. This is under the multiple objects section. So it may look like this:

on; onto; over; against; with; around

and Quest will accept rub albus on plank or rub albus over plank or rub albus onto plank.

You also have to put the same verb under each object. In the case of the boulder and the rope, I needed to add 'tie' as a verb to both objects (I think) and require the other object. This way ' tie boulder with rope' would work just as well as 'tie rope around boulder'. It's late and I've been sitting here too long, so I hope this all works out okay. I'll find out for sure in the a.m. with a clearer head!

I still can't get do (rope, "tie") to work under the verb set fasten; secure; loop


Log in to post a reply.

Support

Forums