I run NoRaid on my server but this encourages players to have twig bases because of the low upkeep costs, which leads to a very ugly landscape :(
Is there a way to individually increase the upkeep cost of twig (with or without plugin)? Or perhaps a command to purge all twig occasionally? Any other suggestions welcome.
Note: NoDecay doesn't help because it only affects the rate of decay once the TC is empty.
How to discourage twig with NoRaid?Solved
Maybe you could set any twig pieces to auto-upgrade to wood, if the builder has TC access.
That would work, can you suggest a plugin to do it?
I've just tried Structure Grades, it seems to have the right potential but unfortunately the twig option doesn't seem to work.
Here's something I whipped up based on how the BGrade plugin upgrades things.
#region Twig Block
private void OnEntityBuilt(Planner plan, GameObject gameObject)
{
if (plan?.isTypeDeployable == true) return;
NextFrame(() =>
{
BasePlayer player = plan?.GetOwnerPlayer();
if (player?.CanBuild() != true) return;
BuildingBlock bb = gameObject?.GetComponent<BuildingBlock>();
if (bb?.grade != 0) return;
if (Interface.Call("OnStructureUpgrade", bb, player, (BuildingGrade.Enum) 1) != null) return;
if (!bb.CanAffordUpgrade((BuildingGrade.Enum) 1, player))
{
player.ChatMessage("Can't afford automatic upgrade to wood.");
bb.Kill(BaseNetworkable.DestroyMode.Gib);
return;
}
foreach (ItemAmount ia in bb.blockDefinition.grades[1].costToBuild)
{
TakeItem(player, ia.itemid, (int)ia.amount);
}
bb.SetGrade((BuildingGrade.Enum)1);
bb.SetHealthToMax();
bb.StartBeingRotatable();
bb.SendNetworkUpdate();
bb.UpdateSkin();
bb.ResetUpkeepTime();
bb.GetBuilding()?.Dirty();
});
}
public static void TakeItem(BasePlayer player, int itemId, int itemAmount)
{
if (player.inventory.Take(null, itemId, itemAmount) > 0)
{
player.SendConsoleCommand("note.inv", itemId, itemAmount * -1);
}
}
#endregion Twig Block Thanks very much for taking the time to write this code for us, we'll keep it in our back pocket for possible future use. Meanwhile we managed to hack the NoRaid plugin so that twig is destructible, now players can purge this stuff by natural methods :)
Locked automatically