Jump to content


Photo

BFME II Guide: How to add a new Create a Hero faction


  • Please log in to reply
7 replies to this topic

#1 Solinx

Solinx

    .

  • Undead
  • 3,101 posts
  • Location:The Netherlands
  • Projects:Real Life
  • Division:Revora
  • Job:Retired Leader / Manager

Posted 30 March 2006 - 03:12 PM

Edit:
2playgames suggested that ppl are more interested in Subclasses. It was my intention to include that in the guide, but I cut it before really making a guide of it. At the bottom of this post I added my notes on the subclasses. They should be enough for someone who has modded ini files before.

Basic instructions for a new faction in the Create a Hero line-up.
*******************************************************************************

This guide is based on Battle for Middle Earth II v1.02 ini files.

19 Jan 2007 Update:
With the RotWK expansion out, there have been a few minor changes about the CaH. However, the guide still applies to all patch versions of both games. The only additional point that came with the expansion is that there is now a fourth CaH specific line in the commandbuttons of the CaH; the line that specifies the costs of the power. The guide has been updated to include the line.


The files you'll need:

"Createaheroupgrades.inc"
"createaherosystem******.inc" ( new file - check step 2)
"createaherosystem.ini"
"createaheromodelconditionupgrades.inc"
"createaheroremoveupgradeupgrades.inc"
"commandbutton.ini"
"createaheroarmorupgrades.inc"

In this guide, there is no real custom stuff. That way it won't get to complex to fast for new modders.
Another big reason is that I don't expect to have much spare time in the near future. :p I thought it would be better to post this shortend version now, than to never post anything, so I kind of cut the more detailed part I was still working on.
Besides, this guide is just an example about creating a basis for a new faction, not an allround modding guide.

Go to this site for basic information about .ini editing:
http://the3rdage.net/beginner.php

*******************************************************************************
1 - "Createaheroupgrades.inc"
*******************************************************************************

This file lists all the upgrades available to CAHs.
The faction side is also an upgrade, which you need to define.

Search for this:
		//--------------------------------------------------------
		//Create a Hero CLASS upgrades
		//--------------------------------------------------------
And add this small block:
( Replacing the "******" with your faction name. )
		Upgrade Upgrade_CreateAHero_Class******
			Type			  = OBJECT
		End
You have now defined the Class upgrade for your hero.
This value is essential, because it is used in many a file to identity your faction.

*******************************************************************************
2 - "createaherosystem******.inc"
*******************************************************************************

Each CAH Faction has its own .inc file.

Create your own:
( Replacing the "******" with your faction name. )

"createaherosystem******.inc"

For now we'll leave it be.


*******************************************************************************
3 - "createaherosystem.ini"
*******************************************************************************

The game doesn't automatically read .inc files, they are referred to in .ini files.
That means we have to create a reference to our own file in the right .ini file.

Open "createaherosystem.ini" and scroll all the way down.
At the bottom you'll see this list:

#include "CreateAHeroSystemMenOfTheWest.inc"
#include "CreateAHeroSystemArcher.inc"
#include "CreateAHeroSystemWizard.inc"
#include "CreateAHeroSystemDwarf.inc"
#include "CreateAHeroSystemServantsOfSauron.inc"
#include "CreateAHeroSystemCorruptedMan.inc"

These are the .inc files of the factions that come with the game.
Add your own .inc file from step 2 to the list in order to link it to the CAH system:

#include "createaherosystem******.inc"

The name you use here has to be the same as the name given to your own .inc file from step 2.

*******************************************************************************
4 - "createaherosystem******.inc"
*******************************************************************************

Now you'll have to open "CreateAHeroSystemMenOfTheWest.inc" and copy the whole contend.

Return to your own faction file and past the copied code in it.

You only NEED to change one line.
		UpgradeName	   = Upgrade_CreateAHero_Class******
Make sure you use the same name as you defined in step 1 !
Otherwise you'll get an error if you start the game.

*******************************************************************************
5 - ...\ini\object\createahero\"createaheromodelconditionupgrades.inc"
*******************************************************************************

Next step are the animations.
Notice that the file isn't in the main ini folder!

The file is build up of pairs of Behavior modules. Just like this one, for the Captain of Gondor subclass:
		//------------------------------------------------------------------------------------------------------
		// CAPTAIN OF GONDOR
		Behavior = ModelConditionUpgrade ModuleTag_HeroOfTheWest_SubClass_0
			TriggeredBy				= Upgrade_CreateAHero_ClassHeroOfTheWest Upgrade_CreateAHero_SubClass_0
			ConflictsWith				= Upgrade_CreateAHeroMapMode 
			RequiresAllTriggers			= Yes
			RemoveConditionFlagsInRange		= CREATE_A_HERO_00 CREATE_A_HERO_65
			AddConditionFlags			= CREATE_A_HERO_00
		End

		// CAPTAIN OF GONDOR (Create A Hero Map Mode)
		Behavior = ModelConditionUpgrade ModuleTag_HeroOfTheWest_SubClass_0_MM
			TriggeredBy				= Upgrade_CreateAHeroMapMode Upgrade_CreateAHero_ClassHeroOfTheWest Upgrade_CreateAHero_SubClass_0
			RequiresAllTriggers			= Yes
			RemoveConditionFlagsInRange		= CREATE_A_HERO_00 CREATE_A_HERO_65
			AddConditionFlags			= CREATE_A_HERO_01
		End
If you scroll down you'll see that each subclass has its own pair.
Here is a default behavior module, with comments behind them to explain what things are for.
Behavior - States the unique name of the behavior
TriggeredBy - Here you'll have to place the upgrade name from step 1 and the subclass number
ConflictsWith - This is a condition to determine if you are playing with or creating the CAH 
RequiresAllTriggers - Makes sure that only the right subclass loads these animations. 
					  You cannot use this as a fast way to use the same animations for all subclasses.
RemoveConditionFlagsInRange - Just to reset the current value of AddConditionFlags
AddConditionFlags - This is the animation link to Createaheromodels.inc. 
					Choose a pair in the range CREATE_A_HERO_00 to CREATE_A_HERO_65.
We have two subclasses, so we will need to copy two pairs and modify the TriggeredBy values.
For now I suggest using the blocks of the Captain of Gondor and the Shield Maiden.

Change "Upgrade_CreateAHero_ClassHeroOfTheWest" into your own faction upgrade name and that's enough to get things running.
Just make sure your set of AddConditionFlags starts with an even number (that includes zero), otherwise you'll have two types of animations.

*******************************************************************************
6 - ...\ini\object\createahero\"createaheroremoveupgradeupgrades.inc"
*******************************************************************************

For all that have noticed the notes in the header of this file: I noticed them too.

One is about FX_CreateAHeroDie, which are the death sounds. These are bound to the animation set, normal sounds are not.
You don't have to change anything here, unless you want to use your homemade animations and/or soundset.

The other is more important. That one makes sure that you won't end up loading more than one animation set at a time in the CAH menu.

Open createaheroremoveupgradeupgrades.inc and scroll down to this section:

//======================================================================
		// This section contains the RemoveUpgradeUpgrades for the Create a Hero class
		//======================================================================
You'll see the following behavior modules:
		Behavior = RemoveUpgradeUpgrade Remove_Upgrades_Upgrade_CreateAHero_ClassHeroOfTheWest
			TriggeredBy		= Upgrade_CreateAHero_ClassHeroOfTheWest
			UpgradeToRemove	= Upgrade_CreateAHero_ClassIstariWizard Upgrade_CreateAHero_ClassDwarf  ......
		End
Copy one of the behaviors and edit it:
- Again the first is the unique name of the behavior, replace "ClassHeroOfTheWest" with the name of your own Faction.
- TriggeredBy = is to be followed by the faction upgrade name from step 1
- UpgradeToRemove - make sure ALL OTHER faction upgrade names are listed here, including any OTHER factions you add.

After you have made your own behavior you will have to edit all the existing ones.
Place your faction upgrade name from step 1 in all (but your own behavior's) UpgradeToRemove lists.


*******************************************************************************
7 - "commandbutton.ini"
*******************************************************************************

The powers, likely for most the reason for adding a new faction among the existing CAH's.
Now as I said at the start, the focus is on getting the faction playable.
That's why I keep this part simple for now.

All you need to do, to have the same powers as the Men of the West faction has, is
to add you faction upgrade name to every instance of:
		CreateAHeroUIAllowableUpgrades		 = Upgrade_CreateAHero_ClassHeroOfTheWest
Hint: use search and replace!

That's all!

Some more info for those who already know how to add powers.
There are three values that are new to CAH's, all of them are used in the CAH power selection menu. (When you create your hero)

CreateAHeroUIAllowableUpgrades - Here all the factions that may choose the power are listed.
CreateAHeroUIMinimumLevel - The minimum level the hero must be before it can choose this power.
CreateAHeroUIPrerequisiteButtonName - If this is a level 2 power, you'll first have to choose the level 1 version.
The "CommandButton" name of that level 1 power is listed here.

19 jan 2007 update:
In RotWK there is an additional CaH specific line:
CreateAHeroUICostIfSelected - This sets the costs that come with selecting this power for your personal CaH. The combined costs of all powers make the costs to purchase your CaH ingame. By default the input for this are macro's, variables that are defined in ...\data\ini\gamedata.ini. You can also choose to just enter numeric values, which is recommended if you intend to make a small mod.


Other files used are:

ini\object\createahero\createaheropowers.inc
createaherospecialpowers.ini
createaheroupgrades.inc

Createaheropowers.inc is used to store all the power behaviors that would otherwise be found in the unit ini file.
The other two are, AFAIK, similar to their non CAH versions.
I know there are more files involved, but these listed are just the new ones.

Before I forget, you DONT need to change "experiencelevels.ini" or "experiencelevels_createahero.inc"
This is now taken care of in "commandbutton.ini" with the three new values.

Those who don't know how to mod themselves some powers, I suggest to check out some of the guides from this site.

19 jan 2007 Update:
In the meanwhile I have written two guides about exchanging powers between normal heroes:
BFME 2 Guide: Converting normal powers into Create A Hero Powers
BFME 2 Guide: Converting Create A Hero powers to normal powers


*******************************************************************************
8 - ...\ini\object\createahero\"createaheroarmorupgrades.inc"
*******************************************************************************

The last step before testing your new faction is very simple and likely not even necessary.
Open up the file and copy a code section like this:
		////-------------------------------------------------------------
		//// Class Hero Of The West Armor upgrade. (Upgrade_CreateAHero_ClassHeroOfTheWest)
		////-------------------------------------------------------------
		ArmorSet
			Conditions = CREATE_A_HERO_01		
			Armor	   = CAHArmorHeroOfTheWest
			DamageFX   = NormalDamageFX
		End

		Behavior = ArmorUpgrade ModuleTag_CreateAHeroMenOfTheWestArmor
			TriggeredBy		  =	Upgrade_CreateAHero_ClassHeroOfTheWest
			ArmorSetFlag		  =	CREATE_A_HERO_01
			CustomAnimAndDuration =	AnimState:USER_1 AnimTime:0	TriggerTime:0;set flag	forever
		End
Rename the behavior module to reflect your own faction.
Change CREATE_A_HERO_01 to CREATE_A_HERO_07.
And again change the "TriggeredBy" value to your own faction upgrade name.
That's it! Unless you want a unique armor setting.

For a guide about armor and Armorsets I suggest you take a look at the guide from the INI section of this site:
http://the3rdage.net/

*******************************************************************************
9 - Test and Backup
*******************************************************************************

It's time to test your new faction.

If there are no problems with the creation of the hero and all animations and powers work fine,
then you should make a backup.

You have the most basic functions of your new faction.
It is always handy to have this backed up, so you can use it again later on.

*******************************************************************************
HAPPY MODDING!

If you have some questions you can always mail me: Solinx.BFME @ gmail dot com

Solinx





Note: I made this guide in notepad. The structure I had made didn't last in this post. I fixed some stuff best as I could, but it's most likely I missed some stuff.

Edit:
=================================================================
SUBCLASSES
=================================================================

From my notes:
*****************
1. Open "createaherosystemmenofthewest.inc"

2. Copy the Shield Maiden Subclass code

3. Rename the value of UpgradeName to Upgrade_CreateAHero_SubClass_2

4. At this point the class is added in the CAH menu next to the Shield Maiden.
It is an exact copy of that class. The only thing missing are the animations.
Alltough it definetly doesn't look the way it should, you can now use it as a new class.

5. Making the animations work is just as easy.
Open "createaheromodelconditionupgrades.inc" which you can find in ...\ini\Object\Createahero

6. Again we copy the Shield Maiden code.

7. Change "ModuleTag_HeroOfTheWest_SubClass_1" into "ModuleTag_HeroOfTheWest_SubClass_2"
Change "ModuleTag_HeroOfTheWest_SubClass_1_MM" into "ModuleTag_HeroOfTheWest_SubClass_2_MM"
Change both "Upgrade_CreateAHero_SubClass_1" into "Upgrade_CreateAHero_SubClass_2"

You can now play the game with your own copy of the Shield Maiden (or whichever character you decide to copy.)

Naturally this isn't exactly what you'd want.
But you now have a copy of the Shield Maiden you can toy with, without destroying the original class.

For instance, you can change the stats and bling stuff in the "createaherosystemmenofthewest.inc" file.
If you know more about the workings of BFME you can change more stuff, but you wont need me to point out the possiblities.

However it is not possible to change the powers that you can choose for your class,
unless you dont mind having them changed for the whole faction.

Unlike with adding a new faction, you don't have to add new Subclass upgrades, untill you have 6 or 7 of them in one faction.

Solinx

Edited by Solinx, 19 January 2007 - 12:36 PM.


#2 Bart

Bart

  • Network Admins
  • 8,524 posts
  • Location:The Netherlands
  • Division:Revora
  • Job:Network Leader

Posted 30 March 2006 - 04:34 PM

hmm, that's a really good tutorial. i finally understand how they work :thumbsup:

however, i think that many people will rather be adding subclasses only. do you have any comments on those?
bartvh | Join me, make your signature small!
Einstein: "We can’t solve problems by using the same kind of thinking we used when we created them."

#3 Solinx

Solinx

    .

  • Undead
  • 3,101 posts
  • Location:The Netherlands
  • Projects:Real Life
  • Division:Revora
  • Job:Retired Leader / Manager

Posted 30 March 2006 - 10:08 PM

Thanks! I'm glad it helped someone!

I didn't just rush into making a new faction, first I tried to add a new subclass.
Lucky for you, I allways make notes about new stuff, because I wouldn't have the time to write you a guide right now.

From my notes:
*****************
1. Open "createaherosystemmenofthewest.inc"

2. Copy the Shield Maiden Subclass code

3. Rename the value of UpgradeName to Upgrade_CreateAHero_SubClass_2

4. At this point the class is added in the CAH menu next to the Shield Maiden.
It is an exact copy of that class. The only thing missing are the animations.
Alltough it definetly doesn't look the way it should, you can now use it as a new class.

5. Making the animations work is just as easy.
Open "createaheromodelconditionupgrades.inc" which you can find in ...\ini\Object\Createahero

6. Again we copy the Shield Maiden code.

7. Change "ModuleTag_HeroOfTheWest_SubClass_1" into "ModuleTag_HeroOfTheWest_SubClass_2"
Change "ModuleTag_HeroOfTheWest_SubClass_1_MM" into "ModuleTag_HeroOfTheWest_SubClass_2_MM"
Change both "Upgrade_CreateAHero_SubClass_1" into "Upgrade_CreateAHero_SubClass_2"

You can now play the game with your own copy of the Shield Maiden (or whichever character you decide to copy.)

Naturally this isn't exactly what you'd want.
But you now have a copy of the Shield Maiden you can toy with, without destroying the original class.

For instance, you can change the stats and bling stuff in the "createaherosystemmenofthewest.inc" file.
If you know more about the workings of BFME you can change more stuff, but you wont need me to point out the possiblities.

However it is not possible to change the powers that you can choose for your class,
unless you dont mind having them changed for the whole faction.

Edit: Or just make a new faction, following the guide from my first post :p
*****************

I had planned to add this and some more stuff to the guide, but I cut it because it wasn't done yet. Yet, this part isn't too bad compared with the rest.

Wish I had more time to add some comments, but I have to go.

O yeah, you don't need to define the subclass upgrade, because the first 9 or 10 are allready defined.
And by the time you've added so many subclasses you should know enough to know what you have to do.

Solinx

Edited by Solinx, 30 March 2006 - 10:13 PM.

Posted Image

"An expert is a man who has made all the mistakes which can be made in a very narrow field." - Niels Bohr


#4 ched

ched

    .

  • Undead
  • 4,431 posts
  • Location:Angers (France)
  • Projects:Rhovanion Alliance
  •  T3A Team Chamber Member
  • Division:BFME
  • Job:Previous Division Leader

Posted 30 March 2006 - 11:36 PM

a great tutorial that opens loads of opportunities for BfME II modding. Thank you for sharing your knowledge with us :p
Software is like sex; it's better when it's free ~Linus Torvald

#5 Fingulfin

Fingulfin

    I Like Pi3. Do you?

  • Hosted
  • 1,752 posts
  • Location:California, USA
  • Projects:Staying Alive.
  •  This place looks familiar. I can't remember why.

Posted 31 March 2006 - 12:33 AM

This will create VERY many interesting MODs. Thanks for putting it in plain and simple English!
Posted Image
--------------------------------------
"You look like a ghost of your former self..."

#6 Solinx

Solinx

    .

  • Undead
  • 3,101 posts
  • Location:The Netherlands
  • Projects:Real Life
  • Division:Revora
  • Job:Retired Leader / Manager

Posted 31 March 2006 - 03:48 PM

This will create VERY many interesting MODs.


That's one of the main reasons I made this guide. :ohmy:
I haven't got the time and patience to make a mod, so I thought this would be a good way to support those who do.

If anything still needs a guide, just post it here, or mail me ( Solinx.BFME @ gmail dot com ) and I'll give it a try. I like to seek out the connections and functions, solve problems. Yes, I could buy myself a puzzle book, but I already have this game and this way I'm helping people :ohmy:
To be honest, I haven't done much with the BFME series yet, but I've been messing around with ini files since Generals got out and as far as I know the mechanics of BFME are based on that game.

Solinx

#7 Guest_rofl waffle_*

Guest_rofl waffle_*
  • Guests

Posted 11 August 2006 - 06:00 PM

First of all, great guide it helped me a lot.

However, I wanted a bit more customization. I searched for a bit and couldn't find anything so I thought I'd make a post.

I'm in my "creataherosystem******.inc" file and I'm trying to change the stuff about the class.
NameTag = CreateAHero:ClassName_ServentsOfSauron
DescriptionTag = CreateAHero:ClassDesc_ServantsOfSauron
I fooled around with it and changed it to ClassName_Custom (custom is the class name btw). However, when I booted it up in game it just displayed "Missing: CreateAHero:ClassName_Custom". Does anyone know where this is located so I can create one for my custom class?

#8 Solinx

Solinx

    .

  • Undead
  • 3,101 posts
  • Location:The Netherlands
  • Projects:Real Life
  • Division:Revora
  • Job:Retired Leader / Manager

Posted 13 August 2006 - 01:33 PM

Ah yes, you want to change descriptions.

Descriptions are stored in lotr.str. You can find this file in Battle for Middle Earth II\lang\englishpatch10X.big, where X stands for the latest patch number.
In the case you haven't patched your game, you can find the file in English.big in the same folder.

Extract the file to the data map Battle for Middle Earth II\data\lotr.str and edit it with notepad.

Add this to the file:
CreateAHero:ClassName_Custom
 "Your description"
End

This methode is used to change any descriptions (button names, button descriptions, spell names, etc)

Solinx

Edited by Solinx, 23 September 2006 - 12:19 AM.

Posted Image

"An expert is a man who has made all the mistakes which can be made in a very narrow field." - Niels Bohr





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users