The 3rd Age

Return of Shadow

Return of Shadow

A large scale mod that greatly expands the game.

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, Battle for Middle-earth II: Rise of the Witch-king ROTWK

Avatar of Solinx

Solinx

Category: Code
Level: Intermediate
Created: Sunday March 25, 2007 - 10:04
Updated: Saturday June 27, 2009 - 18:56
Views: 10347
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
--- The attribute modifier ---


Open up ...\data\ini\attributemodifier.ini and do a search for 'ArmorAttribute20'. You will find this code               
Code
ModifierList ArmorAttribute20
    Category                    = INNATE_ARMOR
    Modifier                    = ARMOR    #MULTIPLY( CREATE_A_HERO_ATTRIBUTE_MULTIPLIER 0.80 )
//    FX                            =
    Duration                    = 0
    ReplaceInCategoryIfLongest    = Yes
End
This is the current maximum attribute modifier for armor. Above this codeblock you will find all the lower modifiers for the armor attribute. They are all sorted in the Category INNATE_ARMOR.
The next line is the core of the modifier, namely the effect. "ARMOR" states that the modifier will affect the amor statistic of the object. At the top of the ini file there is a list with possible statistics that can be changed with a modifier.
Then comes the actual input of the change. EA used a multiply format for the attributes, multiplying a macro that is set to equal 1 (You can find this in ...\data\ini\createaherogamedata.inc) with a numeric value.

From ArmorAttribute01 to ArmorAttribute20 this value has increased from 0.25 to 0.80 with steps of .05, 0.02, 0.03 and again with steps of 0.05. For ArmorAttribute21 I will add another 0.05, making it 0.85.

There are a few more lines left to the code block. The first is the FX. This line is commented out, which means the engine will skipp the line. The effect is innate, so it won't show a visible effect.
The second line is the duration, which is set to 0. My best guess is that this will make the effect last permanent.
The last line, ReplaceInCategoryIfLongest = yes, makes sure that during the creation of you hero, if you switch between attribute values, the modifier with the highest effect is chosen.

So, the code for my 21st attribute modifier will look like this:               
Code
ModifierList ArmorAttribute21
    Category                    = INNATE_ARMOR
    Modifier                    = ARMOR    #MULTIPLY( CREATE_A_HERO_ATTRIBUTE_MULTIPLIER 0.85 )
//    FX                            =
    Duration                    = 0
    ReplaceInCategoryIfLongest    = Yes
End


Now when you have been looking at ...\data\ini\createaherogamedata.inc, you may have noticed that there is more to be found than just the multiply constant that is used for the modifiers. You will also find the base values for health and vision. The base damage can be found at the weapon code, and the armor base would be in the armor code. Teaching how to modifying these two would be the start of another guide.


Next page: To sum it up and endnotes

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

 
3:35:57