Reset Displayverbs Ingame

So I have an Object that has its verbs changed multiple times during my game. I know mostly how this works, but I would like if someone could confirm the following for me:

If I use
name_of_object.displayverbs = name_of_object.displayverbs

Then it removes all the added displayverbs that weren't originally in the list at the beginning of the game, right?
So if my object started with only "Look at" and throughout the game gained a "Bend" "Shatter" "Break" etc. displayverb it would return to just "Look at", right?
Or would I still need to manually remove the other displayverbs from the list?

==> Click here for details on what that line actually does Simplified a little… Quest has both concrete and abstract attributes.

When you type name_of_object.name_of_attribute, first Quest looks if the object has an attribute with that name. That's a "concrete" or "direct" attribute.

If there isn't one, it will look at the object's types ("container", "wearable", "male", etc) instead. If any of those has the requested attribute, it uses that. This is called an "abstract" or "inherited" attibute.

Types can't be modified while the game is running; so adding items to an abstract list will give an error.

objectname.attributename = some_value always creates a concrete attribute, and sets it to that value.

So name_of_object.displayverbs = name_of_object.displayverbs is to replace an abstract attribute with a concrete one.

No; that line just makes the displayverbs editable; it won't change it at all.

You might be able to use:

name_of_object.displayverbs = null

This deletes the attribute, which causes it to go back to its default value. That is, the list of displayverbs that all objects have by default (equal to Split("Look at;Take")), plus any that are added by types such as "npc", "wearable", or "lockable". It won't recreate any that you added to that particular object in the editor.

If you're returning it to just "Look at", the easiest way would be:

name_of_object.displayverbs = Split("Look at")

(note that you can use Split like that to get a list with one item in it. You do this because displayverbs has to be a list)

Log in to post a reply.