LoginLogin

Loading Map files into your programs

Root / Submissions / [.]

MariominerCreated:

Introduction

So I noticed that a lot of people have no clue onto how to use the files that you get from the map editing program. So I decided to write about it. It is very nice and has advantages over just making them in the program. To begin, make sure that you have used "SCSAVE" and not the MAP save, MAP saves are just useful for loading it to work on it again, but not really necessary.

Loading the files

So to begin you are going to want to load the files. They should be "SC_MAPNAME_Lx". So first we are going to make an array. The command that we will use will automatically expand the array, so you can just say 0 elements
DIM MAP[0]
Then what use is it if we don't do anything with it? First, set the BGSCREEN size to 64x64, then put the loading in a FOR loop to have it be simpler.
FOR I=0 TO 3
BGSCREEN I,64,64
LOAD "DAT:SC_MAPNAME_L"+STR$(I),MAP,FALSE
NEXT
If you actually ran this, you will have noticed that nothing really happened. This is because we did not use a vital command: BGLOAD. Basically just put "BGLOAD I,MAP" between the LOAD and the NEXT and it should work.

Challenge

You can read as much as you want, but you're not going to be able to use this unless you put it into practice! So here's the challenge: either create a map for a game and use this or just do it for a map you already have. Or even change the map a game you downloaded uses, just use it! Tell me how it works. Feel free to ask any questions.

Seems legit. Thank you for what you typed in for the intro, I could just not get it too work.

To add to this you should DIM MAP[0] instead of DIM MAP[10000]. DIM MAP[10000] a waste of space and unnecessary, it makes the array size bigger automatically.

Replying to:jamieyello
To add to this you should DIM MAP[0] instead of DIM MAP[10000]. DIM MAP[10000] a waste of space and unnecessary, it makes the array size bigger automatically.
Oh, I did not know that about this. I guess I'll change it then.

Thanks for this tutorial, helpful

Thanks!

Very Helpful!

When you use it with XSCREEN 2, it gives you a syntax error.

Replying to:NintendoFanFever
When you use it with XSCREEN 2, it gives you a syntax error.
the means i'm using the same as above... XD

Replying to:NintendoFanFever
When you use it with XSCREEN 2, it gives you a syntax error.
When you use XSCREEN 2, you need to add additional things to it. XSCREEN normally has 2 things omitted: Sprite count and BG layers. So in order to use it with this you need to do something like XSCREEN 2,256,4 or whatever values you need.

What about loading animations? Its probably going to need another page. Or its really simple and i cant see it.

Replying to:UltraPhoenix4
What about loading animations? Its probably going to need another page. Or its really simple and i cant see it.
UltraPhoenix4, if you mean you want to load animation data onto an existing sprite then SPANIM with the animation target "UV" will let you specify the length and coordinates in your sprite page for each frame in the animation.

I wonder if the array-resizing property could be useful... probably not.

Thanks! That is really helpful.

Thank you! I didn't have a clue of how it worked until now.

Gives me a syntax error when ran: http://imgur.com/ZvJPgcc

Replying to:liknzelda
Gives me a syntax error when ran: http://imgur.com/ZvJPgcc
You forgot to finish the line ;)
SpoilerLOAD "DAT:SC_HS_L"+STR$(I),MAP,FALSE

Replying to:liknzelda
Gives me a syntax error when ran: http://imgur.com/ZvJPgcc
*Sees my map tutorial on front page *Looks to see what's up >2 comments

kldck_hul thank you so much. I didn't realize that on mobile you have to scroll to see the rest of the code box. Sorry for posting this as a new comment. For whatever reason, the reply and quote buttons are gone for me. http://m.imgur.com/PHHkupY

Replying to:liknzelda
kldck_hul thank you so much. I didn't realize that on mobile you have to scroll to see the rest of the code box. Sorry for posting this as a new comment. For whatever reason, the reply and quote buttons are gone for me. http://m.imgur.com/PHHkupY
There's an option on the user page I think

Very useful!