Sprites and warnings

WARNING: Sequence (Attack) has an invalid ‘start’ index (7) that falls outside the range of valid image sheet frame indices: 1 <= index <= 5.
WARNING: Sequence (Attack) has an invalid count (14) that makes the last frame index of the sequence (20) fall outside the range of valid image sheet frame indices: 1 <= index <= 5.
WARNING: Sequence (Attack) has an invalid count (14) that makes the last frame index of the sequence (20) fall outside the range of valid image sheet frame indices: 1 <= index <= 14.

What does this mean?

It means you’re trying to use a frame index 7 when there are only 5, etc.

If I were to guess, your image sheet is borked.

Suggestion: Make a mini virgin/standalone example with just enough code to demo this problem, post it for others to download (not a code paste, but a full mini-project) and folks will be able to help you debug this.

Making said example will also probably help you solve the issue, but if not then we have something concrete to try and give an answer on.

I used wrong sheet and I understood “count” wrongly.
“count” in animations sequences means how much frames to use after “start” frame?

1 Like

And I want to have sprite what is just one image, but when I need it I can play animations on that sprite.
I tried this, but sprite just doesn’t show:

{ name = "heroTop", sheet = heroAnimationSheet , frames = { 1 }}

Again, it is WAY easier to help if we have an example to download and run.

https://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2020/09/sprites.zip

  1. Here is my example, does essentially just what you’re showing and works. So compare yours to mine and see what is different.

  2. Please supply a downloadable-runnable example for debug help. Out of context lines of code only sometimes help

You can use my framework/example for future sprite questions in this post.

1 Like

Question. Have you downloaded this?: https://github.com/roaminggamer/RG_FreeStuff

https://github.com/roaminggamer/RG_FreeStuff/archive/master.zip

You really should. Then look at AskEd. You don’t have to read all the code, but just see what examples I have there. I’ve provided 400+ answers ( might have culled some at some point though) over the years and most of them can be run out of the box.

Also, I see the same questions a lot, so often if you have a question it is likely I have answered it either directly or tangentially in one of those mini-projects.

For example, the code I just posted is a direct copy of an answer I posted in 2015. I only reposted it under the assumption that it might evolve and need to be updated for this thread.

1 Like

ok, I will look into if I need help :slight_smile:
Thanks for help

Sure, but I’m saying look at it before you need help (when you’re taking a break or something). That way you can kind of remember what is there.

Either way, I think it will help a little. Now, back to game making with you…

Cheers!

RoamingGamer is offering some great suggestions,. Also be sure to check out the “TexturePacker app” to build your sprites into one image - it writes code out in LUA so you can easily call on the frames. https://www.codeandweb.com/texturepacker

2 Likes