Can I Make a Verb "Visible"?

parapine
25 Sept 2013, 01:59
Is there a way I can make a verb available only if another verb has been performed?

xavea
25 Sept 2013, 02:19
If I understand what you want to do correctly, the way I accomplish something similar is to use flags.

*Edited for grammar*

HegemonKhan
25 Sept 2013, 03:42
as said above, you'd need to set a flag (boolean) attribute (from false to true) at the end of the first verb's script block, than using a "check flag", if (object.boolean=true) { script }, in whatever other script, you can do this script:

http://quest5.net/wiki/Displayverbs
http://quest5.net/wiki/Using_Lists
http://quest5.net/wiki/List_add

list add (object.displayverbs, "your_second_verb")

and you'll need to have the second verb already created (added) for the object too.

the "displayverbs" stringlist attribute is what shows the second verb as a hyperlink and as a button in the right pane, so it won't exist to the game player, until the boolean is set to true, which will then cause the second verb to now be shown.

-------------

if you want to make "hidden" again, then do this script:

list remove (object.displayverbs, "your_second_verb")

hopefully this helps, if not, ask, and I'll try to help further.

Slent
25 Sept 2013, 07:10
If your plan is to have only the verb visible and thus useable after you've used another verb, you have to follow HKs example above. If, however, you don't mind showing the verb all the time, you can do as follows:

Set a flag when you use the first verb:

SetObjectFlagOn (object, "flag name")


Then on your second verb you can do an if check before the rest of the code that looks like this:

if (GetBoolean(object, "flag name")) {
run code here
}
else {
msg ("that does not work")
}


This will always have your verb shown on that object when you click on it, but it'll print out the "that does not work" if you haven't used the other verb first. That might not be what you're after, in which case you wanna follow HKs example :)