The 3rd Age

BfME 1½ Mod

BfME 1½ Mod

A mod that makes BfME2 as it should have been with the building plot system from BfME1!

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

New Faction Spell Books and Spells

Tutorial for Battle for Middle-earth BFME, Battle for Middle-earth II BFME 2

Avatar of AdmiralGT

AdmiralGT

Category: Code
Level: Intermediate
Created: Monday March 26, 2007 - 13:09
Updated: Saturday June 27, 2009 - 18:47
Views: 16419
Summary: Editing the spells you can buy

Rating

Staff says

3.6

Members say

3.3

Average

3.5/5.0

8 votes

New Faction - Spellbooks

Written By AdmiralGT aka Geoff Thomas

I'd like to thank the staff and community of http://the3rdage.net and the Revora network for the continued support of this series of tutorials and Battle For Middle Earth Modding. The other tutorials in this series can also be found at The 3rd Age website. Thanks to Lavskaegge for pointing out an error in the original tutorial and Deezire for the solution.


Whether you're creating a Spellbook for a new faction or want to change the spellbook for an existing faction, this tutorial aims to take you through the process step by step. For anyone familiar to C&C Generals Moddings, this is a lot like Science editing. However, Battle for Middle Earth introduces a new element to the Science "tree" with the inclusion of OR statements. This allows the Science to be activated via 2 or more different prerequisites. Battle for Middle Earth also uses different Science trees for Single and Multiplayer with 12 Sciences in Single Player and only 8 in Multiplayer. I'm going to base my tutorial off the Mulitplayer Sciences, but both run off the same Principal.

Before tackling this desire to add or edit a Spellbook, I suggest you read through some of the Beginner tutorials HERE so that you are familiar with how to extract INI files and use your edited INI's. The Tools section of the site has all the necessary tools to be able to complete this tutorial.

In this tutorial we will be editing the following INI's:
Science.ini
CommandSet.ini
PlayerTemplate.ini


Now we have everything ready, let's get started. Firstly, I'm going to edit an existing Spellbook. I'm not happy with Rohan having Elven Allies but would rather have some Rohan Allies instead to represent some of my fellow Rohirrim come to my aid so I'm going to replace the Elven Allies Science with the Rohan Allies science for Rohan.

We're going to need to open up Science.ini to do this and search for "SCIENCE_ElvenAllies". This should bring us to the Elven Allies science. While not necessary, it is good progress to remove the unneeded sciences from Sciences. Because the Rohan faction is no longer using this Science, we can remove the 2 Rohan statements from the Elven Allies prerequisite. By doing this our Elven Allies science should now look like this

              
Code
Science SCIENCE_ElvenAllies
PrerequisiteSciences = SCIENCE_GOOD SCIENCE_ElvenWood OR SCIENCE_GONDOR SCIENCE_Heal OR SCIENCE_GONDOR SCIENCE_ElvenWood
SciencePurchasePointCost = 8
SciencePurchasePointCostMP = 3
IsGrantable = Yes
End


Thats all we need to do for that Science, if we scroll down we should be able to see "SCIENCE_RohanAllies". This is the science for the Rohan Allies so we are going to need to edit this. At the moment, Rohan Allies isnt going to be selectable for Mulitplayer games since Rohan don't have SCIENCE_GONDOR or SCIENCE_GOOD so we're going to need to add some prerequisites to our science. While once again not necessary, I am going to maintain the existing tree structure of the Sciences and make the Rohan Allies dependent on me having the Draft Science or the Heal Science. To do this, i'm going to edit my Science so it now looks like this

              
Code
Science SCIENCE_RohanAllies
PrerequisiteSciences = SCIENCE_GOOD SCIENCE_Draft OR SCIENCE_GOOD SCIENCE_ElvenWood OR SCIENCE_GONDOR SCIENCE_ElvenWood OR SCIENCE_ROHAN SCIENCE_Draft OR SCIENCE_ROHAN SCIENCE_HEAL
SciencePurchasePointCost = 8
SciencePurchasePointCostMP = 3
IsGrantable = Yes
End


The last two statements of the Prerequisites is what is important here. I could however decide that I don't want to have to have bought one of the two science to get Rohan Allies and so would only add "OR SCIENCE_ROHAN" and omit the 2 OR statements that I just added.

Our task isn't yet complete on the Science front since the Sciences further down the tree depend on the Elven Allies science. For Rohan this is the Ent Allies and the Cloud Break. Underneath the Rohan Allies is a Cloud Break science, however, this is for singleplayer only as denoted by the _SP at the end. If we scroll down a bit further we'll find a Cloud Break ending in _MP. This is the one we want to edit. You should see here that one of the Prerequisites reads "SCIENCE_ROHAN SCIENCE_ElvenAllies".

However, we're not going to be purchasing the Elven Allies science anymore so we're going to need to change it from "SCIENCE_ElvenAllies" to "SCIENCE_RohanAllies". Note that "SCIENCE_ElvenAllies" appears twice, once after "SCIENCE_ROHAN" and once after "SCIENCE_GONDOR". We are only editing the one after the "SCIENCE_ROHAN" since we are editing the Rohan faction. Our Cloud Break Science should now look like this

              
Code
Science SCIENCE_CloudBreak_MP
PrerequisiteSciences = SCIENCE_ROHAN SCIENCE_Anduril OR SCIENCE_ROHAN SCIENCE_RohanAllies OR SCIENCE_GONDOR SCIENCE_GandalftheWhite OR SCIENCE_GONDOR SCIENCE_ElvenAllies
SciencePurchasePointCost = 0
SciencePurchasePointCostMP = 6
IsGrantable = Yes
End


Underneath this Science is the Science for the Ent Allies. We're going to edit this in exactly the same way as we edited the Cloud Break so that it looks like this

              
Code
Science SCIENCE_EntAllies
PrerequisiteSciences = SCIENCE_GOOD SCIENCE_RohanAllies OR SCIENCE_ROHAN SCIENCE_RohanAllies OR SCIENCE_ROHAN SCIENCE_ElvenWood_Rohan
SciencePurchasePointCost = 10
SciencePurchasePointCostMP = 8
IsGrantable = Yes
End


Don't be fooled by the "SCIENCE_GOOD SCIENCE_RohanAllies" here since we only have "SCIENCE_GOOD" in the Singleplayer game, not multiplayer.

That's our Sciences sorted out, now we're going to need to edit the buttons for the Sciences so the button for Rohan Allies appears instead of Elven Allies. To do this, open up CommandSet.ini and search for "RohanSpellStoreCommandSet". Since we no longer are using the Elven Allies, we don't want to try and purchase the science either. So, we're going to replace the purchasing of the Elven Allies with the purchasing of Rohan Allies so that it looks like this

              
Code
CommandSet RohanSpellStoreCommandSet
1 = Command_PurchaseSpellDraft
2 = Command_PurchaseSpellHeal
3 = Command_PurchaseSpellAnduril
4 = Command_PurchaseSpellRohanAllies
5 = Command_PurchaseSpellElvenWoodRohan
6 = Command_PurchaseSpellCloudBreak_MP
7 = Command_PurchaseSpellEntAllies
8 = Command_PurchaseSpellArmyoftheDead
End


Just above this you'll see our Spell Book. This is what allows us to use our Spells, so we're going to need to edit this as well so we can use Rohan Allies instead of Elven Allies and so should look like this

              
Code
CommandSet RohanSpellBookCommandSet
1 = Command_SpellBookHeal
2 = Command_SpellBookDraft
3 = Command_SpellBookAnduril
4 = Command_SpellBookRohanAllies
5 = Command_SpellBookElvenWood_Rohan
6 = Command_SpellBookCloudBreak_MP
7 = Command_SpellBookEntAllies
8 = Command_SpellBookArmyoftheDead
End


So now we're done, we've taken out the Elven Allies from Rohan and added the Rohan Allies. Remember, you'll need to edit the Science you want to add and the Sciences that are immediately below it in the Science Tree. You may have noticed somce other lines in each of the Sciences, "SciencePurchasePointCost" and "SciencePurchasePointCostMP". This is how much each of the Sciences costs in Single player and Multiplayer. You might decide you want the Rohan Allies to cost 4 points instead of 3. If we do this our Science will look like this.

              
Code
Science SCIENCE_RohanAllies
PrerequisiteSciences = SCIENCE_GOOD SCIENCE_Draft OR SCIENCE_GOOD SCIENCE_ElvenWood OR SCIENCE_GONDOR SCIENCE_ElvenWood OR SCIENCE_ROHAN SCIENCE_Draft OR SCIENCE_ROHAN SCIENCE_HEAL
SciencePurchasePointCost = 8
SciencePurchasePointCostMP = 4
IsGrantable = Yes
End


However, be very careful here. This will increase the cost for all the factions, not just Rohan. A bigger problem is that of the maximum amount of points you can earn. In PlayerTemplate.ini there is a line titled "SpellBookMP" followed by a value. The total points value of your Sciences must be equal to this value. By adding the one to our Science, we're going to need to add one to this line in PlayerTemplate.ini so that it looks like this

              
Code
PlayerTemplate FactionRohan
Side = Rohan
PlayableSide = Yes
Evil = No
StartMoney = 0
MaxLevelMP = 35
MaxLevelSP = 78 ;80
PreferredColor = R:42 G:190 B:53
IntrinsicSciences = SCIENCE_GOOD
IntrinsicSciencesMP = SCIENCE_ROHAN
SpellBook = GoodSpellBook
SpellBookMp = RohanSpellBook
PurchaseScienceCommandSet = GoodSpellStoreCommandSet
PurchaseScienceCommandSetMP = RohanSpellStoreCommandSet
DisplayName = INI:FactionRohan
DefaultPlayerAIType = RohanSkirmishAI
BeaconName = MultiplayerBeacon
LightPointsUpSound = RohanLightPointsUp
ObjectiveAddedSound = Gui_MissionObjectiveNew
ObjectiveCompletedSound = Gui_MissionObjectiveCompleted
InitialUpgrades = Upgrade_RohanDualEconomyChoice Upgrade_RohanFaction ;Any upgrades this player template is born with.
BuildableHeroesMP = RohanTheoden RohanEomer RohanEowyn RohanGimli RohanLegolas GondorAragornMP RohanMerry
SpellStoreCurrentPowerLabel = APT:SpellStoreCurrentEvenstarPower
SpellStoreMaximumPowerLabel = APT:SpellStoreMaximumEvenstarPower
End


Notice how the 34 is now 35 so we can purchase all our Sciences. The maximum value for this is 85 as determined by Rank.ini.

So that's how to edit a Spellbook. If you're only looking to edit the Spellbook, this is where you need to stop. If you wish to add a new Spellbook to a faction, we still have some work to do. At this point I am going to assume that you have read the first tutorial in my series "New Factions - The Basics" and have added your new faction to PlayerTemplate.ini and added your new basic science to Science.ini. I am also going to presume that you haven't edited the files from the previous part of this tutorial. However, as long as you only add the necessary code for the new faction to the edited code above, you should have no problems.

In multiplayer, each spellbook has 8 slots for spells. I am going to keep the style used in BFME and keep the second level sciences dependent on the first, third dependent on second and fourth dependent on third. Firstly, we are going to have to decide what sciences we want and where we are going to put them in our science tree. I have decided to add the following 8 Sciences to my Elven faction.
1. Heal
2. Draft
3. Summon Elven Allies
4. Cloud Break
5. Summon Rohan Allies
6. Summon Eagle Allies
7. Summon Ent Allies
8. Summon Army of the Dead

They are laid out as in the following Diagram.

So, first of all lets start with Heal. We'll open up Science.ini and search for SCIENCE_Heal. Our basic science for our faction is "SCIENCE_ELVES" so we're going to need to add this to the prerequisites of the science so that it now looks like this.

              
Code
Science SCIENCE_Heal
PrerequisiteSciences = SCIENCE_GOOD OR SCIENCE_ROHAN OR SCIENCE_GONDOR OR SCIENCE_ELVES
SciencePurchasePointCost = 1
SciencePurchasePointCostMP = 1
IsGrantable = Yes
End


We're going to do the same for Draft since we also want this available from the start. If we scroll down we'll find SCIENCE_Draft and once again we'll add our science so that it looks like this.

              
Code
Science SCIENCE_Draft
PrerequisiteSciences = SCIENCE_GOOD SCIENCE_ElvenGifts OR SCIENCE_ROHAN OR SCIENCE_ELVES
SciencePurchasePointCost = 1 ;3
SciencePurchasePointCostMP = 1
IsGrantable = Yes
End


So that's our first level of sciences done. Next we'll move onto our second level. If we scroll down again we'll find SCIENCE_ElvenAllies. We have to be careful here, if we just add "SCIENCE_ELVES" it will be available as soon as we get our 3 points and we won'd need to but any first level sciences.

If we just add "SCIENCE_Heal" then this will mean we'll just need to purchase the Heal Science to buy this science, but this will apply to all the factions so we don't want to do this either. To make it just for our faction we're going to need to add both "SCIENCE_ELVES" and "SCIENCE_Heal" in the same OR statement. This will leave our Elven Allies Science looking like this.

              
Code
Science SCIENCE_ElvenAllies
PrerequisiteSciences = SCIENCE_GOOD SCIENCE_ElvenWood OR SCIENCE_GONDOR SCIENCE_Heal OR SCIENCE_GONDOR SCIENCE_ElvenWood OR SCIENCE_ELVES SCIENCE_Heal
SciencePurchasePointCost = 8
SciencePurchasePointCostMP = 3
IsGrantable = Yes
End


Next onto Cloud Break. This is a little bit more complicated since we can either buy Heal or Draft to unlock this science. We can resolve this by using two or statements in our Sciences. One dependent on Heal, and one on draft so we're left with the following.

              
Code
Science SCIENCE_CloudBreak_MP
PrerequisiteSciences = SCIENCE_ROHAN SCIENCE_Anduril OR SCIENCE_ROHAN SCIENCE_RohanAllies OR SCIENCE_GONDOR SCIENCE_GandalftheWhite OR SCIENCE_GONDOR SCIENCE_ElvenAllies OR SCIENCE_ELVES SCIENCE_Heal OR SCIENCE_ELVES SCIENCE_Draft
SciencePurchasePointCost = 0
SciencePurchasePointCostMP = 6
IsGrantable = Yes
End


Remember, there are 2 Cloud Break sciences. The single player and mutliplayer ones. We only want to edit the Mulitplayer one. Next, we'll scroll back up to Rohan Allies and change it to this.

              
Code
Science SCIENCE_RohanAllies
PrerequisiteSciences = SCIENCE_GOOD SCIENCE_Draft OR SCIENCE_GOOD SCIENCE_ElvenWood OR SCIENCE_GONDOR SCIENCE_ElvenWood OR SCIENCE_ROHAN SCIENCE_Draft OR SCIENCE_ROHAN SCIENCE_Heal OR SCIENCE_ELVES SCIENCE_Draft
SciencePurchasePointCost = 8
SciencePurchasePointCostMP = 3
IsGrantable = Yes
End


So thats our second level ones done, only 3 left now. They are much like the previous one just added with them all being dependent on either of the two previous sciences.

              
Code
Science SCIENCE_EagleAllies
PrerequisiteSciences = SCIENCE_GOOD SCIENCE_CloudBreak_SP OR SCIENCE_GONDOR SCIENCE_ElvenAllies OR SCIENCE_GONDOR SCIENCE_RohanAllies OR SCIENCE_ELVES SCIENCE_ElvenAllies OR SCIENCE_elves SCIENCE_CloudBreak_MP
SciencePurchasePointCost = 10
SciencePurchasePointCostMP = 6
IsGrantable = Yes
End

Science SCIENCE_EntAllies
PrerequisiteSciences = SCIENCE_GOOD SCIENCE_RohanAllies OR SCIENCE_ROHAN SCIENCE_RohanAllies OR SCIENCE_ROHAN SCIENCE_ElvenWood_Rohan OR SCIENCE_ELVES SCIENCE_RohanAllies OR SCIENCE_ELVES SCIENCE_CloudBreak_MP
SciencePurchasePointCost = 10
SciencePurchasePointCostMP = 8
IsGrantable = Yes
End

Science SCIENCE_ArmyoftheDead
PrerequisiteSciences = SCIENCE_GOOD SCIENCE_Anduril OR SCIENCE_ROHAN SCIENCE_CloudBreak_MP OR SCIENCE_ROHAN SCIENCE_EntAllies OR SCIENCE_GONDOR SCIENCE_CloudBreak_MP OR SCIENCE_GONDOR SCIENCE_EagleAllies OR SCIENCE_ELVES SCIENCE_EagleAllies OR SCIENCE_ELVES SCIENCE_EntAllies
SciencePurchasePointCost = 16
SciencePurchasePointCostMP = 10
IsGrantable = Yes
End


So thats all our Sciences ready to be purchased but we still have a few things left to do. Firstly, we're going to need to check we're going to earn enough points to be able to buy everything as determined by our code in PlayerTemplate.ini. The total cost of our Sciences is 42 points, but our elves only earn 34 points. So, we'll need to edit our faction. If we open up PlayerTemplate.ini and find our faction again and then change the "MaxLevelMP = 34" to "MaxLevelMP = 42" we'll earn all the necessary points and our faction will now look like this is PlayerTemplate.ini.

              
Code
PlayerTemplate FactionElves
Side = Elves
PlayableSide = Yes
Evil = No
StartMoney = 0
MaxLevelMP = 42
MaxLevelSP = 78
PreferredColor = R:42 G:190 B:53
IntrinsicSciences = SCIENCE_GOOD
IntrinsicSciencesMP = SCIENCE_ELVES
SpellBook = GoodSpellBook
SpellBookMp = ElvesSpellBook
PurchaseScienceCommandSet = GoodSpellStoreCommandSet
PurchaseScienceCommandSetMP = ElvesSpellStoreCommandSet
DisplayName = INI:FactionElves
DefaultPlayerAIType = RohanSkirmishAI
BeaconName = MultiplayerBeacon
LightPointsUpSound = RohanLightPointsUp
ObjectiveAddedSound = Gui_MissionObjectiveNew
ObjectiveCompletedSound = Gui_MissionObjectiveCompleted
InitialUpgrades = Upgrade_ElvesFaction
BuildableHeroesMP =
SpellStoreCurrentPowerLabel = APT:SpellStoreCurrentEvenstarPower
SpellStoreMaximumPowerLabel = APT:SpellStoreMaximumEvenstarPower
End


OK, so we can we will earn enough points to buy them all, but we haven't actually got a way of buying any of them. Remember in my previous tutorial how we added

              
Code
CommandSet ElvesSpellBookCommandSet
End


and

              
Code
CommandSet ElvesSpellStoreCommandSet
End


to CommandSet.ini? These are what determine the buttons that show up when you click on the Phial/Ring and what icons appear on the left for you to use. Firstly, we'll add our needed buttons to the Phial. The SpellStore governs this so we'll edit this first. The numbers used in my previous diagram also correspond to their position in the Command Set.

You'll see the other factions have a 1 to 8 equals and then a "Command_PurchaseSpellSomething". These are buttons for purchasing sciences. All the names of these buttons can be found in CommandButton.ini but since I haven't added any new Sciences they will also be found in the other Spell Stores. So, to add my buttons to my Command Set i'll need to edit it so it looks like this.

              
Code
CommandSet ElvesSpellStoreCommandSet
1 = Command_PurchaseSpellHeal
2 = Command_PurchaseSpellDraft
3 = Command_PurchaseSpellElvenAllies
4 = Command_PurchaseSpellCloudBreak_MP
5 = Command_PurchaseSpellRohanAllies
6 = Command_PurchaseSpellEagleAllies
7 = Command_PurchaseSpellEntAllies
8 = Command_PurchaseSpellArmyoftheDead
End


So that's all the Phial buttons done. But its no use just being able to purchase our Sciences and not actually use them so we'll need to edit our Spell Book. Its a good idea to keep the same order for your Spell Store and your Spell Book, but it isn't necessary. Once again, all these buttons can be found in CommandButton.ini. So we'll edit our Spell Book so it looks like this.

              
Code
CommandSet ElvesSpellBookCommandSet
1 = Command_SpellBookHeal
2 = Command_SpellBookDraft
3 = Command_SpellBookElvenAllies
4 = Command_SpellBookCloudBreak_MP
5 = Command_SpellBookRohanAllies
6 = Command_SpellBookEagleAllies
7 = Command_SpellBookEntAllies
8 = Command_SpellBookArmyoftheDead
End


We're almost there now, just one last thing we need to do. We need to tell BFME that our new spellbook exists. To do this, where going to need to add our Spellbook to the Good or Evil spellbook depending on what we are. If we open up System.ini (located in the object\system folder) we'll see it says "Object EvilSpellBook" at the top.

If we're creating a new evil spellbook you'll need to edit this, I'm however creating a new good spellbook so i'm going to scroll down and edit the good spellbook. At the end of this objects code we should see two Child Objects. We're going to add our own Child Object to this so that the Object now looks like this.

              
Code
Object GoodSpellBook
EditorSorting = SYSTEM

; *** ART Parameters ***
Draw = W3DDefaultDraw ModuleTag_01
;nothing
End ; Never drawn

Behavior = CloudBreakSpecialPower ModuleTag_CloudBreak_SP
SpecialPowerTemplate = SpellBookCloudBreak_SP
SunbeamObject = CloudBreakSunbeam
ObjectSpacing = 300
AttributeModifier = SpellBookCloudBreak
AttributeModifierAffects = ANY +INFANTRY +CAVALRY +MONSTER -HERO ENEMIES
AttributeModifierRange = 999999

ReEnableAntiCategory = Yes ; cancel negative effects on good guys
AntiCategory = LEADERSHIP
; AntiFX = FX_AntiLeadership ; FX for anti category
AttributeModifierWeatherBased = Yes

TargetAllSides = Yes
AvailableAtStart = No
End

Behavior = CloudBreakSpecialPower ModuleTag_CloudBreak_MP
SpecialPowerTemplate = SpellBookCloudBreak_MP
SunbeamObject = CloudBreakSunbeam
ObjectSpacing = 300
AttributeModifier = SpellBookCloudBreak
AttributeModifierAffects = ANY +INFANTRY +CAVALRY +MONSTER -HERO ENEMIES
AttributeModifierRange = 999999

ReEnableAntiCategory = Yes ; cancel negative effects on good guys
AntiCategory = LEADERSHIP
; AntiFX = FX_AntiLeadership ; FX for anti category
AttributeModifierWeatherBased = Yes

TargetAllSides = Yes
AvailableAtStart = No
End

Behavior = ElvenWoodSpecialPower ModuleTag_ElvenWood
SpecialPowerTemplate = SpellBookElvenWood
ElvenGroveObject = ElvenGrove
ElvenWoodRadius = 150
ElvenWoodFX = FX_ElvenWoodSpellFX
ElvenWoodOCL = OCL_ElvenWoodSeed
; CreateLocation = CREATE_AT_LOCATION
AvailableAtStart = No
End

Behavior = ElvenWoodSpecialPower ModuleTag_ElvenWoodRohan
SpecialPowerTemplate = SpellBookElvenWoodRohan
ElvenGroveObject = ElvenGrove
ElvenWoodRadius = 150
ElvenWoodFX = FX_ElvenWoodSpellFX
ElvenWoodOCL = OCL_ElvenWoodSeed
; CreateLocation = CREATE_AT_LOCATION
AvailableAtStart = No
End

Behavior = PlayerUpgradeSpecialPower SpellBookElvenGifts_ModuleTag
SpecialPowerTemplate = SpellBookElvenGifts
UpgradeName = Upgrade_ElvenGift
UpdateModuleStartsAttack = No
AffectAllies = No ; Should not try to affect ally units
AvailableAtStart = No
End

Behavior = SpecialPowerModule SpellBookDraft_Draft
SpecialPowerTemplate = SpellBookDraft
AttributeModifier = SpellBookDraft
AttributeModifierRange = 999999
AttributeModifierAffects = ANY +SWARM_DOZER
AffectAllies = No ; Should not try to affect ally units
;AttributeModifierFX = FX_Draft now in SubObjectsUpgrade in the unit
UpdateModuleStartsAttack = No
AttributeModifierFX = FX_PeasantVoiceDraftUpgrade ;voice only
;InitiateSound = PeasantVoiceDraftUpgrade ;this didn't work
AvailableAtStart = No
End

Behavior = PlayerHealSpecialPower ModuleTag_Heal
SpecialPowerTemplate = SpellBookHeal
HealAffects = INFANTRY CAVALRY MONSTER MACHINE
HealAmount = 1.0 ; 0.5 = 50% of maximum health
HealRadius = SPELL_HEAL_RADIUS_UNIT_SCAN
HealFX = FX_SpellHealUnitHealBuff ;FX_DefaultUnitHealBuff
; To replenish hordes a bit
HealOCL = OCL_HealSpellHordeReplenishPing
AvailableAtStart = No
End

Behavior = PlayerUpgradeSpecialPower ModuleTag_SpellBookAnduril
SpecialPowerTemplate = SpellBookAnduril
UpgradeName = Upgrade_Anduril
UpdateModuleStartsAttack = No
AffectAllies = No ; Should not try to affect ally units
AvailableAtStart = No
End

Behavior = PlayerUpgradeSpecialPower ModuleTag_SpellBookGandalfWhite
SpecialPowerTemplate = SpellBookGandalftheWhite
UpgradeName = Upgrade_GandalfWhite
UpdateModuleStartsAttack = No
AffectAllies = No ; Should not try to affect ally units
AvailableAtStart = No
End

Behavior = OCLSpecialPower ModuleTag_SummonElves
SpecialPowerTemplate = SpellBookElvenAllies
OCL = OCL_SpawnElvenWarriorsEgg
TriggerFX = FX_ElvenAlliesSummon
CreateLocation = CREATE_AT_LOCATION
UpgradeName = Upgrade_ElvenAllies
AvailableAtStart = No
End

;Behavior = PlayerUpgradeSpecialPower ModuleTag_RohanAllies2
; SpecialPowerTemplate = SpellBookElvenAllies
; UpgradeName = Upgrade_ElvenAllies
;End


Behavior = OCLSpecialPower ModuleTag_SummonRohan
SpecialPowerTemplate = SpellBookRohanAllies
OCL = OCL_SpawnRohanRohirrimEgg
TriggerFX = FX_RohirimSummon
CreateLocation = CREATE_AT_LOCATION
UpgradeName = Upgrade_RohanAllies
AvailableAtStart = No
End

Behavior = OCLSpecialPower ModuleTag_SummonEnts
SpecialPowerTemplate = SpellBookEntAllies
OCL = OCL_SpawnEnts
TriggerFX = FX_SummonEntAllies
CreateLocation = CREATE_AT_LOCATION
UpgradeName = Upgrade_EntAllies
AvailableAtStart = No
End

Behavior = OCLSpecialPower ModuleTag_SummonEagles
SpecialPowerTemplate = SpellBookEagleAllies
OCL = OCL_SpawnEagles
CreateLocation = CREATE_ABOVE_LOCATION
AvailableAtStart = No
End

Behavior = OCLSpecialPower ModuleTag_SummonDead
SpecialPowerTemplate = SpellBookArmyoftheDead
OCL = OCL_GondorArmyofTheDeadEgg ;OCL_SpawnArmyOfTheDead
TriggerFX = FX_SummonAOD
CreateLocation = CREATE_AT_LOCATION
AvailableAtStart = No
End

CommandSet = GoodSpellBookCommandSet
RadarPriority = NOT_ON_RADAR
KindOf = SPELL_BOOK IMMOBILE IGNORES_SELECT_ALL INERT
End

ChildObject RohanSpellBook GoodSpellBook
CommandSet = RohanSpellBookCommandSet
End

ChildObject GondorSpellBook GoodSpellBook
CommandSet = GondorSpellBookCommandSet
End

ChildObject ElvesSpellBook GoodSpellBook
CommandSet = ElvesSpellBookCommandSet
End


And that's it. Our new faction is ready to use our new Spell Book and Spell Store. We're almost complete with our new faction so its ready to play. Look out for the final part in my series "New Factions - Bases" which explains about the adding of .bse files so that you can build castles and camps.

Comments

Display order: Newest first

Ludagorias - Sunday June 20, 2021 - 22:59

Hello and thanks for this guide. However I'm struggling to add Anduril spell to Gondor. I could manage to put Aragorn to the Gondor faction. But the spell book never changes no matter what I try. Here are my modified files:

Science SCIENCE_ElvenAllies
PrerequisiteSciences = SCIENCE_GOOD SCIENCE_ElvenWood OR SCIENCE_ROHAN SCIENCE_Draft OR SCIENCE_ROHAN SCIENCE_Heal
SciencePurchasePointCost = 8
SciencePurchasePointCostMP = 3
IsGrantable = Yes
; DisplayName =
; Description =
End

I erased Gondor prerequistes here as you did for Rohan.

Then I added Gondor prerequistes to Anduril:

PrerequisiteSciences = SCIENCE_GOOD SCIENCE_CloudBreak_SP OR SCIENCE_GOOD SCIENCE_ElvenAllies OR SCIENCE_GOOD SCIENCE_RohanAllies OR SCIENCE_ROHAN SCIENCE_Draft OR SCIENCE_GONDOR SCIENCE_Heal OR SCIENCE_GONDOR SCIENCE_ElvenWood
SciencePurchasePointCost = 8
SciencePurchasePointCostMP = 2
IsGrantable = Yes
; DisplayName =
; Description =
End

I added SCIENCE_GONDOR SCIENCE_ANDURIL to Cloud Break MP and Summon Eagles (since Gondor has Eagles instead of Ents).

Science SCIENCE_CloudBreak_MP
PrerequisiteSciences = SCIENCE_ROHAN SCIENCE_Anduril OR SCIENCE_ROHAN SCIENCE_ElvenAllies OR SCIENCE_GONDOR SCIENCE_GandalftheWhite OR SCIENCE_GONDOR SCIENCE_Anduril
SciencePurchasePointCost = 0
SciencePurchasePointCostMP = 7 ; 6
IsGrantable = Yes
; DisplayName =
; Description =
End

Science SCIENCE_EagleAllies
PrerequisiteSciences = SCIENCE_GOOD SCIENCE_CloudBreak_SP OR SCIENCE_GONDOR SCIENCE_Anduril OR SCIENCE_GONDOR SCIENCE_RohanAllies
SciencePurchasePointCost = 10
SciencePurchasePointCostMP = 6
IsGrantable = Yes
; DisplayName =
; Description =
End
And of course I erased Elven Allies requierement from both of those.

Then I changed the Spell Store and Spell Command, bt deleting Elven Allies and adding Anduril

CommandSet GondorSpellBookCommandSet
    1 = Command_SpellBookHeal
    2 = Command_SpellBookElvenWood
    3 = Command_SpellBookGandalftheWhite
    4 = Command_SpellBookAnduril
5 = Command_SpellBookRohanAllies
    6 = Command_SpellBookCloudBreak_MP
    7 = Command_SpellBookEagleAllies
    8 = Command_SpellBookArmyoftheDead
End

CommandSet GondorSpellStoreCommandSet
    1 = Command_PurchaseSpellHeal
    2 = Command_PurchaseSpellElvenWood
    3 = Command_PurchaseSpellGandalftheWhite
4 = Command_PurchaseSpellAnduril
    5 = Command_PurchaseSpellRohanAllies
    6 = Command_PurchaseSpellCloudBreak_MP
    7 = Command_PurchaseSpellEagleAllies
    8 = Command_PurchaseSpellArmyoftheDead
End

The weird thing here, If I made any mistake, how the game continue to operate with all those missing codes and still provides elven allies for Gondor spell book in skirmish? I don't understand the problem here. Hope there is still someone to give me an answer after 13 years.

{AE}Manveru - Tuesday June 30, 2009 - 17:23

I agree with Sul on the system.ini part. The only change in there is really the bottom ChildObject, and thus the entire ini is not needed. Great tutorial though, really understandable and to the point.

Sulherokhh (Team Chamber Member) - Monday April 30, 2007 - 19:13

Very concise and easy to read. Except for the long extract of the system.ini. A link to the ini could make this a bit shorter. Or better yet, intersperse the entries with some comments that mention what the entry is about, even if we don't need it for the implementation. Good anyway! :)

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

 
4:19:21