The 3rd Age

The Battle for Alagaësia

The Battle for Alagaësia

A mod that transport BFME2:ROTWK to the Inheritance cycle universe

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

How to make any building make units

Tutorial for Battle for Middle-earth BFME, Battle for Middle-earth II BFME 2

Avatar of BigBrainiac


Category: Code
Level: Beginner
Created: Saturday September 11, 2010 - 14:46
Updated: Sunday September 19, 2010 - 19:45
Views: 8857
Summary: Guide to make any building have the ability to build units


Staff says


Members say




3 votes

This is a guide that tells how to make any building able to build units.
BACK-STORY: I was reading the forums once when I noticed that Nazgul, a modding icon, was having trouble adding dwarven miners to the build-able units of the mine. His problem was that he didn't know about the "QueueProductionExitUpdate ModuleTag_Exit" code. It makes it that your building can create units at a certain spot around it.

Now for the steps to make the dwarven mine have the ability to make some unit. (I will use guardians)

STEP ONE: Open object/goodfaction/structure/farminterface.ini
This is the object that the Rohan and Gondor factions use as their base.
Go to line #292-296 and copy the entire block:

    Behavior = QueueProductionExitUpdate ModuleTag_Exit
        UnitCreatePoint = X: 20.0 Y:0.0 Z:0.0
        NaturalRallyPoint = X:-60.0 Y:0.0 Z:0.0
        ExitDelay = 350

STEP TWO:Open "object/goodfaction/structure/dwarven/dwarvenmineshaft.ini"
Paste the "Behavior = Queue..." block of code at line between the "TunnelContain" and the "BuildingBehavior" Behaviors. It should look like this:

    Behavior = TunnelContain ModuleTag_Contain
        ObjectStatusOfContained            = UNSELECTABLE ENCLOSED
        ContainMax         = 5
        DamagePercentToUnits         = 0%
        PassengerFilter                = ANY +INFANTRY +BANNER +CAVALRY -MONSTER -SUMMONED -COMBO_HORDE
        AllowEnemiesInside            = No
        AllowAlliesInside            = No
        AllowNeutralInside            = No
        AllowOwnPlayerInsideOverride        = Yes
        NumberOfExitPaths         = 1    // Defaults to 1. Set 0 to not use ExitStart/ExitEnd, set higher than 1 to use            ExitStart01-nn/ExitEnd01-nn
        PassengerBonePrefix         = PassengerBone:ARROW_ KindOf:INFANTRY
        EntryPosition                = X:0.0 Y:0.0 Z:0.0
        EntryOffset                = X:80.0 Y:0.0 Z:0.0
        ExitOffset                = X:100.0 Y:0.0 Z:0.0
        EnterSound                = RuinedTowerEnterSound
        KillPassengersOnDeath            = No
        ShowPips                = No
        ExitDelay                = 0

    Behavior = QueueProductionExitUpdate ModuleTag_Exit
        UnitCreatePoint = X: 20.0 Y:0.0 Z:0.0
        NaturalRallyPoint = X:-60.0 Y:0.0 Z:0.0
        ExitDelay = 350
    Behavior = BuildingBehavior BuildingModuleTag

STEP THREE: Change the "UniCreatePoint" to have the "X:" value of 0.0 and the "NaturalRallyPoint" "X:" value to 100.0.
It would look like:

    Behavior = QueueProductionExitUpdate ModuleTag_Exit
        UnitCreatePoint = X: 0.0 Y:0.0 Z:0.0
        NaturalRallyPoint = X:100.0 Y:0.0 Z:0.0
        ExitDelay = 350

STEP FOUR: Change the DwarvenMineShaftCommandSet to look like this (if you want to build guardians on it):

CommandSet DwarvenMineShaftCommandSet
1 = Command_ExitGarrison
2 = Command_ExitGarrison
3 = Command_ExitGarrison
4 = Command_ExitGarrison
5 = Command_ExitGarrison
6 = Command_Sell
7 = Command_ConstructDwarvenGuardianHorde

Now go in-game and test out the guardian building feature... It SHOULD work (it worked for me)

Happy Modding,

If you have any questions, comment on this article.


MENoticing Code


Display order: Newest first

clank234 - Monday November 15, 2010 - 13:21

It works except 1 thing, the guardians cant be upgraded and they they come as 10 single units.
Keep up the gd work ;)

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