Game Development Community

Failed to acquire asset ID

by John Walsh · in Torque 2D Beginner · 02/06/2014 (1:49 pm) · 10 replies

Hey I'm trying to make an animation sprite, an empty box shows up in game. Here are the console errors:

Asset Manager: Failed to acquire asset Id 'myModules:morgarkWalk' as it does not exist.
ImageFrameProviderCore::playAnimation() - Cannot play AnimationAsset 'myModule:morgarkWalkAnim' - Animation has no validated frames!

Here is my animation taml called morgarkWalkAnim:
<AnimationAsset
    AssetName="morgarkWalkAnim"
    Image="@asset=myModules:morgarkWalk"
    AnimationFrames="0 1 2 3 4 5 6 7"
    AnimationTime="1"
    AnimationCycle="true" />

Here is my image taml which is linked to my sprite sheet png:
<ImageAsset
    AssetName="morgarkWalk"
    ImageFile="morgarkWalk.png"
    CellCountX="8"
    CellCountY="1"
    CellWidth="229"
    CellHeight="382" />

My sprite sheet is called morgarkWalk. Also, I have two folders: 'animations' and 'images' inside 'myModule'. The animation taml is in the animations folder and the rest are in the image folder.

EDIT: Here is the code from my player.cs which calls the animation:
%player.Animation = "myModule:morgarkWalkAnim";

#1
02/06/2014 (2:28 pm)
All I can say is double-check all of your file and folder names - the asset descriptions look correct.

And maybe check your module.taml file - ensure that the Recurse property is "true", that your asset folder is called "assets" and that your asset taml files have the "asset.taml" extension.
#2
02/06/2014 (2:36 pm)
All of what you said is correctly done, I'm confused :/
#3
02/06/2014 (2:53 pm)
What size is the image? (nvm - did the math) 1832 wide....
Can you make it 4x2 cells? I recall an issue a long time ago related to single row animations but I thought it was fixed.
#4
02/06/2014 (2:53 pm)
Another thing to check, in your module.taml file, make sure that the module will automatically scan for assets

[code]
<ModuleDefinition
ModuleID = "MyModule"
...
<DeclaredAssets
Path="assets"
Extension="asset.taml"
Recurse="true"/>
</ModuleDefinition>
[code]

This example would load everything under /assets which has the asset.taml extension.
#5
02/06/2014 (3:05 pm)
It's weird - I remember looking at max texture sizes and I found where we set max height to 2048, but I can't find where it checks width....

Anyway, 1832 is within limits (I was pretty sure, but I thought I'd look) so it might just be the single row thing.
#6
02/06/2014 (8:41 pm)
From reading your first post John, I would interpret your folder structure as:

myModule
-- images
-- animations

and not

myModule
-- assets
    -- images
    -- animations

This could explain why the declared assets path is not working. If you do have it setup like in the second example, then something weird is going on - but it will be difficult to figure it out without seeing your module.
#7
02/06/2014 (8:49 pm)
Another helpful tip is to go into the root main.cs file and change this

// Set asset database information echo.
AssetDatabase.EchoInfo = false;

to true. The asset manager will report a lot more info in the console about what it encounters.
#8
02/07/2014 (4:18 am)
Maybe a typo in the post, but I see you use myModule and myModules. Check to make sure you are using one consistently.
#9
02/07/2014 (6:31 am)
Aw yeah - Mich is on it!

Asset Manager: Failed to acquire asset Id 'myModules:morgarkWalk' as it does not exist.
ImageFrameProviderCore::playAnimation() - Cannot play AnimationAsset 'myModule:morgarkWalkAnim' - Animation has no validated frames!
#10
02/07/2014 (3:03 pm)
Yeah it was a typo! Thanks a lot, it works now