addRating: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "[[Category:Scripting_Commands_Take_On_Helicopters" to "[[Category:Scripting Commands Take On Helicopters")
m (Text replacement - " |r1=[[" to " |r1= [[")
(32 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| ofp |Game name=
|game1= ofp
|version1= 1.00


|1.00|Game version=
|game2= ofpe
|version2= 1.00


|arg= local |Multiplayer Arguments=
|game3= arma1
|version3= 1.00


|eff= global |Multiplayer Effects=
|game4= arma2
____________________________________________________________________________________________
|version4= 1.00


| Add a number to the [[rating]] of a unit - negative values can be used to reduce the rating.
|game5= arma2oa
|version5= 1.50
 
|game6= tkoh
|version6= 1.00
 
|game7= arma3
|version7= 0.50
 
|arg= local
 
|eff= global
 
|gr1= Object Manipulation
 
|descr= Add a number to the [[rating]] of a unit - negative values can be used to reduce the rating.
<br>This command is usually used to reward for completed mission objectives. The rating is given at the end of the mission and is automatically adjusted when killing enemies or friendlies.  
<br>This command is usually used to reward for completed mission objectives. The rating is given at the end of the mission and is automatically adjusted when killing enemies or friendlies.  


<br>When the rating gets below -2000, the unit's side switches to "ENEMY" ([[sideEnemy]]) and the unit is attacked by everyone.(see [[ArmA:_Rating Values|Rating Values]])
<br>When the rating gets below -2000, the unit's side switches to "ENEMY" ([[sideEnemy]]) and the unit is attacked by everyone.(see [[ArmA:_Rating Values|Rating Values]])


<br><br>See also: [[Arma_3:_Event_Handlers#HandleRating]] |DESCRIPTION=
<br><br>See also: [[Arma_3:_Event_Handlers#HandleRating]]
____________________________________________________________________________________________


| unitName '''addRating''' rating |SYNTAX=
|s1= unitName [[addRating]] rating


|p1= unitName: [[Object]] |PARAMETER1=
|p1= unitName: [[Object]]


|p2= rating: [[Number]] |PARAMETER2=
|p2= rating: [[Number]]


| [[Nothing]] |RETURNVALUE=
|r1= [[Nothing]]
____________________________________________________________________________________________
 
|x1= <code>[[player]] [[addRating]] 2000;</code> |EXAMPLE1=
____________________________________________________________________________________________


| [[Side relations]], [[ArmA: Rating Values|Rating Values]], [[rating]], [[rank]], [[setUnitRank]], [[sideEnemy]] |SEEALSO=
|x1= <code>[[player]] [[addRating]] 2000;</code>


|seealso= [[Side relations]], [[ArmA: Rating Values|Rating Values]], [[rating]], [[rank]], [[setUnitRank]], [[sideEnemy]]
}}
}}


<h3 style="display:none">Notes</h3>
 
<dl class="command_description">
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
<dt></dt>
</dl>
 
<h3 style="display:none">Bottom Section</h3>
 
[[Category:Scripting Commands|ADDRATING]]
[[Category:Scripting Commands OFP 1.99|ADDRATING]]
[[Category:Scripting Commands OFP 1.96|ADDRATING]]
[[Category:Scripting Commands OFP 1.46|ADDRATING]]
[[Category:Scripting Commands ArmA|ADDRATING]]
[[Category:Command_Group:_Mission_Information|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]]
 
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on November 16, 2014 - 19:11 (UTC)</dd>
<dd class="notedate">Posted on November 16, 2014 - 19:11 (UTC)</dd>
<dt class="note">[[User:Benargee|Benargee]]</dt>
<dt class="note">[[User:Benargee|Benargee]]</dt>
Line 71: Line 67:
Using this example, no matter what the units rating was before, it will always set its rating to 1000.
Using this example, no matter what the units rating was before, it will always set its rating to 1000.
</dd>
</dd>
</dl>
</dl>
<!-- DISCONTINUE Notes -->

Revision as of 23:36, 7 August 2021

Hover & click on the images for description

Description

Description:
Add a number to the rating of a unit - negative values can be used to reduce the rating.
This command is usually used to reward for completed mission objectives. The rating is given at the end of the mission and is automatically adjusted when killing enemies or friendlies.
When the rating gets below -2000, the unit's side switches to "ENEMY" (sideEnemy) and the unit is attacked by everyone.(see Rating Values)

See also: Arma_3:_Event_Handlers#HandleRating
Groups:
Object Manipulation

Syntax

Syntax:
unitName addRating rating
Parameters:
unitName: Object
rating: Number
Return Value:
Nothing

Examples

Example 1:
player addRating 2000;

Additional Information

See also:
Side relationsRating ValuesratingranksetUnitRanksideEnemy

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


Posted on November 16, 2014 - 19:11 (UTC)
Benargee
Since there is no setRating command, its expected behaviour can scripted as such: BNRG_fnc_setRating = { _setRating = _this select 0; _unit = _this select 1; _getRating = rating _unit; _addVal = _setRating - _getRating; _unit addRating _addVal; }; [1000,player] call BNRG_fnc_setRating//set player rating 1000 Using this example, no matter what the units rating was before, it will always set its rating to 1000.