Difference between revisions of "VN ms fnc aiSetSkill"

From Savage Game Design Wiki
Jump to navigation Jump to search
m (Text replacement - " |a= " to " |author= ")
(Page filling)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
 
{{Function
 
{{Function
  
Line 6: Line 5:
 
|author= Wyqer, veteran29, Spoffy
 
|author= Wyqer, veteran29, Spoffy
  
|e=
+
|a= global
 +
 
 +
|e= global
  
 
|g1= general
 
|g1= general
  
|d= <pre>/*
+
|d= Configure unit skills. These are tuned for infantry jungle-fighting, and may not work as well on vehicle crews.
    File: fn_aiSetSkill.sqf
 
    Author: Wyqer, veteran29, Spoffy
 
    Date: 2020-05-29
 
    Last Update: 2020-12-17
 
    Public: Yes
 
 
 
    Description:
 
        Configure unit skills. These are tuned for infantry jungle-fighting, and may not work as well on vehicle crews.
 
 
 
    Parameter(s):
 
        _unit - Unit to set skills for [OBJECT, defaults to objNull]
 
 
 
    Returns:
 
        Skills were set [BOOL]
 
 
 
    Example(s):
 
        [bob] call vn_ms_fnc_aiSetSkill
 
*/
 
params [
 
    ["_unit", objNull, [objNull]]
 
];
 
  
if (isMultiplayerSolo || {vn_difficulty == DIFFICULTY_EASY}) then {
+
|s= [unit] call [[VN_ms_fnc_aiSetSkill]]
    _unit setSkill 0.6;
 
    _unit setSkill ["general", 0.6];
 
    _unit setSkill ["aimingSpeed", 0.35];
 
    _unit setSkill ["aimingShake", 0.5];
 
    _unit setSkill ["commanding", 0.6];
 
    _unit setSkill ["courage", 0.6];
 
    _unit setSkill ["reloadSpeed", 0.6];
 
    _unit setSkill ["spotDistance", 0.4];
 
    _unit setSkill ["spotTime", 0.3];
 
    _unit setSkill ["aimingAccuracy", 0.15];
 
} else {
 
    _unit setSkill 1;
 
    _unit setSkill ["general", 1];
 
    _unit setSkill ["aimingSpeed", 0.75];
 
    _unit setSkill ["aimingShake", 0.9];
 
    _unit setSkill ["commanding", 1];
 
    _unit setSkill ["courage", 1];
 
    _unit setSkill ["reloadSpeed", 1];
 
    _unit setSkill ["spotDistance", 0.5];
 
    _unit setSkill ["spotTime", 0.7];
 
    _unit setSkill ["aimingAccuracy", 0.2];
 
};
 
  
_unit setVariable ["vn_ms_skill", true];
+
|p1n= unit
 
+
|p1t= object
true
+
|p1d= the unit to which to set skill
</pre><small>''(Placeholder description extracted from the function header by '''LM_exportFunctionsToWiki.sqf''')''</small>
 
 
 
|s= [] call [[vn_ms_fnc_aiSetSkill]];
 
 
 
|p1n=
 
|p1t=
 
|p1d=
 
 
|p1v=
 
|p1v=
  
Line 74: Line 25:
 
|p2v=
 
|p2v=
  
|r1t=
+
|r1t= boolean
|r1d=
+
|r1d= function's success
 +
 
 +
|x1= <code>[bob] call [[VN_ms_fnc_aiSetSkill]];</code>
  
|x1= <code>-</code>
+
|x2= <code>private _pedestrians = allUnits select { isNull objectParent _x };
 +
{
 +
[_x] call [[VN_ms_fnc_aiSetSkill]];
 +
} forEach _pedestrians;</code>
 
}}
 
}}

Latest revision as of 17:47, 22 February 2021

← back to Functions Introduced in S.O.G. Prairie Fire v1.00
by Wyqer, veteran29, Spoffy
Argument(s): global
Effect(s): global

Description

Configure unit skills. These are tuned for infantry jungle-fighting, and may not work as well on vehicle crews.

Syntax

Syntax
[unit] call VN_ms_fnc_aiSetSkill
Parameters
unit: Object - the unit to which to set skill
Return value
Boolean - function's success

Examples

Example 1
[bob] call VN_ms_fnc_aiSetSkill;
Example 2
private _pedestrians = allUnits select { isNull objectParent _x }; { [_x] call VN_ms_fnc_aiSetSkill; } forEach _pedestrians;