Arma 3 Scripting

BIS_fnc_respect

  • Arma 3 v0.50
  • First in Arma 2 v1.00

Function · Markdown · JSON · original wiki page

Description

RESpect - The Effective Calculation Process. Manages "respect" values: an Array of Numbers in range -1..1, one per faction in the order returned by BIS_fnc_getFactions, stored in the public "respect" variable of a unit or of a town logic. "ADD" and "KILLED" work with town logics as used by Ambient Civilians (the unit's "ALICE_twn" variable, the town's "neighbors" variable). No Arma 3 script calls this function.

An unknown mode shows an error with hintC and returns -1.

Syntax

Syntax 1

["SET", unit] call BIS_fnc_respect

Parameters:

Returns: Array of Numbers - 0 for every faction, 1 for the faction of unit

Syntax 2

["ADD", unit, range] call BIS_fnc_respect

Parameters:

Returns: Array of Numbers - unit's new respect values

Syntax 3

["MODIFY", unit, faction, formula] call BIS_fnc_respect

Parameters:

Returns: Number - new respect value, clamped to -1..1. If unit has Code in its "respect_handler" variable, it is spawned with [unit, factionIndex, oldValue, newValue].

Syntax 4

["KILLED", killer, town, changeNeighbors, coefficient] call BIS_fnc_respect

Parameters:

Returns: Array of Numbers - town's new respect values

Examples

Example 1

["SET", player] call BIS_fnc_respect;                    // the player respects their own faction only
["MODIFY", player, "OPF_F", "_r - 0.5"] call BIS_fnc_respect;    // lowers the player's respect for CSAT by 0.5
["MODIFY", player, "IND_F", 0.25] call BIS_fnc_respect;        // sets the player's respect for AAF to 0.25

See also

BIS_fnc_getFactions · addRating · Ambient Civilians