MidrealmDM Posted December 13, 2015 Share Posted December 13, 2015 I've made some custom food items in the crock pot, and they work find in DS vanilla. But in DS together they don't seem to be affecting sanity. The Prefab Item.lualocal Assets ={Asset("ANIM", "anim/fish_n_chips.zip"),Asset("ATLAS", "images/inventoryimages/fish_n_chips.xml"),}local prefabs ={"spoiled_food",}local function fn(Sim)local inst = CreateEntity()inst.entity:AddTransform()inst.entity:AddAnimState()if TheSim:GetGameID() =="DST" then inst.entity:AddNetwork() endMakeInventoryPhysics(inst)MakeSmallBurnable(inst)MakeSmallPropagator(inst)inst.AnimState:SetBank("fish_n_chips")inst.AnimState:SetBuild("fish_n_chips")inst.AnimState:PlayAnimation("idle", false)inst:AddTag("preparedfood")inst:AddTag("catfood")if TheSim:GetGameID()=="DST" thenif not TheWorld.ismastersim thenreturn instendinst.entity:SetPristine()endinst:AddComponent("edible")inst.components.edible.foodtype = "MEAT"inst.components.edible.healthvalue = TUNING.HEALING_MEDinst.components.edible.hungervalue = TUNING.CALORIES_MED*2inst.components.edible.sanityvalue = TUNING.SANITY_TINY,inst:AddComponent("inspectable")inst:AddComponent("inventoryitem")inst.components.inventoryitem.atlasname = "images/inventoryimages/fish_n_chips.xml"inst:AddComponent("stackable")inst.components.stackable.maxsize = TUNING.STACK_SIZE_SMALLITEMinst:AddComponent("perishable")inst.components.perishable:SetPerishTime(TUNING.PERISH_FAST)inst.components.perishable:StartPerishing()inst.components.perishable.onperishreplacement = "spoiled_food"inst:AddComponent("bait")inst:AddComponent("tradable")inst.components.tradable.goldvalue = 1return instendreturn Prefab( "common/inventory/fish_n_chips", fn, Assets ) --- the modmain.lua contains the following.local fish_n_chips_recipe = { name = "fish_n_chips", test = function(cooker, names, tags) return tags.seafood and tags.seafood>=1 and tags.tuber and tags.meat and tags.meat <=1 and not tags.poultry and not tags.seed and not tags.inedible end, priority = 9, weight = 1, foodtype = "MEAT", health = TUNING.HEALING_MED, -- 20 hunger = TUNING.CALORIES_MED*2, -- 50 perishtime = TUNING.PERISH_FAST, -- 6 sanity = TUNING.SANITY_TINY, -- 5 cooktime = 2.00, }AddCookerRecipe("cookpot", fish_n_chips_recipe) So Im not sure why it would work in DS but not in DST. Note: When testing in DST I spawned the items in rather than cooking them in the crock pot.I'm not sure if that would make a difference. Link to comment Share on other sites More sharing options...
ZupaleX Posted December 13, 2015 Share Posted December 13, 2015 (edited) Just to be clear: It increase health and hunger but not sanity?And random question: why do you have a coma after TUNING.SANITY_TINY in the prefab item .lua? Edited December 13, 2015 by ZupaleX Link to comment Share on other sites More sharing options...
MidrealmDM Posted December 16, 2015 Author Share Posted December 16, 2015 (edited) Just to be clear: It increase health and hunger but not sanity?And random question: why do you have a coma after TUNING.SANITY_TINY in the prefab item .lua? yes it appears to be increasing health and hunger fine. as to the comma? ummmm... should I not? EDIT--- ok - removed the comma and that fixed it. Thanks Edited December 16, 2015 by MidrealmDM Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now