Adding recipes in, well, recipe.txt isn't an issue, but the recipe I want to edit is located in the building system ( LogWall - ISBuildungMenu.lua ) and if I change the code like
local numRippedSheets = ISBuildMenu.countMaterial(player, "Base.RippedSheets") + ISBuildMenu.countMaterial(player, "Base.RippedSheetsDirty")
local numTwine = ISBuildMenu.countMaterial(player, "Base.Twine")
local numRope = ISBuildMenu.countMaterial(player, "Base.Rope")
if numRippedSheets >= 2 then
tooltip.description = tooltip.description .. " <RGB:1,1,1>" .. getItemNameFromFullType("Base.RippedSheets") .. " 2 ";
elseif numTwine >= 0.1 then
tooltip.description = tooltip.description .. " <RGB:1,1,1>" .. getItemNameFromFullType("Base.Twine") .. " 0.7 ";
elseif numRope >= 0.5 then
tooltip.description = tooltip.description .. " <RGB:1,1,1>" .. getItemNameFromFullType("Base.Rope") .. " 0.5 ";
else
tooltip.description = tooltip.description .. " <RGB:1,0,0>" .. getItemNameFromFullType("Base.RippedSheets") .. " " .. numRippedSheets .. "/2 <LINE> " .. getText("ContextMenu_or") .. " " .. getItemNameFromFullType("Base.Twine") .. " " .. numTwine .. "/0.7 <LINE> " .. getText("ContextMenu_or") .. " " .. getItemNameFromFullType("Base.Rope") .. " " .. numRope .. "/0.5 ";
if not ISBuildMenu.cheat then
logOption.onSelect = nil;
logOption.notAvailable = true;
end
end
[... further below ...]
ISBuildMenu.canBuildLogWall = function(player)
local logs = ISBuildMenu.countMaterial(player, "Base.Log")
local sheets = ISBuildMenu.countMaterial(player, "Base.RippedSheets") + ISBuildMenu.countMaterial(player, "Base.RippedSheetsDirty")
local twine = ISBuildMenu.countMaterial(player, "Base.Twine")
local rope = ISBuildMenu.countMaterial(player, "Base.Rope")
return logs >= 5 and (sheets >= 2 or twine >= 0.7 or rope >= 0.5)
end
ISBuildMenu.onLogWall = function(worldobjects, player)
local wall = ISWoodenWall:new("carpentry_02_80", "carpentry_02_81", nil);
wall.modData["need:Base.Log"] = "5";
local sheets = ISBuildMenu.countMaterial(player, "Base.RippedSheets");
local sheetsDirty = ISBuildMenu.countMaterial(player, "Base.RippedSheetsDirty");
if sheets > 2 then sheets = 2; sheetsDirty = 0 end
if sheetsDirty > 2 then sheetsDirty = 2; sheets = 0 end
if sheets < 2 and sheetsDirty > 0 then sheetsDirty = 2 - sheets; end
if sheets + sheetsDirty >= 2 then
if sheets > 0 then wall.modData["need:Base.RippedSheets"] = tostring(sheets); end
if sheetsDirty > 0 then wall.modData["need:Base.RippedSheetsDirty"] = tostring(sheetsDirty); end
elseif ISBuildMenu.countMaterial(player, "Base.Twine") >= 0.7 then
wall.modData["need:Base.Twine"] = "0.7";
elseif ISBuildMenu.countMaterial(player, "Base.Rope") >= 0.5 then
wall.modData["need:Base.Rope"] = "0.5";
end
wall.modData["xp:Woodwork"] = 5;
wall.player = player;
wall.noNeedHammer = true
wall.canBarricade = false
wall.name = "Log Wall"
getCell():setDrag(wall, player);
end
it will rather use up the entire item, be it 0.5 / 0.7 delta (respective to their items) 0.1 or even full delta capacity.