Drop Loot When Destroyed Framework
[img]https://sun9-35.userapi.com/impg/RjP2PYrv6uS7DhI5uKJ6-BCgFkDUDmRlAGh1Nw/77VJpcCDd7U.jpg?size=600x47&quality=95&sign=1059fc604675afb099db9b42466fe2a1&type=album[/img]
This is a framework that allows ThingDefs drop loot when they are destroyed by any means (attacking, deconstruction etc).
As for now it adds two comps and a thingClass for filth. First comp is responsible for the loot drops and can be used on anything that can use comps, so items, buildings, pawns etc. Second comp is responsible for destroying an item if it is used. Filth cannot use comps so loot is implemented with a thingClass.
The instructions are in the discussions and there is a couple of example defs in this mod's files.
[img]https://sun9-45.userapi.com/impg/sGPLpMld-6QmAISo8M3XwuND-mK364wnW6eOEg/aBYmAwxI8U4.jpg?size=600x47&quality=95&sign=b4fab0bab16510da9c1233c965011233&type=album[/img]
Loot from filth will not spawn if there is no free space in a 1 cell radius around the destroyed filth spot.
Currently the framework does not account for stackCount. So if an item has a comp for dropping loot it will roll once for the whole stack, not for the each item individually.
If the loot is dropped outside of the home area and is split into multiple stacks, only one stack will be forbidden. This can happen when the loot amount is set higher than item's max stack count.
[img]https://sun9-62.userapi.com/impg/HMWNAh-EeGN3nxE_EXKyaVYxjdN9YhRBK1NqsQ/vq7UYzbGCLo.jpg?size=600x47&quality=95&sign=8be9f3dc35e8006f63cc051502a9b3a8&type=album[/img]
SeedsPlease: Plants will not drop any loot added by DLWD Framework.