[Guide] How to get backgrounds to work for any map.

Apr 16, 2011 at 2:36 AM
Senior Member
"Ha! Ha! Ha! Mega Man is no match for my Mimiga Man!"
Join Date: Jan 21, 2011
Location:
Posts: 249
First of all, you'll need a hex editor. I use Notepad++ for ease of use, it's free but there are others you can use.

Next, you'll need an editor. Since there's only two, and only one of them is actually capable of messing with this stuff, we're going to assume you already have Cave Editor.

I'll be using a map from my own mod as an example. Here's what we see when viewing the map properties in Cave Editor:

[117]Chaco's House(Chakos)

General
Map Name : Chakos
Caption : Chaco's House​

Background
Scroll Type : 1 - move slow
Image : bkGreen​

Tileset
Map Tileset : Pens
NPC Tileset 1 : Guest
NPC Tileset 2 : 0​

Misc
Boss Fight ID : 0 - No special boss​

Most of this you're probably already familiar with if you're used to Cave Editor.

Now, with this information in hand, close Cave Editor (save if necessary), and open the game's exe file in your hex editor of choice. Open the search feature, and search for an ascii string. Type in the name of your map, in this case Chakos. You'll see a lot of gobble-dee-gook in the hex view. Note that the search result will actually bring you to the second parameter in the hex, as the parameter just above is the map's tileset. However, what we want is just after the map name, so this method is easiest.

Code:
43 68 61 6b 6f 73 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
01 82 1f 75 62 6b 30 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 47 75 65 73 74 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 30 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 43 68 61 63 6f 27 73 20 48 6f 75 
73 65 00 00 00 00 00 00

Now, what we want to change is right after where our search brought us, so let's work down through the data:

Code:
43 68 61 6b 6f 73 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
- This is the map's name. "Chakos"

Code:
01 82 1f 75
- This is the map's scroll type. "1 - move slow"
- The first byte is correct, however the remaining
three bytes are never written to by Cave Editor, 
so anything there before a map is added, or 
copied, etc., stays there. This is what causes 
the background to fail to render. The fix is very 
simple. Change the remaining three bytes to 00
so we have [01 00 00 00].

Now save the file, and run it. Your background should be working!

While I have not tested this for overflow maps past #127, this fix should apply to them just the same. However, making more than 127 maps will screw up your exe, preventing the New Game function from operating properly, so it's not recommended.
 
Apr 16, 2011 at 2:53 AM
Lvl 1
Forum Moderator
"Life begins and ends with Nu."
Join Date: May 28, 2008
Location: PMMM MMO
Posts: 3713
Age: 31
Dubby said:
Code:
50 65 6e 73 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- This is the name of the map. "Chakos"

Code:
43 68 61 6b 6f 73 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
- This is the map's caption. "Chaco's House"

Those actually say "Pens" and "Chakos" respectively.

On a side note, I recommend you use xvi32 as a hex editor.
 
Apr 16, 2011 at 4:18 AM
Senior Member
"Ha! Ha! Ha! Mega Man is no match for my Mimiga Man!"
Join Date: Jan 21, 2011
Location:
Posts: 249
GIRakaCHEEZER said:
Those actually say "Pens" and "Chakos" respectively.

On a side note, I recommend you use xvi32 as a hex editor.

Thanks for pointing that out, I just made a 'slight' typo.
 
Apr 16, 2011 at 3:01 PM
Pirate Member
"Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
Join Date: Dec 26, 2007
Location: Lithuania
Posts: 1946
I just copy maps instead of adding new ones, it removes the background issue.
 
Top