addRating: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\|s1= +" to "|s1= ")
m (Some wiki formatting)
 
(11 intermediate revisions by the same user not shown)
Line 28: Line 28:
|gr1= Object Manipulation
|gr1= Object Manipulation


|descr= Add a number to the [[rating]] of a unit - negative values can be used to reduce the rating.
|descr= Add a number to the [[rating]] of a unit - negative values can be used to reduce the rating.<br>
<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.  
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}}.}}


<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]])
|s1= unitName [[addRating]] rating
 
<br><br>See also: [[Arma_3:_Event_Handlers#HandleRating]]
 
|s1= unitName '''addRating''' rating


|p1= unitName: [[Object]]
|p1= unitName: [[Object]]
Line 41: Line 39:
|p2= rating: [[Number]]
|p2= rating: [[Number]]


|r1=[[Nothing]]
|r1= [[Nothing]]
 
|x1= <sqf>player addRating 2000;</sqf>


|x1= <code>[[player]] [[addRating]] 2000;</code>
|x2= Set the rating to a specific value:
<sqf>
private _wantedRating = 9001;
player addRating (_wantedRating - rating player);
</sqf>


|seealso= [[Side relations]], [[ArmA: Rating Values|Rating Values]], [[rating]], [[rank]], [[setUnitRank]], [[sideEnemy]]
|seealso= [[Side Relations]] [[ArmA: Rating Values|Rating Values]] [[rating]] [[rank]] [[setUnitRank]] [[sideEnemy]]
}}
}}
<dl class="command_description">
<dt></dt>
<dd class="notedate">Posted on November 16, 2014 - 19:11 (UTC)</dd>
<dt class="note">[[User:Benargee|Benargee]]</dt>
<dd class="note">
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>
Using this example, no matter what the units rating was before, it will always set its rating to 1000.
</dd>
</dl>

Latest revision as of 13: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