The 3rd Age

The Horse Lords

The Horse Lords

A mod intended to enhance The Rise of the Witch King and add a new campaign

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

Ultimate beginner's guide. New hero, many topics

Avatar of malvack

malvack

Category: Code
Level: Beginner
Created: Saturday March 5, 2016 - 7:37
Updated: Tuesday October 11, 2016 - 8:19
Views: 7519
Summary: Guide to make new hero based on CaH and many other topics

Rating

Staff says

-

Members say

5.0

Average

5.0/5.0

2 votes

Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Your hero is now looking good, sounding good, and behaving good, and for some reason the AI doesn't seem to like him/her very much, so here I will talk about the basic AI your hero needs. First will let the AI to recruit your hero, to accomplish this we'll need to go to the data>ini>default>skirmishaidata.ini file, when you open it you'll see the basics of all the AI. So, now that you're here we must go to your faction's ArmyDefinition. If you scroll down you'll see a variable named "HeroBuildOrder", what this variable does is to set a pattern to create certain heroes.

Picture 2 different factions, one has this HeroBuildOrder instances:

HeroBuildOrder = RingHero Hero1 Hero2 Hero3 Hero4

What this does is that tells the AI "first try to create the Ring Hero (if you have the One Ring and enough money)", if it fails to create the Ring Hero, it will jump to Hero1 and then to Hero2 and so on, once it's done with the list, it will start all over again. The jumps are NOT done immediately one after the other, it takes a little while to make a jump.

Now take for example the next HeroBuildOrder

HeroBuildOrder = RingHero Hero1 Hero2 Hero1 Hero3 Hero4 Hero1

With this order the AI will do the exact same thing as explained before, however having multiple instances of the same hero will increase the odds to make the AI recruit that hero. In the example above, it is very likely that the AI will recruit Hero1, simply because it has more entries.

Having this in mind, go to the HeroBuildOrder of your faction and place the name of your hero, in my case this will look like:

              
Code

HeroBuildOrder = MordorSauron_RingHero AngmarMalvack AngmarWitchking AngmarRogash AngmarMalvack AngmarMorgramir AngmarHwaldar AngmarKarsh


0k. Now the AI will recruit your hero, but it won't use his/her powers majorly because it doesn't know how to use them. For the most part, every power has an AI module somewhere, this module tells the AI how to use a power, the parameter that the AI needs to know is the commandbutton name of the power.

So let's give our hero the AI modules of his powers; the first power he had was Gloin's Shake Foundation, so we go to Gloin's ini file and look for that module, after looking for it we found this:

              
Code

    Behavior = AISpecialPowerUpdate ShakeFoundationAI
        CommandButtonName = Command_SpecialAbilityDwarvenGloinShakeFoundation
        SpecialPowerAIType    = AI_SPECIAL_POWER_ENEMY_TYPE_KILLER_STRUCTURES
        SpecialPowerRange    = 200
    End


Look how it doesn't tell which SpecialPowerTemplate is using, but the name of the commandbutton that is linked to the power. We copy this module and paste it in malvack.ini somewhere in the bottom of the file. Now we have to change the name of the commandbutton so the AI actually use the power. Now malvack's file will look like this:

              
Code

    Behavior = AISpecialPowerUpdate ShakeFoundationAI
        CommandButtonName = Command_SpecialAbilityAngmarMalvackShakeFoundation
        SpecialPowerAIType    = AI_SPECIAL_POWER_ENEMY_TYPE_KILLER_STRUCTURES
        SpecialPowerRange    = 200
    End


For the CaH's AI you have to go to the data>ini>object>createahero>createaheroaipowers.inc file and copy the AI modules that you want. For the spellbook powers you go to data>ini>object>system>system.ini and there you'll find the AI modules for all the spellbook powers. Once you copy/paste the modules and change the commandbutton names yourhero.ini file should look like this:

              
Code


    ;///////////////////
    ; AISpecialPowers
    ;///////////////////
    
    Behavior = AISpecialPowerUpdate GondorFighterHordeStanceBattle
        CommandButtonName = Command_SetStanceBattle
        SpecialPowerAIType = AI_SPECIAL_POWER_STANCEBATTLE
    End

    Behavior = AISpecialPowerUpdate GondorFighterHordeStanceAggressive
        CommandButtonName = Command_SetStanceAggressive
        SpecialPowerAIType = AI_SPECIAL_POWER_STANCEAGGRESSIVE
    End

    Behavior = AISpecialPowerUpdate GondorFighterHordeHoldGround
        CommandButtonName = Command_SetStanceHoldGround
        SpecialPowerAIType = AI_SPECIAL_POWER_STANCEHOLDGROUND
    End
    Behavior = AISpecialPowerUpdate ShakeFoundationAI
        CommandButtonName = Command_SpecialAbilityAngmarMalvackShakeFoundation
        SpecialPowerAIType    = AI_SPECIAL_POWER_ENEMY_TYPE_KILLER_STRUCTURES
        SpecialPowerRange    = 200
    End

Behavior = AISpecialPowerUpdate CrippleStrikeMeleeHotWL2AI
    CommandButtonName = Command_MalvackCrippleStrikeMelee
    SpecialPowerAIType = AI_SPECIAL_POWER_ENEMY_TYPE_KILLER
End

    Behavior = AISpecialPowerUpdate SpellBookDarknessAI
        CommandButtonName = Command_SpecialAbilityMalvackDarkness
        SpecialPowerAIType = AI_SPELLBOOK_ALWAYS_FIRE
        SpecialPowerRadius = 100
    End



You can delete the AI modules of Boromir BTW.

Now not only the AI will recruit your hero, but will also know how to use him/her.

Links / Downloads

 HitsAdded
WinXPSoundRecorder581March 6, 2016 - 7:03
FinalBigEditor712March 5, 2016 - 8:29

Comments

Display order: Newest first

Amonrath - Monday August 14, 2017 - 4:16

Hello! I'm trying to do the but in the bfme I. Is there any different steps? I created a folder with my own mod... I then just edit the values that I want and I save them... I have also added the -mod in the end of the "Path" as well as done the lotr.srt extraction. Could anyone help? Thanks =D

--------

Hello! I'm trying to do the but in the bfme I. Is there any different steps? I created a folder with my own mod... I then just edit the values that I want and I save them... I have also added the -mod in the end of the "Path" as well as done the lotr.srt extraction. Could anyone help? Thanks =D

BouncyKnight - Wednesday April 26, 2017 - 0:08

Amazing step-by-step, very detailed and explanatory tutorial on how to create your custom heroes! Thank you sir, you're great!

Gabriel Oak - Tuesday December 13, 2016 - 12:19

I created this account only to thank you, sir. This tutorial is really, really useful.

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

 
13:49:02