Hi all!
Maybe someone who is way better at this then I am can help me out. Does anyone know if it is possible to use the latest version of allegro with Mappy? I did a little with it a few years ago, and really liked working with Mappy, and I have a new project I think it would be a great tool for. Well, from the looks of it Mappy hasn't been updated in a bit, and Allegro seems wayyyy different then when I used it in version 4 something. So I got a base allegro program running and then just added the mappyal.h / mappyal.c to my main and tried to compile it, and of course the compiler goes batty.
Is there anything else I need in order to get it compile? Or is using it a no-go? I'd like to try out the latest version of allegro, but I liked how in mappy I could add data to arbitrary tiles, to handle collision, encounter rates, etc etc. I might would just reset to an older version. Or is there any newer program that duplicates any of the functionality? Thanks in advance!
There's some code in this thread: https://www.allegro.cc/forums/thread/606962
Yeah, I took a look at that when I was researching the problem. Seems like that forum post is actually older then what is on his webpage. The header/cpp file actually has changed to mappyal.h/c since that post was made. I tried compiling it in C just to make sure that wasn't the issue. (since it mentioned it in the forum post) I'm still getting errors like "screen" and "PACKFILE" is undefined. (not to mention a host of others).
The reason I liked mappy for my project is its inbuilt block editor. If it was just a matter of splitting tiles up and using them, I would just take a screen shot and make a tileset by hand and load it manually. The mappy interface of being able to create the tileset, then give each of the individual blocks data I could then check for and manipulate in my program was what I was looking for. I think that would save me quite a bit of time and headache! (assuming I could get it to work ) I just checked out http://www.mapeditor.org/ and while it looks like a great tile editor, probably better in that regard, I didn't see a way to edit the individual characteristics of tiles in a way that my program could check. I just looked at it today so if I missed it, please tell me, because it looks like a pretty well done program.
I'm still getting errors like "screen" and "PACKFILE" is undefined. (not to mention a host of others).
Those are all Allegro 4 things. You need to find some Allegro 5 code to interface with mappy.
I just checked out http://www.mapeditor.org/ and while it looks like a great tile editor, probably better in that regard, I didn't see a way to edit the individual characteristics of tiles in a way that my program could check. I just looked at it today so if I missed it, please tell me, because it looks like a pretty well done program.
Tiled is great I've not used mappy, so hopefully I've understood what you're wanting but tiled lets you add custom properties for tiles (you may need to turn on the properties and tileset boxes on the view menu), so they may do the job you are looking for (see attached screenshot for button).
This goes into the xml as:
The level files are quite easy to process, I'm sure there was a loader and rendering library for them somewhere which I found, but now I can't find a link to it (sorry) I didn't use it because it didn't meet my requirements so I just parsed the file in using RapidXML and loaded it into a series of objects in c++.
I hope that helps, if I find the link I'll post it
Edit: As soon as I'd posted I managed to find the link: allegro_tiled. Enjoy.
Yeah, it looks like I can add custom properties to that for an individual tile, which should fit my purposes. Your example looks clear, although I just checked back on the tileset webpage and certainly do see anything that looks like that, but I believe you. I will download and mess around with it tonight. The biggest problem is I guess getting the library you linked to installed, so it can talk to allegro and vice versa. I use windows so I don't do a whole lot of 'making,' and not just that, but msvc as well, which in the instructions seems like it is a little problematic to get work. But it might be worth it, especially if Mappy isn't updated to work with Allegro 5.
Seems like that forum post is actually older then what is on his webpage
The age of posts is irrelevant if one of them is written for Allegro 5 and one is written for Allegro 4. Did you download the zip file attached to that post?
Hrmm, no I didn't see that zip file, but I got it from your post, thanks! Looks like upon including the header I get different errors, which is an improvement! Looks like the thing the compiler isn't liking now is " 'char' followed by 'bool' is illegal " in the file astdbool.h
That mean anything to anyone?
Are you using the correct version of Allegro? Does a simple file like this compile?
#include <allegro5/allegro.h> int main() { al_init(); return 0;}
Also, some code in that zip is definitely a bit off... I've attached somewhat fixed versions of mappy_A5.h and mappy_A5.c.
Thanks siege for the better versions of mappy! So it compiles now. I had posted last night when I was raiding so I hadn't had a chance to google that specific error for myself. Once I did the solution was actually pretty trivial.
Fix is here: https://www.allegro.cc/forums/thread/614655
After that, everything worked liked a charm. I'll make a new topic if I have any more hiccups, but it seems like this is taken care of, thanks guys!