addRating: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("serv...)
m (Some wiki formatting)
 
(32 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command
{{RV|type=command


| ofp
|game1= ofp
|version1= 1.00


|1.00
|game2= ofpe
|version2= 1.00


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


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


|gr1= Object Manipulation
|game5= arma2oa
|version5= 1.50


| Add a number to the [[rating]] of a unit - negative values can be used to reduce the rating.
|game6= tkoh
<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.  
|version6= 1.00


<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]])
|game7= arma3
|version7= 0.50


<br><br>See also: [[Arma_3:_Event_Handlers#HandleRating]]
|arg= local


| unitName '''addRating''' rating
|eff= global


|p1= unitName: [[Object]]
|gr1= Object Manipulation


|p2= rating: [[Number]]
|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>
When the rating gets below -2000, the unit's side switches to [[sideEnemy]] and the unit is attacked by everyone.
{{Feature|informative|See also {{Link|ArmA: Armed Assault: Rating Values}} and {{Link|Arma 3: Event Handlers#HandleRating}}.}}


| [[Nothing]]
|s1= unitName [[addRating]] rating
 
|x1= <code>[[player]] [[addRating]] 2000;</code>


| [[Side relations]], [[ArmA: Rating Values|Rating Values]], [[rating]], [[rank]], [[setUnitRank]], [[sideEnemy]]
|p1= unitName: [[Object]]


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


<h3 style="display:none">Bottom Section</h3>
|r1= [[Nothing]]


[[Category:Scripting Commands|ADDRATING]]
|x1= <sqf>player addRating 2000;</sqf>
[[Category:Scripting Commands OFP 1.99|ADDRATING]]
[[Category:Scripting Commands OFP 1.96|ADDRATING]]
[[Category:Scripting Commands OFP 1.46|ADDRATING]]
{{GameCategory|arma1|Scripting Commands}}
{{GameCategory|arma2|Scripting Commands}}
{{GameCategory|arma3|Scripting Commands}}
{{GameCategory|tkoh|Scripting Commands}}


<!-- CONTINUE Notes -->
|x2= Set the rating to a specific value:
<dl class="command_description">
<sqf>
<dd class="notedate">Posted on November 16, 2014 - 19:11 (UTC)</dd>
private _wantedRating = 9001;
<dt class="note">[[User:Benargee|Benargee]]</dt>
player addRating (_wantedRating - rating player);
<dd class="note">
</sqf>
Since there is no '''setRating''' command, its expected behaviour can scripted as such:
<code>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</code>
|seealso= [[Side Relations]] [[ArmA: Rating Values|Rating Values]] [[rating]] [[rank]] [[setUnitRank]] [[sideEnemy]]
Using this example, no matter what the units rating was before, it will always set its rating to 1000.
}}
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 14:07, 12 March 2024

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 sideEnemy and the unit is attacked by everyone.
Groups:
Object Manipulation

Syntax

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

Examples

Example 1:
player addRating 2000;
Example 2:
Set the rating to a specific value:
private _wantedRating = 9001; player addRating (_wantedRating - rating player);

Additional Information

See also:
Side Relations Rating Values rating rank setUnitRank sideEnemy

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