TMX Map loader? (Tiled Map Editor)

General FreeBASIC programming questions.
Alex Scarlet
Posts: 3
Joined: Aug 17, 2019 0:14
Contact:

TMX Map loader? (Tiled Map Editor)

Postby Alex Scarlet » Oct 20, 2019 6:02

Not exactly sure where to start on the map loader.
Tiled can export as a XML file, So I'm trying an XML loader
Except I don't really understand XML in FreeBASIC so yeah.
I should probably spend more time figuring it out but at the time of writing its 11pm and my brain hurts
just wanna post this before i go to bed

Sweet Dreams
~Alex
badidea
Posts: 1766
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: TMX Map loader? (Tiled Map Editor)

Postby badidea » Oct 30, 2019 22:49

Hi, did you make some progress?
I had installed the 'Tiled Map Editor' before, but I never used it. Did some test now.
The standard files (.tmx and .tsx) are in XML format, but you can export both (map and tile set) in JSON format.
JSON is somewhat easier to read, but not much.
The map can also be exported in CSV format, but then you only get the 'tile layer' it seems.
paul doe
Posts: 1061
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: TMX Map loader? (Tiled Map Editor)

Postby paul doe » Nov 01, 2019 22:38

Alex Scarlet wrote:...
Except I don't really understand XML in FreeBASIC so yeah.
I should probably spend more time figuring it out but at the time of writing its 11pm and my brain hurts
...

Hey Alex, I have a Xml reader that's very easy to use. You can use it to parse your file (I can even provide an example of how to do it, if you post the Xml in question here). As soon as I gain access to my GitHub account again (grrrr) I'll upload it. It's part of a bigger framework, but I can upload just the bits you need.

As for JSON, there's a reader here by another member. You may want to look out for it, too.
Alex Scarlet
Posts: 3
Joined: Aug 17, 2019 0:14
Contact:

Re: TMX Map loader? (Tiled Map Editor)

Postby Alex Scarlet » Jan 23, 2020 3:53

Thanks ^^
paul doe
Posts: 1061
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: TMX Map loader? (Tiled Map Editor)

Postby paul doe » Jan 23, 2020 5:37

Alex Scarlet wrote:Thanks ^^

No prob. Here's the example I was talking about:

Xml parsing example

Return to “General”

Who is online

Users browsing this forum: No registered users and 3 guests