setUnitRank: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Some wiki formatting)
 
(44 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma |Game name=
|game1= ofpe
|version1= 1.00


|1.00|Game version=
|game2= arma1
|version2= 1.00


|arg= global |Multiplayer Arguments=
|game3= arma2
|version3= 1.00


|eff= local |Multiplayer Effects=
|game4= arma2oa
|version4= 1.50


|gr1= Unit Identity |GROUP1=
|game5= tkoh
____________________________________________________________________________________________
|version5= 1.00


| Sets rank of given unit.
|game6= arma3
|version6= 0.50


Possible rank values, and the associated [[rating]] that is automatically given:
|arg= global
{{{!}} class{{=}}"bikitable"
! rowspan{{=}}"2" {{!}} Rank !! colspan{{=}}"3" {{!}} Ratings
{{!}}-
! ArmA 1 !! {{arma2}} !! {{arma3}}
{{!}}-
{{!}} PRIVATE {{!}}{{!}} 0 {{!}}{{!}} ? {{!}}{{!}} 0
{{!}}-
{{!}} CORPORAL {{!}}{{!}} 500 {{!}}{{!}} ? {{!}}{{!}} 0
{{!}}-
{{!}} SERGEANT {{!}}{{!}} 1500 {{!}}{{!}} ? {{!}}{{!}} 0
{{!}}-
{{!}} LIEUTENANT {{!}}{{!}} 2500 {{!}}{{!}} ? {{!}}{{!}} 0
{{!}}-
{{!}} CAPTAIN {{!}}{{!}} 3500 {{!}}{{!}} ? {{!}}{{!}} 0
{{!}}-
{{!}} MAJOR {{!}}{{!}} 5000 {{!}}{{!}} ? {{!}}{{!}} 0
{{!}}-
{{!}} COLONEL {{!}}{{!}} 7500 {{!}}{{!}} ? {{!}}{{!}} 0
{{!}}}


{{Feature arma3| Since {{arma3}} v1.67 this command is {{EffArg|cmd|arg|glob}} {{EffArg|cmd|eff|glob}}}} |DESCRIPTION=
|eff= global
____________________________________________________________________________________________


| unitName [[setUnitRank]] rank |SYNTAX=
|gr1= Unit Identity


|p1= unitName: [[Object]] |PARAMETER1=
|descr= Sets rank of given unit.


|p2= rank: [[String]] - as above |PARAMETER2=
Possible rank values, and the associated [[rating]] that is '''set''' (not added, the value replaces previous rating) with it:


| [[Nothing]] |RETURNVALUE=
{{{!}} class="wikitable" style="text-align: center"
____________________________________________________________________________________________
! colspan="2" {{!}} Ranks
 
! PRIVATE
|x1= <code>[[player]] [[setUnitRank]] "COLONEL";</code> |EXAMPLE1=
! CORPORAL
____________________________________________________________________________________________
! SERGEANT
! LIEUTENANT
! CAPTAIN
! MAJOR
! COLONEL
{{!}}-
! rowspan="3" {{!}} Ratings
!
{{Name|arma1|short}}<br>
{{Name|arma2|short}}<br>
{{Name|arma2oa|short}}<br>
{{Name|tkoh|short}}
{{!}} 0
{{!}} 500
{{!}} 1500
{{!}} 2500
{{!}} 3500
{{!}} 5000
{{!}} 7500
{{!}}-
! {{Name|arma3|short}} (ca 2015)
{{!}} 0
{{!}} 50
{{!}} 150
{{!}} 250
{{!}} 350
{{!}} 500
{{!}} 750
{{!}}-
! {{Name|arma3|short}}
{{!}} 0
{{!}} 0
{{!}} 0
{{!}} 0
{{!}} 0
{{!}} 0
{{!}} 0
{{!}}}


| [[ArmA: Rating Values|Rating Values]], [[rating]], [[addRating]], [[rank]], [[setRank]] |SEEALSO=
{{Feature|arma3|Before {{arma3}} v1.68 and in previous titles, this command was {{Icon|globalArgument|32}} {{Icon|localEffect|32}}.}}
}}


<h3 style="display:none">Notes</h3>
|s1= unitName [[setUnitRank]] rank
<dl class="command_description">
<!-- Note Section BEGIN -->


<dd class="notedate">Posted on Mar 26, 2009 - 19:24
|p1= unitName: [[Object]]
<dt class="note">[[User:Wolfrug|Wolfrug]]
<dd class="note">
Changing a unit's rank using either [[setUnitRank]] or [[setRank]] will also REPLACE their current rating dependent on their new rank (colonels have a rating of 7500 etc). That is to say REPLACE, not add to: the unit's old rating will disappear with the rank change.


<dd class="notedate">Posted on December 24, 2015 - 21:10 (UTC)</dd>
|p2= rank: [[String]] - see above. If a wrong string is provided, the command errors and reverts to using "PRIVATE"
<dt class="note">[[User:Wyattwic|Wyattwic]]</dt>
<dd class="note">
In Arma 3, if the rank is not spelled correctly or the string is empty, it will default to Private.  This command is not case sensitive. For Arma 3 the rating set by this command is as follows.
    (PRIVATE: 0)
    (CORPORAL: 50)
    (SERGEANT: 150)
    (LIEUTENANT: 250)
    (CAPTAIN: 350)
    (MAJOR: 500)
    (COLONEL: 750)  The rating listed here will be present on base type respawn.
</dd>


<dd class="notedate">Posted on September 14, 2019 - 21:37 (UTC)</dd>
|r1= [[Nothing]]
<dt class="note">[[User:Lou Montana|Lou Montana]]</dt>
<dd class="note">
In {{arma3}} (v1.94), unit's rating is reset to '''zero'''. Also, all ranks start with a rating of '''zero'''.
</dd>
<!-- Note Section END -->
</dl>


<h3 style="display:none">Bottom Section</h3>
|x1= <sqf>player setUnitRank "COLONEL";</sqf>


[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
|seealso= [[ArmA: Armed Assault: Rating Values|Rating Values]] [[rating]] [[addRating]] [[rank]] [[setRank]]
[[Category:Scripting Commands OFP Elite |{{uc:{{PAGENAME}}}}]]
}}
[[Category:Scripting Commands Armed Assault|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Command_Group:_Object_Manipulation|{{uc:{{PAGENAME}}}}]]

Latest revision as of 18:03, 29 April 2023

Hover & click on the images for description

Description

Description:
Sets rank of given unit. Possible rank values, and the associated rating that is set (not added, the value replaces previous rating) with it:
Ranks PRIVATE CORPORAL SERGEANT LIEUTENANT CAPTAIN MAJOR COLONEL
Ratings

ArmA
Arma 2
Arma 2:OA
TKOH

0 500 1500 2500 3500 5000 7500
Arma 3 (ca 2015) 0 50 150 250 350 500 750
Arma 3 0 0 0 0 0 0 0
Arma 3
Before Arma 3 v1.68 and in previous titles, this command was GAGlobal LELocal.
Groups:
Unit Identity

Syntax

Syntax:
unitName setUnitRank rank
Parameters:
unitName: Object
rank: String - see above. If a wrong string is provided, the command errors and reverts to using "PRIVATE"
Return Value:
Nothing

Examples

Example 1:
player setUnitRank "COLONEL";

Additional Information

See also:
Rating Values rating addRating rank setRank

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