Competition RoomHomePortalCalendarFAQSearchRegisterMemberlistUsergroupsLog in

Share | 
 

 Tutorial: How to hack AW2

View previous topic View next topic Go down 
AuthorMessage
Ephraim225
Battle Copter
avatar

Male
Number of posts : 622
Age : 25
Registration date : 2007-11-23

PostSubject: Tutorial: How to hack AW2   Thu Jan 28, 2010 6:31 am

I decided to write this tutorial because there isn't (in my opinion) a user-friendly tutorial for hacking AW2. So here we go. First you'll need these:

-The AW2 ROM (Find it yourself)
-A hex editor (I highly recommend Hex Workshop, which is free for 30 days, but there are ways around that...)
- War Lord Console (You need Microsoft's .NET Framework to run it; Google it, it's a free download, don't worry)

Once you have all that go to C:\Windows\System32 and copy cmd.exe to the folder with War Lord Console in it. Also place your AW2 ROM there as well.

Here's how to extract a map from the AW2 ROM using War Lord Console: Run cmd.exe and type

Code:
WarLordConsole -d --map=header --ref=reference.xml ROM name.gba XML name.xml

Replace "header" with the header of the map you want to extract (there's a list of them in one of the text files that comes with War Lord Console), replace "ROM name" with the name of the ROM, and replace "XML name" with the name of the XML file to be created. Then hit enter. Go ahead, try extracting a map.

That's how you extract maps...but what about editing and inserting your own?

I extracted Cleanup. Here's what the XML looks like:

Code:
<?xml version="1.0"?>
<awMap version="1.1" xmlns="urn:awmaps-schema">
  <ref file="reference.xml" />
  <meta>
    <description>Dumped by WarLord.</description>
  </meta>
  <header address="085CA94C">
    <name index="0ABD" address="086087E0" text="Cleanup" />
    <fog enable="false" />
    <tileMap address="081C7528" />
    <unitList address="085CE1F0" />
  </header>
  <tileMap address="081C7528" width="15" height="10">
    <row>2A00 2A00 2A00 2800 8700 2100 0100 0100 0100 0100 8700 2100 0100 4000 0100</row>
    <row>2A00 6801 2A00 1D01 1900 1900 1900 5B00 8700 2100 0100 0100 8700 8000 0100</row>
    <row>0A00 0A00 0A00 2900 0100 0100 0100 7800 5B00 8700 2100 0100 CA01 8000 0100</row>
    <row>2000 8600 8600 2100 4300 0100 0100 0100 7800 1900 5B00 0100 0100 4000 8700</row>
    <row>8700 2100 0100 0100 2200 2100 0100 0100 8700 2100 1800 0100 0100 4000 0100</row>
    <row>6100 6100 4200 0100 2300 8600 2100 0100 0100 8700 7800 1900 1900 1600 1900</row>
    <row>2000 2100 4000 0100 0100 0100 0100 0100 0100 0100 8700 2100 0100 4000 0100</row>
    <row>0100 0100 4000 0100 0100 0100 0100 0100 0100 0100 0100 0100 0100 4000 8700</row>
    <row>6100 6100 C501 A100 6100 6100 6100 6100 6100 6100 6100 8700 A100 6200 0100</row>
    <row>0100 0100 0100 0100 8700 2100 8700 2100 8700 2100 8700 8700 8700 2100 8700</row>
  </tileMap>
  <unitList address="085CE1F0">
    <team id="1">
      <unit base="INFANTRY">
        <xpos>1</xpos>
        <ypos>8</ypos>
      </unit>
      <unit base="INFANTRY">
        <xpos>2</xpos>
        <ypos>9</ypos>
      </unit>
      <unit base="INFANTRY">
        <xpos>2</xpos>
        <ypos>7</ypos>
      </unit>
      <unit base="APC">
        <ypos>5</ypos>
      </unit>
    </team>
    <team id="2">
      <unit base="INFANTRY">
        <xpos>12</xpos>
        <ypos>3</ypos>
        <ai>04</ai>
      </unit>
      <unit base="INFANTRY">
        <xpos>11</xpos>
        <ypos>3</ypos>
        <ai>04</ai>
      </unit>
    </team>
  </unitList>
</awMap>

Looks confusing, eh? Don't worry, I'll explain what everything does:

Code:
  <header address="085CA94C">
    <name index="0ABD" address="086087E0" text="Cleanup" />
    <fog enable="false" />
    <tileMap address="081C7528" />
    <unitList address="085CE1F0" />
  </header>

Header address: The header of the map. There's a list of headers in a text file that came with War Lord Console. Type the header of the map you want to replace (such as 5CA94C for Cleanup).
Name index: The text index of the map. There's a list of indexes in a text file that came with War Lord Console. Type the index of the map you want to replace (Such as 0ABD for Cleanup)
Address: The location in the ROM the name of the map will be inserted.
Text: The name of the map.
Fog enable: Type "true" to play the map in FOW, leave as "false" otherwise. (Note that you can't have Fog on a War Room map. Fail.)
Tilemap address: The location in the ROM the map's tile data will be inserted.
Unitlist address: The location in the ROM the map's unit data will be inserted.

Code:
  <tileMap address="081C7528" width="15" height="10">
    <row>2A00 2A00 2A00 2800 8700 2100 0100 0100 0100 0100 8700 2100 0100 4000 0100</row>
    <row>2A00 6801 2A00 1D01 1900 1900 1900 5B00 8700 2100 0100 0100 8700 8000 0100</row>
    <row>0A00 0A00 0A00 2900 0100 0100 0100 7800 5B00 8700 2100 0100 CA01 8000 0100</row>
    <row>2000 8600 8600 2100 4300 0100 0100 0100 7800 1900 5B00 0100 0100 4000 8700</row>
    <row>8700 2100 0100 0100 2200 2100 0100 0100 8700 2100 1800 0100 0100 4000 0100</row>
    <row>6100 6100 4200 0100 2300 8600 2100 0100 0100 8700 7800 1900 1900 1600 1900</row>
    <row>2000 2100 4000 0100 0100 0100 0100 0100 0100 0100 8700 2100 0100 4000 0100</row>
    <row>0100 0100 4000 0100 0100 0100 0100 0100 0100 0100 0100 0100 0100 4000 8700</row>
    <row>6100 6100 C501 A100 6100 6100 6100 6100 6100 6100 6100 8700 A100 6200 0100</row>
    <row>0100 0100 0100 0100 8700 2100 8700 2100 8700 2100 8700 8700 8700 2100 8700</row>
  </tileMap>

Tilemap address: The location in the ROM the map's tile data will be inserted. (Yes, you have to type it again, and make sure they match)
Width and height: The width and height of the map. Minimum width is 15 tiles, minimum height is 10 tiles.
Following that are the map's tiles. Each 4-digit number is one tile; for example 2A00 is a sea tile. Click here for a list of tiles.

Entering all those tiles by hand can be tedious as all hell, so if you want an easier way, you're in luck, there IS an easier way! If you have Hex Workshop, that is. First, open the AW2 ROM in an emulator, go into design maps mode, edit the map however you want (you'll have to insert BH inventions by hand) name the map something recognizable and save it.

If you want your map to be a size other than 30x20 use these Codebreaker codes: 3201e450 00XX for width, 3201e452 00XX for height (replace XX with your desired height/width in hexadecimal; use the Calculator program that comes with Windows to convert the numbers if you need to)

Then open up the .SAV file in Hex Workshop and open up the Preferences menu (under options). Set the "Group Bytes" option to "2 (word)" and set the "Bytes per row" equal to your map's width multiplied by 2. (Also, uncheck "Fit Contents to Window" if it's checked.) Next hit CTRL+F and search for the name of the map you saved. Scroll up a bit and you should see a pair of bytes representing the width and height of the map you made (It'll be 1E14 if you made a 30x20 map). Position the cursor just after those two bytes, hold shift and press the down key to highlight as many rows as you need (i.e. the number of rows in your map). Then click Edit>Copy As>Hex String. Open up a text document, press CTRL+V and ta-da! There's the data for the map's tiles. Now all you need to do is insert "" at the beginning of every row and "" at the end of every row, and then you can copy and paste it into your XML file. Handy!

I also wrote an app that will generate this data for you, however you can't make maps with sea or shoals due to me being too lazy to program that in. Razz Still, it could be useful if Hex Workshop isn't an option for you.

That just leaves units...

Code:
  <unitList address="085CE1F0">
    <team id="1">
      <unit base="INFANTRY">
        <xpos>1</xpos>
        <ypos>8</ypos>
      </unit>
      <unit base="INFANTRY">
        <xpos>2</xpos>
        <ypos>9</ypos>
      </unit>
      <unit base="INFANTRY">
        <xpos>2</xpos>
        <ypos>7</ypos>
      </unit>
      <unit base="APC">
        <ypos>5</ypos>
      </unit>
    </team>
    <team id="2">
      <unit base="INFANTRY">
        <xpos>12</xpos>
        <ypos>3</ypos>
        <ai>04</ai>
      </unit>
      <unit base="INFANTRY">
        <xpos>11</xpos>
        <ypos>3</ypos>
        <ai>04</ai>
        <ammo>0</ammo>
        <fuel>20</fuel>
      </unit>
    </team>
  </unitList>

Unitlist address: The location in the ROM the map's unit data will be inserted. (Yes, you have to type it again, and make sure they match)
Team ID: The ID of the units in that team; 1 for P1, etc.
Unit base: The name of the unit type, in all caps (INFANTRY, MECH, MEDIUM TANK, etc.)
xpos: The unit's X position MINUS ONE. (IE if the unit is on the leftmost cloumn its X position is 0)
ypos: The unit's Y position MINUS ONE.
AI: The unit's AI; 00 is "only attack if enemy is in range", 04 is "Move and attack actively"
Ammo: The unit's remaining primary weapon ammo (You only have to enter this if you want a unit to start with less than max ammo)
Fuel: The unit's remaining fuel (You only have to enter this if you want a unit to start with less than max fuel)

Personally I found adding and editing units to be a pain. Anyways, if you're wondering where you can insert data without overwriting another part of the game there's plenty of blank space in the ROM, look around with a hex editor.

Once you have your XML ready to be inserted, place it and your ROM in the same place War Lord Console is. Make a backup of your ROM just in case something goes wrong. Run cmd.exe and type

Code:
WarLordConsole -i ROM name.gba XML name.xml

Replace "ROM name" with the name of your ROM, and replace "XML name" with the name of the XML file to be inserted. Then hit enter.

Oh, and there's one last thing I neglected to mention: When inserting a map with no units, WarLordConsole will make the game think your map has units when it actually doesn't. This causes problems, as you can imagine. So you need to edit the header manually with a hex editor. Go to the map header of your map (with the "Go to offset" function of whatever hex editor you happen to be using). Find a group of four bytes that read "00 00 00 08". Change the 08 to 00 and save. The map should then work just fine.

If War Lord Console doesn't return an error, congratulations, you've successfully inserted a map! Be sure to test the ROM to make sure the map works okay. Next I recommend downloading my AW2 Nightmare Modules. These will allow you to edit army colors and such; good for fine-tuning War Room maps. You can also use them to edit terrain, unit and CO data. To use them, run Nightmare, open up your ROM and load the module you want to use.

Phew...glad I'm done writing that. Anyways, if you have any questions or if there's something you don't understand feel free to ask.

_________________
See also:
http://www.freewebs.com/ephraim225/index.htm
Back to top Go down
View user profile http://awdesignroom.forumotion.com
fergusoni
Infantry


Male
Number of posts : 2
Age : 20
Location : Bellingen, NSW Australia
Job/hobbies : Guitar, Retro Games
Registration date : 2011-09-06

PostSubject: Re: Tutorial: How to hack AW2   Thu Sep 08, 2011 1:16 am

Are there any editors like advance map for pokemon??But for advance wars 1 or 2/?
btw, thanks for the thread!! very handy
Back to top Go down
View user profile
Ephraim225
Battle Copter
avatar

Male
Number of posts : 622
Age : 25
Registration date : 2007-11-23

PostSubject: Re: Tutorial: How to hack AW2   Fri Sep 09, 2011 2:54 am

There aren't really any editors for AW1 or AW2 like the typical level editors you see for Mario or Pokemon. The games compress the map data do there's no real way to edit a map directly.

_________________
See also:
http://www.freewebs.com/ephraim225/index.htm
Back to top Go down
View user profile http://awdesignroom.forumotion.com
Sponsored content




PostSubject: Re: Tutorial: How to hack AW2   

Back to top Go down
 
Tutorial: How to hack AW2
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» Great Tank and Weathering tutorial
» Power Sword Tutorial (with more to follow)
» Instant Mold Tutorial
» good c++ tutorial series
» After Effects Tutorial - Organic Cell Edges

Permissions in this forum:You cannot reply to topics in this forum
Advance Wars Design Room :: Gaming :: Game Mods-
Jump to: