Page 1 of 1

How would I save / load maps?

PostPosted: Fri Aug 21, 2009 10:13 am
by Hblade
I have a map editor almost fully functional and I'm goign to release it for everyone to use as soon as I can find out how to save the maps, DST showed me once but the method he had was insanly confusing O.o If anyone could explain it instead of throw a bunch of code at me, I'll get you a candy

Re: How would I save / load maps?

PostPosted: Fri Aug 21, 2009 5:18 pm
by zygoth
There is no "simple" solution. Specifics would take a long time to explain so I will try to give you an overview. You would make a 2-D array that is about 200 by 4. when you hit the save button, each actor has code that checks for the first open column in the array and inputs its x, y, animpos, and name into the spot. Then, on the load button, make a for loop that creates each actor in the array at the specified position and with the specified animation position. Note that if there are too many actors, the game will crash and say something like "accessing memory out of bounds". I hope this helps...I have done this before but I don't remember 100% how I did it.

Zygo

Re: How would I save / load maps?

PostPosted: Fri Aug 21, 2009 6:43 pm
by Hblade
Thanks, I'l give it a try O.o

Re: How would I save / load maps?

PostPosted: Thu Aug 27, 2009 3:47 pm
by zygoth
I just remembered, when I did it I made 4 different arrays because you can only store data of one type in an array. Sorry if this came too late...