The 3rd Age

Westernesse

Westernesse

Numenor awaits, with new armies, units, factions and heroes; witness the darkest Age of Middle-earth

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

Creating a Dwarven Hero from CAH

Avatar of robnkarla

robnkarla

Category: Code
Level: Intermediate
Created: Saturday April 7, 2007 - 21:47
Updated: Saturday June 27, 2009 - 18:34
Views: 14909
Summary: Create your own hero off of the Dwarven Sage Create-A-Hero

Rating

Staff says

4.9

Members say

4.1

Average

4.4/5.0

21 votes

Page 1 2 3 4 5 6 7
Special Powers (1)

This page will take you throw the steps to add a special power to your newly created hero. Now there are a number of tutorials to walk you through setting up your powers either from an existing unit or from created heroes, but I'll walk you through this as well.

The first thing that you want to do is figure out which powers you want to use. For this example we will be doing axe throw, leap, and earthshaker.

Axe Throw:
1) Open up the createaheropowers.inc found in \data\ini\object\createahero and look for the axethrow:

              
Code

//--------------------------------------------------------------------------
//    AXE THROW SPECIAL POWER Level 1
//--------------------------------------------------------------------------
Behavior = UnpauseSpecialPowerUpgrade ModuleTag_CreateAHeroAxeThrowEnabler_Level1
    SpecialPowerTemplate = SpecialAbilityCreateAHeroAxeThrow_Level1
    TriggeredBy = Upgrade_CreateAHeroAxeThrow_Level1
End

Behavior = SpecialPowerModule ModuleTag_CreateAHeroAxeThrowStarter_Level1
    SpecialPowerTemplate        = SpecialAbilityCreateAHeroAxeThrow_Level1
    UpdateModuleStartsAttack    = Yes
    StartsPaused            = Yes
    //InitiateSound            = EomerVoiceAttackSpear
End

Behavior = WeaponFireSpecialAbilityUpdate ModuleTag_CreateAHeroAxeThrowUpdate_Level1
    SpecialPowerTemplate = SpecialAbilityCreateAHeroAxeThrow_Level1

    UnpackTime = 1500
    PackTime = 1000

    AwardXPForTriggering = 0
    
    StartAbilityRange        = CREATE_A_HERO_AXE_THROW_DO_POWER_RANGE
    ApproachRequiresLOS        = Yes
    
    SpecialWeapon = CreateAHeroAxeThrow
    WhichSpecialWeapon = 5
End


2) Copy and paste this into the Dwarven[HeroName].ini where noted to put special powers.
3) The first change that we will be doing is to change what upgrade grants this power. Change the TriggeredBy to Upgrade_ObjectLevel# where # is the level that you would like to your hero to gain this power.
              
Code

        TriggeredBy = Upgrade_ObjectLevel1


4) The next thing that you are going to do is change the special weapon from CreateAHeroAxeThrow to [HeroName]AxeThrow where [HeroName] is the name of your hero. The weapon for this is included in the weapon.ini that you copied over earlier.
              
Code

        SpecialWeapon = ThorinAxeThrow


5) If you wish there are a couple other items that you can change - The StartAbililtyRange you can be hard coded or you can define a new value in gamedata.ini. If you wish to change the power refresh timer you will need to create a new specialpower value in your specialpower.ini. You can use SpecialAbilityCreateAHeroAxeThrow_Level1 as a basis.

6) Next we need to create the commandbutton. Look up the Command_CreateAHero_AxeThrow_Level1 in commandbutton.ini.
              
Code

CommandButton Command_CreateAHero_AxeThrow_Level1
Command        = SPECIAL_POWER
SpecialPower        = SpecialAbilityCreateAHeroAxeThrow_Level1
Options        = NEED_TARGET_ENEMY_OBJECT // NEED_TARGET_NEUTRAL_OBJECT CONTEXTMODE_COMMAND
TextLabel        = CONTROLBAR:CAH_AxeThrow_Level1
ButtonImage        = HSAxeThrow
CursorName        = Bombard
ButtonBorderType    = ACTION
DescriptLabel        = CONTROLBAR:ToolTipCAH_AxeThrow_Level1
InvalidCursorName    = GenericInvalid
//UnitSpecificSound    = EomerVoiceModeThrow
InPalantir        = Yes
AutoAbility        = Yes
PresetRange        = 200.0

    CreateAHeroUIAllowableUpgrades                =    Upgrade_CreateAHero_ClassDwarf
    CreateAHeroUIMinimumLevel                    =    1
    CreateAHeroUIPrerequisiteButtonName    = None
    CreateAHeroUICostIfSelected                 = RJ_CAH_AXETHROW_LEVEL1_COST
End


7) Copy and paste this commandbutton to the bottom of the file.
8) Rename the commandbutton, replacing CreateAHero with your hero's name and remove the _Level1. Remember to put a space/tab at the end of the commandbutton name if you wish to reference it in Worldbuilder without an error.
9) If you changed the specialpower name in step 6, change the special power to match what you changed it to.
10) Remove the last 4 lines of code relating to CreateAHero information.
11) If you wish to change the name or hotkey for the command, create a new entry in lotr.str and reference it in the TextLabel line
12) If you wish to change the tooltip for the comand, create a new entry in lotr.str and reference it in the DescriptLabel line.

13) You are finished with the commandbutton it should look something like this:
              
Code

CommandButton Command_Thorin_AxeThrow
Command        = SPECIAL_POWER
SpecialPower        = SpecialAbilityCreateAHeroAxeThrow_Level1
Options        = NEED_TARGET_ENEMY_OBJECT // NEED_TARGET_NEUTRAL_OBJECT CONTEXTMODE_COMMAND
TextLabel        = CONTROLBAR:Thorin_AxeThrow
ButtonImage        = HSAxeThrow
CursorName        = Bombard
ButtonBorderType    = ACTION
DescriptLabel        = CONTROLBAR:ToolTipAxeThrow
InvalidCursorName    = GenericInvalid
InPalantir        = Yes
AutoAbility        = Yes
PresetRange        = 200.0
End


14) Next you will place it in your commandset. Open commandset.ini and search for the entry that you created in the previous step. Copy and paste the commandbutton name into the commandset in the 2nd slot and remove the comment.

15) Last thing to do for the power is to create the AI. You can use the CreateAHero AI as a base. You can find this in \data\ini\object\createaherocreateaheroaipowers.inc:
              
Code

Behavior = AISpecialPowerUpdate AxeThrowL1AI
    CommandButtonName = Command_CreateAHero_AxeThrow_Level1
    SpecialPowerAIType = AI_SPECIAL_POWER_ENEMY_TYPE_KILLER_RANGED
End


16) Change the CommandButtonName to the name of the button created earlier. If you are a perfectionist like me, you can also rename the tag to just AxeThrowAI:
              
Code

Behavior = AISpecialPowerUpdate AxeThrowAI
    CommandButtonName = Command_Thorin_AxeThrow
    SpecialPowerAIType = AI_SPECIAL_POWER_ENEMY_TYPE_KILLER_RANGED
End


Your hero can now throw an axe!!!!!

Next Page...Special powers cont.

Links / Downloads

 HitsAdded
RJ-RotWK2238April 8, 2007 - 2:03
Sage .rar file to use2894April 7, 2007 - 21:48

Comments

Display order: Newest first | Page: 1, 2

Anthem - Saturday October 3, 2009 - 13:18

Well Ingwe, you'll have to do a few things to make that work. Frist you need to set the Weaponsets like this:

              
Code
    WeaponSet
        Conditions = None
        Weapon = PRIMARY [Your melee weapon]
        AutoChooseSources = PRIMARY FROM_PLAYER FROM_SCRIPT FROM_AI
    End    
    WeaponSet
        Conditions = WEAPONSET_TOGGLE_1        
        Weapon = PRIMARY [Your bow]
        AutoChooseSources = PRIMARY FROM_PLAYER FROM_SCRIPT FROM_AI
    End


And then you have to add this:
              
Code

    Behavior = DoCommandUpgrade ModuleTag_CreateAHeroMakeSureArcherUsesBowInitially
        TriggeredBy                        = Upgrade_ObjectLevel1
        GetUpgradeCommandButtonName        = Command_CreateAHero_A_ToggleWeapon
        RemoveUpgradeCommandButtonName    = Command_CreateAHero_A_ToggleWeapon
    End


And then make sure that that the hero gets the upgrade "Upgrade_ObjectLevel1" at level 1. If you want to put the weapon toggle at later levels I don't know what to do at the moment, but if you really want to I'll check it out.

Grey Beard - Wednesday January 21, 2009 - 13:05

can someone not mkae somthing like this for bfme1

Ingwe - Sunday March 2, 2008 - 2:44

Oh ok. Thanks. We figured some of the stuff out as well since then, at the time we were quite stumped. We (chrisbolling2 and me) spent five hours on figuring it out. ROFL. A lot of bling had to be eliminated LoL. Got the sword to turn to a normal bow too. But as far as using switch command set from bow to sword, haven't tried it quite yet.

Ridder Geel (Staff) - Sunday February 10, 2008 - 3:43

Ingwe,
you have to use the code for the bling hiding:
HideSubObjects    =
instead of doing:
Showsubobjects =

I figured that out myself when i was fooling around with the wizard CAH.

If you have noticed there is the 'shining' thing around your hero,
thats because its a dwarf:
you need to remove this part of the coding above the design parameters:

              
Code

    ;Draw module just for the HeroSelection
    Draw = W3DScriptedModelDraw Icon
        ModelConditionState = NONE
            Model                    = Icon02
        End
    End


about your person shooting with a sword you should look in the CreateAHeroWeaponUpgrades.inc
at these 2 weapon things:
Belthronding    Weapon upgrade.
MithlondBow Bow Weapon upgrade.

Im not sure how the toggle weapon thing for the archer CAH works so i can't help alot there...

Oh, and BTW, robnkarla the tutorial is great except for the points i adressed up there.
But without your tutorial i wouldn't have the fun heroes I made, so thanks for the great tutorial!

chrisbolling2 - Friday January 11, 2008 - 15:19

Having the same problem as Ingwe, started a topic in the forums. Tutorial seems a little incomplete to me.

Ingwe - Friday December 14, 2007 - 2:05

I applied this method with an Elven Archer custom hero. All the sounds are right. She has the same powers as Elrond does just because I didn't feel like messing with all that yet. She has a cool upgraded arrow that looks like a Silverthorne arrow (added my own weapon in weapon.ini). And (most) everything works great! Great tutorial. However, there are two problems when I applied this. For one thing, she shoots arrows...with a sword. For another thing, she has tons of bling. She has some kind of tan cape and a shield on the back along with a red hood. I want just a plain hero. I didn't add any bling to the file or anything but the bling is still there! I've searched for things to help on this problem but don't find anything on it. I usually don't like to put up posts asking for help because I like to figure this out myself; alas, I can't for the life of me figure it out. Help. :o

--------

I applied this method with an Elven Archer custom hero. All the sounds are right. She has the same powers as Elrond does just because I didn't feel like messing with all that yet. She has a cool upgraded arrow that looks like a Silverthorne arrow (added my own weapon in weapon.ini). And (most) everything works great! Great tutorial. However, there are two problems when I applied this. For one thing, she shoots arrows...with a sword. For another thing, she has tons of bling. She has some kind of tan cape and a shield on the back along with a red hood. I want just a plain hero. I didn't add any bling to the file or anything but the bling is still there! I've searched for things to help on this problem but don't find anything on it. I usually don't like to put up posts asking for help because I like to figure this out myself; alas, I can't for the life of me figure it out. Help. :o

--------

I applied this method with an Elven Archer custom hero. All the sounds are right. She has the same powers as Elrond does just because I didn't feel like messing with all that yet. She has a cool upgraded arrow that looks like a Silverthorne arrow (added my own weapon in weapon.ini). And (most) everything works great! Great tutorial. However, there are two problems when I applied this. For one thing, she shoots arrows...with a sword. For another thing, she has tons of bling. She has some kind of tan cape and a shield on the back along with a red hood. I want just a plain hero. I didn't add any bling to the file or anything but the bling is still there! I've searched for things to help on this problem but don't find anything on it. I usually don't like to put up posts asking for help because I like to figure this out myself; alas, I can't for the life of me figure it out. Help. :o

Bart (Administrator) - Monday June 25, 2007 - 7:34

check out data\ini\mappedimages\

{IP}Sauron - Monday June 25, 2007 - 4:44

@aragon94: the reason why some commandbuttons is on the same pic is becuz there's a ini file which cut out small reas of the image and name it :P

aragon94 - Monday June 4, 2007 - 4:27

Ok, I found the portraits... But they are with the CommandButton images in the same pic!! Does anyone know how to make the portrait then??

aragon94 - Monday June 4, 2007 - 4:24

By the way, where is the art folder where you put the portrait into? I only find apt, not art.

I always wondered where the CommandButton images and the hero portraits are...

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

 
16:36:31