Commanding Menu Modding – Arma Reforger
Lou Montana (talk | contribs) (Page creation) |
Lou Montana (talk | contribs) (Add config links) |
||
Line 98: | Line 98: | ||
{{Feature|informative| | {{Feature|informative| | ||
A command class can be used more than once, provided its <enforce inline>[Attribute()]</enforce> make it generic and malleable enough <!-- see <enforce inline>SCR_WaypointGroupCommand</enforce> multiple usages in {{Link | A command class can be used more than once, provided its <enforce inline>[Attribute()]</enforce> make it generic and malleable enough <!-- see <enforce inline>SCR_WaypointGroupCommand</enforce> multiple usages in {{Link|enfusion://ResourceManager/~ArmaReforger:Configs/Commanding/Commands.conf}} .--> | ||
}} | }} | ||
=== Command Menu Declaration === | === Command Menu Declaration === | ||
The | The {{Link|enfusion://ResourceManager/~ArmaReforger:Configs/Commanding/CommandingMenu.conf}} config file declares what is present in the actual commanding menu. | ||
The | The {{Link|enfusion://ResourceManager/~ArmaReforger:Configs/Commanding/CommandingMapMenu.conf}} config file declares what is present in the ''map'' commanding menu. | ||
Commands are referenced simply by their previously declared ID there along with their display text. | Commands are referenced simply by their previously declared ID there along with their display text. |
Revision as of 12:23, 13 October 2023
Class Creation
The first step is to create a new class inheriting from cSCR_BaseGroupCommand.
From there, it is time to override important methods to give life to the command:
Execute
The cExecute() method determines what happens when the command is executed from the menu; it can be AI commanding, but it can actually be anything - an emote, a hint, a Game Master lightning, etc.
CanBeShown
The cCanBeShown() method determines when is the command shown in the command menu; for example, a "move" order cannot be issued by a non-leader, a "get in" order cannot be issued without aiming at a vehicle, etc.
The command can be shown, yet be unavailable - see CanBePerformed below.
CanBePerformed
The cCanBePerformed() method determines whether or not the command can be executed; for example, an emote cannot be used when in a vehicle, lightning cannot be thrown if not aiming at the terrain, etc.
Example
Config Declaration
Command Declaration
The commands.conf config file is the file that declares the class as a command and holds its various properties, including its string ID, whether or not the command is leader-only, etc.
Now remains adding that command to the commanding menu.
Command Menu Declaration
The CommandingMenu.conf config file declares what is present in the actual commanding menu.
The CommandingMapMenu.conf config file declares what is present in the map commanding menu.
Commands are referenced simply by their previously declared ID there along with their display text.
That's it! The new command is now added to the desired Command Menu.