lost item
MatCauthon137
23 Oct 2015, 01:15Ok, maybe I'm overthinking things here. I very recently upgraded from quest 4.0 (to 5.6.1)so that is what I'm used to working with. Now, let's say you have an arbitrary status variable, we'll call "beauty" and an item "makeup".
The gain command is simple, upon "take" increase the variable beauty. I got that to work. On drop, decrease beauty. Works also. Here is where I stumble.
Since the decrease is with the command "drop" then putting the item in a box or on a shelf doesn't decrease beauty. And for the life of me, I can't find the old "on lose item" only "on drop item".
I'm assuming I need to do this with an attribute, maybe an inherited attribute, but I can't wrap my head around that. I would only be able to change the attribute "on lose item". I thought about using a turn script with a flag system, but that seems overly cumbersome?
Any suggestions would be greatly appreciated.
The gain command is simple, upon "take" increase the variable beauty. I got that to work. On drop, decrease beauty. Works also. Here is where I stumble.
Since the decrease is with the command "drop" then putting the item in a box or on a shelf doesn't decrease beauty. And for the life of me, I can't find the old "on lose item" only "on drop item".
I'm assuming I need to do this with an attribute, maybe an inherited attribute, but I can't wrap my head around that. I would only be able to change the attribute "on lose item". I thought about using a turn script with a flag system, but that seems overly cumbersome?
Any suggestions would be greatly appreciated.
The Pixie
23 Oct 2015, 11:46There is nothing built-in as such, but you can add a change script to the object. In fact it will already have one, you need to modify it. Assuming you are working offline, go to the Attributes tab, and select changeparent in the list at the bottom. Now click the Make editable copy button, then click on the Code view icon. You will see this:
You can get rid of that as the makeup will never by a player object. Replace it with this:
if (game.pov = this) {
if (IsDefined("oldvalue")) {
OnEnterRoom (oldvalue)
}
else {
OnEnterRoom (null)
}
if (game.gridmap) {
MergePOVCoordinates
}
}
You can get rid of that as the makeup will never by a player object. Replace it with this:
if (IsDefined("oldvalue")) {
if (oldvalue = player) {
msg ("You are no longer holding it")
}
}