The 3rd Age

MasterHero Mod 1.9

MasterHero Mod 1.9

Enhances Visuals, provide series of modifications and additions to the game play, support WOR

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

The Special Power Guide

Avatar of Ridder Blauw

Ridder Blauw

Category: Code
Level: Intermediate
Created: Wednesday March 25, 2009 - 9:41
Updated: Friday May 28, 2010 - 15:36
Views: 12090
Summary: Here you will read and learn tips and tricks about special powers.

Rating

Staff says

3.7

Members say

4.0

Average

3.9/5.0

9 votes

Page 1 2 3 4 5 6 7 8 9
New Projectile Spells (Part Two) (Beginner - Intermediate)

This is the coding part of the tutorial, here we will actually bring the Throwing Knife in game.
For this you be needing:
Goodfactionsubobjects.ini
Gimli.ini
Sam.ini
Specialpower.ini
Weapon.ini
Commandset.ini
Commandbutton.ini


We will start with the Goodfactionsubobjects.ini.

Goodfactionsubobjects.ini

Remember to add the rusam_knife1.w3d (Make it yourself or use the one below), and run the assetchachebuilder. Paste this piece of code somewhere in the ini, I recommend the bottom.

              
Code
Object GimliAxeProjectile

; *** ART Parameters ***
; Draw = W3DModelDraw ModuleTag_01
; ConditionState = NONE
; Model = RUGIMLI_AXE
; Animation = RUGIMLI_AXE.RUGIMLI_AXE
; AnimationMode = LOOP
; End
; End
Draw = W3DScriptedModelDraw ModuleTag_Draw
DefaultModelConditionState
; Model = RUGIMLI_AXE
Model = RUGimli_AXE1
ParticleSysBone = Tracer1 GimliThrownAxeTrail
ParticleSysBone = Tracer2 GimliThrownAxeTrail
End
IdleAnimationState
Animation = RUGimli_AXE1
AnimationName = RUGimli_AXE1.RUGimli_AXE1
AnimationMode = LOOP
End
End
End

; *** AUDIO Parameters ***

; ***DESIGN parameters ***
EditorSorting = SYSTEM
ArmorSet
Armor = NoArmor
End
VisionRange = 0.0

; *** ENGINEERING Parameters ***
KindOf = PROJECTILE
Body = ActiveBody ModuleTag_02
MaxHealth = 10.0
End

Behavior = DestroyDie ModuleTag_03
;nothing
End

Behavior = BezierProjectileBehavior ModuleTag_04
; To tweak a Bezier path
FirstHeight = 9 ; Height of Bezier control points above highest intervening terrain
SecondHeight = 9
FirstPercentIndent = 50% ; Percentage of shot distance control points are placed
SecondPercentIndent = 90%
FlightPathAdjustDistPerSecond = 50
; Can allow a max speed this can attempt to follow a target. Units are their velocity we can tag. (45 is default human speed)
DetonateCallsKill = Yes
CurveFlattenMinDist = 60.0
End

Behavior = PhysicsBehavior ModuleTag_05
KillWhenRestingOnGround = Yes
GravityMult = 0.0
End

;commented out until art gets the correct Projectile bits
; Behavior = CreateObjectDie ModuleTag_06
; DeathTypes = ALL
; CreationList = OCL_GimliAxeProjectileBits
;End

Behavior = FXListDie ModuleTag_07
DeathTypes = ALL
DeathFX = FX_GimliAxeProjectileHit
End

Geometry = Sphere
GeometryIsSmall = Yes
GeometryMajorRadius = 0.8
End

Once you done that, change it to this:
              
Code
Object SamKnifeProjectile

; *** ART Parameters ***
; Draw = W3DModelDraw ModuleTag_01
; ConditionState = NONE
; Model = RUGIMLI_AXE
; Animation = RUGIMLI_AXE.RUGIMLI_AXE
; AnimationMode = LOOP
; End
; End
Draw = W3DScriptedModelDraw ModuleTag_Draw
DefaultModelConditionState
; Model = RUGIMLI_AXE
Model = RUSAM_KNIFE1
ParticleSysBone = Tracer1 GimliThrownAxeTrail
ParticleSysBone = Tracer2 GimliThrownAxeTrail
End
IdleAnimationState
Animation = RUSAM_KNIFE1
AnimationName = RUSAM_KNIFE1.RUSAM_KNIFE1
AnimationMode = LOOP
End
End
End

; *** AUDIO Parameters ***

; ***DESIGN parameters ***
EditorSorting = SYSTEM
ArmorSet
Armor = NoArmor
End
VisionRange = 0.0

; *** ENGINEERING Parameters ***
KindOf = PROJECTILE
Body = ActiveBody ModuleTag_02
MaxHealth = 10.0
End

Behavior = DestroyDie ModuleTag_03
;nothing
End

Behavior = BezierProjectileBehavior ModuleTag_04
; To tweak a Bezier path
FirstHeight = 9 ; Height of Bezier control points above highest intervening terrain
SecondHeight = 9
FirstPercentIndent = 50% ; Percentage of shot distance control points are placed
SecondPercentIndent = 90%
FlightPathAdjustDistPerSecond = 50
; Can allow a max speed this can attempt to follow a target. Units are their velocity we can tag. (45 is default human speed)
DetonateCallsKill = Yes
CurveFlattenMinDist = 60.0
End

Behavior = PhysicsBehavior ModuleTag_05
KillWhenRestingOnGround = Yes
GravityMult = 0.0
End

;commented out until art gets the correct Projectile bits
; Behavior = CreateObjectDie ModuleTag_06
; DeathTypes = ALL
; CreationList = OCL_GimliAxeProjectileBits
;End

Behavior = FXListDie ModuleTag_07
DeathTypes = ALL
DeathFX = FX_GimliAxeProjectileHit
End

Geometry = Sphere
GeometryIsSmall = Yes
GeometryMajorRadius = 0.8
End


That's it for the goodsubobjects.ini, next up is Gimli&Sam.ini.

Gimli&Sam.ini

Open the Gimli.ini and look for this piece of code:

              
Code
;;====================== MODELS ================================================================
        DefaultModelConditionState
            Model = RUGimli_SKN
            Skeleton = RUGimli_SKL
            WeaponLaunchBone = TERTIARY AXE02
        End
        
        ModelConditionState = WEAPONSET_TOGGLE_1
            Model = RUGimli_SKN
            Skeleton = RUGimli_SKL
            ParticleSysBone = BAT_HEAD Slayer FollowBone:Yes
        End


Copy this code:

              
Code
            WeaponLaunchBone = TERTIARY AXE02


And paste it here, in the Sam.ini.
              
Code
;;================== MODELS ===================================================================
        DefaultModelConditionState
            Model = RUSam_SKN
            Skeleton = RUSam_SKL
            ;WeaponLaunchBone = PRIMARY B_FARMR        ;sometimes it's in primary sometimes in secondary.
            ;WeaponLaunchBone = SECONDARY B_FARMR
            WeaponLaunchBone = PRIMARY B_HANDR        ;sometimes it's in primary sometimes in secondary.
            WeaponLaunchBone = SECONDARY B_HANDR
            WeaponLaunchBone = TERTIARY AXE02
            ParticleSysBone        = NONE Predator FollowBone:Yes Persist:HOLD PersistID:100
        End

        ModelConditionState        = INVISIBLE_STEALTH
            ParticleSysBone        = NONE Predator FollowBone:Yes Persist:SPAWN PersistID:100
        End


Now we will change the code so it is this:

              
Code
WeaponLaunchBone = TERTIARY B_HANDR


Then paste this under attack animations:

              
Code
; AXE THROW
        AnimationState = FIRING_OR_PREATTACK_C
            Animation = SPCA
                AnimationName = RUGimli_SPCA
                AnimationMode = ONCE
;                UseWeaponTiming        = Yes
            End
            FrameForPristineBonePositions = 42;44
            ;ParticleSysBone = None MeleeDust
            BeginScript
                CurDrawableShowSubObject("AXE02")
                Prev = CurDrawablePrevAnimationState()
                if Prev == "DwarfToss" then CurDrawableSetTransitionAnimState("TRANS_EndDwarfToss") end
            EndScript
        End


And change it to this:

              
Code
; THROWING KNIFE
        AnimationState = FIRING_OR_PREATTACK_C
            Animation = SPCA
                AnimationName = RUSam_THRA
                AnimationMode = ONCE
;                UseWeaponTiming        = Yes
            End
            FrameForPristineBonePositions = 42;44
            ;ParticleSysBone = None MeleeDust
            BeginScript
;                CurDrawableShowSubObject("AXE02")
                Prev = CurDrawablePrevAnimationState()
                if Prev == "DwarfToss" then CurDrawableSetTransitionAnimState("TRANS_EndDwarfToss") end
            EndScript
        End


No scroll down to the weapons, an add this code to each weaponset:

              
Code
Weapon                    = TERTIARY    RohanSamThrowingKnife
AutoChooseSources        = TERTIARY NONE


Specialpower.ini

Now open the Specialpower.ini, and paste this at the bottom:

              
Code
;------------------------------------------------------------------------------
SpecialPower SpecialAbilityGimliAxe
    Enum            = SPECIAL_AT_VISIBLE_OBJECT
    ReloadTime        = 45000 ; ;30000
End


And change it to:

              
Code
;------------------------------------------------------------------------------
SpecialPower SpecialAbilitySamKnife
    Enum            = SPECIAL_AT_VISIBLE_OBJECT
    ReloadTime        = 45000 ; ;30000
End


Weapon.ini

Scroll to the bottom and paste this:

              
Code
;------------------------------------------------------------------------------
Weapon RohanSamThrowingKnife
    AttackRange = GIMLI_THROW_RANGE
    WeaponSpeed = 161 ; dist/sec
    MinWeaponSpeed = 201
    MaxWeaponSpeed = 241 ; dist/sec Upper limit on scaling, when attacking past nominal "max" range
    FireFX = FX_GimliAxeThrow
    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.
    DelayBetweenShots = 0 ; time between shots, msec
    
AntiAirborneVehicle    = Yes ; added so he can attack fellbeast and birds
AntiAirborneMonster    = Yes ; added so he can attack fellbeast and birds
    
    ClipSize            = 1            ; how many shots in a Clip (0 == infinite)
    ClipReloadTime        = 45000 ; ;10000 ; how long to reload a Clip, msec
    AutoReloadsClip        = Yes
    ;IdleAfterFiringDelay = 2500;
    ;HoldAfterFiringDelay = 2500 ; So I don't move while the weapon needs to complete
InstantLoadClipOnActivate = Yes

    PreAttackDelay = 1500; 1467 ; 1467 is the prep time for archer.
    PreAttackType = PER_SHOT ; Do the delay each time we attack a new target
    FiringDuration = 1600; 1567 ; Duration of the archer firing shot is 500ms.

    ProjectileNugget
        ProjectileTemplateName = GimliAxeProjectile
        WarheadTemplateName = RohanGimliAxeThrownWarhead
    End
End


Commandbutton.ini

At the bottom, paste this:

              
Code
CommandButton Command_SamKnife
Command = FIRE_WEAPON
WeaponSlot = TERTIARY
Options = NEED_TARGET_ENEMY_OBJECT NO_PLAY_UNIT_SPECIFIC_SOUND_FOR_AUTO_ABILITY ; NEED_TARGET_NEUTRAL_OBJECT CONTEXTMODE_COMMAND
TextLabel = CONTROLBAR:AxeThrow
ButtonImage = HSGimliAxeThrow
CursorName = Bombard
ButtonBorderType = ACTION
DescriptLabel = CONTROLBAR:ToolTipAxeThrow
InvalidCursorName = GenericInvalid
AutoAbility             = Yes
UnitSpecificSound = GimliVoiceModeAxeThrow
SetAutoAbilityUnitSound = GimliVoiceModeAxeThrow ; Only when he is set to use it, not each time he uses it
InPalantir             = Yes
End


Commandset.ini

Find this piece of code:

              
Code
CommandSet RohanSamCommandSet
    1    = Command_ToggleStance
    2    = Command_ToggleHobbitRockThrow
    3    = Command_SpecialAbilityElfCloakSam
    12 = Command_CaptureBuilding    
    13    = Command_AttackMove
    14    = Command_Stop
End


Change it to this:
              
Code
CommandSet RohanSamCommandSet
    1    = Command_ToggleStance
    2    = Command_ToggleHobbitRockThrow
    3    = Command_SpecialAbilityElfCloakSam
    4    = Command_SamThrowingKnife    
    12 = Command_CaptureBuilding    
    13    = Command_AttackMove
    14    = Command_Stop
End


Now add RohanSam in the playertemplate.ini (if not done so yet), and run the game and check out your new projectile spell!

-------------------------------------------
You can change the button, and description etc.

Links / Downloads

 HitsAdded
Throwing Knife, Premade (Credit Required)1359August 19, 2009 - 2:17
Weapons Tutorial, by Ridder Geel1605May 6, 2009 - 2:11

Comments

Display order: Newest first | Page: 1, 2

clank234 - Tuesday November 16, 2010 - 12:41

I gave a 5
1) A lot off effort just to help others which i love to see a lot.
2) Can i hav some help with Summon Balrog, when i try to play it crashes and the upgrade.ini isnt right

Ridder Blauw - Monday August 23, 2010 - 6:05

That means the thing that is filled in at Attackrange in the weapon is wrong.

Or the macro there doesnt exsist or the characters filled in are wrong.

SkillModLord - Friday August 20, 2010 - 0:02

Weapon.ini

That part where you combine woundarrow with Word of Power goes wrong.

When I put the piece of code you written there in my weapon.ini and correct it as you said, I try to start up the game and it says that attacktange in the file weapon.ini isnt good. I try to put other command first under the wounding arrow but then the the same bug appears with the new command first :S

Shininku - Sunday September 13, 2009 - 18:53

This was pretty awesome guide and it helped me to fix up my powers. But I think I need help. I've set up my hero so that he can summon a BlackRider (Ringwraith w/e) at level 10. When my character gets to level 10, Blackrider icon lights up like it's usable. But when I click it, nothing happens. I don't get the little summoning area thing. What'd I do wrong?

Ridder Blauw - Friday September 11, 2009 - 10:02

Yes.

drogoth232 - Wednesday September 9, 2009 - 14:07

In the coding part. Will sam have the throwing anims?

Ridder Blauw - Wednesday August 19, 2009 - 8:34

That's modeling and coding. ;)

--------

Added a Two Part tutorial to continue the Editing Projectile Spells tutorial, New Projectile Spells! ;):);)

Spartan184 - Wednesday June 24, 2009 - 18:09

I tryed adding Summon Balrog to Saruman and it crashed its for bfme1.
Nevermind Fixed it. Thanks a lot UR THE BEST!!!
For the Gimli thing for instead of haveing a axe he has a Spear can we change the weopen like say sarumans staff or something?

Ridder Blauw - Sunday May 10, 2009 - 22:26

The code calls them dozers in the code block DOZER_CONSTRUCT don't they?

--------

Didn't get at first why you brought it up, so would you forgive me.
And thanks.

Prolong - Sunday May 10, 2009 - 19:57

DOZERs are Builder/Porters

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:08:04