BIS fnc respect: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (1 revision)
(Page filling - missing example)
Line 1: Line 1:
 
{{Function|Comments=
{{Function|= Comments
____________________________________________________________________________________________
____________________________________________________________________________________________


| arma2 |= Game name
| arma2 |Game name=


|1.00|= Game version
|1.00|Game version=
____________________________________________________________________________________________
____________________________________________________________________________________________


| <pre>
| RESpect - The Effective Calculation Process. |Description=
/*
____________________________________________________________________________________________
File: RESTECP
 
Description:
RESpect - The Effective Calculation Process.
 
Parameter(s):
_this select 0: String - Mode
 
 
* SET - set respect default values
o _this select 1: Nothing or Object
o Returned value: Array with zero respect values (if Object is passed as argument, 1 is on place of object's faction).
* ADD - add respect values depending on global town respect
o _this select 1: Object - Unit to which is given respect from assigned town with random difference defined in third argument.
o _this select 2: Number - Range of random difference.
o Returned value: Unit's respect values.
* MODIFY - change givern respect value
o _this select 1: Object - Unit of which respect value will be changed.
o _this select 2: String - Faction of which respect will be changed.
o _this select 3: String - Code which defines formula for change (current respect value is stored in variable _r) - e.g. "_r / 2"
o Returned value: Modified respect value.
* KILLED - Modify global town respect after civilian has been killed.
o _this select 1: Object - Units's killer
o _this select 2: Object - Town logic
o _this select 3: Number - Optional - change coeficient
o Returned value: Modified town respect value.


*/
| [mode'', param1, param2, param3''] call [[BIS_fnc_respect]] |Syntax=
</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_respect]]; --> |= Syntax
|p1= mode: [[String]] - '''case-sensitive''', can be one of "SET", "ADD", "MODIFY", "KILLED" |Parameter 1=


|p1= |= Parameter 1
|p2= depending on ''mode'':
* "SET" - set respect default values
** param1: [[Nothing]] or [[Object]] (see '''Return value''')
* "ADD" - add respect values depending on global town respect
** param1: [[Object]] - unit to which is given respect from assigned town with random difference defined in third argument
** param2: [[Number]] - range of random difference
* "MODIFY" - change given respect value
** param1: [[Object]] - unit of which respect value will be changed
** param2: [[String]] - [[Faction|faction]] of which respect will be changed
** param3: [[String]] - [[Code|code]] which defines formula for change (current respect value is stored in variable _r) - e.g. "_r / 2"
* "KILLED" - modify global town respect after civilian has been killed
** param1: [[Object]] - killer
** param2: [[Object]] - town logic
** param3: [[Number]] - change coefficient |Parameter 2=


| |= Return value
|
* "SET": [[Array]] with zero respect values  (if [[Object]] is passed as argument, 1 is on place of object's faction)
* "ADD": unit's respect values
* "MODIFY": modified respect value
* "KILLED": modified town respect value |Return value=
____________________________________________________________________________________________
____________________________________________________________________________________________


|x1= <code></code> |=  
|x1= <code></code> |Example 1=
____________________________________________________________________________________________
____________________________________________________________________________________________


| |= See also
| [[addRating]], [[Ambient Civilians]] |See also=
 
}}
}}


Line 63: Line 50:


<h3 style="display:none">Bottom Section</h3>
<h3 style="display:none">Bottom Section</h3>
[[Category:Functions|{{uc:respect}}]]
[[Category:Function Group: Systems|{{uc:respect}}]]
[[Category:Function Group: Systems|{{uc:respect}}]]
[[Category:Functions|{{uc:respect}}]]
[[Category:{{Name|arma2}}: Functions|{{uc:respect}}]]
[[Category:{{Name|arma2}}: Functions|{{uc:respect}}]]
[[Category:{{Name|arma2oa}}: Functions|{{uc:respect}}]]
[[Category:{{Name|arma2oa}}: Functions|{{uc:respect}}]]
[[Category:{{Name|tkoh}}: Functions|{{uc:respect}}]]
[[Category:{{Name|tkoh}}: Functions|{{uc:respect}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:respect}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:respect}}]]

Revision as of 16:18, 4 June 2018

Hover & click on the images for description

Description

Description:
RESpect - The Effective Calculation Process.
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
[mode, param1, param2, param3] call BIS_fnc_respect
Parameters:
mode: String - case-sensitive, can be one of "SET", "ADD", "MODIFY", "KILLED"
depending on mode:
  • "SET" - set respect default values
  • "ADD" - add respect values depending on global town respect
    • param1: Object - unit to which is given respect from assigned town with random difference defined in third argument
    • param2: Number - range of random difference
  • "MODIFY" - change given respect value
    • param1: Object - unit of which respect value will be changed
    • param2: String - faction of which respect will be changed
    • param3: String - code which defines formula for change (current respect value is stored in variable _r) - e.g. "_r / 2"
  • "KILLED" - modify global town respect after civilian has been killed
Return Value:
  • "SET": Array with zero respect values (if Object is passed as argument, 1 is on place of object's faction)
  • "ADD": unit's respect values
  • "MODIFY": modified respect value
  • "KILLED": modified town respect value

Examples

Example 1:

Additional Information

See also:
addRatingAmbient Civilians

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

Notes

Bottom Section