Configuration - gruppe-adler/grad-aiCommand GitHub Wiki
Add the class CfgGradAICommand
to your description.ext
and set any of these attributes to configure the module:
General Settings
Set these attributes directly in CfgGradAICommand
:
Attribute | Default Value | Explanation |
---|---|---|
canGiveCommandsDefault | 1 | Can every player give commands by default? (0/1) |
canReceiveCommandsDefault | 1 | Can every AI receive commands by default? (0/1) |
canUseHighcommandDefault | 0 | Can every player use the high command mode? (0/1) |
Events
Set these attributes directly in CfgGradAICommand
:
Attribute | Default Value | Explanation |
---|---|---|
onMapOpenend | "" | String - Statement that is executed when aiCommand map is openend. In Highcommand mode params 0 and 1 will be the editing unit. Parameters are [edited unit, editing unit, display, map control] . |
onGroupSelected | "" | String - Statement that is executed when a new group is selected. Parameters are [selected group] . |
onGroupUnselected | "" | String - Statement that is executed when a group is unselected. Also gets triggered by selecting a new group. Parameters are [previously selected group] . |
onWaypointSelected | "" | String - Statement that is executed when a waypoint is rightclicked. Parameters are [waypoint,group] . |
onWaypointCreated | "" | String - Statement that is executed when a waypoint is created. Parameters are [waypoint,group] . |
Custom
Create child classes within CfgGradAICommand
to add custom menu entries. There are also functions available to do this.
Child Class | Explanation |
---|---|
customWaypointActions | Add custom waypoint actions here. Will be executed when waypoint is completed. No _this array! Instead the variables this (group leader) and thisList (group units) are available. |
customWaypointContext | Add custom waypoint contextmenu entries here. Will be executed instantly. Passed parameters are [group,waypoint] . |
customGroupContext | Add custom group contextmenu entries here. Will be executed instantly. Passed parameters are [group] . |
Create one class per entry within the child classes mentioned above. Each one only needs the following attributes:
Attribute | Explanation |
---|---|
displayName | String - Name that will be displayed in context menu. |
statement | String - Statement that will be executed. |
Example:
class CfgGradAICommand {
canReceiveCommandsDefault = 1;
canGiveCommandsDefault = 1;
canUseHighcommandDefault = 0;
onMapOpenend = "diag_log _this";
onGroupSelected = "diag_log _this";
onGroupUnselected = "diag_log _this";
onWaypointSelected = "diag_log _this";
onWaypointCreated = "diag_log _this";
class customWaypointActions {
class myTestWaypointAction {
displayName = "Test123";
statement = "diag_log ['action1 complete',this]";
};
};
class customWaypointContext {
class myTestWaypointContext {
displayName = "test wp";
statement = "diag_log ['test wp',_this]";
};
};
class customGroupContext {
class myTestGroupContext {
displayName = "test context";
statement = "diag_log ['test1',_this]";
};
class myOtherGroupContext {
[...]
};
};
};