Up to Main Index Up to Journal for October, 2020 JOURNAL FOR THURSDAY 29TH OCTOBER, 2020 ______________________________________________________________________________ SUBJECT: Waiting resets, #DUMPing disabled items and other goodies DATE: Thu 29 Oct 21:29:54 GMT 2020 I’ve have just updated the public dev branch with a number of commits so quite a bit to get through here. First of all I have sorted out the mobile, and container, reset issue. This was the issue where a mobile or container could reset without its associated items being present. For mobiles there was an additional issue where items would not be used after a reset. For example a city guard could reset without their armour and clothes or shortsword. Even if they did reset with their items the items would not be held, worn or wielded. It’s taken quite a few iterations and false starts to get something working that I approve of, and there are still a few quirks and kinks to iron out. Having said that, WAIT can now be specified on the Reset field for a container or mobile in zone files. This will cause the container or mobile to delay resetting until all of its Inventory content is ready, recursively into nested containers. Specifying WAIT for an item currently has no effect. I’ve also added reset hooks via a new Thing.ResetHooks method to hook into the reset process of a Thing. An attribute can define a resetHook method to be called by ResetHooks just before a container/mobile is enabled during a reset. Using WAIT and reset hooks together a mobile can be made to wait for all of its equipment to spawn and be ready, the reset hooks equip all the equipment, finally the mobile is respawned. Documentation for the new Reset WAIT is available in the docs/zone-files.txt file. The reset hooks are handled automatically by the $RESET command and the new Thing.ResetHooks method. The implementation of reset hooks seemed cleaner and more sane than the Load/Save hooks — so I’ve updated and refined the Load and Save methods and renamed them LoadHooks and SaveHooks, the processing is via attributes defining loadHook and saveHook - renamed from simply load and save. Inventory has gained a new SearchDisabled method to search for a disabled Thing by alias. I also added a minor optimisation to Inventory.Move when the from and to Inventory are the same. For debugging the #DUMP command can now find and display disabled items. Very useful for displaying the state of something while waiting for it to reset. The Body attribute has a new RemoveAll method which will unconditionally stop holding, wielding and wearing all items currently in use. The toy doll, sweet flower girl and city guards have been tweaked and now have WAIT set on their Reset field. Some duplicate aliases specified on a few items have also been tidied up. I think things are in pretty good shape for the Halloween release, and with a number of meaningful new features to boot :) All of the above is now available on the public dev branch. Only 2 days left to Halloween… /\oo/\ -- Diddymus Up to Main Index Up to Journal for October, 2020