-
Notifications
You must be signed in to change notification settings - Fork 5
MFD Editing notes
In this document I will be talking about every piece of User Interface that is configured with arma 3's class MFD
in a cfgVehicles class.
This is a fairly unknown system, and it's fairly daunting, so I will be offering some examples in this picture of what is done with MFDs, and how it works.
In the above image everything with a red square around it is made with MFD technology. What this means is that it can be edited without access to the model or model.cfg.
Because MFDs are config defined, we can edit and redefine MFDs of vanilla vehicles, but not everything on a vanilla vehicle that looks like an MFD is actually defined with MFD technology.
In the above image, all red squares are defined with MFD technology, while the blue squares are actually animated textures on the vehicle. This means we cannot edit the blue squares with MFD technology.
Sometimes an MFD can be rendered over non-MFD technology so that we can edit them anyways, depending on whether the right mempoints are available to do so.
An MFD is rendered between 3 mempoints, these mempoints are points defined in the model, this means we cannot add them to any vanilla vehicles, but we can use any combination of 3 mempoints in a vanilla vehicle to set up an MFD.
class B_MBT_01_arty_base_F;
class B_MBT_01_arty_F: B_MBT_01_arty_base_F { // I am overriding the vanilla blufor howitzer
class MFD { // this is the wrapper for my MFD configurations
class GunnerDisplay { // this is a single MFD
alpha = 0.5; // opacity
bottomLeft = "mfd_gun_BL"; // these are the mempoints the MFD is rendered between
topLeft = "mfd_gun_TL"; // these are the mempoints the MFD is rendered between
topRight = "mfd_gun_TR"; // these are the mempoints the MFD is rendered between
borderBottom = 0; // this allows me to make a margin, so the MFD can be smaller than the area between mempoints
borderLeft = 0; // this allows me to make a margin, so the MFD can be smaller than the area between mempoints
borderRight = 0; // this allows me to make a margin, so the MFD can be smaller than the area between mempoints
borderTop = 0; // this allows me to make a margin, so the MFD can be smaller than the area between mempoints
color[] = {1,1,1}; // default colour for MFD elements
enableParallax = 0; // this means whether the MFD moves based on your head position, so this is used in a HUD
font = "EtelkaMonospaceProBold"; // default font
turret[] = {0}; // if you use any weapon related information in the MFD, it will use this turret's weapons
class Bones {}; // here we can define bones, this is used for moving elements, like a waypoint overlay
class Draw { // here we can draw elements
class background { // I'm drawing a background polygon here that just covers the whole MFD in a white square
type = "polygon";
points[] ={
{
{{0, 0},1},
{{1, 0},1},
{{1, 1},1},
{{0, 1},1}
}
};
};
}; // Draw
}; // GunnerDisplay
class CommanderDisplay: GunnerDisplay { // doing the same big white square but on the commander MFD
bottomLeft = "pip_com_BL";
topLeft = "pip_com_TL";
topRight = "pip_com_TR";
};
class DriverDisplay: GunnerDisplay { // doing the same but on the driver display
bottomLeft = "mfd_driver_1_BL";
topLeft = "mfd_driver_1_TL";
topRight = "mfd_driver_1_TR";
borderBottom = -8; // here I use a negative margin to make the MFD bigger than the mempoints it's defined between
borderLeft = -3.5;
borderRight = -1;
borderTop = -8;
};
}; // MFD
}; // B_MBT_01_arty_base_F
}; // cfgVehicles
The above config results in the following MFDs:
Driver:
In the above screenshot you can see some of the MFD square outlines that are defined in texture
Gunner:
Above you can see the turret direction indicator, which is not MFD defined but an animated texture
Commander:
Seeing mempoints
private _action = ["toggle_mem", "toggle vehicle mempoints", "", {DRAW_MEMPOINTS = !DRAW_MEMPOINTS;}, {true}] call ace_interact_menu_fnc_createAction;
[typeof player, 1, ["ACE_SelfActions"], _action] call ace_interact_menu_fnc_addActionToClass;
[] spawn {
STOP_DRAWING = true;
sleep 0.1;
STOP_DRAWING = false;
if (isNil "DRAW_MEMPOINTS") then {DRAW_MEMPOINTS = false;};
if (isNil "CUSTOM_DRAW") then {CUSTOM_DRAW = [];};
waitUntil {
{
drawIcon3D [
"\a3\ui_f\data\IGUI\Cfg\Cursors\selected_ca.paa",
[1,0,0,1],
(vehicle player) modelToWorld _x,
1,
1,
0,
str _foreachIndex,
2,
0.03
];
} forEach CUSTOM_DRAW;
if (DRAW_MEMPOINTS) then {
{
drawIcon3D [
"\a3\ui_f\data\IGUI\Cfg\Cursors\selected_ca.paa",
[1,1,1,1],
(vehicle player) modelToWorld ((vehicle player) selectionPosition _x),
1,
1,
0,
_x,
2,
0.03
];
} forEach (vehicle player selectionNames "memory");
};
STOP_DRAWING
};
}
Finding a mempoint position
vehicle player selectionPosition "mempointname"