The 3rd Age

BFME Nostalgia Mod

BFME Nostalgia Mod

Play as BFME 1 gameplay in BFME2

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

Eowyn Disguise/Camouflage (Scripts)

Tutorial for Battle for Middle-earth II BFME 2, Battle for Middle-earth II: Rise of the Witch-king ROTWK

Avatar of Sulherokhh

Sulherokhh

Category: Code
Level: Expert
Created: Sunday May 20, 2007 - 3:21
Updated: Friday October 5, 2007 - 6:00
Views: 6157
Summary: How to make Eowyn's Disguise unique and useful, finally!

Rating

Staff says

3.8

Members say

3.8

Average

3.8/5.0

13 votes

Page 1 2 3 4 5
Now for the units providing Eowyn with a cover.

The following piece of code should be inserted somewhere among the other behavior code of the units providing cover, meaning the Rohirrim (riders) and the Peasants (if you have reintroduced them to your mod, as we did with S.E.E.).

The files' names (and Object names) are:

'data\ini\object\goodfaction\units\men\rohanrohirrim.ini' (Object RohanRohirrim)
'data\ini\object\neutral\neutralunits.ini' (Object RohanPeasant1)

If you do this for RohanPeasant1, all the other Peasant variants will benefit from this too, because they are Childobjects of RohanPeasant1.

This is the Code:

              
Code
;----------------- Start Disguise Aura --------------

    Behavior = AttributeModifierAuraUpdate ModuleTag_EowynDisguiseAura
        StartsActive    = No ;If no, requires upgrade to turn on.
        BonusName        = EowynDisguiseModifier_SEE
        TriggeredBy        = Upgrade_EowynConditionDisguised_SEE
        RefreshDelay    = 1000
        Range            = 100
        AntiCategory    = BUFF
        ObjectFilter    = NONE +RohanEowyn ALLIES
    End    

    Behavior = UnpauseSpecialPowerUpgrade ModuleTag_UnpauseEowynDisguiseAura
        SpecialPowerTemplate = SpecialAbilityFakeLeadership
        TriggeredBy = Upgrade_EowynConditionDisguised_SEE
    End

    Behavior = SpecialPowerModule ModuleTag_EowynDisguiseAuraUpdate
        SpecialPowerTemplate = SpecialAbilityFakeLeadership
        UpdateModuleStartsAttack = No
        StartsPaused = Yes
    End


Looking a bit more closely, you see that this Aura, much like a leadership aura, only affects eowyn. And it provides her with an Attributemodifier that you will have to define in 'attributemodifiers.ini', which would look like this:

              
Code
ModifierList EowynDisguiseModifier_SEE
    Category = SPELL
    Duration = 3000            // Duration is forever when set to 0
    ModelCondition = USER_1
End


As you can see, all the aura of the rohirrim does is give Eowyn the ModelCondition USER_1 while she is around, and then only if the PLAYER Upgrade 'Upgrade_EowynConditionDisguised_SEE' has been acquired. How that is done you will see on page 4.


Note 1: The 'Duration' of the Modifier needs to be higher than the Refreshdelay of the AuraUpdate, otherwise the disguise will stutter on and off. The duration also signifies about how long the disguise will keep on working even if she leaves the aura of the rohirrim. A maximum of 3 seconds in this case.

Note 2: Totally unimportant for our purposes here, but you might implement different Updates for Rohirrim and Peasants that only work when Eowyn is mounted (for the rohirrim) or on foot (for the peasants). But we don't need to go into that right now...


The Upgrades

The next thing you should do, if you haven't already, is to define the upgrades that have been used in the code so far. You do this inside the file 'upgrade.ini'. There is a lot of similiar code in there. Our upgrades need only the smallest amount of detail, as you cannot buy them, they have no builttimes, etc. So it would like this:

              
Code
;------------------ Eowyn's disguise triggers

Upgrade Upgrade_EowynConditionDisguised_SEE
    Type                = PLAYER
End

Upgrade Upgrade_EowynConditionStealthed_SEE
    Type                = OBJECT
End

Upgrade Upgrade_EowynConditionNotStealthed_SEE
    Type                = OBJECT
End


The acquisition of the first Upgrade (a PLAYER upgrade, and therefor global) is the trigger without which the covering auras of the Peasants and Riders wouldn't work.

The other two OBJECT-upgrades are needed for Eowyns personal InvisibilityUpdate and are for that reason on the OBJECT-Level. The Aura of the Rohirrim (triggered if she is disguised) provide Eowyn with the ModelCondition USER_1 when she is in range. The presence (and removal) of USER_1 in turn provides Eowyn with the needed upgrade that activates her actual InvisibilityUpdate (or deactivates it). This works via the files 'scriptevents.xml' and 'scripts.lua'.

Go to the next page...

Credits

PhilFor hinting at the 'scriptevents.xml'

Comments

Display order: Newest first

Mouth of Sauron - Thursday January 14, 2010 - 5:49

Thank you, this is most useful generally ; about Eowyn however... I never understood this ability and I cannot see for what should it be used - she was not hiding before the ennemy, she was hiding before Theoden, wasn't she...

MoS

--------

Thank you, this is most useful generally ; about Eowyn however... I never understood this ability and I cannot see for what should it be used - she was not hiding before the ennemy, she was hiding before Theoden, wasn't she...

MoS

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:36:14