How would I save / load maps?

Non-platform specific questions.

How would I save / load maps?

Postby Hblade » Fri Aug 21, 2009 10:13 am

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
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: How would I save / load maps?

Postby zygoth » Fri Aug 21, 2009 5:18 pm

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
Nova: 100% Vertigo/Mazeman: 100%
Visit my website to download them both! http://www.ketonegames.com
User avatar
zygoth
 
Posts: 140
Joined: Mon Jun 11, 2007 6:37 pm
Score: 5 Give a positive score

Re: How would I save / load maps?

Postby Hblade » Fri Aug 21, 2009 6:43 pm

Thanks, I'l give it a try O.o
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: How would I save / load maps?

Postby zygoth » Thu Aug 27, 2009 3:47 pm

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...
Nova: 100% Vertigo/Mazeman: 100%
Visit my website to download them both! http://www.ketonegames.com
User avatar
zygoth
 
Posts: 140
Joined: Mon Jun 11, 2007 6:37 pm
Score: 5 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron