The 3rd Age

Master Hero Mod 2.0

Master Hero Mod 2.0

MasterHero Mod : Enhances Visuals, provide series of modifications and additions to the game play

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 new faction

Tutorial for Battle for Middle-earth BFME

Avatar of AdmiralGT

AdmiralGT

Category: Code
Level: Intermediate
Created: Monday March 26, 2007 - 11:22
Updated: Wednesday April 11, 2007 - 11:10
Views: 13144
Summary: Adding new factions to the BFME I

Rating

Staff says

3.0

Members say

4.0

Average

3.6/5.0

8 votes

Before you begin, there's a way that's alot easier for this to work. All you do is to go here and do what it says... however, if your up for a better view of the process, and want a "challenge", please proceed... It's a easy process anyways.


I'd like to thank Sy from Deezire.net for his work on adding a new faction which has enabled me to be able to write this tutorial. I'd also like to thank Hostile for hosting my tutorial and the Revora Network for their continued support of the project.



Whether you're creating a new Total Conversion, or just want to create a new Faction to play with in The Battle For Middle Earth, this tutorial series aims to get your new faction from your mind, into your game. This first tutorial in the series aims to set out the basic foundation for your faction and be the first step to getting your new faction in game.

Before embarking on this challenge of adding a New Faction, I suggest you read the beginner tutorials so that you know how to extract the INI's and use your edited INI's.

All the tools you need to add your new faction can also be found at The 3rd Age website (in the Downloads section) along with the other tutorials in my series and other useful tutorials. So, let's get started.

The INI's we will need to edit for this tutorial are:

PlayerTemplate.ini
Science.ini
Upgrade.ini
VictorySystem.ini
CommandSet.ini


Depending on whether your Faction is good or evil depends on whether we need to edit GoodFactionBuildings.ini or EvilFactionBuildings.ini

We're also going to need to edit lotr.csf. A csf editor can be downloaded from the site, in the Tools Section. You'll find lotr.csf in English.big (replacing English with the language your game is in)

If you have installed EA Games patch 1.01 for BFME than your CSF file needs to be extracted from _englishpatch101 file.

[NOTE 3/26/07: We now recommend you edit a String file instead of the CSF file. String files are much easier to edit and there is a tutorial on how to do this in the Articles section.]

Now we know what we are going to edit, we can get started on some editing.

I've chosen to make a new faction of the Elves. If your creating your own faction, you'll need to replace Elves with your Factions Name. Firstly I need to add my faction to PlayerTemplate.ini. To do this we'll need to add the following to it.

              
Code
PlayerTemplate FactionElves
Side = Elves ;My side name, referenced by units, structures etc
PlayableSide = Yes ;I want to be able to use my elves
Evil = No ;My Elves fight on the side of Good, but you might want them to be Dark Elves, evil.
StartMoney = 0
MaxLevelMP = 34 ;Don't change this
MaxLevelSP = 78 ;Or this
PreferredColor = R:42 G:190 B:53
IntrinsicSciences = SCIENCE_GOOD ;Because I'm a good guy, i'm going to have the Good Sciences
IntrinsicSciencesMP = SCIENCE_ELVES ;I need to create this Science in Science.ini later
SpellBook = GoodSpellBook
SpellBookMp = ElvesSpellBook ;The spells you'll get in Multiplayer\Skirmish
PurchaseScienceCommandSet = GoodSpellStoreCommandSet
PurchaseScienceCommandSetMP = ElvesSpellStoreCommandSet
DisplayName = INI:FactionElves ;This is so it says Elves in game, but we'll need to add this.
DefaultPlayerAIType = RohanSkirmishAI
BeaconName = MultiplayerBeacon
LightPointsUpSound = RohanLightPointsUp
ObjectiveAddedSound = Gui_MissionObjectiveNew
ObjectiveCompletedSound = Gui_MissionObjectiveCompleted
InitialUpgrades = Upgrade_ElvesFaction ;Any upgrades this player is born with.
BuildableHeroesMP = ;Your Hero Units for this faction go here.
SpellStoreCurrentPowerLabel = APT:SpellStoreCurrentEvenstarPower
SpellStoreMaximumPowerLabel = APT:SpellStoreMaximumEvenstarPower
End


I've added comments to each line so that you know what they mean but you don't need to add these comments to the actual PlayerTemplate.ini. Because you've created a new side, you'll need new hero units since the Heros have one of the previous sides. The heros are found in GoodFaction\Units or EvilFaction\Units depending on which race they belong to. If you want to use existing Heros, just copy the code and change the line with "Side = Gondor/Rohan/Mordor/Isengard" in each Hero to "Side = Elves". You'll also need to change the Object name so that it is a unique name (ie. not used by any other unit in your game). That Object name then needs to be placed in your BuildableHeroesMP line above.

So now we have our new faction in place, however, to be able to play it in game we are going to need a few other things. Firstly, our Elves are going to have their own "science" tree. This is actually the spells you get when you click on the Phial or One Ring. To do this we need to open up Science.ini and add this

              
Code
Science SCIENCE_ELVES
PrerequisiteSciences = None
SciencePurchasePointCost = 0 ; note that this means "not purchasable", NOT "free"!
IsGrantable = No
End


This is our basic Science for our Elves. Because we've added a new science, we won't have any sciences to use in game. However, another tutorial in this series "New Factions - Spellbooks" will go through the basics on adding new sciences and getting it them to work with your new faction.

So what have we got now. We've got our Faction, and we've got our basic Science for it. We're about half way through now, we still need to edit a few more things. Next we'll edit Upgrade.ini by adding the following.

              
Code
Upgrade Upgrade_ElvesFaction
DisplayName = UPGRADE:ElvesFaction
Type = PLAYER
End


This is all we need to add to Upgrade.ini. This corresponds to the InitialUpgrades line in PlayerTemplate.ini. If you didnt edit this line, you don't need to add this.

Next we'll edit VictorySystem.ini

              
Code
FactionVictoryData Elves
AllyDeathScaleFactor = 1.0 ; Value this faction places on the loss of its own units.
EnemyKillScaleFactor = 1.1 ; Value this faction places on 'kills' of enemy units that it gets.
VictoryThreshold = 200.0 ; Thereshold needed for a 'Victory'
MajorUnitValue = 10.0 ; Value placed on special/major units (normal units are worth 1.0)
MapToCellVictoryRatio = 0.8 ; Factor of VictoryThreshold that a cell needs for a Victory, practical range should be
; on the order of 0.2 and 1.0. Larger values make it more difficult to achieve 'Victory'
End


You should set VictoryThreshold to 150.0 if you're creating an Evil Faction so that it fits in with the others.

Next we'll move onto CommandSet.ini. We'll need to add 3 things here, Firstly

              
Code
CommandSet ElvesFoundationCommandSet
End

then
              
Code
CommandSet ElvesSpellBookCommandSet
End

and finally
              
Code
CommandSet ElvesSpellStoreCommandSet
End


You may be asking yourself why are these blank and what they do. Well, the first is what buildings your camp will be able to build when you select a construction plot. This will likely be different for your faction from the factions already created. The next 2 are the spell books you have in Mulitplayer games. You'll need to create your spells in Science.ini and then add the buttons to these CommandSets. I'll go through this in my "New Factions - Spellbooks"

Next we'll need to edit GoodFactionBuildings.ini or EvilFactionBuildings.ini. I'm going to edit GoodFactionBuildings.ini since my Elves are good by adding the following, in the very bottom for easier access.

              
Code
Object ElvesBuildingFoundation

SelectPortrait = BPRCamp_Plot
; *** ART Parameters ***


Draw = W3DScriptedModelDraw ModuleTag_Draw2
DefaultModelConditionState
Model = OBBFoundationX
End
ModelConditionState = WORLD_BUILDER
Model = RBSizeTemplate
End

End
Draw = W3DFloorDraw ModuleTag_Draw
ModelName = RBFoundationX
End

;PlacementViewAngle = 0

; ***DESIGN parameters ***
DisplayName = OBJECT:ElvesBuildingFoundation
Side = Elves ;The same as your Sides = in PlayerTemplate.ini
EditorSorting = STRUCTURE
ThreatLevel = 1.0

BuildCost = 1
BuildTime = 5.0 ; in seconds
VisionRange = 160.0 ; Shroud clearing distance
ShroudClearingRange = 160

CommandSet = ElvesFoundationCommandSet ;The same as what you just added to CommandSet.ini

; *** AUDIO Parameters ***

VoiceSelect = Gui_PlotSelect


; *** ENGINEERING Parameters ***

RadarPriority = STRUCTURE
KindOf = STRUCTURE SELECTABLE IMMOBILE BASE_FOUNDATION UNATTACKABLE MP_COUNT_FOR_VICTORY NO_COLLIDE DO_NOT_CLASSIFY

Behavior = FoundationAIUpdate ModuleTag_foundationAI
End

Behavior = CastleMemberBehavior ModuleTag_CMB
End

Body = ImmortalBody ModuleTag_05
MaxHealth = 15000.0
End

Geometry = BOX
GeometryMajorRadius = 24.0
GeometryMinorRadius = 24.0
GeometryHeight = 0.8
GeometryIsSmall = No
Shadow = SHADOW_VOLUME
BuildCompletion = PLACED_BY_PLAYER
End


There isn't really much you need to change here other than its Object name, Display Name, Side and CommandSet. This is pretty standard among all the factions. Continue with this, which is the citadel, the center building for every faction, where you build and revive your heroes..

              
Code
Object ElvesCampKeep

SelectPortrait = BPGCamp

; *** ART Parameters ***
Draw = W3DScriptedModelDraw ModuleTag_Draw
OkToChangeModelColor = Yes
UseStandardModelNames = Yes
DefaultModelConditionState
Model = GBCCenter
End

IdleAnimationState
End
;------------Build Up States
ModelConditionState = ACTIVELY_BEING_CONSTRUCTED
Model = GBCCenter_A
ParticleSysBone = NONE BuildingContructDust
End
AnimationState = ACTIVELY_BEING_CONSTRUCTED
Animation
AnimationName = GBCCenter_A.GBCCenter_A
AnimationMode = MANUAL
End
BeginScript
CurDrawablePlaySound("GondorBarracksBeginConstruction")
CurDrawablePlaySound("BuildingTopple")
EndScript
End

;------------Build Up States
ModelConditionState = BASE_BUILD
Model = GBCCenter_A
ParticleSysBone = NONE BuildingContructDust
End
AnimationState = BASE_BUILD
Animation
AnimationName = GBCCenter_A.GBCCenter_A
AnimationMode = ONCE
AnimationBlendTime = 0
AnimationSpeedFactorRange = 2.0 2.0 ; 300 frame anim, but need to shrink down to 5 seconds
End
BeginScript
CurDrawablePlaySound("GondorBarracksBeginConstruction")
CurDrawablePlaySound("BuildingTopple")
EndScript
End
ModelConditionState = JUST_BUILT
Model = GBCCenter_A
End

AnimationState = JUST_BUILT
Animation
AnimationName = GBCCenter_A.GBCCenter_A
AnimationMode = MANUAL
AnimationBlendTime = 0
End
Flags = START_FRAME_FIRST
End
ModelConditionState = DAMAGED
Model = GBCCenter_D1
ParticleSysBone dustbone01 TrebuchetImpactDebris


End
AnimationState = DAMAGED
EnteringStateFX = FX_BuildingDamaged
End
ModelConditionState = REALLYDAMAGED
Model = GBCCenter_D2
ParticleSysBone = glowbone02 TrebuchetImpactDebris
ParticleSysBone = glowbone01 Explosion5

End
AnimationState = REALLYDAMAGED
EnteringStateFX = FX_BuildingReallyDamaged
End

ModelConditionState = RUBBLE
Model = GBCCenter_D2
ParticleSysBone dustbone01 TrebuchetImpactDebris
ParticleSysBone = glowbone01 Explosion5
ParticleSysBone = glowbone02 BuildingChunkDebris
End
AnimationState = RUBBLE
End
ModelConditionState = POST_RUBBLE
Model = GBGenRubble
ParticleSysBone NONE SmokeBuildingMediumRubble
End
AnimationState = POST_RUBBLE
End

ModelConditionState = POST_COLLAPSE
Model = GBGenRubble
ParticleSysBone NONE SmokeBuildingMediumRubble
End
AnimationState = POST_COLLAPSE
End
End

; *** AUDIO Parameters ***
VoiceSelect = GondorCitadelSelect
SoundAmbient = CitadelSignalFireLoop
SoundOnDamaged = BuildingLightDamageStone
SoundOnReallyDamaged = BuildingHeavyDamageStone
VoiceSelectUnderConstruction = BuildingGoodVoiceSelectUnderConstruction
UnitSpecificSounds
UnderConstruction = BuildingBigConstructionLoop ; Built first time
UnderRepairFromRubble = BuildingBigConstructionLoop ; Repaired from completely destroyed
End
EvaEventDieOwner = CitadelDie

; ***DESIGN parameters ***
DisplayName = OBJECT:ElvesCampKeep
Side = Elves
EditorSorting = STRUCTURE
ThreatLevel = 1.0
BuildCost = 1000
BuildTime = 30.0 ; in seconds
CommandSet = GenericKeepCommandSet

ArmorSet
Conditions = None
Armor = CitadelArmor
DamageFX = None
End

; *** ENGINEERING Parameters ***
KindOf = VITAL_FOR_BASE_SURVIVAL STRUCTURE SELECTABLE IMMOBILE CASTLE_KEEP MP_COUNT_FOR_VICTORY FS_FACTORY AUTO_RALLYPOINT MADE_OF_STONE SCORE
RadarPriority = STRUCTURE
KeepSelectableWhenDead = Yes

Body = ActiveBody ModuleTag_02
MaxHealth = GONDOR_CENTRAL_CAMP_KEEP_HEALTH
End

Behavior = GettingBuiltBehavior ModuleTag_04
SelfBuildingLoop = BuildingBigConstructionLoop ; Only played if we DON'T spawn a worker
SelfRepairFromDamageLoop = NoSound ; This doesn't cause an animation, so don't bother playing a sound
SelfRepairFromRubbleLoop = BuildingBigConstructionLoop
End

Behavior = CastleMemberBehavior ModuleTag_CMB
BeingBuiltSound = BuildingBigConstructionLoop
End

;-----------------------------------------------
;Used for hero revival and initial construction
Behavior = ProductionUpdate ProductionUpdateModuleTag
; nothing, but is required if we have any Object-level Upgrades!
End

Behavior = QueueProductionExitUpdate ModuleTag_QueuePEU
UnitCreatePoint = X:0.0 Y:-20.0 Z:0.0
NaturalRallyPoint = X:28.8 Y:-80.0 Z:0.0;NaturalRallyPointX must always match GeometryMajorRadius!
ExitDelay = 300 ; Mainly for the multiple produced Red Guard. Make them come out one at a time.
End

Behavior = KeepObjectDie ModuleTag_IWantRubble
End

Behavior = AutoDepositUpdate AutoDepositModuleTag
DepositTiming = GENERIC_KEEP_MONEY_TIME ; in milliseconds
DepositAmount = GENERIC_KEEP_MONEY_AMOUNT ; cash amount to deposit every DepositTiming
InitialCaptureBonus = 0 ; no initial bonus
End

Behavior = StructureCollapseUpdate ModuleTag_06
MinCollapseDelay = 000
MaxCollapseDelay = 000
CollapseDamping = .5
MaxShudder = 0.6
MinBurstDelay = 250
MaxBurstDelay = 800
BigBurstFrequency = 4
FXList = INITIAL FX_StructureMediumCollapse
End

Behavior = RubbleRiseUpdate ModuleTag_07
MinRubbleRiseDelay = 000
MaxRubbleRiseDelay = 000
;RubbleRiseDamping = .5
RubbleHeight = 4.0
MaxShudder = 0.6
MinBurstDelay = 250
MaxBurstDelay = 800
BigBurstFrequency = 4
FXList = INITIAL FX_StructureMediumPostCollapse
End

Geometry = BOX
GeometryMajorRadius = 7.0
GeometryMinorRadius = 7.0
GeometryHeight = 113.0

AdditionalGeometry = BOX
GeometryMajorRadius = 14.0
GeometryMinorRadius = 14.0
GeometryHeight = 38.0

AdditionalGeometry = CYLINDER ; this is needed so melee units can reach athe citidel to attack it
GeometryMajorRadius = 30.0
GeometryMinorRadius = 30.0
GeometryHeight = 10.0
GeometryIsSmall = No
Shadow = SHADOW_VOLUME
GeometryContactPoint = X:0.407 Y:-0.489 Z:122.392 Swoop
AttackContactPoint = X:0 Y:0 Z:0
End

And also add this, which is the ElvenFarm we need when we are to create the bases, which will be explained in another tutorial..
              
Code
ChildObject ElvenFarm FarmInterface

Draw = W3DScriptedModelDraw ModuleTag_Draw_HCBanner
OkToChangeModelColor = Yes
DefaultModelConditionState
Model = RBHCFarm
End
MultiPlayerOnly = Yes
End



DisplayName = OBJECT:ElvenFarm
Description = OBJECT:ElvenFarmDescription
Side = Elven
BuildCost = ROHAN_FARM_BUILDCOST
BuildTime = ROHAN_FARM_BUILDTIME ; in seconds
VisionRange = 160.0 ; Shroud clearing distance
ShroudClearingRange = ROHAN_FARM_SHROUD_CLEAR


;;--- to allow generation of peasants ----------------
CommandSet = ElvenFarmCommandSet


WeaponSet
Conditions = None
End


Behavior = GettingBuiltBehavior GetBuiltBehaviorTag
WorkerName = RohanWorkerNoSelect
End


Body = StructureBody ModuleTag_05
MaxHealth = ROHAN_FARM_HEALTH
MaxHealthDamaged = ROHAN_FARM_HEALTH_DAMAGED
MaxHealthReallyDamaged = ROHAN_FARM_HEALTH_REALLY_DAMAGED

DamageCreationList = OCL_BuildingDamageList01 CATAPULT_ROCK

DamageCreationList = OCL_GBFarm_Chunk1 CATAPULT_ROCK FRONT_DESTROYED
DamageCreationList = OCL_GBFarm_Chunk2 CATAPULT_ROCK RIGHT_DESTROYED
DamageCreationList = OCL_GBFarm_Chunk3 CATAPULT_ROCK BACK_DESTROYED
DamageCreationList = OCL_GBFarm_Chunk4 CATAPULT_ROCK LEFT_DESTROYED
End


Behavior = AutoDepositUpdate AutoDepositModuleTag
DepositTiming = ROHAN_FARM_MONEY_TIME ; in milliseconds
DepositAmount = ROHAN_FARM_MONEY_AMOUNT ; cash amount to deposit every DepositTiming
InitialCaptureBonus = 0 ; no initial bonus
End
End


;------------------------------------------------------------------------------
ChildObject ElvenFarmMultiplayer ElvenFarm

PlacementViewAngle = 45


BuildCost = ROHAN_FLAG_ECONOMY_UNPACK_FARM_COST
RefundValue = 100 ; Half the plot cost.

Behavior = ExperienceLevelCreate CreateExperienceLevel
LevelToGrant = 2
End

End



We've done all the INI editing we need for the moment, next we need to edit our lotr.csf file. We'll need to add 5 strings to our lotr.csf file. There names and values are as follows

              
Code
INI:FactionElves - Elves
SIDE:Elves - Elves
LWA:Elves - Elves
LWA:ElvesArmy - Elves Army
OBJECT:ElvesBuildingFoundation - Elves Building Foundation


Once we've added these strings, we'll need to save our lotr.csf(or lotr.str) file. Once done, our game will be ready for our new faction. However, our faction isnt ready to be played just yet, we've only just laid our the basics, we still need to add all our new bases, buildings, spells, units and heros so that our faction is playable. The most important part of this are our new bases. Until we add these our faction will instantly die when we try to play a game. This will be covered in "New Factions - Bases".

Comments

Display order: Newest first

{AE}Manveru - Sunday June 14, 2009 - 13:49

The INI files are from your INI.BIG file in your BFME install directory. If you don't know the basics of BIG files, this is an intermediate tutorial and I'd suggest you start with something simpler.

Sauron012 - Thursday March 5, 2009 - 7:49

where do i get the ini. files???????????????????

Liam Rogers - Tuesday January 20, 2009 - 2:17

where could i get the .ini files? are they standard or?...

Bart (Administrator) - Thursday August 23, 2007 - 11:59

always data\ini, almost never data\ini\default

ched (Team Chamber Member) - Thursday August 23, 2007 - 3:48

data/ini/upgrade.ini

you'll find that most of the files in /default/ are not to be used

CNCM_BLITZ - Wednesday August 22, 2007 - 15:26

Is the Upgrade.ini you referred to the file that comes from data/ini/upgrade.ini or data/ini/default/upgrade.ini?

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."

 
12:44:25