The 3rd Age

Wars of the East

Wars of the East

A mod for RotWK that adds new factions, units, heroes, stuctures, powers and more.

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

Mount/Unmount Fellbeast WitchKing

Tutorial for Battle for Middle-earth BFME

Avatar of GothmogtheOrc

GothmogtheOrc

Category: Code
Level: Expert
Created: Monday March 26, 2007 - 12:42
Updated: Monday March 26, 2007 - 13:33
Views: 7949
Summary: The original method of mounting the witchking

Rating

Staff says

3.0

Members say

3.7

Average

3.3/5.0

6 votes

Note: This is the original method developed to mount the WitchKing. However, it should be possible to mount him as the other heroes mount simply replacing the horse codes with the fellbeast codes.

Also, this method by Vapula has the flaw that the witchking is killed each time he mounts/dismounts thus you can not make him change experience levels and gain powers over time. What he starts with is what he gets.


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 [**below tutorial or in the downloads section**] 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:

              
Code
;;;;;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:

              
Code
;;;;;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:

              
Code
;;;;;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:

              
Code
;;;;;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:

              
Code
;;;;;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:
              
Code
TargetNames = MordorWitchKingOnFellBeast MordorWitchKingNew MordorWitchKingOnFellBeastNew


8. Open your playertemplate.ini and add MordorWitchKingNew in Mordor's BuildableHeroesMP
              
Code
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.

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


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

Links / Downloads

 HitsAdded
Witchking.ini1713March 26, 2007 - 13:01

Credits

Vapula

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

 
4:51:45