AireAyquaza Posted December 29, 2017 Share Posted December 29, 2017 Hello ! I got an issue when making a new equipable item using the wand tutorial. I make all idle anim and swap anim with spriter and compiled them with autocompiler I'd make a new craft for this item but when i try to craft it i get "I can't do that" In my server log i found a line with "Could not preload undefined prefab (myitem)" The prefab is in the prefab list on modmain What is wrong with my item ? my code is exaclty the same for the prefab file than the wand tutorial Link to comment https://forums.kleientertainment.com/forums/topic/85911-game-is-not-loading-my-new-item/ Share on other sites More sharing options...
Aquaterion Posted December 29, 2017 Share Posted December 29, 2017 You're gonna have to provide more than that. Maybe screenshots of your file directories, and some code Link to comment https://forums.kleientertainment.com/forums/topic/85911-game-is-not-loading-my-new-item/#findComment-988252 Share on other sites More sharing options...
AireAyquaza Posted December 29, 2017 Author Share Posted December 29, 2017 (edited) Thank you for replying There is some informations : Working directory treeview : GlacialStaff anim glacialstaff.zip swap_glacialstaff.zip exported glacialstaff glacialstaff.png glacialstaff.scml glacialstaff.zip grass-0.png swap_glacialstaff glacialstaff.png swap_glacialstaff.scml swap_glacialstaff.zip images tabimages tab.tex tab.xml inventoryimages glacialstaff.tex glacialstaff.xml prefabs glacialstaff.lua preview.png modmain.lua modinfo.lua modicon.xml modicon.tex The modmain file : local Ingredient = GLOBAL.Ingredient local RECIPETABS = GLOBAL.RECIPETABS local STRINGS = GLOBAL.STRINGS local TECH = GLOBAL.TECH local ACTIONS = GLOBAL.ACTIONS ACTIONS.CASTAOE.GLACIALSTAFF = "Call Ice Age" STRINGS.NAMES.GLACIALSTAFF = "Glacial Staff" STRINGS.CHARACTERS.GENERIC.DESCRIBE.GLACIALSTAFF = "Frost power in my hands !" STRINGS.RECIPE_DESC.GLACIALSTAFF = "Glacial Staff" PrefabsFiles = { "glacialstaff" } Assets = { Asset("ANIM", "anim/glacialstaff.zip"), Asset("ANIM", "anim/swap_glacialstaff.zip"), Asset("ATLAS", "images/inventoryimages/glacialstaff.xml"), Asset("IMAGE", "images/inventoryimages/glacialstaff.tex"), } local mytab = AddRecipeTab("Tab test", 6, "images/tabimagestab.xml", "tab.tex", nil) AddRecipe("glacialstaff" , {Ingredient("bluegem", 1)}, mytab, TECH.SCIENCE_TWO, nil, nil, nil, nil, nil, "images/inventoryimages/glacialstaff.xml", "glacialstaff.tex") And the glacialstaff.lua prefab local assets= { Asset("ANIM", "anim/glacialstaff.zip"), Asset("ANIM", "anim/swap_glacialstaff.zip"), Asset("ATLAS", "images/inventoryimages/glacialstaff.xml"), Asset("IMAGE", "images/inventoryimages/glacialstaff.tex"), } local prefabs = { } local function fn(colour) local function OnEquip(inst, owner) owner.AnimState:OverrideSymbol("swap_object", "swap_glacialstaff", "glacialstaff") owner.AnimState:Show("ARM_carry") owner.AnimState:Hide("ARM_normal") end local function OnUnequip(inst, owner) owner.AnimState:Hide("ARM_carry") owner.AnimState:Show("ARM_normal") end local inst = CreateEntity() local trans = inst.entity:AddTransform() local anim = inst.entity:AddAnimState() MakeInventoryPhysics(inst) anim:SetBank("glacialstaff") anim:SetBuild("glacialstaff") anim:PlayAnimation("idle") inst:AddComponent("inventoryitem") inst.components.inventoryitem.imagename = "glacialstaff" inst.components.inventoryitem.atlasname = "images/inventoryimages/glacialstaff.xml" inst:AddComponent("equippable") inst.components.equippable:SetOnEquip( OnEquip ) inst.components.equippable:SetOnUnequip( OnUnequip ) return inst end return Prefab("common/inventory/glacialstaff", fn, assets, prefabs) glacialstaff.zip Edited December 29, 2017 by AireAyquaza Link to comment https://forums.kleientertainment.com/forums/topic/85911-game-is-not-loading-my-new-item/#findComment-988254 Share on other sites More sharing options...
Aquaterion Posted December 29, 2017 Share Posted December 29, 2017 in modmain.lua line 12, you have a typo "PrefabsFiles" should be "PrefabFiles" Link to comment https://forums.kleientertainment.com/forums/topic/85911-game-is-not-loading-my-new-item/#findComment-988284 Share on other sites More sharing options...
AireAyquaza Posted December 29, 2017 Author Share Posted December 29, 2017 Wow, thank you so much ! This is really stupid x) Link to comment https://forums.kleientertainment.com/forums/topic/85911-game-is-not-loading-my-new-item/#findComment-988287 Share on other sites More sharing options...
AireAyquaza Posted December 29, 2017 Author Share Posted December 29, 2017 Do you have some tutorial to make swap anim for equipable item ? The wand tutorial tell to make "swap_myitem->BUILD" anim but this is not working on DST :/ Link to comment https://forums.kleientertainment.com/forums/topic/85911-game-is-not-loading-my-new-item/#findComment-988305 Share on other sites More sharing options...
Aquaterion Posted December 29, 2017 Share Posted December 29, 2017 7 minutes ago, AireAyquaza said: Do you have some tutorial to make swap anim for equipable item ? The wand tutorial tell to make "swap_myitem->BUILD" anim but this is not working on DST :/ owner.AnimState:OverrideSymbol("swap_object", "swap_glacialstaff", "symbol0") Link to comment https://forums.kleientertainment.com/forums/topic/85911-game-is-not-loading-my-new-item/#findComment-988306 Share on other sites More sharing options...
AireAyquaza Posted December 29, 2017 Author Share Posted December 29, 2017 What does "symbol0" mean exactly ? Link to comment https://forums.kleientertainment.com/forums/topic/85911-game-is-not-loading-my-new-item/#findComment-988309 Share on other sites More sharing options...
Aquaterion Posted December 29, 2017 Share Posted December 29, 2017 (edited) 3 minutes ago, AireAyquaza said: What does "symbol0" mean exactly ? in your .scml file(which you can open with a texteditor as well) you don't have a name for your folder tag so the autocompiler automatically names it "symbol" and the id Edited December 29, 2017 by Aquaterion Link to comment https://forums.kleientertainment.com/forums/topic/85911-game-is-not-loading-my-new-item/#findComment-988311 Share on other sites More sharing options...
AireAyquaza Posted December 29, 2017 Author Share Posted December 29, 2017 Thank again for your help, i'm understanding better now. I still not understand how to correctly place the item in the character hand, in spriter there is a kind of circle i can move to set where the item is placed when i equip it, but this and the scale are not well rendered, i missed something again :/ See screenshots Link to comment https://forums.kleientertainment.com/forums/topic/85911-game-is-not-loading-my-new-item/#findComment-988328 Share on other sites More sharing options...
Aquaterion Posted December 29, 2017 Share Posted December 29, 2017 I believe the issue is that you're putting the pivot on the animation, but that animation is not actually used. What you have to do is open .scml in a texteditor again and copy the pivot_x and pivot_y from the animations to the image file Link to comment https://forums.kleientertainment.com/forums/topic/85911-game-is-not-loading-my-new-item/#findComment-988330 Share on other sites More sharing options...
AireAyquaza Posted December 29, 2017 Author Share Posted December 29, 2017 Ok ! I got it, thank you a lot Link to comment https://forums.kleientertainment.com/forums/topic/85911-game-is-not-loading-my-new-item/#findComment-988337 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