Taob Posted July 24, 2020 Share Posted July 24, 2020 I'm trying to port the Leafy Meat recipes to Don't Starve, I don't see the image of the food on the crock pot. A message is printed on the console : "Can't find prefab leafymeatsouffle". I already put the prefab on modmain.lua local assets = { Asset("ANIM", "anim/cook_pot_food4.zip"), } local prefabs = { "spoiled_food", } local function fn() local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddNetwork() MakeInventoryPhysics(inst) inst.AnimState:SetBank("cook_pot_food4") inst.AnimState:SetBuild("cook_pot_food4") inst.AnimState:PlayAnimation("idle") MakeInventoryFloatable(inst, "small", 0.2, 0.95) inst.entity:SetPristine() if not TheWorld.ismastersim then return inst end inst:AddComponent("inspectable") inst:AddComponent("inventoryitem") inst:AddComponent("edible") inst.components.edible.foodtype = "MEAT" inst.components.edible.healthvalue = TUNING.CALORIES_LARGE inst.components.edible.hungervalue = TUNING.PERISH_FAST inst.components.edible.sanityvalue = TUNING.SANITY_HUGE inst:AddComponent("perishable") inst.components.perishable:SetPerishTime(TUNING.PERISH_FAST) inst.components.perishable:StartPerishing() inst.components.perishable.onperishreplacement = "spoiled_food" inst:AddComponent("stackable") inst.components.stackable.maxsize = TUNING.STACK_SIZE_LARGEITEM inst.replica.inventoryitem:SetImage("leafymeatsouffle") inst.components.inventoryitem.atlasname = "images/inventoryimages/leafymeatsouffle.xml" MakeHauntableLaunch(inst) return inst end return Prefab("common/inventory/leafymeatsouffle", fn, assets, prefabs ) log.txt Link to comment Share on other sites More sharing options...
krylincy Posted July 25, 2020 Share Posted July 25, 2020 1) the error message in your attached log is "Could not find anim build leafymeatsouffle". is the animation ok? and is the name correct? 2) you are talking about ds not dst? there is no "replica". you should remove it ( inst.replica.inventoryitem:SetImage("leafymeatsouffle")) 3) i think you need to import the inventory images too, not only the animation local assets = { Asset("ANIM", "anim/XX.zip"), Asset("ATLAS", "images/inventoryimages/XX.xml"), Asset("IMAGE", "images/inventoryimages/XX.tex"), } Link to comment Share on other sites More sharing options...
Taob Posted July 26, 2020 Author Share Posted July 26, 2020 1) Yep, I think I already fixed that 2) DS, I will remove it. 3) Done Still not working.:( Link to comment Share on other sites More sharing options...
penguin0616 Posted July 30, 2020 Share Posted July 30, 2020 You need to include it in PrefabFiles. Link to comment Share on other sites More sharing options...
krylincy Posted July 30, 2020 Share Posted July 30, 2020 can you cahnge the code to use a default image that is already in the game? to verify if it is a problem with the image itself or the integration? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.