setUserMFDValue: Difference between revisions

From Bohemia Interactive Community
No edit summary
(mfdMaxUserValues)
 
(32 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma3 |= Game name
|game1= arma3
|version1= 1.70


|1.70|= Game version
|gr1= Interaction
____________________________________________________________________________________________


| When MFD is using user controllers, this command can set values on them. For example, MFD config for Blackfoot has an entry
|descr= When MFD is using user controllers, this command can set values on them. For example, MFD config for Blackfoot has an entry
<syntaxhighlight lang=cpp>
<syntaxhighlight lang="cpp">
...
// ...
class Draw
class Draw
{
{
alpha = "user3";
alpha = "user3";
color[] = {"user0","user1","user2"};
color[] = {"user0","user1","user2"};
...
// ...
</syntaxhighlight>
</syntaxhighlight>
which could control color of the MFD. See Example 2-3-4 on how to set different colors of the Blackfoot MFD |= Description
which could control color of the MFD. See Example 2-3-4 on how to set different colors of the Blackfoot MFD<br>
____________________________________________________________________________________________
{{Feature|GVI|arma3|2.20|Vehicles can be configured to support more than 50 user sources with "mfdMaxUserValues {{=}} 50" entry in CfgVehicles config class. As of 2.20 the limit is 256. It is recommended to configure this also for vehicles that use fewer MFD sources, it improves performance to only set as many as are being used.}}


| vehicle '''setUserMFDValue''' [index, value]|= Syntax
|s1= vehicle [[setUserMFDValue]] [index, value]


|p1= vehicle: [[Object]] - an vehicle with MFD |= Parameter 1
|p1= vehicle: [[Object]] - an vehicle with MFD


|p2= index: [[Number]] - index of custom MFD user actions |= Parameter 2
|p2= index: [[Number]] - index of custom MFD user actions


|p3= value: [[Number]] - value which should custom source return in MFD |= Parameter 3
|p3= value: [[Number]] - value which should custom source return in MFD


| [[Nothing]] |= Return value
|r1= [[Nothing]]
____________________________________________________________________________________________
 
|x1= <code> BIS_Plane [[setUserMFDValue]] [0,1]; // user0 in MFD will return 1</code> |= Example 1


|x2= Set MFD Red:<code>Blackfoot [[setUserMFDvalue]] [0, 1]; // "user0" - 1
|x1= <sqf>BIS_Plane setUserMFDValue [0,1]; // user0 in MFD will return 1</sqf>
Blackfoot [[setUserMFDValue]] [1, 0]; // "user1" - 0
Blackfoot [[setUserMFDValue]] [2, 0]; // "user2" - 0
Blackfoot [[setUserMFDValue]] [3, 1]; // "user3" - 1</code> |= Example 2


|x3= Set MFD pale Blue:<code>Blackfoot [[setUserMFDValue]] [0, 0]; // "user0" - 0
|x2= Set MFD Red:
Blackfoot [[setUserMFDValue]] [1, 0]; // "user1" - 0
<sqf>
Blackfoot [[setUserMFDValue]] [2, 1]; // "user2" - 1
Blackfoot setUserMFDValue [0, 1]; // "user0" - 1
Blackfoot [[setUserMFDValue]] [3, 0.1]; // "user3" - 0.1</code> |= Example 3
Blackfoot setUserMFDValue [1, 0]; // "user1" - 0
Blackfoot setUserMFDValue [2, 0]; // "user2" - 0
Blackfoot setUserMFDValue [3, 1]; // "user3" - 1
</sqf>


|x4= Hide MFD:<code>Blackfoot [[setUserMFDValue]] [3, 0]; // "user3" - 0</code> |= Example 4
|x3= Set MFD pale Blue:
____________________________________________________________________________________________
<sqf>
Blackfoot setUserMFDValue [0, 0]; // "user0" - 0
Blackfoot setUserMFDValue [1, 0]; // "user1" - 0
Blackfoot setUserMFDValue [2, 1]; // "user2" - 1
Blackfoot setUserMFDValue [3, 0.1]; // "user3" - 0.1
</sqf>


| [[getUserMFDValue]], [[setUserMFDText]], [[getUserMFDText]]|= See also
|x4= Hide MFD:
<sqf>Blackfoot setUserMFDValue [3, 0]; // "user3" - 0</sqf>


|x5= {{GVI|arma3|1.72}} multiple changes at once:
<sqf>
myPlane setUserMFDValue [10, 16, 404, 64]; // "user10" - 16
// "user11" - 404
// "user12" - 64
</sqf>
|seealso= [[getUserMFDValue]] [[setUserMFDText]] [[getUserMFDText]]
}}
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]

Latest revision as of 18:50, 18 March 2025

Hover & click on the images for description

Description

Description:
When MFD is using user controllers, this command can set values on them. For example, MFD config for Blackfoot has an entry
// ...
class Draw
{
	alpha = "user3";
	color[] = {"user0","user1","user2"};
// ...

which could control color of the MFD. See Example 2-3-4 on how to set different colors of the Blackfoot MFD

Vehicles can be configured to support more than 50 user sources with "mfdMaxUserValues = 50" entry in CfgVehicles config class. As of 2.20 the limit is 256. It is recommended to configure this also for vehicles that use fewer MFD sources, it improves performance to only set as many as are being used.
Groups:
Interaction

Syntax

Syntax:
vehicle setUserMFDValue [index, value]
Parameters:
vehicle: Object - an vehicle with MFD
index: Number - index of custom MFD user actions
value: Number - value which should custom source return in MFD
Return Value:
Nothing

Examples

Example 1:
Copy
BIS_Plane setUserMFDValue [0,1]; // user0 in MFD will return 1
Example 2:
Set MFD Red:
Copy
Blackfoot setUserMFDValue [0, 1]; // "user0" - 1 Blackfoot setUserMFDValue [1, 0]; // "user1" - 0 Blackfoot setUserMFDValue [2, 0]; // "user2" - 0 Blackfoot setUserMFDValue [3, 1]; // "user3" - 1
Example 3:
Set MFD pale Blue:
Copy
Blackfoot setUserMFDValue [0, 0]; // "user0" - 0 Blackfoot setUserMFDValue [1, 0]; // "user1" - 0 Blackfoot setUserMFDValue [2, 1]; // "user2" - 1 Blackfoot setUserMFDValue [3, 0.1]; // "user3" - 0.1
Example 4:
Hide MFD:
Copy
Blackfoot setUserMFDValue [3, 0]; // "user3" - 0
Example 5:
Arma 3 logo black.png1.72 multiple changes at once:
Copy
myPlane setUserMFDValue [10, 16, 404, 64]; // "user10" - 16 // "user11" - 404 // "user12" - 64

Additional Information

See also:
getUserMFDValue setUserMFDText getUserMFDText

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note