The 3rd Age

MasterHero Mod 1.8.1

MasterHero Mod 1.8.1

Modifications&Additions@RingHeroes+Heroes+Factions+Units+System+SpellBook+Theme+AI+new play-style

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: 18748
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
Weapons & Nuggets in detail

This Tutorial will show you more about weapons and damagenuggets.


NOTE
I Suggest that you have read the Weapons & Weaponsets by Hostile article before you read this tutorial, but you don't have to since I will be explaining a bit about the basics too...

This tutorial does not require you to do anything, it is just for you to find out more things about weapons and damagenuggets.

For all the damage types look in the file: DamageTypes which you can download at the bottom of this page!

WEAPONS

Weapons are the basic things you need for a unit to be able to do any damage at all.
Here is an example of a Weapon with descriptions of the different parts:
              
Code

Weapon HobbitSword ; BALANCE Hobbit Sword Weapon
    LeechRangeWeapon = Yes        ;Once fired is it avoidable?
    AttackRange = 20.0        ;How far can you be from the target and still be able to attack?
    MeleeWeapon = Yes        ;Is it a melee weapon?
    DelayBetweenShots = HOBBIT_SWORD_DELAYBETWEENSHOTS ; time between shots, msec
    PreAttackDelay = HOBBIT_SWORD_PREATTACKDELAY ; 433 is natural time of the stabbing animation.
    PreAttackType = PER_SHOT                ; Do the delay each time we attack a new target
    FiringDuration = HOBBIT_SWORD_FIRINGDURATION ; min 600 for anim
    FireFX = FX_GondorSwordHit        ;FX Played when fired
    FireFlankFX        = FX_Flanking            ;FX Played when Flanking

    DamageNugget ; A basic Nugget that just does damage
        Damage = HOBBIT_SWORD_DAMAGE ; The amount of damage the nugget does
        Radius = 0.0            ; How far from target do other units get hurt?
        DelayTime = 0            ; Time it takes for the nugget to be used
        DamageType = CRUSH     ;What kind of damage is it?
        DamageFXType = SWORD_SLASH ;used to cross with their DamageFX listing to determine what effect to play
        DeathType = NORMAL ;What kind of death does the unit have when killed, EX: Burning, Normal, Crushed
        FlankingBonus = 50%        ;Damage% added when you attack a unit from behind
    End
End


This is the basics of the Hobbitsword weapon. If you read all the descriptions on the side you should pretty much be able to understand what each part of the weapon does.

A Ranged weapon has a not so different kind of code:
I'm not going to put descriptions to things I have already mentioned

              
Code

;------------------------------------------------------------------------------
; Merry and Pippin use these to throw rocks
Weapon HobbitRockThrow ; BALANCE Hobbit Weapon Rock
    AttackRange = HOBBIT_ROCK_RANGE
    WeaponSpeed = 150.0 ; dist/sec (huge value == effectively instant)
    AcceptableAimDelta = 20        ; prevent twitchy reaiming in horde on horde
    PreAttackDelay = 500        
    PreAttackType = PER_SHOT
    HitPercentage     = 0 ; never auto hits, always hits ground
    ScatterRadius     = 0.0 ;When this weapon misses it can randomly miss by as much as this distance.
    FiringDuration            = 1200
    DelayBetweenShots        = 3166
    CanFireWhileMoving        = Yes    ;This is Self-explanatory

    ProjectileNugget ; A Nugget that creates an Object and sends it to the target with a Warhead
        ProjectileTemplateName = HobbitRockProjectile    ;The object that goes to target
        WarheadTemplateName = HobbitRockThrowWarhead    ;The warhead, or thing that does damage when it hits
    End
End

;----------------------------
Weapon HobbitRockThrowWarhead        ;The Warhead mentioned up there
    FireFX         = FX_ImpactHobbitRock
    ProjectileCollidesWith = ENEMIES NEUTRAL STRUCTURES WALLS ; What can it collide with?
    RadiusDamageAffects    = ENEMIES            ;who does the radius damage affect?
    HitStoredTarget = Yes    ; Always hits initial target.
    DamageNugget ; A basic Nugget that just does damage
        Damage = HOBBIT_ROCK_DAMAGE    ; ; The *DAMAGE* Done
        DamageScalar = 25% ANY +HERO +STRUCTURE +INFANTRY -MONSTER ; how much % of the *Damage* these units take
        DamageScalar = 50% ANY +MONSTER        ; how much % of the *Damage* these units take
        Radius = 0.0 ; HitStoredTarget means we hurt the person we launched at. And nobody else. So a miss hurts nobody.
        DelayTime = 0
        DamageType = HERO_RANGED
        DamageFXType = SMALL_ROCK
        DeathType = NORMAL
    End
End


A ranged weapon from a hobbit is somewhat different from another units bow:

              
Code

;------------------------------------------------------------------------------
Weapon GondorRangerBow
    AttackRange = GONDOR_RANGER_RANGE
    
    RangeBonusMinHeight = 10 ;how much higher than target do i have to be to have an longer range
    RangeBonus        = 1    ;range advantage gotten from height
    RangeBonusPerFoot    = 1 ; ;range advantage gotten per foot
    
    LeechRangeWeapon = Yes
    WeaponSpeed     = 321 ; dist/sec
    MinWeaponSpeed     = 241
    MaxWeaponSpeed     = 481 ; dist/sec Upper limit on scaling, when attacking past "max" range
    FireFX                 = FX_RohanArcherBowWeapon
    PlayFXWhenStealthed = Yes    ;does FX play even though unit is stealthed?
    ScaleWeaponSpeed     = Yes ; Used for lob weapons, scales speed proportional to range
    HitPercentage     = 100 ;Chance it hits target '100 = Always'
    ScatterRadius     = 16.0
    
    AcceptableAimDelta    = 20
    DelayBetweenShots     = 0
    PreAttackDelay = GONDOR_RANGER_BOW_PREATTACKDELAY
    PreAttackType = PER_SHOT
    PreAttackRandomAmount = 0
    FiringDuration = 0
    
    ClipSize             = 1    ;How many of the projectilenuggets are shot at one shot?
    AutoReloadsClip     = Yes
    AutoReloadWhenIdle     = 1    
    ClipReloadTime         = 1366 ; Time to reload
    ContinuousFireOne    = 2 ; how many shots at the same target constitute CONTINUOUS_FIRE_MEAN
    WeaponBonus = CONTINUOUS_FIRE_MEAN RATE_OF_FIRE 225% ; ;
    ContinuousFireCoast    = GONDOR_RANGER_BOW_RELOADTIME_MAX ;how long in ms can the weapon coast without firing before it loses continuous fire status and enters CONTINUOUS_FIRE_SLOW state
    
    AntiAirborneVehicle    = Yes    ;can hit airborne things?
    AntiAirborneMonster    = Yes    ;can hit airborne things?
    HitPassengerPercentage    = 20%
    CanBeDodged = Yes ; Will check for a DodgePercent on the target to see if he can dodge it
    
    ProjectileNugget ; Default arrow
        ProjectileTemplateName = GoodFactionArrow
        WarheadTemplateName = GondorRangerBowWarhead
        ForbiddenUpgradeNames = Upgrade_GondorFireArrows ;upgrades not allowed for shooting this
    End
    ;Fire arrow available from fire arrow upgrade
    ProjectileNugget    ;Nugget used when *Upgrade_GondorFireArrows* is purchased
        ProjectileTemplateName = GoodFactionFireArrow
        WarheadTemplateName = GondorRangerBowFireWarhead
        RequiredUpgradeNames = Upgrade_GondorFireArrows    ;upgrades needed for shooting this
    End
End

;----------------------------
Weapon GondorRangerBowWarhead
    ProjectileCollidesWith = ENEMIES NEUTRAL STRUCTURES WALLS
    RadiusDamageAffects = ENEMIES NEUTRALS ALLIES NOT_SIMILAR
    HitStoredTarget = Yes    ; Always hits initial target.
    DamageNugget ; A basic Nugget that just does damage
        Damage = GONDOR_RANGER_DAMAGE
        DamageScalar    = 135% ANY +MONSTER -SUMMONED
        Radius = 0.0
        DelayTime = 0
        DamageType = PIERCE
        DamageFXType = GOOD_ARROW_PIERCE
        DeathType = NORMAL
    End
End


If you look at both the Hobbit's rocks and the ranger's bow you will notice that the bow has alot more code. This is because a ranger has a bigger chance of hitting a unit and he shoots a different speeds and has height advantages!

This rounds up the Weapon part of this tutorial...

_________________________________________________________________
On the next page I will explain the different kind of Weapon Nuggets in the game \

Links / Downloads

 HitsAdded
Available DamageTypes2003February 10, 2008 - 18:15
JackSpearLVL4exspearglow.tga -@Page31694February 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."

 
8:15:13