Jump to content


Fingulfin

Member Since 27 Jan 2006
Offline Last Active Jul 02 2018 02:39 PM

#346019 How to make a Switching CommandSet

Posted by Fingulfin on 19 August 2006 - 06:43 PM

Making a Working Switching Commandset (v 1.1)
A Fingulfin Tutorial

First off, thank you to all the good Folks at T3A who tried to help me get this working, including, but not limited to, Solinx, 2PlayGames, and Cahik_.

In this tutorial you will learn how to create a working Commandset Switch, compatable with BFME II.

Now on to the tutorial!

Switching Menu Tutorial

1: The Files

CommandButton.ini
Commandset.ini
lotr.STR

You will need to have a medium level knowledge of coding, including at least an O.K. knowledge of CommandButtons.

2: The CommandSet
Open CommandSet.ini, and create your new commandset. It should look along the lines of this:

CommandSet MyUnitSet
End

Now we will add all the spots.

CommandSet MyUnitSet
;	1	= 
;	2   = 
;	3   = 
;	4	= 
;	5	= 
;	6	= 
;	7	= 
;	8	= 
;	9	= 
;	10	= 
;	11	= 
;	12	= 
;	13	= 
;	14 	= 
;	15	= 
;	16	= 
;	17	= 
;	18	= 
;	19	= 
;	20	= 
;	21	= 
;	22	= 
;	23	= 
;	24	= 
;	25	= 
;	26	= 
;	30	= 
End

For Starters, leave everything commented out.

3: More CommandSets
Now is where it starts to get logical :p

CommandSet MyUnitSet
	//Main Menu
	1	= Command_ToggleStance
;	2   = 
;	3   = 
;	4	= 
;	5	= 
;	6	= 
;	7	= 
	8	= Command_AttackMove
	//Menu 2
;	9	= 
;	10	= 
;	11	= 
;	12	= 
;	13	= 
;	14 	= 
;	15	= 
	16	= Command_AttackMove
	//Extras
	30	= Command_CaptureBuilding
	31	= Command_Stop
End

You will see why it looks like this in a little bit. The Toggle Stance button is there so you can toggle Stances, Capture Building so you can Capture Stuff, Stop for the hell of it, and attack move at the bottom of every menu, so we can attack move no matter what menu we are on (I learned this the hard way :dry:)

4: The Visible Buttons
Add this at the top of the list, right under the CommandButton name, and Right Under the //Main Menu.
InitialVisible = 8

This makes it so only the first 8 buttons are pressable (so our hotkeys don't get confused). This is also the reason for all the attack Moves. Don't worry, we can still capture buildings and stop!

5: The CommandButton
Now we will make 2 Buttons. Do a search for one of the Fortress Menu Switchers (Example: Command_SelectUpgradesMordorFortress) Copy and paste one to the bottom of CommandSet.ini

CommandButton Command_SelectUpgradesMordorFortress
	Command				 = PUSH_VISIBLE_COMMAND_RANGE
	TextLabel			   = CONTROLBAR:SelectUpgradesMordorFortress
	ButtonImage			 = UCCommon_UpgradeStructureNew
	ButtonBorderType		= SYSTEM 
	DescriptLabel		   = CONTROLBAR:ToolTipCommandSelectUpgradesMordorFortress
	Radial				  = Yes
	CommandRangeStart		= 6
	CommandRangeCount		= 7
End

First, rename it 'Menu2Switcher', and tell it
CommandRangeStart	= 8
	CommandRangeCount	= 8

Now amend it to look like this:

CommandButton Command_Menu2Switcher
	Command				= PUSH_VISIBLE_COMMAND_RANGE
	TextLabel			= CONTROLBAR:SelectUpgradesMordorFortress
	ButtonImage			= UCCommon_UpgradeStructureNew
	ButtonBorderType		= SYSTEM 
	DescriptLabel			= CONTROLBAR:ToolTipCommandSelectUpgradesMordorFortress
	Radial			  = No
	InPalantir			= No
	CommandRangeStart	= 8
	CommandRangeCount	= 8
End

Note how I made it so you will not see the button (Radial = No, InPalantir = No). The 'Button Image' does not matter, as this button is invisible!

6: Enter the STR!
Now comes the interesting part: Under 'Text Label' type in CONTROLBAR:SwitchMenu. Then in your STR Type the Following:

CONTROLBAR:SwitchMenu
"&M"
End

This makes it so the HotKey for this button is 'M'.

However, the user will have no clue what it is, so we have to find a way to alert them!

7: The ShortCut Button
Make a new button. The Command doesn't matter, as you will not be able to click it. This is what I used:
CommandButton Command_Menu2Shortcut
	  Command				 = CANCEL_UPGRADE
	  Options					= NONPRESSABLE
	  TextLabel			   = CONTROLBAR:Menu2
	DescriptLabel	   		= CONTROLBAR:ToolTipMenu2
	  ButtonImage			 = UCCommon_EvilHeroes
	  ButtonBorderType		= ACTION
	  InPalantir				= Yes
End
Now a little bit about this button: It is Non-Pressable, which means the command Does not matter, It is 'InPalantir' so you can see it, it has an image (so you can see it :)) ant it has a 'TextLabel' and a 'DescriptLabel'. Now lets go fill those in.

8: More STRs and ComandSets
In your STR make 2 Strings:
CONTROLBAR:Menu2
"Go to Second Menu"
End

CONTROLBAR:ToolTipMenu2
"Press 'M' to go to the second menu"
End

Now add these 2 buttons to your commandset. When you are done, it should look like this:
CommandSet MyUnitSet
	InitialVisible = 8
	//Main Menu
	1	= Command_ToggleStance
;	2   = 
;	3   = 
;	4	= 
;	5	= 
	6	= Command_Menu2Shortcut
	7	= Command_Menu2Switcher
	8	= Command_AttackMove
	//Menu 2
;	9	= 
;	10	= 
;	11	= 
;	12	= 
;	13	= 
;	14 	= 
;	15	= 
	16	= Command_AttackMove
	//Extras
	30	= Command_CaptureBuilding
	31	= Command_Stop
End
Notice how the Working Button Is in the '7' Slot. This makes it so you can't see it (in the palantir it would be an invisible slot) but it is still active! The 'Shortcut' IS visible, so the player can hover over it, and be able to see what button to push to activate it.
Our CommandSet will now Switch! But we are not finished yet!

9: How do we get back?
Make another button:
CommandButton Command_MainMenuSwitcher
	Command				 = PUSH_VISIBLE_COMMAND_RANGE
	TextLabel				= CONTROLBAR:GoToMain
;	ButtonImage			 = UCCommon_EvilHeroes
	ButtonBorderType			= SYSTEM 
;	DescriptLabel	   		= CONTROLBAR:ToolTipGoToMain
	Radial				  = No
	InPalantir				= No
	CommandRangeStart		= 0
	CommandRangeCount		= 8
End
Then Fill in Your STR:
CONTROLBAR:GoToMain
"&N"
End

Make yet one more button (another Shortcut) that looks like this:
CommandButton Command_MainMenuShortcut
	  Command				 = CANCEL_UPGRADE
	  Options					= NONPRESSABLE
	  TextLabel			   = CONTROLBAR:MainMenuShortCut
	DescriptLabel	   		= CONTROLBAR:ToolTipMainMenuShortCut
	  ButtonImage			 = UCCommon_BackArrow
	  ButtonBorderType		= ACTION
	  InPalantir				= Yes
End
And once again, fill in the STR:
CONTROLBAR:MainMenuShortCut
"Go to Main Menu"
End
CONTROLBAR:ToolTipMainMenuShortCut
"Press 'N' to go back to the main Menu."
End

Add them to the commandSet and you are done!

10: Finished Work

You should, in total, have made 1 CommandSet, 4 CommandButtons, 6 STR Strings, and 1 Menu Switching System! Your Finished CommandSet should look like this:
CommandSet MyUnitSet
	InitialVisible = 8
	//Main Menu
	1	= Command_ToggleStance
;	2   = 
;	3   = 
;	4	= 
;	5	= 
	6	= Command_Menu2Shortcut
	7	= Command_Menu2Switcher
	8	= Command_AttackMove
	//Menu 2
;	9	= 
;	10	= 
;	11	= 
;	12	= 
;	13	= 
	14 	= Command_MainMenuShortcut
	15	= Command_MainMenuSwitcher
	16	= Command_AttackMove
	//Extras
	30	= Command_CaptureBuilding
	31	= Command_Stop
End
Just add your powers into the commented slots, and you have a hero with a HUGE Arsenal!

I hope this tutorial was helpful! If you beleive you can help me improve upon it, send me an e-mail at ulairemapping@yahoo.com, a PM on Revora, or simply post in the Topic where you found this!

Thanks in Advance,
-Fingulfin

Solinx: Corrected a numerical typo which led to some confusion.