The 3rd Age

Gauntlet: Dark Legacy

Gauntlet: Dark Legacy

Gauntlet: Dark Legacy BFME 2 Mod

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

Stealth Upgrade - Elven Cloak Style

Tutorial for Battle for Middle-earth BFME

Avatar of Radspakr Wolfbane

Radspakr Wolfbane

Category: Code
Level: Intermediate
Created: Friday January 25, 2008 - 14:39
Updated: Thursday April 25, 2013 - 0:07
Views: 6159
Summary: Giving hordes a stealth upgrade

Rating

Staff says

3.0

Members say

4.5

Average

3.8/5.0

4 votes

Recently I successfully got hordes able to be upgraded with Elven Cloaks so that they can stealth.
I had been trying to get this work for a long time and after a lot of experimenting I got it to work.
Heres' a brief run down on how it will work.
Instead of normal stealth when units become stealth when near trees this will function like the Elven Cloaks for the Hobbit Heroes.
Instead for the whole horde.

The files you'll need
the object.ini for the unit and Horde
Upgrade.ini
commandbutton.ini
commandset.ini
SpecialPower.ini

Also I should note that this tutorial is for those with a good grasp of coding.

First up place this in the Unit
              
Code
Behavior = StealthUpdate StealthUpdateModuleTag;unit
StealthDelay = 2500
FriendlyOpacityMin = STEALTH_FRIENDLY_OPACITY_MIN
FriendlyOpacityMax = STEALTH_FRIENDLY_OPACITY_MAX
PulseFrequency = 750
StealthForbiddenConditions = HORDEBRAIN_NOT_STEALTHED
OrderIdleEnemiesToAttackMeUponReveal= Yes
DetectedByAnyoneRange = 120
RevealWeaponSets = CLOSE_RANGE CONTESTING_BUILDING
VoiceMoveToStealthyArea = RangerVoiceMoveTrees
VoiceEnterStateMoveToStealthyArea = RangerVoiceEnterStateMoveTrees
End


This is the stealh for the unit,the unit will only stealth if the horde is told too.

Next we add this to the Horde


              
Code
    Behavior = StatusBitsUpgrade ModuleTag_ProductionLegalityCloaks
        TriggeredBy = Upgrade_ElvenCloakUpgrade Upgrade_TechnologyElvenCloakUpgrade
        RequiresAllTriggers = Yes
    End


    Behavior = StealthUpdate ModuleTag_StealthForCloak
     StealthDelay = 500 ; msec
     FriendlyOpacityMin = STEALTH_FRIENDLY_OPACITY_MIN
     FriendlyOpacityMax = STEALTH_FRIENDLY_OPACITY_MAX
     PulseFrequency = 750 ; msec
     InnateStealth                    = No
     OrderIdleEnemiesToAttackMeUponReveal = Yes
     BecomeStealthedFX = FX_ElvenCloakOn
     ExitStealthFX = FX_ElvenCloakOff
    End
    
    Behavior = SpecialPowerModule ModuleTag_ElfCloakStarter
        SpecialPowerTemplate = SpecialAbilityElfCloakUpgrade
        UpdateModuleStartsAttack = Yes
    End

    Behavior = ToggleHiddenSpecialAbilityUpdate ModuleTag_ElfCloakUpdate
        SpecialPowerTemplate = SpecialAbilityElfCloakUpgrade
        AwardXPForTriggering = 0
    End    
    

The top code here adds the upgrade (same as the Heavy Armor upgrade)

The second is the stealth module that tells the unit to stealth.
It is told not to stealth unless through the button.
              
Code
InnateStealth = No


the next is for the Elven Cloak power just like the Hobbits version except I gave it a new special power .

Next we go to Upgrade.ini and add in the following

              
Code


Upgrade Upgrade_TechnologyElvenCloakUpgrade
DisplayName = UPGRADE:ElvenCloakUpgrade
Type = PLAYER
BuildCost = MORDOR_TECH_BASIC_TRAINING_BUILDCOST
BuildTime = MORDOR_TECH_BASIC_TRAINING_BUILDTIME
End

Upgrade Upgrade_ElvenCloakUpgrade
DisplayName = UPGRADE:ElvenCloakUpgrade
Type = OBJECT
BuildCost = MORDOR_PERSONAL_BASIC_TRAINING_BUILDCOST
BuildTime = MORDOR_PERSONAL_BASIC_TRAINING_BUILDTIME
End


you change the values to what ever you want.

Then we go to specialpower.ini and add the following

              
Code

;------------------------------------------------------------------------------
SpecialPower SpecialAbilityElfCloakUpgrade
Enum = SPECIAL_GENERAL_TARGETLESS_TWO
ReloadTime = 10000
PublicTimer = No
;InitiateAtLocationSound = GenericSpell ;this doesn't work
End


Here you can adjust the Reload time

and finally we go to the Button stuff
in CommandSet add this the horde's commandset

              
Code
1 = Command_SpecialAbilityElfCloakUpgrade
2 = Command_PurchaseUpgradeElvenCloaks


to the Armory commandset (or where ever the Technology is bought from)
              
Code
1 = Command_PurchaseTechnologyElvenCloaks


and now to wrap things up with the 3 buttons

              
Code


CommandButton Command_PurchaseTechnologyElvenCloaks
Command = PLAYER_UPGRADE
Options = CANCELABLE
;Options = NEED_UPGRADE
Upgrade = Upgrade_TechnologyElvenCloakUpgrade
TextLabel = CONTROLBAR:PurchaseTechnologyRohanBasicTraining
ButtonImage = BIElfBanner_New
ButtonBorderType = UPGRADE
DescriptLabel = CONTROLBAR:ToolTipPurchaseTechnologyRohanBasicTraining
Radial = Yes
InPalantir = Yes
End

CommandButton Command_PurchaseUpgradeElvenCloaks
Command = OBJECT_UPGRADE
Options = NEED_UPGRADE OK_FOR_MULTI_SELECT CANCELABLE
Upgrade = Upgrade_ElvenCloakUpgrade
NeededUpgrade = Upgrade_TechnologyElvenCloakUpgrade
TextLabel = CONTROLBAR:PurchaseUpgradeRohanBasicTraining
ButtonImage = BIElfBanner_New
ButtonBorderType = UPGRADE
DescriptLabel = CONTROLBAR:ToolTipPurchaseUpgradeRohanBasicTraining
InPalantir = Yes
LacksPrerequisiteLabel = TOOLTIP:LackRohanBasicTraining
End



CommandButton Command_SpecialAbilityElfCloakUpgrade
Command = SPECIAL_POWER
SpecialPower = SpecialAbilityElfCloakUpgrade
Options = NEED_UPGRADE OK_FOR_MULTI_SELECT
NeededUpgrade = Upgrade_ElvenCloakUpgrade
TextLabel = CONTROLBAR:ElvenCloak
ButtonImage = HPFrodoElfCloak
ButtonBorderType = ACTION
DescriptLabel = CONTROLBAR:ToolTipElvenCloak
InPalantir = Yes
End


I'll leave it up to you to add in the Labels and customise it how you wish.
I hope you find this helpful.

This can be applied in different ways for example to a single unit, Hero or have it triggered by an experience level.

For BFME 2 and ROTWK it would use the invisibiltyupdate which I have little experience in but I guess it works in a similar way I may right up a BFME2 version.


Radspakr

Comments

Display order: Newest first

modboy451 - Tuesday November 9, 2010 - 19:45

Nice tutorial, That gives me an idea for my next mod!
preveiw here:(will be updated frequently)
http://aworldofcode.blogspot.com/p/my-biggest-mod-yet.html
new heros have been listed only so far will be listing new units, abilities, and other things soon!

Radspakr Wolfbane (Team Chamber Member) - Monday February 11, 2008 - 22:25

I'm working on an innate version of the stealth upgrade I should have the tutorial up soon.

Guess Who - Friday January 25, 2008 - 19:49

Nice tutorial il be sure to add this.

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:01:44