
The 3rd Age -Mount/Unmount Fellbeast Tutorial
http://the3rdage.net/ini/mountfell.php?mod=52



Mount/Unmount Fellbeast Witch King
Mount/Unmount Fellbeast

Written by: Vapula

This tutorial explains you how to make your Witch-king be able to mount/unmount 
a fellbeast (toggle fellbeast). Before going any further I have to mention that 
this toggle fellbeast feature is a trick. Witch-king doesn't really mount/unmount 
fellbeast but he kills himself when you toggle fellbeast, and then a new object 
which is Witch-king riding on fell beast spawns right on the corpse of Witch-king. 
For this reason there are several problems related to this toggle feature 
therefore it isn't perfect, but I reduced the number of problems as much as I could. 
I thank pabtyf for giving me a start for making this toggle feature.
If you want to use this toggle feature in your mod, please give me (Vapula) credit 
since it took days and days to tweak this.

At first, I give you a quick guide to put this toggle feature in your B4ME and 
I will later explain how it works and how it is coded for those who wanna know 
about it more.

<<Quick installation guide>>
1. Move this witchking.ini to \data\ini\object\evilfaction
If you don't wanna use a separete ini file for your Witch-king you can copy and 
paste all the lines in witchking.ini into your evilfactionunits.ini.
In this tutorial the object name for on-foot Witch-king is MordorWitchKingNew, 
and the object name for Witch-king riding on fellbeat is MordorWitchKingOnFellBeastNew.
The reason why I'm using new objects rather than modifying already existing Witch-king 
objects is because it modifies HELL A LOT so making new objects is much easier.

2. Open your objectcreationlist.ini and copy and paste following lines:

;;;;;WITCHKING;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ---------------------------------------------------------------------------------------
ObjectCreationList OCL_SpawnMordorWitchKing
CreateObject
ObjectNames = MordorWitchKingNew
Count = 1
FadeIn = Yes
FadeTime = 4000
IgnoreCommandPointLimit = Yes
End
End

; ---------------------------------------------------------------------------------------
ObjectCreationList OCL_MordorWitchKingEgg
CreateObject
ObjectNames = MordorWitchKingEgg
IgnoreCommandPointLimit = Yes
Disposition = LIKE_EXISTING
End
End

; ---------------------------------------------------------------------------------------
ObjectCreationList OCL_SpawnMordorWitchKingOnFellBeast
CreateObject
ObjectNames = MordorWitchKingOnFellBeastNew
Count = 1
FadeIn = Yes
FadeTime = 4000
IgnoreCommandPointLimit = Yes
End
End

; ---------------------------------------------------------------------------------------
ObjectCreationList OCL_MordorWitchKingOnFellBeastEgg
CreateObject
ObjectNames = MordorWitchKingOnFellBeastEgg
IgnoreCommandPointLimit = Yes
Disposition = LIKE_EXISTING
End
End

; ---------------------------------------------------------------------------------------
ObjectCreationList OCL_MordorWitchKingEggDummy
CreateObject
ObjectNames = MordorWitchKingEggDummy
IgnoreCommandPointLimit = Yes
Disposition = LIKE_EXISTING
End
End
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

3. Open your weapon.ini and copy and paste following lines:

;;;;;WITCHKING;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;------------------------------------------------------------------------------
Weapon WitchKingOnFootToFellBeast
RadiusDamageAffects = ALLIES NEUTRALS SELF
DelayBetweenShots = 5000 ; time between shots, msec
PreAttackDelay = 2600
PreAttackType = PER_ATTACK ; Do the delay each time we attack a new target
PreAttackFX = FX_UnSummonElvenAllies
FireFX = FX_UnSummonElvenAllies
FiringDuration = 2000


DamageNugget ; A basic Nugget that just does damage
Damage = 10000
Radius = 0
DamageType = MAGIC
DamageFXType = FLAME
DeathType = CRUSHED
End
End

;------------------------------------------------------------------------------
Weapon WitchKingFellBeastToOnFoot
RadiusDamageAffects = ALLIES NEUTRALS SELF
DelayBetweenShots = 5000 ; time between shots, msec
PreAttackDelay = 2600
PreAttackType = PER_ATTACK ; Do the delay each time we attack a new target
PreAttackFX = FX_UnSummonElvenAllies
FireFX = FX_UnSummonElvenAllies
FiringDuration = 2000
AntiAirborneVehicle = Yes ;allows attack of flying units
AntiAirborneMonster = Yes


DamageNugget ; A basic Nugget that just does damage
Damage = 10000
Radius = 0
DamageType = MAGIC
DamageFXType = FLAME
DeathType = CRUSHED
End
End
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

4. Open your commandset.ini and copy and paste following lines:

;;;;;WITCHKING;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
CommandSet MordorWitchKingCommandSetNew
1 = Command_WitchKingLeadership
2 = Command_FireWitchKingMorgulBlade
3 = Command_ToggleWitchKingWeapon
4 = Command_WitchKingMountFellBeast
13 = Command_AttackMove
14 = Command_Stop
15 = Command_Guard
End

>CommandSet MordorWitchKingRidingFellBeastCommandSetNew
1 = Command_SpecialAbilityScreech
2 = Command_WitchKingLeadership
3 = Command_WitchKingUnMountFellBeast
13 = Command_AttackMove
14 = Command_Stop
15 = Command_Guard
End
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

5. Open your commandbutton.ini and copy and paste following lines:

;;;;;WITCHKING;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
CommandButton Command_WitchKingMountFellBeast
Command = SPECIAL_POWER 
SpecialPower = SpecialAbilityWitchKingOnFootToFellBeast
TextLabel = ;write one by yourself
ButtonImage = SBEvil_Plus1Nazgul
ButtonBorderType = ACTION 
DescriptLabel = ;write one by yourself
InPalantir = Yes
UnitSpecificSound2 = FellBeastAlert
End


CommandButton Command_WitchKingUnMountFellBeast
Command = SPECIAL_POWER 
SpecialPower = SpecialAbilityWitchKingFellBeastToOnFoot
TextLabel = ;write one by yourself
ButtonImage = SBEvil_Plus1Nazgul
ButtonBorderType = ACTION 
DescriptLabel = ;write one by yourself
InPalantir = Yes
UnitSpecificSound2 = FellBeastAlert
End


CommandButton Command_ToggleWitchKingWeapon
Command = TOGGLE_WEAPONSET
Options = TOGGLE_IMAGE_ON_WEAPONSET
FlagsUsedForToggle = WEAPONSET_TOGGLE_1
TextLabel = CONTROLBAR:FireWitchKingMace
ButtonImage = HSWitchKingWarMace HSWitchKingMorgulBlade
ButtonBorderType = ACTION 
DescriptLabel = CONTROLBAR:ToolTipFireWitchKingMace
InPalantir = Yes
End
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

6. Open your specialability.ini and copy and paste following lines:

;;;;;WITCHKING;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;------------------------------------------------------------------------------
SpecialPower SpecialAbilityWitchKingOnFootToFellBeast
Enum = SPECIAL_WORD_OF_POWER
ReloadTime = 1000
PublicTimer = No
End

;------------------------------------------------------------------------------
SpecialPower SpecialAbilityWitchKingFellBeastToOnFoot
Enum = SPECIAL_WORD_OF_POWER
ReloadTime = 1000
PublicTimer = No
End
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

7. Open your experience.ini, search for the string "FellBeastWitchKingLevel1" and 
add MordorWitchKingNew and MordorWitchKingOnFellBeastNew in TargetNames like this:
TargetNames = MordorWitchKingOnFellBeast MordorWitchKingNew MordorWitchKingOnFellBeastNew

8. Open your playertemplate.ini and add MordorWitchKingNew in Mordor's BuildableHeroesMP
BuildableHeroesMP = MordorWitchKingNew MordorWitchKingOnFellBeast MordorFellBeast MordorFellBeast NeutralGollum

<<Technical guide>>
Here I explain how this toggle is coded and how it works. Firstly, these new Witch-king 
objects (MordorWitchKingNew and MordorWitchKingOnFellBeastNew) have an active body, not a respawn body. Since the toggle kills Witch-king once and spawns another Witch-king which is on fell beast (and vice versa when it's from fell beast to on-foot), if he's given a 
respawn body toggling will create another Witch-king in the citadel and therefore there 
will be two Witch-kings. Continuing this will create an army of Witch-king. In order to 
avoid this I had to give him an active body and make a fake respawn body feature for him.

When Witch-king dies normally (being killed by other units), he creates MordorWitchKingEggDummy by these behaviours. The first behaviour specifies the way Witch-king dies, and the second creates a dummy object.

Behavior = SlowDeathBehavior ModuleTag_NormalDeath
DeathTypes = ALL -CRUSHED
DeathFlags = DEATH_1
SinkDelay = 3000
SinkRate = 1.40 ; in Dist/Sec
DestructionDelay = 10000
End


Behavior = CreateObjectDie ModuleTag_MakeMordorWitchKingEggDummy
RequiredStatus = DEATH_1
CreationList = OCL_MordorWitchKingEggDummy
End

This dummy object is invisible and it dies automatically right after spawned. However this dummy egg is given a respawn body and "RespawnAsTemplate = MordorWitchKingNew" so it can be respawned as on-foot Witch-king in the citadel.

When you click on toggle fellbeast, a word-of-power based weapon (Weapon WitchKingOnFootToFellBeast) becomes actived which has a minimal range but massive damage influencing all the allies so it will kill Witch-king (for this reason if you active toggle fellbeast when your Witch-king is very close to a building or unit, that building/unit will be destroyed). This word-of-power based weapon has a deathtype of CRUSHED, and MordorWitchKingNew is designed that if he gets killed by a deathtype of CRUSHED, an egg object called MordorWitchKingOnFellBeastEgg will be created by these behaviours.


Behavior = SlowDeathBehavior ModuleTag_MountFellbeast
DeathTypes = NONE +CRUSHED
DeathFlags = DEATH_2
FadeDelay = 0
FadeTime = 3000
DestructionDelay = 3000
End


Behavior = CreateObjectDie ModuleTag_MakeMordorWitchKingOnFellBeastEgg
RequiredStatus = DEATH_2
CreationList = OCL_MordorWitchKingOnFellBeastEgg
End

MordorWitchKingOnFellBeastEgg dies automatically in a second and then it will create MordorWitchKingOnFellBeastNew which is an actual fell beast object. You should of noticed that it is possible that Witch-king dies from a deathtype of CRUSHED accidentally (for instance 
Sauron's mace attack has a deathtype of CRUSHED so if Witch-king gets killed by Sauron, he will automatically respawns as a fell beast without clicking on toggle). However heroes cannot be crushed by horses so this problem will rarely occur.

These are the basics of the toggle feature (from on-foot to fellbeast). The other way around (from fellbeast to on-foot) is coded in a similar way so I don't explain it here.

Top



© 2004 All Rights Reserved Eric Edwards. BFME, Battle For Middle Earth, 
and all assumed entities associated with them are © 2004 EA Games.
