Solarus-Games English Forum

Solarus => Development => Topic started by: ffomega on January 31, 2017, 05:58:50 AM

Title: [SOLVED] Error: Cannot create pickable treasure
Post by: ffomega on January 31, 2017, 05:58:50 AM
I ran into a small problem with items.  I have moved the items sprite sheet into the items subfolder within the /sprites/entities/ directory, and whenever I load a game, all the pickables are gone, giving me the error message:

"Error: Cannot create pickable treasure 'item': Sprite 'entities/items' has no animation 'item' ".

Should I have left the items.png file in the root directory of 'entities'?  Are pickables hardcoded into always looking for 'items.png' within the 'entities' folder and nowhere else?
Title: Re: Error: Cannot create pickable treasure
Post by: Diarandor on January 31, 2017, 08:10:41 AM
As far as I know, you can move your png files to any folder/ subfolder of the sprites folder. But then you will have to modify your dat file of the sprite, so that the engine knows where to find the png. There is no need to modify the dat file directly, as you can open the sprite from the editor and change the source file location for each animation.
Title: Re: Error: Cannot create pickable treasure
Post by: MetalZelda on January 31, 2017, 12:28:46 PM
You can move the png, but you need to modify the .dat where the source pointer is located
Title: Re: Error: Cannot create pickable treasure
Post by: Shimon on January 31, 2017, 05:33:29 PM
From what I understand any Item image must originate from the entities/items sprite. So say I wanted to add a baked potato - I would make the baked_potato.lua and then create a folder inside the entities/items sprite called baked_potato, then after creating a direction I can load the image of my baked potato to use from where ever I want.
Hope this helps.
Title: Re: Error: Cannot create pickable treasure
Post by: ffomega on January 31, 2017, 08:53:53 PM
it might also be noted that, when I started thr quest, I got the error:

Error: Cannot find quest file 'sprites/entities/items.dat'

Does this file HAVE to be located in "sprites/entities"? The image itself I know can be anywhere as long as you have all your images point to the items.dat file.  This was what I was asking earlier when I wondered if the location of the items was hardcoded into the engine.
Title: Re: Error: Cannot create pickable treasure
Post by: Christopho on January 31, 2017, 09:14:29 PM
The PNG images can be anywhere (under sprites/) but the items sprite must be exactly sprites/entities/items.dat.
Title: Re: Error: Cannot create pickable treasure
Post by: ffomega on January 31, 2017, 11:07:45 PM
That's what I wanted to know.  Thanks Chris :)  I will need to make a small adjustment to the package then, to avoid anyone else running into this problem