第57页:用芦苇种植芦苇
展开五十七.用芦苇种植芦苇(芦苇可移植)
1.用记事本打开游戏目录\data\DLC0001\scripts\prefabs\cutreeds.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容:
local function OnDeploy (inst, pt)
SpawnPrefab("reeds").Transform:SetPosition(pt.x, pt.y, pt.z)
inst.components.stackable:Get():Remove()
end
inst:AddComponent("deployable")
inst.components.deployable.ondeploy = OnDeploy
2.用记事本打开游戏目录\data\scripts\prefabs\reeds.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容:
local function dig_up(inst, chopper)
inst.components.lootdropper:SpawnLootPrefab("cutreeds")
inst:Remove()
end
inst:AddComponent("workable")
inst.components.workable:SetWorkAction(ACTIONS.DIG)
inst.components.workable:SetOnFinishCallback(dig_up)
inst.components.workable:SetWorkLeft(1)
inst:AddComponent("lootdropper")
即可让芦苇可以被铲子铲掉得芦苇,用芦苇可种芦苇,使芦苇可移植
更多相关内容请关注:饥荒专区
责任编辑:Shy夏夏