Self-dropping objects

cdutton184
How do I make Quest drop an individual object in the inventory at the location the player is in at the time.

E.g. The player is carrying a candle and it's lit. It's getting hotter and the wax is melting (on a timer). It's gets too hot to handle and the candle is dropped at the location the player just happens to be situated.

I'm not a great programmer and don't understand the DoDrop command fully since move #object# to #LocationYouAreAt# doesn't exist.

duggold
Something like this will drop it:

candle.parent = player.parent

player.parent is the room the player is in. Setting the candle.parent to the same value will drop the item in the player's current room. you might want to preface it with text like

msg("The candle gets too hot to hold! You quickly drop it!")
candle.parent = player.parent

Maybe even alter the display name:

candle.alias = candle.alias + "(burnt out)"


would alter the name of the candle to Candle(burnt out) when it is shown in rooms, panes etc.

cdutton184
I've incorporated this in my latest game Island of the Magi. Rather than getting crushed by the weight of the anchor you're carrying when your superstrength runs out, you just have to drop it where you stand and realize that if it's in the wrong place, you're screwed!

Thanks, duggold.

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

Support

Forums