Difference between revisions of "EMFRoleSet"

From cluster wiki
Jump to navigation Jump to search
Line 1: Line 1:
=== Description ===
<div style="padding:0.33em 2em;font-size:1.2em;font-weight:bold;display:block; border-bottom: #25A1A1 solid 1px; background-color:#E0FFFF;color:#25A1A1">Description</div>
{| class="wikitable"
!Description:
|This function sets the team and squad role of a playerunit, due to how i use EMF in missions it is required for a lot of functions in EMF. it is recommended you run this function for each playable unit in your mission.
|-
!Execution:
|call
|-
!Groups:
|Utility Functions: Eric's Mission Framework
|}


=== Syntax ===
<dl style="width:100%;">
{| class="wikitable"
!Syntax:
|[unit, role, team] call '''EMF_fnc_EMFRoleSet'''
|-
!Parameters:
|unit: Object - Unit to affect.


<!-- DESCRIPTION -->
<dt style="clear:both;font-weight:bold;position:absolute;padding:.3em;">Description:</dt>
<dd style="width:90%;padding:.3em .3em .3em 7em;"><div style="display:block;">
This function sets the team and squad role of a playerunit, due to how i use EMF in missions it is required for a lot of functions in EMF. it is recommended you run this function for each playable unit in your mission.
</div></dd>
<!-- EXECUTION -->
<dt style="clear:both;font-weight:bold;position:absolute;padding:.3em;">Execution:</dt>
<dd style="width:90%;padding:.3em .3em .3em 7em;"><div style="display:block;">
call
</div></dd>
<!-- GROUPS -->
<dt style="clear:both;font-weight:bold;position:absolute;padding:.3em;">Groups:</dt>
<dd style="width:90%;padding:.3em .3em .3em 7em;"><div style="display:block;">
Utility Functions: Eric's Mission Framework
</div></dd>
</dl>
<div style="padding:0.33em 2em;font-size:1.2em;font-weight:bold;display:block;border-bottom: #25A1A1 solid 1px; background-color:#E0FFFF;color:#25A1A1">Syntax</div>
<dl style="width:100%;">
<!-- SYNTAX -->
<dt style="clear:both;font-weight:bold;position:absolute;padding:.3em;">Syntax:</dt>
<dd style="width:90%;padding:.3em .3em .3em 7em;"><div style="display:block;">
[unit, role, team] call '''EMF_fnc_EMFRoleSet'''
</div></dd>
<!-- PARAMETERS -->
<dt style="clear:both;font-weight:bold;position:absolute;padding:.3em;">Parameters:</dt>
<dd style="width:90%;padding:.3em .3em .3em 7em;"><div style="display:block;">
unit: Object - Unit to affect.
</div></dd>
<dd style="width:90%;padding:.3em .3em .3em 7em;"><div style="display:block;">
role: String - Unit's Squad Role as defined in the loadout whitelist.
role: String - Unit's Squad Role as defined in the loadout whitelist.
</div></dd>


<dd style="width:90%;padding:.3em .3em .3em 7em;"><div style="display:block;">
Team: Number - (Optional) Sets team. [Default: 0]
Team: Number - (Optional) Sets team. [Default: 0]
|-
</div></dd>
!Return Value:
|Boolean - Returns true on success.
|}


=== Examples ===
<!-- RETURN VALUE -->
{| class="wikitable"
<dt style="clear:both;font-weight:bold;position:absolute;padding:.3em;">Return Value:</dt>
|// Set myUnit's role to "SL"
<dd style="width:90%;padding:.3em .3em .3em 7em;"><div style="display:block;">
[myUnit, "SL"] call EMF_fnc_EMFRoleSet;
Boolean - Returns true on success.
|-
</div></dd>
|// Set this object's role to "MED" and team to 1
</dl>


[this, "MED", 1] call EMF_fnc_EMFRoleSet;
<div style="padding:0.33em 2em;font-size:1.2em;font-weight:bold;display:block; border-bottom: #25A1A1 solid 1px; background-color:#E0FFFF;color:#25A1A1">Examples</div>
|}
<dl style="width:100%;">


=== Notes ===
<!-- EXAMPLE -->
<dt style="clear:both;font-weight:bold;position:absolute;padding:.3em;">Example 1:</dt>
<dd style="width:90%;padding:.3em .3em .3em 7em;"><code style="border:#25A1A1 dashed 1px;display:block;">
// Set myUnit's role to "SL"
[myUnit, "SL"] call '''EMF_fnc_EMFRoleSet''';
</code></dd>


<!-- EXAMPLE -->
<dt style="clear:both;font-weight:bold;position:absolute;padding:.3em;">Example 1:</dt>
<dd style="width:90%;padding:.3em .3em .3em 7em;"><code style="border:#25A1A1 dashed 1px;display:block;">
// Set this object's role to "MED" and team to 1<br>
[this, "MED", 1] call '''EMF_fnc_EMFRoleSet''';
</code></dd>
</dl>
<div style="padding:0.33em 2em;font-size:1.2em;font-weight:bold;display:block;border-bottom: #25A1A1 solid 1px; background-color:#E0FFFF;color:#25A1A1">Additional Information</div>
<!-- ADDITIONAL INFORMATION -->
<dl style="width:100%;">
<!-- SEE ALSO -->
<dt style="clear:both;font-weight:bold;position:absolute;padding:.3em;">See also:</dt>
<dd style="width:90%;padding:.3em .3em .3em 7em;column-count:4;">
</dd>
</dl>
<div style="padding:0.33em 2em;font-size:1.2em;font-weight:bold;display:block;border-bottom: #25A1A1 solid 1px; background-color:#E0FFFF;color:#25A1A1">Notes</div>
<!-- NOTES -->
* the variable name for unit role is: '''unitSquadRole''' <sup>(this is subject to change in the near future)</sup>
* the variable name for unit role is: '''unitSquadRole''' <sup>(this is subject to change in the near future)</sup>
* the variable name for unit team is: '''unitTeamRole''' <sup>(this is subject to change in the near future)</sup>
* the variable name for unit team is: '''unitTeamRole''' <sup>(this is subject to change in the near future)</sup>
<!-- CATEGORIES -->
[[Category:Utility Functions: Eric's Mission Framework]]
[[Category:Utility Functions: Eric's Mission Framework]]

Revision as of 19:11, 15 June 2021

Description
Description:

This function sets the team and squad role of a playerunit, due to how i use EMF in missions it is required for a lot of functions in EMF. it is recommended you run this function for each playable unit in your mission.

Execution:

call

Groups:

Utility Functions: Eric's Mission Framework

Syntax
Syntax:

[unit, role, team] call EMF_fnc_EMFRoleSet

Parameters:

unit: Object - Unit to affect.

role: String - Unit's Squad Role as defined in the loadout whitelist.

Team: Number - (Optional) Sets team. [Default: 0]

Return Value:

Boolean - Returns true on success.

Examples
Example 1:
// Set myUnit's role to "SL" [myUnit, "SL"] call EMF_fnc_EMFRoleSet;
Example 1:
// Set this object's role to "MED" and team to 1
[this, "MED", 1] call EMF_fnc_EMFRoleSet;
Additional Information
See also:


Notes
  • the variable name for unit role is: unitSquadRole (this is subject to change in the near future)
  • the variable name for unit team is: unitTeamRole (this is subject to change in the near future)