The 3rd Age

Age of the Firstborn

Age of the Firstborn

A mod that adds two new factions, new CaH-Class, new maps and more

Button for The 3rd AgeButton for The Dwarf HoldsButton for The Elven AllianceButton for Helm's Deep Last HopeButton for GothmogtheOrcButton for BFME+Button for The Four AgesButton for HDR HeadquartersButton for Middle Earth CenterButton for Project Perfect Mod

Become an affiliate!

   

Quick Lists

Top Rated Popular New Updated Last Comments Users

Register and log in to move these advertisements down

Adding a DualEconomyChoice upgrade to a faction

Tutorial for Battle for Middle-earth BFME

Avatar of Jeth Calark

Jeth Calark

Category: Code
Level: Beginner
Created: Friday September 5, 2008 - 16:12
Updated: Sunday March 29, 2009 - 21:47
Views: 5797
Summary: A step-by-step tutorial on how to create 2 or more building options for your faction's economy plot

Rating

Staff says

3.3

Members say

4.5

Average

4.0/5.0

7 votes

Have you ever wanted to give your faction two or more building option for their economy plots? Coding this in is very easy and can give a faction some interesting setups. You will be modifying the following INI's:

              
Code
playertemplate.ini
upgrade.ini
commandset.ini
civilianbuildings.ini


I recommend that you be familiar with extracting and adding files to a .big file. I also assume that your faction is all properly coded in the basics. If you don't know how to code in a new faction, or want to make sure you did it right, I recommend reading AdmiralGT's three-part “New Faction” series of tutorials. The link for the first one is available in Links.

Since I am creating a Narnia faction at this time, I will use Narnia as my example faction. Just simply replace “Narnia” with the name of your faction as it appears in playertemplate.ini.

First step is to give your faction the upgrade in their profile. Open up playertemplate.ini and find the line InitialUpgrades. Add Upgrade_NarniaDualEconomyChoice to the list of upgrades, making sure to keep a space between each name of the upgrades. Save it, and close. You are done there.

All upgrades, in order to be properly recognized and applied, must be in upgrades.ini. This is our second step. Open the file and copy and paste the below code. Don't forget to change the word “Narnia”! One whole empty line should precede and follow the code.

              
Code

Upgrade Upgrade_NarniaDualEconomyChoice
    DisplayName        = UPGRADE:NarniaDualEconomyChoice
    Type            = PLAYER
End



Save your file and close it.

For the third step, you must open up the massive civilianbuildings.ini. Find Object EconomyPlotFlag, and add this code among its other behaviors (preferably with the other similiar ones). In this case, don't put anything between it and the others.

              
Code

    Behavior = CommandSetUpgrade ModuleTag_commandSetNarniaDualEconomy
        TriggeredBy = Upgrade_NarniaDualEconomyChoice
        CommandSet = NarniaEconomyPlotCommandSet
    End    



I recommend that you do this for all objects that are economy plots, but it is not necessary.
Once again, save and close.

For your fourth and final step, open up commandset.ini. Copy and paste this code. It doesn't matter where you put it, but the bottom is an easily accessible place. Put a whole empty line before and after the code.

              
Code

CommandSet NarniaEconomyPlotCommandSet
1 = Command_ConstructRohanFarm
2 = Command_ConstructGondorArcherRange
3 = Command_ConstructRohanStable
End


Now Narnia has three options for their economy plots, build a farm or build one of two buildings from their allies in the distant West......Save the file and close.

Now take your changed INIs and add them to your .big file. Test it out!

I put in existing BFME buildings as a demo, but you can add your own buildings to it. Just use Command_ConstructFactionMyBuilding or Command_UnpackExplicitFactionMyBuilding and be sure to define your new commands in commandbutton.ini.

Have fun coding your faction! If you should have any problems, PM me, and I can probably help you.

For those of you who do not wish to go through the trouble of adding the new behavior to all the economy plot type objects, I have included a pre-done civilianbuildings.ini. Just replace Faction1 with the name of your faction. HOWEVER, I have not added the other stuff needed for a new faction! You will have to do that on your own.

Links / Downloads

 HitsAdded
modified civilianbuildings.ini1257September 7, 2008 - 20:50
AdmiralGT's first "New Faction" tutorial1465September 5, 2008 - 20:26

Credits

Because of the trouble I had figuring this out, I decided to save future modders from the trouble. Thanks to Flameguard and Radspakr for patiently helping me to figure this process out!

Comments

Display order: Newest first

jasm1n88 - Tuesday January 4, 2011 - 11:45

nice one for noobs like me:)

The Dark Lord of Mordor - Thursday May 28, 2009 - 1:48

i see said the blind man to his deaf friend who wasn't listening at the time.

but in all seriousness this is really helpfull at first i thought i meant resource producing buildings

Go to top

 

"One site to rule them all, one site to find them,
one site to host them all, and on the network bind them."

 
18:33:09