Commanding Menu Modding – Arma Reforger
Lou Montana (talk | contribs) (Page creation) |
Lou Montana (talk | contribs) m (Add another one) |
||
(One intermediate revision by the same user not shown) | |||
Line 24: | Line 24: | ||
The <enforce inline>CanBeShown()</enforce> 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 <enforce inline>CanBeShown()</enforce> 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 {{Link|#CanBePerformed}} below. | The command can be shown, yet be unavailable - see {{Link|#CanBePerformed}} below. | ||
Line 93: | Line 92: | ||
=== Command Declaration === | === Command Declaration === | ||
The | The {{Link|enfusion://ResourceManager/~ArmaReforger:Configs/Commanding/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. | Now remains adding that command to the commanding menu. | ||
{{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 {{Link|enfusion://ResourceManager/~ArmaReforger:Configs/Commanding/CommandingMapMenu.conf}} config file declares what is present in the ''map'' commanding menu. | |||
The | |||
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. |
Latest revision as of 17:17, 13 October 2023
Class Creation
The first step is to create a new class inheriting from SCR_BaseGroupCommand.
From there, it is time to override important methods to give life to the command:
Execute
The Execute() 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 CanBeShown() 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 CanBePerformed() 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.