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.

2D All the way! / How to read TST files to get individual tiles

Author
Message
Frank C
12
Years of Service
User Offline
Joined: 3rd Jul 2010
Location: Houston TX
Posted: 29th Jul 2010 19:12
I have all the code to implement tiles into a map for my 2D RPG, I have a bunch of TST files from RPGToolkit and the website it comes from. The problem I have is reading the TST files in and pulling out the Tiles I want, or is there an app that will allow me to break the sections to individual image files I can just load?
Phaelax
DBPro Master
19
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 30th Jul 2010 09:08
I've tried finding a document on the TST format, but the only link I found was dead. Without some kind of documentation, I doubt I could reverse the format very effectively.


"Any sufficiently advanced technology is indistinguishable from magic" ~ Arthur C. Clarke
David Gervais
Retired Moderator
17
Years of Service
User Offline
Joined: 28th Sep 2005
Location: Montreal, Canada
Posted: 31st Jul 2010 14:03 Edited at: 31st Jul 2010 14:17
This might help...



Cheers!

P.S. also RPG Toolkit is now open source and under the free GPU licence.. http://www.toolkitzone.com/toolkit.php all you need to do is get it and if you can't export to a different format.. once loaded into the tileset editor, hit print screen and then past that into ms paint and crop the tiles you need and save them as individual images.

Phaelax
DBPro Master
19
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 1st Aug 2010 00:11
Looks pretty straight forward, I'll have a go tonight at writing a parser for it. Kinda lame it doesn't support an alpha channel. Not a very robust format.


"Any sufficiently advanced technology is indistinguishable from magic" ~ Arthur C. Clarke
Phaelax
DBPro Master
19
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 6th Aug 2010 06:42 Edited at: 6th Aug 2010 06:43
Here you go, wrote it this morning.




"Any sufficiently advanced technology is indistinguishable from magic" ~ Arthur C. Clarke
wildbill
16
Years of Service
User Offline
Joined: 14th Apr 2006
Location:
Posted: 7th Aug 2010 23:18
I've noticed before that people make a request for code and don't thank the person that fulfills the request. Thanks Phaelax. I may not ever use the code you have written, but its nice to read.
Frank C
12
Years of Service
User Offline
Joined: 3rd Jul 2010
Location: Houston TX
Posted: 9th Aug 2010 14:10
@wildbill - I don't appreciate the comment, I was not available to respond and look at the code till late yesterday although I did know it was here since I got the alert on my phone to a response in the thread.

@Phaelax: Thanks for the code, I did test it yesterday with a few different TST files I downloaded from the RPGTookit site, it works great. I am going through the code trying to understand the use of memblocks better. I want to use this in a smaller application to pull some tiles out and save them to a bmp for use rather than include a bunch of tst files to pull out a few tiles from each.
Frank C
12
Years of Service
User Offline
Joined: 3rd Jul 2010
Location: Houston TX
Posted: 9th Aug 2010 19:37
Phaelax I added a function to the end of your code to try and create a png file from a few of the tiles that your code extracts. I used the image numbers that are displayed by your code when you hit the spacebar. The code creates the image file but it is just a blank square the size of the bitmap I created, can you look at the code snippet to see whats wrong with my paste image statements. Eventually I would like to make it so I can click on a selection of tiles displayed by your code and create png files to use.

Login to post a reply

Server time is: 2022-11-29 15:38:37
Your offset time is: 2022-11-29 15:38:37