Breaking an object?

Say I wanted to break an object, and then have the object name changed to "a broken object" and change the interactions you can have with it and everything. How do I do that?
I've literally just started today, I'm actually a bit clueless with everything in general


You can change everything about an object by changing its attributes. For example, you could do something like:

vase.alias = "broken vase"
vase.look = "a pretty vase with a big crack in it"

You can also change an object's verbs. For example:

vase.fill = "You can't fill a broken vase."
vase.repair => {
    // put a script here to add a verb
}

If you add or remove verbs, you should also change the attribute generatedverbslist, which is used to determine which verbs to show on the pop up menu. For example:

list remove (vase.generatedverbslist, "fill")

But…


If you're making a lot of changes at once, it might be easier making a separate object for the broken vase. Put it in a location the player can't get to, and when the vase gets broken just swap them around.


A trick I discovered allows you to have 2 completely different objects with the same name!

e.g. Have a capital letter for one and lower case for another. This allows you to replace one with the other, but change the description and interactions as you wish.

This is very handy if an object is seen but cannot be taken. Then after doing a task, you can make object "Necklace" disappear and make object "necklace"(lower case version) appear in your inventory or in an excessable place after an event etc.

Necklace

necklace


An extra step might be to give "necklace" the alias "Necklace", so they look the same, or the alias "Broken Necklace", so one is specific, and all capitals are uniform, but both words start with the same letter and are easier to find in the alphabetized list.


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

Support

Forums