It would be great if this mod could get an update, or someone else could make a mod similar to this but with a chance. That not every item at 0% durability drops.
Works as is for me but no thrown weapons ever drop. I've tried changing some of the code but I suspect there is something missing that I don't know how to identify in the script.
Hi, your script is working great, but some weird things are dropped after battle like goblin\orc helmets and armor. Can you fix this, please. Thanks. And also some armor that dropes worth nothing (armor with high durability, for example mail shirt).
ok, just solved the wired drop problem, copy and paste below into the .nut file:::mods_hookNewObject("items/item_container", function ( o ) { local dropAll = o.dropAll; o.dropAll = function ( _tile, _killer, _flip = false ) { return; } local updateAppearance = o.updateAppearance; o.updateAppearance = function () { if (this.m.Actor != null && !this.m.Actor.isNull() && this.m.Actor.isAlive()) { this.m.Actor.onAppearanceChanged(this.m.Appearance); } } local onActorDied = o.onActorDied; o.onActorDied = function ( _onTile ) { this.m.IsUpdating = true; if (_onTile == null) { if (this.m.Actor.isPlacedOnMap()) { _onTile = this.m.Actor.getTile(); } else { _onTile = this.Tactical.getTileSquare(2, 2); } } for( local i = 0; i < this.Const.ItemSlot.COUNT; i = ++i ) { for( local j = 0; j < this.m.Items[i].len(); j = ++j ) { if (this.m.Items[i][j] == null || this.m.Items[i][j] == -1) { } else { this.m.Items[i][j].m.Condition = this.m.Items[i][j].m.ConditionMax; if (this.m.Items[i][j].m.Value > 30 && this.m.Items[i][j].m.ConditionMax > 0) { this.m.Items[i][j].m.IsDroppedAsLoot = true; this.m.Items[i][j].m.LastEquippedByFaction = this.Const.Faction.Player; this.m.Items[i][j].drop(_onTile); //_onTile.IsContainingItemsFlipped = true; } } } } this.m.IsUpdating = false; } }); ::mods_registerMod("mod_battlecleanup", 1, "Battlefield Cleanup");
You can modify the drop value after the "*.m.Value >" , note changed it too high will filter out lengendary / name items, chnaged it too low might got you lots of junk.... Note: Side effect is that you will get drops in arena now...
Copy and paste this below the existing text in the nut file or delete all and replace with this? I've been trying to get this working for hours without success and if you can provide some clarity on the install process i'd appreciate it.
This is great thanks! I pasted in the new text and it works perfectly! I have two questions if you have a minute: 1. Can you safely install and delete repeatedly? (it is so op I don't want it installed all the time, but there are certain battles I want the drops). 2. Is there something I can add/change in the text to make it so low/0% items drop a certain percentage of the time instead of always? (keeping famed/named items at 100%)
Thanks for keeping this updated! Love and endorsed!
Thank you good sir. Great mod that makes a game a lot easier. I know that this game is meant to be hard and i like it but the start of the game is a pain in the ass but with this mod, it is much more fun.
Sounds really nice, but somewhat breaks economy. Maybe some less overpowered version that gives you 25% if you have Scavenger in retinue? Or some scaling? This mod would be a somewhat fair help early-game, but mid-post is too OP.
Any idea on how this will interact with the in-game Scavenger retinue/follower? The one that gives tools for destroyed armours and weapons in a combat? Do they suddenly become useless if everything is kept?
If you get both tools and the item; on the other hand, that's really overpowered ^_^' and you might want to consider a version that has some kind of "50% chance to keep a destroyed item" to balance it out.
Really cool idea though; no one likes having to spam dagger punctures to get armours.
20 comments
https://www.nexusmods.com/battlebrothers/mods/445
You may have other mods messing with item management on the tactical layer, even if they may not warn about it.
::mods_hookNewObject("items/item_container", function ( o )
{
local dropAll = o.dropAll;
o.dropAll = function ( _tile, _killer, _flip = false )
{
return;
}
local updateAppearance = o.updateAppearance;
o.updateAppearance = function ()
{
if (this.m.Actor != null && !this.m.Actor.isNull() && this.m.Actor.isAlive())
{
this.m.Actor.onAppearanceChanged(this.m.Appearance);
}
}
local onActorDied = o.onActorDied;
o.onActorDied = function ( _onTile )
{
this.m.IsUpdating = true;
if (_onTile == null)
{
if (this.m.Actor.isPlacedOnMap())
{
_onTile = this.m.Actor.getTile();
}
else
{
_onTile = this.Tactical.getTileSquare(2, 2);
}
}
for( local i = 0; i < this.Const.ItemSlot.COUNT; i = ++i )
{
for( local j = 0; j < this.m.Items[i].len(); j = ++j )
{
if (this.m.Items[i][j] == null || this.m.Items[i][j] == -1)
{
}
else
{
this.m.Items[i][j].m.Condition = this.m.Items[i][j].m.ConditionMax;
if (this.m.Items[i][j].m.Value > 30 && this.m.Items[i][j].m.ConditionMax > 0)
{
this.m.Items[i][j].m.IsDroppedAsLoot = true;
this.m.Items[i][j].m.LastEquippedByFaction = this.Const.Faction.Player;
this.m.Items[i][j].drop(_onTile);
//_onTile.IsContainingItemsFlipped = true;
}
}
}
}
this.m.IsUpdating = false;
}
});
::mods_registerMod("mod_battlecleanup", 1, "Battlefield Cleanup");
You can modify the drop value after the "*.m.Value >" , note changed it too high will filter out lengendary / name items, chnaged it too low might got you lots of junk....
Note: Side effect is that you will get drops in arena now...
1. Can you safely install and delete repeatedly? (it is so op I don't want it installed all the time, but there are certain battles I want the drops).
2. Is there something I can add/change in the text to make it so low/0% items drop a certain percentage of the time instead of always? (keeping famed/named items at 100%)
Thanks for keeping this updated! Love and endorsed!
Maybe some less overpowered version that gives you 25% if you have Scavenger in retinue?
Or some scaling?
This mod would be a somewhat fair help early-game, but mid-post is too OP.
If you get both tools and the item; on the other hand, that's really overpowered ^_^' and you might want to consider a version that has some kind of "50% chance to keep a destroyed item" to balance it out.
Really cool idea though; no one likes having to spam dagger punctures to get armours.