How to add verbs after certain conditions + More

First time I'm coming here with questions and not bugs. :)

I want to make an object start off with 1 verb, forcing the player to click it, and then after it is used, add more verbs to the the object. Is there a way to do that?

And then I just want to ask what script prints messages that make you click continue. I see some games do that all the time, and I'm not quite sure which script does it.

Thanks. :D


To control what verbs appear when an object is clicked on, you'd set up all the verbs as normal, but tick "Disable automatically generated display verb list for this object" on the 'object' tab.

Then in the "Display verbs" and "Inventory verbs" lists on that page, you put the verbs that you want to appear at the start of the game. ("Inventory verbs" is used when the object is in the player's inventory, "display verbs" otherwise).

When you want to add another verb, you would add an object to the array.
For example, in code view, you could do:

list add (bucket.displayverbs, "kick")

to add a "kick" verb to the object named "bucket".

Note that if the command bar is displayed, the player can still type "kick bucket". So you'd want your verb to start with an if script to check that you've got to that part of the game and display a suitable message otherwise.


Alternatively, you could actually add the verb when you need it. I think this is simpler, but it can be a little confusing.

You'd need to make sure the verb definition exists; I think verbs show up in the sidebar in the desktop editor (but not in the online editor). You create a new verb definition by giving any object that verb, but the verb definition continues to exist when the verb is removed from that object.

If the verb definition exists, then you can do something like:

objectname.verbname => {
  // The scripts for the verb go here
}

Note that the verbname in that example is the verb's property, which is usually the same as the name of the verb, but might not be. Check the verb definition if you're not sure, I think it shopuld show you what the verb's property is.

Not sure if you can do that in the GUI script editor.


Yeah, I'm pretty much confined to the GUI script editor. I clicked code view once and my eyes melted out of my head. It was gross.


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

Support

Forums