Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / parent image does not contain subimage

Author
Message
Vladimuffin
7
Years of Service
User Offline
Joined: 27th Nov 2016
Location:
Posted: 30th Jul 2017 15:16
So I have used this command a bunch of time. I works fine in every other instant of the program, but I am getting an error on this 1 line that I just can't shake.

media folder contains guy.png and guy subimages.txt

guy subimages says:


and program says:



I don't know what I'm doing wrong?

i have renamed the png, renamed the subimages in the txt file, renamed the loaded image, renamed the subimage in the program, verified the img type and txt document.

Any help would be greatly appreciated.
One smart fellow, he felt smart. Two smart fellows, both felt smart. Three smart fellows all felt smart...
Dybing
13
Years of Service
User Offline
Joined: 12th Sep 2011
Location: Bergen, Norway
Posted: 30th Jul 2017 17:06
I find it odd that you have no image format extension in the subimages. Surely you create the sprite-sheet with a bunch of .png images, so the accompanying text-file should read something similar to

guy1.png:0:0:32:32
guy2.png:32:0:32:32
guy3.png:64:0:32:32
guy4.png:96:0:32:32

Not sure if AppGameKit accepts imagefiles without the correct extension. Anyhow, get that sorted, and load them up with



As an aside, it is worth remembering that AppGameKit is a bit odd in regards to arrays. In all other languages, the array definition gives max numbers of indexes and actual counting is done from index 0.

So in for instance C/C++/C# or Go you'd assign 4 indexes to the array and count 0 to 3. AppGameKit however sets highest index. Which in your code means you'll have 5 indexes, filling index 1 through 4 and have an empty index 0.
Fluorescent
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 1st Aug 2005
Location: Stockholm, Sweden
Posted: 30th Jul 2017 17:20
Make sure you didn't accidently add two spaces between guy and subimages for example. AppGameKit gets confused in that situation. Also check that any file name doesn't contain any other characters that might be difficult to see. So rename both files and make sure to retype every character.
Vladimuffin
7
Years of Service
User Offline
Joined: 27th Nov 2016
Location:
Posted: 30th Jul 2017 20:44
Dybing, I created a spritesheet. All 4 images are cropped from 1 atlas image, not 4 separate png files. While your suggestion works perfectly, i dont want 300 separate image files, nor do i want file names overlapping.

Fluorescent, thanks. I will just retype the txt files from scratch, since they are so short. Maybe that will solve the issue. I'll follow up asap. Thanks, guys, for the feedback!
One smart fellow, he felt smart. Two smart fellows, both felt smart. Three smart fellows all felt smart...
Vladimuffin
7
Years of Service
User Offline
Joined: 27th Nov 2016
Location:
Posted: 30th Jul 2017 20:54
Oh my....

2 spaces in the guy subimages.txt AND girl subimages.txt!!!!!!!!!

works now. I'm sorry for wasting your time. I can't even begin to rationalize how I did this, nor the amount of time I spent trying to make it work. @Fluorescent you are a life saver.
One smart fellow, he felt smart. Two smart fellows, both felt smart. Three smart fellows all felt smart...

Login to post a reply

Server time is: 2024-11-22 07:18:31
Your offset time is: 2024-11-22 07:18:31