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

Command Buttons and Command Sets

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

Avatar of Hostile

Hostile

Category: Code
Level: Beginner
Created: Monday March 26, 2007 - 11:48
Updated: Monday March 26, 2007 - 19:18
Views: 11134
Summary: What are CommandButtons and how do you edit them

Rating

Staff says

3.5

Members say

4.4

Average

4.0/5.0

9 votes

The Basics - Command Buttons and Command Sets

Written by: Hostile

The purpose of this tutorial is to go step by step on explaining the differant command buttons, they're functions, and how they work. We will than compile these command buttons into commandsets. Command buttons are the buttons you can click into during the game to accomplish such things as buy units, purchase upgrades, purchase spells, and activate spells.

Commandsets are the list of buttons avaliable for each unit or structure to tell it what functions it can activate.

Before embarking on this challenge of learning about command buttons and commandsets, I suggest you read the beginner tutorials so that you know how to extract the INI's and use your edited INI's. They can be found at the following page Getting Started

All the tools you need to add your edit your INI files can also be found at The 3rd Age website (http://the3rdage.net) along with the other tutorials. So, let's get started.

Open up you commandbutton.ini file. I have chosen this example to start with:

              
Code
CommandButton Command_ConstructGondorFighterHorde
Command = UNIT_BUILD
Object = GondorFighterHorde
Options = CANCELABLE
TextLabel = CONTROLBAR:ConstructGondorFighterHorde
ButtonImage = BGBarracks_Soldiers
ButtonBorderType = BUILD ; Identifier for the User as to what kind of button this is
DescriptLabel = CONTROLBAR:ToolTipBuildGondorFighterHorde
Radial = Yes
InPalantir = Yes
ShowProductionCount = Yes
End


Each button must have a unique name. So as you add new buttons to your commandbutton.ini remember this.

The second line, Command, tells the computer what function this button will have. I've compiled a list of proper commands allowed in the game. Some of these commands are hardcoded and may not need to be added to a commandset as they are built into the game.

              
Code
CANCEL_UNIT_BUILD - hardcoded
CANCEL_UPGRADE - hardcoded
HORDE_TOGGLE_FORMATION
TOGGLE_WEAPONSET
ATTACK_MOVE - hardcoded
STOP - hardcoded but can be added to a commandset
GUARD - hardcoded but can be added to a commandset
FIRE_WEAPON - hardcoded but can be added to a commandset
SPECIAL_POWER
WAKE_AUTO_PICKUP
BLOODTHIRSTY
MONSTERDOCK
OBJECT_UPGRADE
EXIT_CONTAINER
EVACUATE
CREW_EVACUATE
EVACUATE_CONTESTED - hardcoded
FOUNDATION_CONSTRUCT
SET_RALLY_POINT - hardcoded
SELL - hardcoded but can be added to a commandset
CASTLE_UNPACK
CASTLE_UNPACK_EXPLICIT_OBJECT
UNIT_BUILD
PLAYER_UPGRADE
REVIVE
FOUNDATION_CONSTRUCT_CANCEL - hardcoded
SPELL_BOOK
PURCHASE_SCIENCE
TOGGLE_NO_AUTO_ACQUIRE


There is no way I can possibly take the time or research to tell you what ever command type does. It should be self explanitory for most though. I'll start with UNIT_BUILD first and touch on a few others along the way.

              
Code
Object = GondorFighterHorde


This second line of the above command button tells the computer what object should be built as a result of this button.

              
Code
Options = CANCELABLE


The third line tells us that this choice can be canceled if we choose. Not needed if you do not want the option to be undone.

              
Code
TextLabel = CONTROLBAR:ConstructGondorFighterHorde


The fourth line describes the CSF entry (the text) that will show up to describe what the button does.

              
Code
ButtonImage = BGBarracks_Soldiers


The fifth line tells us what image we should use for the command button ingame.

              
Code
ButtonBorderType = BUILD


This gives a unique border color that tells the differance between buildin a unit and upgrading one. There other option also.

              
Code
DescriptLabel = CONTROLBAR:ToolTipBuildGondorFighterHorde


When you hover over this button it will give you a description. This is the CSF entry.

              
Code
InPalantir = Yes


Will this button show up in the Palantir? (The circular series of buttons around the portrait)

              
Code
ShowProductionCount = Yes


If you buy more than one a number will show up to tell you how many are in line to be built.

That sorta sums up the BUILD_UNIT command button. I'll go into the upgrade button at this point.

              
Code
CommandButton Command_PurchaseUpgradeGondorHeavyArmor
Command = OBJECT_UPGRADE
Options = NEED_UPGRADE OK_FOR_MULTI_SELECT CANCELABLE
Upgrade = Upgrade_GondorHeavyArmor
NeededUpgrade = Upgrade_TechnologyGondorHeavyArmor
TextLabel = CONTROLBAR:PurchaseUpgradeGondorHeavyArmor
ButtonImage = BGBlacksmith_HeavyArmor
ButtonBorderType = UPGRADE
DescriptLabel = CONTROLBAR:ToolTipPurchaseUpgradeGondorHeavyArmor
InPalantir = Yes
LacksPrerequisiteLabel = TOOLTIP:LackGondorHeavyArmor
End<


              
Code
Command = OBJECT_UPGRADE


This should be self explanatory at this point in the tutorial.

              
Code
Options = NEED_UPGRADE OK_FOR_MULTI_SELECT CANCELABLE


This means the player needs an upgrade to be able to use this button. (Namely you have to purchase this from the armory first)

              
Code
Upgrade = Upgrade_GondorHeavyArmor


This is where you tell the computer what upgrade is needed before you can purchase this object upgrade. (This one is purchased from the armory)

Here is an example of a SPECIAL_POWER command.

              
Code
CommandButton Command_SpellBookBalrogAlly
Command = SPELL_BOOK
SpecialPower = SpellBookBalrogAlly
Options = NEED_TARGET_POS ; Huh, you can't have this flag and a radius cursor: CONTEXTMODE_COMMAND
TextLabel = CONTROLBAR:SummonBalrog
ButtonImage = SBEvil_BalrogAlly
ButtonBorderType = ACTION ; Identifier for the User as to what kind of button this is
DescriptLabel = CONTROLBAR:TooltipSummonBalrog
RadiusCursorType = SUMMON_BALROG
CursorName = AttackObj
InvalidCursorName = GenericInvalid
End<


              
Code
SpecialPower = SpellBookBalrogAlly


This second line links it directly to the special power it refers to.

              
Code
Options = NEED_TARGET_POS


This means we are going to be placing this power on the map via a cursor.

              
Code
RadiusCursorType = SUMMON_BALROG


Now this tells it when you place it which special power cursor will we be using. When you place the Balrog ingame you notice it has an image on the map to tell you where he's going to show up.

We could go on forever talking about the parameters of every single button, but for the sake of space this should give some insight on how they work. Now onto the commandsets.

Every object has a commandset. This is the set of buttons that allows us to pick our unit commands.

              
Code
CommandSet GondorFighterHordeCommandSet
1 = Command_Guard
2 = Command_ToggleFormationGondorFighter
3 = Command_PurchaseUpgradeGondorForgedBlades
4 = Command_PurchaseUpgradeGondorHeavyArmor
5 = Command_PurchaseUpgradeGondorBasicTraining
13 = Command_AttackMove
14 = Command_Stop
15 = Command_Guard
End


As you can see, your Gondor Horde can choose to guard, toggle formations, purchase upgrades, and such. Commandsets are found in the commandset.ini file. They are assigned in the object itself under the unit listing of commandset.

I hope this answers a few questions regarding commandbuttons and commandsets. Any further questions about this tutorial can be answered by coming to our forums.

Credits

HostileOriginal Author

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

 
10:47:02