Content: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Background: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Pattern: Blank Waves Notes Sharp Wood Rockface Leather Honey Vertical Triangles
Welcome to Xbox Chaos: Modding Evolved

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

Sign in to follow this  
Followers 0
Lord Zedd

.MAP
Replacing Built-In Forge Maps

4 posts in this topic

This tutorial will let you replace the Built-In map variants with your own external variant. This could be applied for maps packs or even to accompany your own .map mod without needing to distribute a troublesome CON file.

Requirements:
mainmenu.map
A backup of mainmenu.map for safety
The sandbox.map extracted from your new variant
Hex Editor
Newest Plugins (8/14/12 or later)

First and foremost, you want to grab the Map Magic of mainmenu.map. While you can go into Ascension and find it yourself, I'll just post them here:
Normal mainmenu.map: B973A000
Anniversary mainmenu.map: B972C000
This tutorial will feature the normal mainmenu.

Before we do anything with the Map Magic, we need to check the size of your new variant.
Open up your extracted sandbox.map into a hex editor and head to the string "mvar". it shouldn't be hard to find. if it is, just do a text search.
From there, jump x20 bytes from the beginning of the string to get to your size.
I'm not sure how other editors work, but in Hex Workshop all you need to do is select the bytes and it will tell you the conversion automatically:
qiUkO0t.jpg

If your editor does not have such a feature, paste the 4 selected bytes into an online converter or similar.

Once you have the size, make a note of it lets finish up with the sandbox.map by going to x24 past mvar (right after the selection you made, will always be a backtick (`) in text view.) Now select the bytes from there using your size. Copy and paste those selected bytes into a new file and save it for later, then close everything down:
16Yma7E.jpg

Now that sandbox.map is done with, open up your mainmenu in Ascension and load the only VTGL tag so you can grab your offsets.

Remember your variant size? good. Now pick from the available chunks and find a built-in variant equal to or larger than your own. In my case, the first chunk (Asylum) is larger, so let's go with that one:
OuJzXkH.jpg

Copy the raw Magic Offset in the box below the size and be ready for some hex math. :P (Click for online calculator)

DeadCanadian has informed me that the standard Windows 7 Calculator can do hex as well by using the hotkey "Alt+3" or through "View>Programmer"

Take the offset you copied, and subtract the Map Magic from it to get your File Offset, like so:
BF85D7DC
-B973A000
=
061237DC

Now note that offset down, along with the original size. Do the same calculation for the header offset and note the result (06123688), with its size as well. Close Ascension.

Open up your mainmenu.map in your hex editor and jump to your mvar offset. Select from that point the original size you copied from Ascension. Fill the selection with 0's:
hv41aNk.jpg

Head back to your original offset again and open up the file you created from sandbox.map. Copy everything from it, then once again select from your offset in mainmenu, this time using your new size. Paste your variant into the selection. Save.

Now jump to your header offset and select the original size to fill with 0's again. Then return to the offset.

The only thing left to do is to copy the new header from your variant. The problem is that the size is not fixed. Open your created file again an select everything. We are going to shift the selection 8 bits to the right in order to view the mvar's embedded name and description. In Hex Workshop you'll find the command in "Tools>Operations>Shift Right..."

After doing this, look through the file until you see your map description. After the description you should see 00 00, which denotes the end of the header: (My map has no description, so there is another 00 00 before it. Ignore.)
VaoHSfz.jpg

Note the point after the 00 00 and undo the shift. Select from the beginning of the file up to this point and copy.

Go back to mainmenu and select the size or your new header (x6F or 111 in my case) and paste in the header. save again and close your hex editor. Only one quick step left!
EW5rlhQ.jpg

Open mainmenu.map into Ascension and head to VTGL. All you have to do is fill in your new sizes and save.
For the header, use a hex converter to get the decimal conversion of the header size.
MT2FtuU.jpg


Make a patch to poke or copy the map itself over and load up Reach. You should see your variant waiting for you.

Share this post


Link to post
Share on other sites
Sign in to follow this  
Followers 0