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

Create a Hero Attribute guide - Part 2

Tutorial for Battle for Middle-earth II BFME 2

Avatar of Solinx

Solinx

Category: Code
Level: Intermediate
Created: Sunday March 25, 2007 - 10:04
Updated: Saturday June 27, 2009 - 18:56
Views: 10723
Summary: Going beyond the basic enhancement of the CaH attributes.

Rating

Staff says

3.7

Members say

-

Average

3.7/5.0

3 votes

Page 1 2 3 4 5
--- Linking the upgrade to an modifier ---

Now we have defined our upgrade, we need to link it to some code that actually does something. Open ...\data\ini\object\createahero\createaheroattributemodifiers.inc

CaH attributes work like a leadership, they influence the statistics of the unit through a very basic attribute modifier module. Find the following code by searching for 'Upgrade_ArmorAttribute20', our link from the last code we modified.               
Code
Behavior = AttributeModifierUpgrade ModuleTag_ArmorAttribute20
    TriggeredBy            = Upgrade_ArmorAttribute20
    AttributeModifier    = ArmorAttribute20
End
If you look around this code block, you will see that there is a while list of them, each following number in the range has it's own block and that for each separate attribute.

Our additional code will look like this:               
Code
Behavior = AttributeModifierUpgrade ModuleTag_ArmorAttribute21
    TriggeredBy            = Upgrade_ArmorAttribute21
    AttributeModifier    = ArmorAttribute21
End
Each module needs an unique name or you will get an error, either at the start of the game, or when you want to use the specific code.
The TriggeredBy entry contains our own upgrade, which we defined in ...\data\ini\createaheroupgrades.inc
The last entry is the link to our next step, the actual attribute modifier, again, the name is unique and incremental to the last value, to make coding this a lot easier.
We have now linked the upgrade to the actual attribute modifier, only that modifier doesn't exist yet. Out next and last step will be to create the modifier.


Next page: The attribute modifier

Comments

Display order: Newest first

Telcontar - Saturday July 14, 2012 - 12:34

Thanks for the guide. You may want to know that you can adjust the graphics editing createaherosystemattributes.inc

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

 
17:00:59