Expanded Game Setup ASM

Discussion of hacking, editing and developments in Advance Wars games.
Remember, no Rom Requests
User avatar
Mark999
Rank: GM_S9_S9
Location: In America

Expanded Game Setup ASM

Post by Mark999 » Tue Mar 10, 2015 3:00 pm

Welp, I'm back to make something interesting for AW2 that nobody will likely use! XD

This time around I'm putting my newfound ASM ability to good use. I've created a code that is to be run at the start of a map through an event. What the code does is it copies info you define from the map header into the relevant RAM areas. Now you might wonder, what's the point of that? Well, the map header doesn't decide certain settings such as teams and AI in Campaign and Fog of War in the War Room. With this ASM you can control that - to a certain extent, anyways.

First let's talk about how to run it. What you need to do is use the Campaign Cutscene Creator and use a "CustomAction(offset)" before the first turn of the map, where "offset" is a pointer to where you insert the ASM to (remember: add 1 to this offset). To get the ASM itself into the ROM, first edit the code to your liking and then assemble it using an assembler such as this. Finally you'll need to use this Nightmare Module to edit in the new info you can now take advantage of - I used some of the unused space in the Map Header. (If anything strange happens in the map as a result of this let me know!)

Finally, the ASM code itself:
Hidden Text
.text
.align 2
.thumb
.thumb_func

main:
push {r0-r7,lr}
ldr r0, =0x085C77A4
ldr r1, =0x03003FC2
ldrh r2, [r1]
mov r3, #0x5C
mul r2, r2, r3
add r0, r0, r2

/* r0 now has the map header location */

/* Fog of War */
ldr r1, =0x03003FCD
mov r2, #0x13
add r3, r0, r2
ldrb r2, [r3]
strb r2, [r1]

/* Funds per Property */
ldr r1, =0x03003FE8
mov r2, #0x22
add r3, r0, r2
ldrh r2, [r3]
strh r2, [r1]


/* Weather Settings */
ldr r1, =0x03003FEC
mov r2, #0x24
add r3, r0, r2
ldr r2, [r3]
str r2, [r1]

/* Capture Limit */
ldr r1, =0x03003FF1
mov r2, #0x55
add r3, r0, r2
ldrb r2, [r3]
strb r2, [r1]

/* COPs On */
ldr r1, =0x03003FC8
mov r2, #0x1
strb r2, [r1]

/* Player COs */
ldr r1, =0x020232DD

mov r2, #0x38
add r3, r0, r2
ldrb r2, [r3]
strb r2, [r1]

add r1, r1, #0x3C
mov r2, #0x39
add r3, r0, r2
ldrb r2, [r3]
strb r2, [r1]

add r1, r1, #0x3C
mov r2, #0x3A
add r3, r0, r2
ldrb r2, [r3]
strb r2, [r1]

add r1, r1, #0x3C
mov r2, #0x3B
add r3, r0, r2
ldrb r2, [r3]
strb r2, [r1]


/* Player Controls */
ldr r1, =0x020232DB

mov r2, #0x44
add r3, r0, r2
ldrb r2, [r3]
strb r2, [r1]

add r1, r1, #0x3C
mov r2, #0x45
add r3, r0, r2
ldrb r2, [r3]
strb r2, [r1]

add r1, r1, #0x3C
mov r2, #0x46
add r3, r0, r2
ldrb r2, [r3]
strb r2, [r1]

add r1, r1, #0x3C
mov r2, #0x47
add r3, r0, r2
ldrb r2, [r3]
strb r2, [r1]

/* Player Teams */
ldr r1, =0x020232EC

mov r2, #0x40
add r3, r0, r2
ldrb r2, [r3]
strb r2, [r1]

add r1, r1, #0x3C
mov r2, #0x41
add r3, r0, r2
ldrb r2, [r3]
strb r2, [r1]

add r1, r1, #0x3C
mov r2, #0x42
add r3, r0, r2
ldrb r2, [r3]
strb r2, [r1]

add r1, r1, #0x3C
mov r2, #0x43
add r3, r0, r2
ldrb r2, [r3]
strb r2, [r1]

End:
pop {r0-r7,pc}
Now take note of the section of code highlighted in red: that sets the COs to whatever the map header decides, overwriting the player's choice in the War Room or certain Campaign maps. If you don't want this to happen, remove that section. Anyways, there is only one known problem so far: Setting the funds per property to anything other than 1000 will only take effect after a player captures something, because the game won't notice the change until then. So remove the section highlighted in blue if you don't care about funds per property.

So to recap, with this method you can:
-Make property capture maps in Campaign and War Room
-Make Fog battles in War Room
-Make custom weather battles in Campaign and War Room
-Control what armies the computer controls - meaning BH isn't the only computer-controlled army in Campaign anymore

If you know your ASM you can even customize this further and change the different game settings mid-battle, which will surely be amusing.

EDIT: Please remove the "Player Teams" section before compiling or else this happens. I'll try to figure out what went wrong.

User avatar
NINGUEM

Re: Expanded Game Setup ASM

Post by NINGUEM » Wed May 13, 2015 2:51 am

I could really use this, but I'm a bit confused, i can't really get it to work....

I think i know how the assembler works, and i've used Nightmare Modules many times.

what i'm confused about is the CustomAction part, since i'm not really making a custom dialog. (in fact i rather Keep the campaign dialogs)
i tried following everything, but all i managed to get was the game Freezing, (to be clear, the game still ran,AKA map sprites still moved, it just didn't do anything)
or it went back to the main menu. (yes i did add 1 to the offset.)


i need more info since i'm not the most skilled in this area. :geshrug:
an example would be nice, ether a hack i can look at or a more detailed tutorial.

all i really Want to be able to do is
-Change who the AI Control's so it doesn't need to be Black Hole all the time.
-Weather for campaign.
-Potentially, Fog of war for War Room.

Who is online

Users browsing this forum: Multivac [Bot] and 0 guests