|
making a datafile, but it won't load..? |
red-dragon
Member #7,722
August 2006
|
Ok, yeah, I know I'm taking over the forums But I'm trying to learn how to make data files and uhh I followed this tutorial but it didn't work. A zip file is attached, please check it out. I found Grabber, opened it up, Right-clicked in white side, clicked on New, for a bitmap, names it linksawakening. Then I gave it the header, linkawakes.h. The file with no name is the .dat file. The original linksawakening.bmp was 24-bit. Could the problem be in here somewhere: set_color_conversion(COLORCONV_24_TO_32);//?? set_color_depth(32); // Set the color depth set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640,480,0,0); If so, what am I doing wrong? Lastly, is there a tutorial on how to make a Mappy level into a .dat file? If you've done it, can you give me clear, precise instructions? I'd REALLY appreciate it. REALLLLLY! |
gnolam
Member #2,030
March 2002
|
Quote: But I'm trying to learn how to make data files and uhh I followed this tutorial but it didn't work. Define "didn't work". Did the program crash? Did load_datafile() return NULL? Was the bitmap full of garbage? Did your computer explode? Did you spontaneously burst into flames? Did Timmy fall down the well? Quote: DATAFILE *my_datafile = load_datafile("linksawakening.dat"); And the file is actually just called ".dat"? -- |
red-dragon
Member #7,722
August 2006
|
haha, hey gnolam, It is very important that I find out how to do this for a map created in mappy, so I can follow a tutorial and finish the scrolling part of the project. SO, I beg someone.. please. I'll give you a $1 EDIT: I need to mainly know what type to make it as.. obviously it's not a bitmap or sprite.. |
Edward Sheets
Member #4,734
June 2004
|
red-dragon, may I suggest that you simply start from scratch and play with Allegro for a while. You will learn more that way than any of us can teach you by giving you lines of code to plug into your program. There is a program in the example folder called 'exdata' that shows you the basics of using datafiles. Adding your own user-defined maps to a datafile is a more complex subject and you will need to have a good understanding of the grabber utility and datafiles in order to do that. The tutorial will still be there waiting for you when you're ready for it. --- Note: carving a pentagram on the top of a container of spoiled yogurt does not summon a yogurt demon. -Kikaru |
red-dragon
Member #7,722
August 2006
|
hey Edward, i.e. why don't i just use store my maps as a 2d array and work on scrolling from there? I need to get some sleep! I Just got pulled in too many directions. And now I'm gonna sound even moreso retarded... after I export a mappy file as "map array as comma values only (.csv)", I rename it as .txt and open it up in Notepad. Now, I'm trying to save it as "Map Array (.MAR)" and it saves it as a MS Access shortcut? What do I do with that? I swear I've searched and can't find an answer. Game programming as a whole is frustrating! Lessons learned though |
Edward Sheets
Member #4,734
June 2004
|
red-dragon, you are not retarded at all (and we would like you even if you were ). Programming is a complex thing and game programming is one of the most challenging programming tasks there is. I think this is the perfect time to "reinvent the wheel" a little bit. Mappy is a great tool but you could write a simple, elegant solution to this problem in half the time it would take to figure out the inner-workings of Mappy. And in the process of writing your own simple map loading and saving functions, you would get a much better understanding of how Mappy works under the hood. Take a look at how simple it can be:
I'd play with something like that and maybe add some features to this simple tile engine and in no time you'll know exactly how Mappy works and you might even decide that your own simple version of Mappy works good enough Also, you can get rid of that set_color_conversion() call. Just make sure you set the color depth with set_color_depth(32) before loading any graphics. That way when you call load_datafile() it will automatically load everything in the color depth you passed to set_color_depth(). Here's a handy way to set color depth based on the local color depth of the computer your game is running on:
--- Note: carving a pentagram on the top of a container of spoiled yogurt does not summon a yogurt demon. -Kikaru |
red-dragon
Member #7,722
August 2006
|
Edward, I wanted to save my map into a 2d array. So I was trying the .MAR option. It saves it as a MS Access REPORT shortcut. I open it and and it opens up the Access application and that's it. Nothing else. What am I suppose to do that I'm not doing? |
|