rockninja Posted July 27, 2018 Share Posted July 27, 2018 I'm new to modding and don't understand why the game can't seem to find my prefab. require "prefabutil" local Assets= { Asset("ANIM", "anim/wharang_dango.zip"), } local function fn(Sim) local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.AnimState:SetBank("wharang_dango") inst.AnimState:SetBuild("scroll") inst.AnimState:PlayAnimation("idle", true) MakeInventoryPhysics(inst) inst:AddTag("wharangmod") inst:AddComponent("inspectable") inst:AddComponent("fuel") inst.components.fuel.fuelvalue = TUNING.SMALL_FUEL MakeSmallBurnable(inst, TUNING.SMALL_BURNTIME) MakeSmallPropagator(inst) inst:AddComponent("inventoryitem") inst.components.inventoryitem.atlasname = "images/inventoryimages/wharang_dango.xml" return inst end return Prefab("common/inventory/scroll", fn, Assets), any help would be appreciated. Link to comment https://forums.kleientertainment.com/forums/topic/94032-cant-find-prefab/ Share on other sites More sharing options...
BraveChicken Posted July 27, 2018 Share Posted July 27, 2018 Did you add your prefab to the list of prefabs in your modmain.lua file? If not, then that might be the reason why. To add it simply open the modmain.lua file and there you'll see something like: PrefabFiles = { "YourCharacter" } Simply add your prefab there so it'll look like that: PrefabFiles = { "YourCharacter", "YourPrefabHere" } However, if you did add it and it doesn't work, then I'm guessing it could be probably just a typo somewhere. So simply make sure that you typed the name of your prefab file everywhere correctly. Link to comment https://forums.kleientertainment.com/forums/topic/94032-cant-find-prefab/#findComment-1069036 Share on other sites More sharing options...
rockninja Posted July 28, 2018 Author Share Posted July 28, 2018 I've added it to the list, but now the game gets frozen on the title screen? PrefabFiles = { "scroll", } I have no idea what i'm doing wrong now. Link to comment https://forums.kleientertainment.com/forums/topic/94032-cant-find-prefab/#findComment-1069244 Share on other sites More sharing options...
Rincevvind Posted July 28, 2018 Share Posted July 28, 2018 (edited) and where your lua file? in scripts/prefabs directory i hope? show part of log where error is appears Edited July 28, 2018 by Rincevvind Link to comment https://forums.kleientertainment.com/forums/topic/94032-cant-find-prefab/#findComment-1069414 Share on other sites More sharing options...
BraveChicken Posted July 29, 2018 Share Posted July 29, 2018 (edited) On 7/27/2018 at 4:57 PM, rockninja said: inst.components.inventoryitem.atlasname = "images/inventoryimages/wharang_dango.xml" Did you also add all of the item's custom images to the Assets = { } section in your modmain.lua? Assets = { Asset( "IMAGE", "images/inventoryimages/wharang_dango.tex" ), Asset( "ATLAS", "images/inventoryimages/wharang_dango.xml" ), } You should add it along with all the other assets which are already there. (If there currently are any) Edited July 29, 2018 by BraveChicken Link to comment https://forums.kleientertainment.com/forums/topic/94032-cant-find-prefab/#findComment-1069674 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