The 3rd Age

BFME+

BFME+

A mod that intends to bring back the fun to 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

Weapons

Tutorial for Battle for Middle-earth II BFME 2

Avatar of Ridder Geel

Ridder Geel

Category: Code
Level: Intermediate
Created: Saturday February 9, 2008 - 8:20
Updated: Thursday December 15, 2011 - 14:27
Views: 18912
Summary: About Weapons, Weapon 'Leveling' and how to make a 'MorgulBlade' weapon effect.

Rating

Staff says

3.7

Members say

4.5

Average

4.4/5.0

20 votes

Page 1 2 3 4 5 6 7
Leveling Spear
This Tutorial will show you how to make your spear become stronger as your hero levels up!
In this tutorial 'myhero' will be Jack and he is going to throw a spear that gets stronger everytime he levels up!

NOTE
If you are going to do this then I do expect you to know what you are going to do and that you have a fairly good understanding about coding.
This tutorial will not teach you how to understand everything I'm doing here, but if you read other tutorials about the INI's that are listed down there then you should be able to have a basic idea about what im doing.
One last thing, you should know how to add commandsets and buttons since i wont be telling that.


INI's Needed:
-'Myhero'.ini *the hero you are editing
-Upgrade.ini
-experiencelevels.ini
-Weapon.ini

-'MyHero'.ini-
Open your hero's ini and add this to his specialpowers area:

              
Code

    //--------------------------------------------------------------------------    
    //    THROW SPEAR SPECIAL POWER
    //--------------------------------------------------------------------------
    Behavior = UnpauseSpecialPowerUpgrade ModuleTag_SmiteEnabler
        SpecialPowerTemplate = SpecialAbilitySpearThrow
        TriggeredBy = Upgrade_JackSpearThrow
    End

    Behavior = SpecialPowerModule ModuleTag_EowynSmiteStarter
        SpecialPowerTemplate        = SpecialAbilitySpearThrow
        UpdateModuleStartsAttack    = Yes
        StartsPaused            = Yes
    End

    Behavior = WeaponFireSpecialAbilityUpdate ModuleTag_SpecialAbilitySmiteUpdate
        SpecialPowerTemplate = SpecialAbilitySpearThrow

        UnpackTime = 1200
        PackTime = 2000

        AwardXPForTriggering = 0
        
        StartAbilityRange        = 275.0
        ApproachRequiresLOS        = Yes
        
        SpecialWeapon = JackSpear
        WhichSpecialWeapon = 1
    End


Your hero will now use the 'JackSpear' as the weapon he throws.

-Upgrade.ini-
Open the Upgrade.ini
Go all the way to the bottom of the file and add this code.
              
Code

Upgrade Upgrade_JackSpearThrow
Type                = OBJECT
End

Upgrade Upgrade_JackSpearLVL1
Type                = OBJECT
End

Upgrade Upgrade_JackSpearLVL2
Type                = OBJECT
End

Upgrade Upgrade_JackSpearLVL3
Type                = OBJECT
End

Upgrade Upgrade_JackSpearLVL4
Type                = OBJECT
End


Most of these 'upgrades' you don't have to worry about for now.
You should have noticed that we start with the upgrade Upgrade_JackSpearThrow.
We will put this upgrade in the experience.ini later on.
The upgrades after that one are the ones which will enable the spear to become stronger as 'Jack' Levels up.
In this tutorial I will only use the spear upgrades till lvl 4, but you can just add your own upgrades to make it go up to LVL 10 or higher.

-experiencelevels.ini-
We will now add the upgrades to 'Jacks' experience levels...

Add this code at the bottom of the file:

              
Code

ExperienceLevel    JackLevel1
    TargetNames                        =    Jack    
    RequiredExperience                =    1    
    ExperienceAward                    =    FARAMIR_LVL1_EXP_AWARD
    Rank                            =    1
    Upgrades                        =    Upgrade_JackSpearThrow Upgrade_JackSpearLVL1
    SelectionDecal
        Texture                        =    decal_hero_good
        Style                        =    SHADOW_ALPHA_DECAL
        OpacityMin                    =    50%    
        OpacityMax                    =    100%
        MinRadius                    =    40
        MaxRadius                    =    200
        MaxSelectedUnits            =    40
    End    
End    

ExperienceLevel    JackLevel2
    TargetNames                        =    Jack    
    RequiredExperience                =    FARAMIR_LVL2_EXP_NEEDED
    ExperienceAward                    =    FARAMIR_LVL2_EXP_AWARD
    LevelUpFx                        =    FX:GandalfLevelUp1FX
    Rank                            =    2
    AttributeModifiers                =    HeroLevelUpDageel1
    Upgrades                        =    Upgrade_JackSpearLVL2
    SelectionDecal
        Texture                        =    decal_hero_good
        Style                        =    SHADOW_ALPHA_DECAL
        OpacityMin                    =    50%    
        OpacityMax                    =    100%
        MinRadius                    =    40
        MaxRadius                    =    200
        MaxSelectedUnits            =    40
    End    
End    

ExperienceLevel    JackLevel3
    TargetNames                        =    Jack    
    RequiredExperience                =    FARAMIR_LVL3_EXP_NEEDED
    ExperienceAward                    =    FARAMIR_LVL3_EXP_AWARD     
    LevelUpFx                        =    FX:GandalfLevelUp1FX
    Rank                            =    3
    Upgrades                        =    Upgrade_JackSpearLVL3
    AttributeModifiers                =    HeroLevelUpDageel2
    SelectionDecal
        Texture                        =    decal_hero_good
        Style                        =    SHADOW_ALPHA_DECAL
        OpacityMin                    =    50%    
        OpacityMax                    =    100%
        MinRadius                    =    40
        MaxRadius                    =    200
        MaxSelectedUnits            =    40
    End    
End    

ExperienceLevel    JackLevel4
    TargetNames                        =    Jack    
    RequiredExperience                =    FARAMIR_LVL4_EXP_NEEDED
    ExperienceAward                    =    FARAMIR_LVL4_EXP_AWARD     
    LevelUpFx                        =    FX:GandalfLevelUp1FX
    Rank                            =    4
    Upgrades                        =    Upgrade_JackSpearLVL4
    AttributeModifiers                =    HeroLevelUpDageel3
    SelectionDecal
        Texture                        =    decal_hero_good
        Style                        =    SHADOW_ALPHA_DECAL
        OpacityMin                    =    50%    
        OpacityMax                    =    100%
        MinRadius                    =    40
        MaxRadius                    =    200
        MaxSelectedUnits            =    40
    End    
End


For your information all I did was add the upgrades Upgrade_JackSpearLVL1 till LVL 4 and add the Upgrade_JackSpearThrow at JackLevel1
So if you have other upgrades for your hero all you have to do is add those upgrades Manually to your character's Experience levels.
And remember in this tutorial I will only go till lvl 4, but you can make it go up to LVL 10 or higher.

-Weapon.ini-
So finally we are going to make the Weapon for our hero's spear.

Add this code to the bottom of your weapon.ini:
              
Code

Weapon JackSpear                        ; BALANCE Rohan Eomer Spear Weapon
    AttackRange         = 300.0
    LeechRangeWeapon        = Yes
    WeaponSpeed            = 261                ; dist/sec
    MinWeaponSpeed        = 201
    MaxWeaponSpeed         = 301                ; dist/sec Upper limit on scaling, when attacking past nominal "max" range
    FireFX             = FX_EomerSpearThrow
    ScaleWeaponSpeed         = Yes                ; Used for lob weapons, scales speed proportional to range
    HitPercentage        = 100
    ScatterRadius     = 0.0                ;When this weapon misses it can randomly miss by as much as this distance.
    AntiAirborneVehicle = Yes
    AntiAirborneMonster    = Yes

    PreAttackDelay        = 1
    PreAttackType        = PER_SHOT            ; Do the delay each time we attack a new target
    FiringDuration        = 2000            ; Duration of the archer firing shot is 500ms.
    HoldAfterFiringDelay    = 2000

    ProjectileNugget                        ; A Nugget that creates an Object and sends it to the target with a Warhead
        ProjectileTemplateName    = RohanEomerSpearProjectile
        WarheadTemplateName    = JackSpearWarheadLVL1
        ForbiddenUpgradeNames    = Upgrade_JackSpearLVL2 Upgrade_JackSpearLVL3 Upgrade_JackSpearLVL4
    End
    ProjectileNugget ; LVL 2
        ProjectileTemplateName    = RohanEomerSpearProjectile
        WarheadTemplateName    = JackSpearWarheadLVL2
        RequiredUpgradeNames    = Upgrade_JackSpearLVL2
        ForbiddenUpgradeNames    = Upgrade_JackSpearLVL3 Upgrade_JackSpearLVL4
    End
    ProjectileNugget ; LVL 3
        ProjectileTemplateName    = RohanEomerSpearProjectile
        WarheadTemplateName    = JackSpearWarheadLVL3
        RequiredUpgradeNames    = Upgrade_JackSpearLVL3
        ForbiddenUpgradeNames    = Upgrade_JackSpearLVL4
    End
    ProjectileNugget ; LVL 4
        ProjectileTemplateName    = RohanEomerSpearProjectile
        WarheadTemplateName    = JackSpearWarheadLVL4
        RequiredUpgradeNames    = Upgrade_JackSpearLVL4
    End
End

;-----------------------------------

Weapon JackSpearWarheadLVL1
    RadiusDamageAffects    = ENEMIES NEUTRALS NOT_SIMILAR
    FireFX            = FX_GondorSwordHit
    HitStoredTarget        = Yes
    DamageNugget                  ; A basic Nugget that just does damage
        Damage        = 1000
        ;Spear Bad Against Buildings, Perfect For Flying Units, Good For Breaking Ships.    
        DamageScalar    = 5% NONE +STRUCTURE
        DamageScalar    = 400% NONE +MordorFellBeast +MordorWitchKingOnFellBeast +GondorGwaihir +Drogoth
        DamageScalar    = 200% NONE +EvilMenCorsairShip +EvilShoreBombardShip +EvilFireShip +ElvenBattleShip +ElvenFireShip +ElvenShoreBombardShip            
        Radius        = 15
        DelayTime        = 0
        DamageType        = MAGIC
        DamageFXType    = SWORD_SLASH
        DeathType        = NORMAL
    End
End

Weapon JackSpearWarheadLVL2
    RadiusDamageAffects    = ENEMIES NEUTRALS NOT_SIMILAR
    FireFX            = FX_GondorSwordHit
    HitStoredTarget        = Yes
    DamageNugget                  ; A basic Nugget that just does damage
        Damage        = 1000
        ;Spear Bad Against Buildings, Perfect For Flying Units, Good For Breaking Ships.    
        DamageScalar    = 5% NONE +STRUCTURE
        DamageScalar    = 400% NONE +MordorFellBeast +MordorWitchKingOnFellBeast +GondorGwaihir +Drogoth
        DamageScalar    = 200% NONE +EvilMenCorsairShip +EvilShoreBombardShip +EvilFireShip +ElvenBattleShip +ElvenFireShip +ElvenShoreBombardShip            
        Radius        = 15
        DelayTime        = 0
        DamageType        = MAGIC
        DamageFXType    = SWORD_SLASH
        DeathType        = NORMAL
    End
End

Weapon JackSpearWarheadLVL3
    RadiusDamageAffects    = ENEMIES NEUTRALS NOT_SIMILAR
    FireFX            = FX_GondorSwordHit
    HitStoredTarget        = Yes
    DamageNugget                  ; A basic Nugget that just does damage
        Damage        = 1500
        ;Spear Bad Against Buildings, Perfect For Flying Units, Good For Breaking Ships.    
        DamageScalar    = 5% NONE +STRUCTURE
        DamageScalar    = 400% NONE +MordorFellBeast +MordorWitchKingOnFellBeast +GondorGwaihir +Drogoth
        DamageScalar    = 200% NONE +EvilMenCorsairShip +EvilShoreBombardShip +EvilFireShip +ElvenBattleShip +ElvenFireShip +ElvenShoreBombardShip            
        Radius        = 15
        DelayTime        = 0
        DamageType        = MAGIC
        DamageFXType    = SWORD_SLASH
        DeathType        = NORMAL
    End
End

Weapon JackSpearWarheadLVL4
    RadiusDamageAffects    = ENEMIES NEUTRALS NOT_SIMILAR
    FireFX            = FX_GondorSwordHit
    HitStoredTarget        = Yes
    DamageNugget                  ; A basic Nugget that just does damage
        Damage        = 2000
        ;Spear Bad Against Buildings, Perfect For Flying Units, Good For Breaking Ships.    
        DamageScalar    = 5% NONE +STRUCTURE
        DamageScalar    = 400% NONE +MordorFellBeast +MordorWitchKingOnFellBeast +GondorGwaihir +Drogoth
        DamageScalar    = 200% NONE +EvilMenCorsairShip +EvilShoreBombardShip +EvilFireShip +ElvenBattleShip +ElvenFireShip +ElvenShoreBombardShip            
        Radius        = 15
        DelayTime        = 0
        DamageType        = MAGIC
        DamageFXType    = SWORD_SLASH
        DeathType        = NORMAL
    End
End


Your hero now throws this spear, which becomes stronger when your hero levels up!
If you want to add more then you should look at the principle I have used up there.
Its fairly simple: to add more levels you must add more upgrades to the projectilenuggets and you must make more warheads for the spear...

Your spear throw should now work!
Just a little tip: don't forget to add the command button Command_RohanEomerSpear to your hero's commandset!

On The Next Page:
How to make the spear change color as you level up...

Links / Downloads

 HitsAdded
Available DamageTypes2065February 10, 2008 - 18:15
JackSpearLVL4exspearglow.tga -@Page31760February 9, 2008 - 12:02

Comments

Display order: Newest first | Page: 1, 2

Sauron-the-Deciever - Thursday December 1, 2011 - 3:10

Flank bonus means the bonus for attacking units from behind

modboy451 - Friday November 12, 2010 - 10:34

Excellent Article!
Thanks, Im using different forms of morgul blades now (that give me different thing)
i was wanting to know how to put poison and flame onto my heros weapons too, thanks!

Ridder Geel (Staff) - Saturday July 4, 2009 - 11:56

In weapon.ini....
change this line:
        Damage            = GLORFINDEL_SWORD_DAMAGE
to a different value...
Simple...
Next time ask this in the forums.

elvenlord95 - Thursday July 2, 2009 - 8:19

e...how can i make a hero's weapon(for example glorfindels) making more damage?
"the sky has fallen"

Ridder Geel (Staff) - Thursday April 30, 2009 - 7:23

1. Good idea ;)
2. Reformat, will do that later.
3. I didn't click on it alot. I usually do check the tutorial for replies or comments and such once every day, and i think that maybe because of this tutorials subject some people open the tutorial more than once to check out some things about some nuggets and such. I sometimes even go here to check some of the nuggets ;)

Behavior? do you mean all the things from in the "Engineering" part of the "Unit" or "Structure"? If thats the case then I will consider making that later.

Sulherokhh (Team Chamber Member) - Wednesday April 29, 2009 - 1:33

1. How about you list any changes on page 1?
2. Don't you think a reformat would help reading? (like removal of empty space, etc.)
3. How long did it take you to click on the tutorial so it would appear in the top ten popular section? ;-)

Can you answer those questions? I might give it a 4 instead of 3. :)

Otherwise, this is just what is needed, a very thankful job indeed.
Now a comprehensive listing of 'Behavior'-modules with a listing of all toggles would be nice indeed ... in an additional tutorial.

Masterbadeend - Wednesday April 29, 2009 - 1:05

I think Flanking Bonus is this: When the unit flanks (yellow lightning bolt) an another unit then he gets for example +50% extra damage to that other unit.

Zarmoz - Tuesday March 10, 2009 - 2:44

You are the best of the best. good job!

I have made Aragorn have a Poisonous sword, Gandalf with Flame sword, Legolas with magic bow, Frodo with poisonous dagger and create a heros have flame if they're swordsman or poison if they're archer. ;)

dethwaker3 - Monday October 27, 2008 - 21:36

I am definitely gonna use the get healed by attacking units!!!!

Lurtzy - Tuesday June 10, 2008 - 14:11

Helped me get started a while ago, good tutorial!

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

 
12:22:33