It requires a bit of assembly, but I'll show it off here. Note that this only works for human players. AI players need to have their scripting modified and I haven't researched that very much yet.
You need to make two changes to code in order to allow you to build from the HQ. The first just allows you to treat the HQ as a base, the second allows you to customise what build bits you want.
Firstly, open up your hex editor and go to
HQ Building Routine (Players Only)
By default this is 2A0A.
Change the value of 0A to change what properties are allowed to build. To allow HQs to build, change it to 2A08. 2A06 allows you to build from cities as well.
Now, you'll find that the city/HQ will build as a base. If you want to change this, you'll need to change the build ability bit of the HQ or City. This requires a bit of assembly. Changing it for a Base/Airport/Port just requires changing one value at the end of their pointer, so it's no big deal.
Firstly, you need to change a pointer.
For HQs, the pointer is at 0x2D638, (HQ is ID 8, City is 6, so City's pointer should be at 0x2D628, but no promises).
Change the pointer to a word-aligned address (something ending with an 8 or a 0), for my hack I used 087001C0.
You'll need to add your new small change here.
Change the 37 to whatever you want as a bitsum to allow you to build certain troops from that building.
Code: Select all
2437 mov r4, 0x37 4901 ldre r1, 468F mov pc, r1 (0802D65E) 0802D65E
The hex code you should insert into your ROM should be:
Here's the build location IDs by default:
0x2: Treaded Vehicles
0x4: Tire Vehicles
0x20: Naval Units
Oh, and as a final note, if you set a property to be buildable but it can't actually deploy any units the game will freeze.