Fancy_Fox_Pers Posted December 16, 2015 Share Posted December 16, 2015 (edited) Hi, there! I've tried to make a simple item, non swappable, that you can put in your inventory. The ultimate goal of this is to act as an eyebone for a custom mob. But right now, I'm crashing because of the inventory images (great start...). I am currently waiting for my head to recover from all the hairpulling that happened recently, so I'm asking you dear guys the following : why does the game crash when putting it in my inventory (thought to be linked to the inventoryimage.xml) Here's what the log says :LUA ERROR stack traceback: scripts/widgets/image.lua(32,1) in function 'SetTexture' scripts/widgets/image.lua(13,1) in function '_ctor' scripts/class.lua(181,1) in function 'Image' scripts/widgets/itemtile.lua(45,1) in function '_ctor' scripts/class.lua(181,1) in function 'ItemTile' scripts/widgets/inventorybar.lua(984,1) in function 'OnItemGet' scripts/widgets/inventorybar.lua(79,1) in function 'fn' scripts/entityscript.lua(942,1) in function 'PushEvent' scripts/components/inventory.lua(698,1) =(tail call) ? scripts/actions.lua(224,1) =(tail call) ? scripts/bufferedaction.lua(23,1) in function 'Do' scripts/entityscript.lua(1216,1) in function 'PerformBufferedAction' scripts/stategraphs/SGwilson.lua(2234,1) in function 'fn' scripts/stategraph.lua(563,1) in function 'UpdateState' scripts/stategraph.lua(602,1) in function 'Update' scripts/stategraph.lua(123,1) in function 'Update' scripts/update.lua(209,1)[00:00:31]: 1070219108LUA ERROR stack traceback: scripts/widgets/image.lua(32,1) in function 'SetTexture' scripts/widgets/image.lua(13,1) in function '_ctor' scripts/class.lua(181,1) in function 'Image' scripts/widgets/itemtile.lua(45,1) in function '_ctor' scripts/class.lua(181,1) in function 'ItemTile' scripts/widgets/inventorybar.lua(984,1) in function 'OnItemGet' scripts/widgets/inventorybar.lua(79,1) in function 'fn' scripts/entityscript.lua(942,1) in function 'PushEvent' scripts/components/inventory.lua(698,1) =(tail call) ? scripts/actions.lua(224,1) =(tail call) ? scripts/bufferedaction.lua(23,1) in function 'Do' scripts/entityscript.lua(1216,1) in function 'PerformBufferedAction' scripts/stategraphs/SGwilson.lua(2234,1) in function 'fn' scripts/stategraph.lua(563,1) in function 'UpdateState' scripts/stategraph.lua(602,1) in function 'Update' scripts/stategraph.lua(123,1) in function 'Update' scripts/update.lua(209,1)[00:00:31]: 1070219108LUA ERROR stack traceback: scripts/widgets/image.lua(32,1) in function 'SetTexture' scripts/widgets/image.lua(13,1) in function '_ctor' scripts/class.lua(181,1) in function 'Image' scripts/widgets/itemtile.lua(45,1) in function '_ctor' scripts/class.lua(181,1) in function 'ItemTile' scripts/widgets/inventorybar.lua(984,1) in function 'OnItemGet' scripts/widgets/inventorybar.lua(79,1) in function 'fn' scripts/entityscript.lua(942,1) in function 'PushEvent' scripts/components/inventory.lua(698,1) =(tail call) ? scripts/actions.lua(224,1) =(tail call) ? scripts/bufferedaction.lua(23,1) in function 'Do' scripts/entityscript.lua(1216,1) in function 'PerformBufferedAction' scripts/stategraphs/SGwilson.lua(2234,1) in function 'fn' scripts/stategraph.lua(563,1) in function 'UpdateState' scripts/stategraph.lua(602,1) in function 'Update' scripts/stategraph.lua(123,1) in function 'Update' scripts/update.lua(209,1) [00:00:31]: WARNING! Could not find region 'FROMNUM' from atlas 'FROMNUM'. Is the region specified in the atlas?[00:00:31]: Looking for default texture '' from atlas 'FROMNUM'.[00:00:31]: 1070219108LUA ERROR stack traceback: scripts/widgets/image.lua(32,1) in function 'SetTexture' scripts/widgets/image.lua(13,1) in function '_ctor' scripts/class.lua(181,1) in function 'Image' scripts/widgets/inventorybar.lua(991,1) in function 'OnItemGet' scripts/widgets/inventorybar.lua(79,1) in function 'fn' scripts/entityscript.lua(942,1) in function 'PushEvent' scripts/components/inventory.lua(698,1) =(tail call) ? scripts/actions.lua(224,1) =(tail call) ? scripts/bufferedaction.lua(23,1) in function 'Do' scripts/entityscript.lua(1216,1) in function 'PerformBufferedAction' scripts/stategraphs/SGwilson.lua(2234,1) in function 'fn' scripts/stategraph.lua(563,1) in function 'UpdateState' scripts/stategraph.lua(602,1) in function 'Update' scripts/stategraph.lua(123,1) in function 'Update' scripts/update.lua(209,1)[00:00:33]: Force aborting... Here's the full code of bone_lionel.lua :local assets ={ Asset("ANIM", "anim/bone_lionel.zip"),Asset("ATLAS", "images/inventoryimages/bone_lionel.xml"), Asset("IMAGE", "images/inventoryimages/bone_lionel.tex"),}-- local SPAWN_DIST = 30-- local function OpenEye(inst) -- inst.isOpenEye = true -- inst.components.inventoryitem:ChangeImageName(inst.openEye)-- end-- local function CloseEye(inst) -- inst.isOpenEye = nil -- inst.components.inventoryitem:ChangeImageName(inst.closedEye)-- end-- local function RefreshEye(inst) -- if inst.isOpenEye then -- OpenEye(inst) -- else -- CloseEye(inst) -- end-- end-- local function GetSpawnPoint(pt) -- local theta = math.random() * 2 * PI -- local radius = SPAWN_DIST -- local offset = FindWalkableOffset(pt, theta, radius, 12, true) -- return offset ~= nil and (pt + offset) or nil-- end-- local function SpawnChester(inst) -- local pt = inst:GetPosition() -- local spawn_pt = GetSpawnPoint(pt) -- if spawn_pt ~= nil then -- local picolo_lionel = SpawnPrefab("picolo_lionel") -- if picolo_lionel ~= nil then -- picolo_lionel.Physics:Teleport(spawn_pt:Get()) -- picolo_lionel:FacePoint(pt:Get()) -- return picolo_lionel -- end -- end-- end-- local StartRespawn-- local function StopRespawn(inst) -- print("chester_eyebone - StopRespawn") -- if inst.respawntask ~= nil then -- inst.respawntask:Cancel() -- inst.respawntask = nil -- inst.respawntime = nil -- end-- end-- local function Rebindpicolo_lionel(inst, picolo_lionel) -- picolo_lionel = picolo_lionel or TheSim:FindFirstEntityWithTag("picolo_lionel") -- if picolo_lionel ~= nil then -- inst.AnimState:PlayAnimation("idle", true) -- OpenEye(inst) -- inst:ListenForEvent("death", function() StartRespawn(inst, TUNING.CHESTER_RESPAWN_TIME) end, chester) -- if picolo_lionel.components.follower.leader ~= inst then -- picolo_lionel.components.follower:SetLeader(inst) -- end -- return true -- end-- end-- local function Respawnpicolo_lionel(inst) -- StopRespawn(inst) -- Rebindpicolo_lionel(inst, TheSim:FindFirstEntityWithTag("picolo_lionel") or Spawnpicolo_lionel(inst))-- end-- StartRespawn = function(inst, time) -- StopRespawn(inst) -- time = time or 0 -- inst.respawntask = inst:DoTaskInTime(time, RespawnChester) -- inst.respawntime = GetTime() + time -- inst.AnimState:PlayAnimation("dead", true) -- CloseEye(inst)-- end-- local function Fixpicolo_lionel(inst)-- inst.fixtask = nil-- take an existing picolo_lionel if there is one-- if not Rebindpicolo_lionel(inst) then -- inst.AnimState:PlayAnimation("dead", true) -- CloseEye(inst)-- if inst.components.inventoryitem.owner ~= nil then-- local time_remaining = 0-- local time = GetTime()-- if inst.respawntime and inst.respawntime > time then-- time_remaining = inst.respawntime - time -- end-- StartRespawn(inst, time_remaining)-- end-- end-- end-- local function OnPutInInventory(inst) -- if inst.fixtask == nil then -- inst.fixtask = inst:DoTaskInTime(1, Fixpicolo_lionel) -- end-- end-- local function OnSave(inst, data) -- data.EyeboneState = inst.EyeboneState -- if inst.respawntime ~= nil then -- local time = GetTime() -- if inst.respawntime > time then -- data.respawntimeremaining = inst.respawntime - time -- end -- end-- end-- local function OnLoad(inst, data) -- if data == nil then -- return -- end -- if data.EyeboneState == "SHADOW" then -- MorphShadowEyebone(inst) -- elseif data.EyeboneState == "SNOW" then -- MorphSnowEyebone(inst) -- end -- if data.respawntimeremaining ~= nil then -- inst.respawntime = data.respawntimeremaining + GetTime() -- end-- end-- local function GetStatus(inst) -- if inst.respawntask ~= nil then -- return "WAITING" -- end-- endlocal function fn() local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddNetwork() MakeInventoryPhysics(inst) inst:AddTag("bone_lionel") inst:AddTag("irreplaceable") inst:AddTag("nonpotatable") inst.AnimState:SetBank("bone_lionel") inst.AnimState:SetBuild("bone_lionel") inst.AnimState:PlayAnimation("idle") inst.entity:SetPristine() if not TheWorld.ismastersim then return inst end inst:AddComponent("inventoryitem") -- inst.components.inventoryitem:SetOnPutInInventoryFn(OnPutInInventory)inst.components.inventoryitem.imagename = "bone"inst.components.inventoryitem.atlasname = "images/inventoryimages/bone_lionel.xml" -- inst.EyeboneState = "NORMAL" -- inst.openEye = "picolo_lionel" -- inst.closedEye = "picolo_lionel" -- inst.isOpenEye = nil -- OpenEye(inst) inst:AddComponent("inspectable") -- inst.components.inspectable.getstatus = GetStatus -- inst.components.inspectable:RecordViews() inst:AddComponent("leader") MakeHauntableLaunch(inst) -- inst.OnLoad = OnLoad -- inst.OnSave = OnSave -- inst.fixtask = inst:DoTaskInTime(1, Fixpicolo_lionel) return instendreturn Prefab("common/inventory/bone_lionel", fn, assets) Attached files : (FYI: images are just placeholders)bone_lionel.zip (bone_lionel.lua is different here, I uncommented lines related to the eyebone thingy, the updated one is here above)log.txt Thank you very much to anyone willing to help, this one really grinds my gears ^^''' Edited December 16, 2015 by Thibooms Link to comment https://forums.kleientertainment.com/forums/topic/60841-issues-with-item-prefab/ Share on other sites More sharing options...
ZupaleX Posted December 16, 2015 Share Posted December 16, 2015 Isn't your .tex called "bone_lionel.tex"? Then the line 204 should beinst.components.inventoryitem.imagename = "bone_lionel" Link to comment https://forums.kleientertainment.com/forums/topic/60841-issues-with-item-prefab/#findComment-698094 Share on other sites More sharing options...
Fancy_Fox_Pers Posted December 16, 2015 Author Share Posted December 16, 2015 @ZupaleX, tried that, still crashes :/ (same crash) Link to comment https://forums.kleientertainment.com/forums/topic/60841-issues-with-item-prefab/#findComment-698103 Share on other sites More sharing options...
ZupaleX Posted December 16, 2015 Share Posted December 16, 2015 (edited) Ok, but still it should be called like that, because bone.tex doen't exist. EDIT: forget what i said before instead of this edit line. I'll look a bit closer your code then. EDIT2 : everything is commented out, and a closer look at the log says it's indeed coming from the inventoryitem part. I guess there is some mistake with your images. Are you sure that your bone_lionel.png is 64*64? I checked your png is 64*64 EDIT3 : it's normal there is no modmain.lua/modinfo.lua in the file you provided?? Edited December 16, 2015 by ZupaleX Link to comment https://forums.kleientertainment.com/forums/topic/60841-issues-with-item-prefab/#findComment-698106 Share on other sites More sharing options...
Fancy_Fox_Pers Posted December 16, 2015 Author Share Posted December 16, 2015 @ZupaleX, yes it is. I have a lot of things in my mod so I didn't want to provide unecessary things. The only thing relevant to this item I put in the modmain is listing it in "prefab files" as "bone_lionel", Link to comment https://forums.kleientertainment.com/forums/topic/60841-issues-with-item-prefab/#findComment-698111 Share on other sites More sharing options...
ZupaleX Posted December 16, 2015 Share Posted December 16, 2015 by putting bone_lionel for the inventoryimage.imagename, the error is EXACTLY the same? Link to comment https://forums.kleientertainment.com/forums/topic/60841-issues-with-item-prefab/#findComment-698128 Share on other sites More sharing options...
Fancy_Fox_Pers Posted December 16, 2015 Author Share Posted December 16, 2015 (edited) by putting bone_lionel for the inventoryimage.imagename, the error is EXACTLY the same? Yep [00:00:41]: Could not find anim [dead] in bank [bone_lionel][00:00:42]: WARNING! Could not find region 'FROMNUM' from atlas 'FROMNUM'. Is the region specified in the atlas?[00:00:42]: Looking for default texture '' from atlas 'FROMNUM'.[00:00:42]: 1070219108LUA ERROR stack traceback: scripts/widgets/image.lua(32,1) in function 'SetTexture' scripts/widgets/image.lua(13,1) in function '_ctor' scripts/class.lua(181,1) in function 'Image' scripts/widgets/itemtile.lua(45,1) in function '_ctor' scripts/class.lua(181,1) in function 'ItemTile' scripts/widgets/inventorybar.lua(984,1) in function 'OnItemGet' scripts/widgets/inventorybar.lua(79,1) in function 'fn' scripts/entityscript.lua(942,1) in function 'PushEvent' scripts/components/inventory.lua(698,1) =(tail call) ? scripts/actions.lua(224,1) =(tail call) ? scripts/bufferedaction.lua(23,1) in function 'Do' scripts/entityscript.lua(1216,1) in function 'PerformBufferedAction' scripts/stategraphs/SGwilson.lua(2234,1) in function 'fn' scripts/stategraph.lua(563,1) in function 'UpdateState' scripts/stategraph.lua(602,1) in function 'Update' scripts/stategraph.lua(123,1) in function 'Update' scripts/update.lua(209,1)[00:00:42]: 1070219108LUA ERROR stack traceback: scripts/widgets/image.lua(32,1) in function 'SetTexture' scripts/widgets/image.lua(13,1) in function '_ctor' scripts/class.lua(181,1) in function 'Image' scripts/widgets/itemtile.lua(45,1) in function '_ctor' scripts/class.lua(181,1) in function 'ItemTile' scripts/widgets/inventorybar.lua(984,1) in function 'OnItemGet' scripts/widgets/inventorybar.lua(79,1) in function 'fn' scripts/entityscript.lua(942,1) in function 'PushEvent' scripts/components/inventory.lua(698,1) =(tail call) ? scripts/actions.lua(224,1) =(tail call) ? scripts/bufferedaction.lua(23,1) in function 'Do' scripts/entityscript.lua(1216,1) in function 'PerformBufferedAction' scripts/stategraphs/SGwilson.lua(2234,1) in function 'fn' scripts/stategraph.lua(563,1) in function 'UpdateState' scripts/stategraph.lua(602,1) in function 'Update' scripts/stategraph.lua(123,1) in function 'Update' scripts/update.lua(209,1)[00:00:42]: 1070219108LUA ERROR stack traceback: scripts/widgets/image.lua(32,1) in function 'SetTexture' scripts/widgets/image.lua(13,1) in function '_ctor' scripts/class.lua(181,1) in function 'Image' scripts/widgets/itemtile.lua(45,1) in function '_ctor' scripts/class.lua(181,1) in function 'ItemTile' scripts/widgets/inventorybar.lua(984,1) in function 'OnItemGet' scripts/widgets/inventorybar.lua(79,1) in function 'fn' scripts/entityscript.lua(942,1) in function 'PushEvent' scripts/components/inventory.lua(698,1) =(tail call) ? scripts/actions.lua(224,1) =(tail call) ? scripts/bufferedaction.lua(23,1) in function 'Do' scripts/entityscript.lua(1216,1) in function 'PerformBufferedAction' scripts/stategraphs/SGwilson.lua(2234,1) in function 'fn' scripts/stategraph.lua(563,1) in function 'UpdateState' scripts/stategraph.lua(602,1) in function 'Update' scripts/stategraph.lua(123,1) in function 'Update' scripts/update.lua(209,1) [00:00:42]: WARNING! Could not find region 'FROMNUM' from atlas 'FROMNUM'. Is the region specified in the atlas?[00:00:42]: Looking for default texture '' from atlas 'FROMNUM'.[00:00:42]: 1070219108LUA ERROR stack traceback: scripts/widgets/image.lua(32,1) in function 'SetTexture' scripts/widgets/image.lua(13,1) in function '_ctor' scripts/class.lua(181,1) in function 'Image' scripts/widgets/inventorybar.lua(991,1) in function 'OnItemGet' scripts/widgets/inventorybar.lua(79,1) in function 'fn' scripts/entityscript.lua(942,1) in function 'PushEvent' scripts/components/inventory.lua(698,1) =(tail call) ? scripts/actions.lua(224,1) =(tail call) ? scripts/bufferedaction.lua(23,1) in function 'Do' scripts/entityscript.lua(1216,1) in function 'PerformBufferedAction' scripts/stategraphs/SGwilson.lua(2234,1) in function 'fn' scripts/stategraph.lua(563,1) in function 'UpdateState' scripts/stategraph.lua(602,1) in function 'Update' scripts/stategraph.lua(123,1) in function 'Update' scripts/update.lua(209,1)[00:00:45]: Force aborting... Edited December 16, 2015 by Thibooms Link to comment https://forums.kleientertainment.com/forums/topic/60841-issues-with-item-prefab/#findComment-698143 Share on other sites More sharing options...
ZupaleX Posted December 17, 2015 Share Posted December 17, 2015 it looks like it doesn't find your atlas. This is quite strange. Could you upload your complete mod folder? Link to comment https://forums.kleientertainment.com/forums/topic/60841-issues-with-item-prefab/#findComment-698177 Share on other sites More sharing options...
Fancy_Fox_Pers Posted December 17, 2015 Author Share Posted December 17, 2015 (edited) @ZupaleX, Good luck ^^' (this is litterally everything) Edit: there's also currently something from the eyebone code that makes the ground image disappear after a few seconds, this doesn't happen when uncommenting all this code. I don't know what part of it does this though. If you happen to stumble on it, let met know, would be awesome Thanks by the way Edited December 17, 2015 by Thibooms Link to comment https://forums.kleientertainment.com/forums/topic/60841-issues-with-item-prefab/#findComment-698183 Share on other sites More sharing options...
ZupaleX Posted December 17, 2015 Share Posted December 17, 2015 For your second question I would say it's because the anim is missing. You know that on the ground, the eyebone is blinking. Link to comment https://forums.kleientertainment.com/forums/topic/60841-issues-with-item-prefab/#findComment-698206 Share on other sites More sharing options...
Fancy_Fox_Pers Posted December 17, 2015 Author Share Posted December 17, 2015 @ZupaleX, I fixed it today. Now the only problem is the inventory image ^^' Link to comment https://forums.kleientertainment.com/forums/topic/60841-issues-with-item-prefab/#findComment-698292 Share on other sites More sharing options...
ZupaleX Posted December 17, 2015 Share Posted December 17, 2015 I don't know what to tell you, the image looks fine. I guess I would have to install the mod and try to debug it myself, because just looking at the script I do not see the problem. But I unfortunatly do not have the time to do that right now. If you happen to fix your issue, let me kno, otherwise I'll check it out as soon as I can. Link to comment https://forums.kleientertainment.com/forums/topic/60841-issues-with-item-prefab/#findComment-698300 Share on other sites More sharing options...
Fancy_Fox_Pers Posted December 17, 2015 Author Share Posted December 17, 2015 @ZupaleX, fixed it, turns out it was because of the eyeOpen-Closed thingy Link to comment https://forums.kleientertainment.com/forums/topic/60841-issues-with-item-prefab/#findComment-698312 Share on other sites More sharing options...
ZupaleX Posted December 17, 2015 Share Posted December 17, 2015 Wasn't it commented out in the code you posted? Link to comment https://forums.kleientertainment.com/forums/topic/60841-issues-with-item-prefab/#findComment-698338 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