addRating: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Some wiki formatting)
 
(57 intermediate revisions by 5 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 |= Arguments in MP
|game3= arma1
|version3= 1.00


|eff= global |= Effects in MP
|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
<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.  
|version5= 1.50


<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]])|= Description
|game6= tkoh
____________________________________________________________________________________________
|version6= 1.00


| unitName '''addRating''' rating |= Syntax
|game7= arma3
|version7= 0.50


|p1= unitName: [[Object]] |= Parameter 1
|arg= local


|p2= rating: [[Number]] |= Parameter 2
|eff= global


| [[Nothing]] |= Return value
|gr1= Object Manipulation
____________________________________________________________________________________________
 
|x1= <code>[[player]] [[addRating]] 2000;</code> |= Example 1
____________________________________________________________________________________________


| [[Side relations]], [[ArmA: Rating Values|Rating Values]], [[rating]], [[rank]], [[setUnitRank]], [[sideEnemy]] |= See also
|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}}.}}


}}
|s1= unitName [[addRating]] rating
 
|p1= unitName: [[Object]]


<h3 style="display:none">Notes</h3>
|p2= rating: [[Number]]
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|r1= [[Nothing]]
</dl>


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


[[Category:Scripting Commands|ADDRATING]]
|x2= Set the rating to a specific value:
[[Category:Scripting Commands OFP 1.99|ADDRATING]]
<sqf>
[[Category:Scripting Commands OFP 1.96|ADDRATING]]
private _wantedRating = 9001;
[[Category:Scripting Commands OFP 1.46|ADDRATING]]
player addRating (_wantedRating - rating player);
[[Category:Scripting Commands ArmA|ADDRATING]]
</sqf>
[[Category:Command_Group:_Mission_Information|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]


<!-- CONTINUE Notes -->
|seealso= [[Side Relations]] [[ArmA: Rating Values|Rating Values]] [[rating]] [[rank]] [[setUnitRank]] [[sideEnemy]]
<dl class="command_description">
}}
<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, it's expected behaviour can scripted as such:
<code><nowiki>_setRating = 100000;//value rating is to be set to.
_getRating =</nowiki> [[rating]] <nowiki>_unit;
_addVal = _setRating - _getRating;
_unit</nowiki> [[addRating]] _addVal;</code>
</dd>
</dl>
<!-- DISCONTINUE Notes -->

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