This is the second part to my ini coding Beginners guide.
I would advise reading the 1st part of the tutorial before doing this one.
Tools Needed
Final big
Files to be edited
CommandSet.ini
CommandButton.ini
Command Buttons
A command button is a command for an object to preform a task. Each button has a unique name. All these buttons can be found in CommandButtons.ini. Here is the command button for the gondor soldier.
CommandButton Command_ConstructGondorFighterHorde Command = UNIT_BUILD Object = GondorFighterHorde [B]; The to be trained or built[/B] Options = CANCELABLE TextLabel = CONTROLBAR:ConstructGondorFighterHorde[B];I would not change this unless you know about strings[/B] ButtonImage = BGBarracks_Soldiers [B];This is the button image the command button uses[/B] ButtonBorderType = BUILD[B]; Identifier for the User as to what kind of button this is[/B] DescriptLabel = CONTROLBAR:ToolTipBuildGondorFighterHorde[B];I would not change this unless you know about strings[/B] Radial = Yes InPalantir = Yes ShowProductionCount = Yes End
Command Sets
A command set is where you assign command buttons to a unit, building or hero. For Example, here is the gondor soldier horde's command set.
CommandSet GondorFighterHordeCommandSet 1 = Command_ToggleStance [B];The button to bring out the stance selections[/B] 2 = Command_ToggleFormationGondorFighter [B];The button to put the horde into their alternate formation[/B] 3 = Command_PurchaseUpgradeGondorForgedBlades [B]; The button to upgrade them with forged blades[/B] 4 = Command_PurchaseUpgradeGondorHeavyArmor [B]; The button to upgrade them with Heavy Armor[/B] 5 = Command_PurchaseUpgradeGondorBasicTraining[B]; The button to upgrade them with a banner[/B] 12 = Command_CaptureBuilding 13 = Command_AttackMove 14 = Command_Stop 16 = Command_SetStanceBattle 17 = Command_SetStanceAggressive 18 = Command_SetStanceHoldGround End
Each command set has a unique name, which is then assigned to a building or unit through their object.ini.
Each command button has to be numbed in order it will appear in the palantir ingame. Any numbers over 6 will not be shown in the palantir, as there are only 6 spaces in the palantir. Except building commandsets and builder commandsets, as thier commands arnt shown in the palantir.
You now know abit about how commandbutton.ini and commandset.ini work. Now i'll show you how make a unit buildable from anouther building.
Open CommandButton.ini, and type
InnGondorRangerHorde
in the find bar (Ctrl + f).
You should find the following command button.
CommandButton Command_ConstructInnGondorRangerHorde Command = UNIT_BUILD Object = GondorRangerInnHorde Options = CANCELABLE TextLabel = CONTROLBAR:ConstructGondorRangerSummonedHorde ButtonImage = BCInn_DunedainRanger ButtonBorderType = BUILD DescriptLabel = CONTROLBAR:ToolTipBuildGondorRangerSummonedHorde Radial = Yes InPalantir = Yes ShowProductionCount = Yes UnitSpecificSound = GondorArcherVoiceBuy End
That is the command button for the dunedain ranger horde, which is normally trained from men's inn.
Copy the button name
Command_ConstructInnGondorRangerHordeand open CommandSet.ini, type
GondorArcheryCommandSetin the find bar. You should now see this command set.
CommandSet GondorArcheryCommandSet 1 = Command_ConstructGondorArcherHorde 2 = Command_ConstructGondorRangerHorde 3 = Command_PurchaseTechnologyGondorFireArrows 4 = Command_PurchaseUpgradeGondorArcheryRangeLevel2 6 = Command_Sell End CommandSet GondorArcheryCommandSetLevel2 1 = Command_ConstructGondorArcherHorde 2 = Command_ConstructGondorRangerHorde 3 = Command_PurchaseTechnologyGondorFireArrows 4 = Command_PurchaseUpgradeGondorArcheryRangeLevel3 6 = Command_Sell End CommandSet GondorArcheryCommandSetLevel3 1 = Command_ConstructGondorArcherHorde 2 = Command_ConstructGondorRangerHorde 3 = Command_PurchaseTechnologyGondorFireArrows 6 = Command_Sell EndThis is Men's Archery range command set, there is one command set for each level of the building. Now paste the dunedain rangers build button that you copied earlier into the command sets. So they should now look like this.
CommandSet GondorArcheryCommandSet 1 = Command_ConstructGondorArcherHorde 2 = Command_ConstructGondorRangerHorde 3 = Command_ConstructInnGondorRangerHorde 4 = Command_PurchaseTechnologyGondorFireArrows 5 = Command_PurchaseUpgradeGondorArcheryRangeLevel2 6 = Command_Sell End CommandSet GondorArcheryCommandSetLevel2 1 = Command_ConstructGondorArcherHorde 2 = Command_ConstructGondorRangerHorde 3 = Command_ConstructInnGondorRangerHorde 4 = Command_PurchaseTechnologyGondorFireArrows 5 = Command_PurchaseUpgradeGondorArcheryRangeLevel3 6 = Command_Sell End CommandSet GondorArcheryCommandSetLevel3 1 = Command_ConstructGondorArcherHorde 2 = Command_ConstructGondorRangerHorde 3 = Command_ConstructInnGondorRangerHorde 4 = Command_PurchaseTechnologyGondorFireArrows 6 = Command_Sell EndThe dunedain rangers are now buildable from the archery range.
But as they are a powerful unit, they should only be available from a level 2 archery range.
So if you open CommandButton.ini again, and find
CommandButton Command_ConstructInnGondorRangerHorde Command = UNIT_BUILD Object = GondorRangerInnHorde Options = CANCELABLE TextLabel = CONTROLBAR:ConstructGondorRangerSummonedHorde ButtonImage = BCInn_DunedainRanger ButtonBorderType = BUILD DescriptLabel = CONTROLBAR:ToolTipBuildGondorRangerSummonedHorde Radial = Yes InPalantir = Yes ShowProductionCount = Yes UnitSpecificSound = GondorArcherVoiceBuy EndAdd
NEED_UPGRADEto Options, then add in the following line under options.
NeededUpgrade = Upgrade_GondorArcheryRangeLevel2This will make it so that the dunedain rangers are avaible only from a level 2 men archery range.
So the command button should now look like this,
CommandButton Command_ConstructInnGondorRangerHorde Command = UNIT_BUILD Object = GondorRangerInnHorde Options = CANCELABLE NEED_UPGRADE NeededUpgrade = Upgrade_GondorArcheryRangeLevel2 TextLabel = CONTROLBAR:ConstructGondorRangerSummonedHorde ButtonImage = BCInn_DunedainRanger ButtonBorderType = BUILD DescriptLabel = CONTROLBAR:ToolTipBuildGondorRangerSummonedHorde Radial = Yes InPalantir = Yes ShowProductionCount = Yes UnitSpecificSound = GondorArcherVoiceBuy End
You have now finnished the tutorial. Have an attempt at adding diferent units to diferent command sets.
You have learned
What a command button is,
What a command set is,
How to move units, buildings and upgrades to diferent command sets.