Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting a Invaild Tileset Reference
#1
Hello, I've been playing around with the sample files and I finally got around to trying to load some of my own artwork into the engine, however I have ran into an error that I'm not sure how to fix. I've basically taken the Platformer.py sample and replaced the tilemap with one that I have made personally. Everything is the same I just changed lines 64 and 65 the file to redirect to my tmx files. Doing this I get the error "tilengine.TilengineException: 'Invalid Tileset reference'" Any ideas what might be wrong?


Thank you and have a wonderful day.
Reply
#2
Without having your artwork and the contents of the line you have changed, I can't tell the problem. However my guess is that you've produced 32-bit ARGB artwork, whereas Tilengine requires 8-bit indexed color format, and it's refusing to load it. It's a common mistake. Make sure your PNGs are 8-bit and index 0 is the transparent color.

The python binding is a bit outdated, but the core library got a TLN_SetLogLevel() function in release 2.10 to print this kind of errors to the standard output before they crash something.

Thanks and goog luck!
Reply
#3
(11-13-2019, 07:10 AM)megamarc Wrote: Without having your artwork and the contents of the line you have changed, I can't tell the problem. However my guess is that you've produced 32-bit ARGB artwork, whereas Tilengine requires 8-bit indexed color format, and it's refusing to load it. It's a common mistake. Make sure your PNGs are 8-bit and index 0 is the transparent color.

The python binding is a bit outdated, but the core library got a TLN_SetLogLevel() function in release 2.10 to print this kind of errors to the standard output before they crash something.

Thanks and goog luck!

Hey Marc, thank you for reply, unfortunately the file is already an 8-bit indexed color PNG. Would it be possible for me to send you the file which I'm having trouble with so you could take a look?
Reply
#4
Of course, you can post the files here in the forum if you want. And also the modified Platformer.py
Reply
#5
(11-13-2019, 07:43 AM)megamarc Wrote: Of course, you can post the files here in the forum if you want. And also the modified Platformer.py

I've attached a zip with all the files. Let me know what you find. Thank you again for the help, it's much appreciated.
Reply
#6
Hi again,

Spritesets are loaded from a pair of files with the same base name, different extension:
  • a png file with all the sprites packed together (player.png)
  • a txt describing the rectangles and names of each individual graphic inside the big png. (player.txt)
In the zipfile you provide, the associated "player.txt" required by "player.png" is missing. 

Also, the funcion call to load the spriteset expects the base name without the extension, line 65 should be:

Code:
playerSprite = Spriteset.fromfile("player")

I see the documentation is not clear in this regard.

For a full working example in python, i recommend you to check this project:
https://github.com/megamarc/TilenginePythonPlatformer

Your interest is much appreciated too Smile
Reply
#7
(11-13-2019, 08:17 AM)megamarc Wrote: Hi again,

Spritesets are loaded from a pair of files with the same base name, different extension:
  • a png file with all the sprites packed together (player.png)
  • a txt describing the rectangles and names of each individual graphic inside the big png. (player.txt)
In the zipfile you provide, the associated "player.txt" required by "player.png" is missing. 

Also, the funcion call to load the spriteset expects the base name without the extension, line 65 should be:

Code:
playerSprite = Spriteset.fromfile("player")

I see the documentation is not clear in this regard.

For a full working example in python, i recommend you to check this project:
https://github.com/megamarc/TilenginePythonPlatformer

Your interest is much appreciated too Smile
Were you able to get the tmx files to load? If so, how did you fix the issue with invaild tileset reference?
Reply
#8
Hi again,

I didn't try loading more assets as I saw the error with the sprites. I was going to try it now, but I'm on another computer and you've removed the attachment from the post
Reply
#9
(11-13-2019, 06:04 PM)megamarc Wrote: Hi again,

I didn't try loading more assets as I saw the error with the sprites. I was going to try it now, but I'm on another computer and you've removed the attachment from the post

Oh sorry, I just didn't want any others getting a hold of my art, I'll upload it one more time, just let me know when you got it so I can delete it again.
Reply
#10
Done. The problem is that Tilengine doesn't load tilesets embedded inside tilemaps (something that Tiled editor itself can do), they must be exported as stand-alone tilesets. I've done it, here you can find attached the resulting decoupled tmx/tsx files. I haven't included the png.

Let me know your progress!


Attached Files
.zip   assets.zip (Size: 3.11 KB / Downloads: 5)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)