I want to make a lever into a one-time use thing where it shatters after being pulled, then pushed. I have it set so it starts out in the up position, got the echoes for the 'shatter' message. To delete the item in question, I tried MPJUNK and MPPURGE, but neither work. Any suggestions?
Oprog Question- Deleting the Object?
Posted by Seahawk on Tue 03 Aug 2010 06:18 AM — 4 posts, 20,458 views.
I'm no expert on mobprogs but from the help:
http://www.gammon.com.au/forum/?wiki=mpjunk - for objects in inventory
http://www.gammon.com.au/forum/?wiki=mppurge - sounds like it should work - was a bug logged?
If it isn't obvious, try running gdb and on the mppurge put a breakpoint, and then follow through and see why the object isn't removed.
http://www.gammon.com.au/gdb
http://www.gammon.com.au/forum/?wiki=mpjunk - for objects in inventory
http://www.gammon.com.au/forum/?wiki=mppurge - sounds like it should work - was a bug logged?
If it isn't obvious, try running gdb and on the mppurge put a breakpoint, and then follow through and see why the object isn't removed.
http://www.gammon.com.au/gdb
I figured out the reason after digging through how progs work - oprogs set the CHAR_DATA to supermob as a proxy mob, which works fine in most instances, but mpjunk directly references CHAR_DATA ch's inventory, and the item in question wouldn't be in the supermob's inventory - a workaround (that worked) is to just force it to drop with mpforce "drop item" and then mppurge when it's on the ground. It's annoying, though, in that it gives you the drop message, and it won't work in nodrop rooms.
One solution to that problem might be to look through the stock progs in New Darkhaven. I believe that most of the shopkeeps (or at least certain mobs who routinely get things from players) have in their progs to every so often mpgoto a room that's not player accessible, drop whatever they've gotten for purging, then use mppurge to get rid of it, then mpgoto whence they came. Even if a player is watching them do this, it's all completely over and done with before they'd ever know anything transpired and there's no messages displayed about it.