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.

DarkBASIC Professional Discussion / Tile Map Editor (saving and loading problems)

Author
Message
Goldsoul80
12
Years of Service
User Offline
Joined: 17th Oct 2011
Location:
Posted: 10th Jan 2012 23:16
(This is from a previous post of mine, only under a more accurate topic post) Okay, I must be doing something glaringly wrong here but I now have another problem. I've written my tilemap editor and I can, of course place and reset my tiles. I'll make my editor a bit more sophisticated once I can figure out why I'm unable to save/load data from the files it's supposed to make.




A bit of assistance please? Everytime I load the files, all of the tiles reset to 0 (the default image) even though I saved a previous file. Also, I've tried opening the dat file and it doesn't show anything, it's just a blank file. (even though I tried saving stuff to it)

Thank you much.


~(A bit later)~
Okay, turns out I'm unable to save anything or something. I've tried saving things like strings or variables but I'm unable to load them. I think it has to do with the way I've saved them but I don't know what it is (I used the same function above and tried .dat, .txt, and other random letters). I seem to be able to insert loaded things back into my program but none of my files have anything on them when I save them. Anybody see anything wrong with my save code?

I used to be the Great Mighty Poo until...
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 10th Jan 2012 23:48
You might want to double check you WRITE FILE and READ FILE and change them to something like WRITE WORD and READ WORD instead so that you know you're reading the right variable size.

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Goldsoul80
12
Years of Service
User Offline
Joined: 17th Oct 2011
Location:
Posted: 11th Jan 2012 00:30 Edited at: 11th Jan 2012 00:35
I'm ashamed that my problem was such a small one but thanks for your help WLGfx! This turned into me learning something about functions too. It seems that my variables weren't being carried into the function properly. (After I tried changing from file to word) I tried...



where mw and mh equal the map width and height respectively. Once I did this, my problem disappeared, my save files are populated and loaded, and I can now proceed with my editor Thank you very much!

At least, it's too early to tell if I may have anymore problems but hey, I'm moving again!

I used to be the Great Mighty Poo until...
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 11th Jan 2012 13:05
Hey, good luck with the rest of your project...

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!

Login to post a reply

Server time is: 2024-05-02 10:06:11
Your offset time is: 2024-05-02 10:06:11