Difference between revisions of "VN ms fnc tracker spawnGroup"

From Savage Game Design Wiki
Jump to navigation Jump to search
vn>Unknown user
m (Generated by LM_exportFunctionsToWiki.sqf)
 
(Page filling)
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
 
{{Function
 
{{Function
  
 
|v= 1.00
 
|v= 1.00
  
|a= Wyqer, veteran29
+
|author= Wyqer, veteran29
  
|e=
+
|a=
 +
 
 +
|e= global
  
 
|g1= tracker
 
|g1= tracker
  
|d= <pre>/*
+
|d= Spawns a group and potential vehicles based on <tt>{{Biki|configFile}} >> "CfgTrackerArmies" >> ''army'' >> "alert_''alert''"</tt> config entry.
    Author: Wyqer, veteran29
 
    Date: 2019-07-31
 
  
    Description:
+
|s= [pos, alert, side, army] call [[VN_ms_fnc_tracker_spawnGroup]]
        No description added yet.
 
  
    Parameter(s):
+
|p1n= pos
        _localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
+
|p1t= position
 
+
|p1d= group spawn position
    Returns:
+
|p1v=
        Function reached the end [BOOL]
 
*/
 
params [
 
    ["_position", [0,0,0], [[]], [2,3]],
 
    ["_alert", 0, [0]],
 
    ["_side", EAST, [sideUnknown]],
 
    ["_army", "VN", [""]]
 
];
 
 
 
private _alertCfg = configFile >> "CfgTrackerArmies" >> _army >> format ["alert_%1", _alert];
 
if (isNull _alertCfg) then {
 
    [format ["No CfgTrackerArmies entry for army: '%1' and alert '%2'", _army, _alert]] call BIS_fnc_error;
 
};
 
 
 
// Append 0z to Position2D
 
if (2 == count _position) then {
 
    _position = _position + [0];
 
};
 
 
 
private _group = createGroup [_side, true];
 
 
 
// create vehicles
 
{
 
    private _vehicle = createVehicle [_x, _position, [], 15, "FORM"];
 
    createVehicleCrew _vehicle;
 
    crew _vehicle joinSilent _group;
 
    _group addVehicle _vehicle;
 
} forEach selectRandom getArray (_alertCfg >> "vehicles");
 
 
 
// create units
 
{
 
    private _infantryUnit = _group createUnit [_x, _position, [], 5, "FORM"];
 
    _infantryUnit call vn_ms_fnc_aiSetSkill;
 
} forEach selectRandom getArray (_alertCfg >> "units");
 
 
 
{
 
    _x triggerDynamicSimulation false;
 
} forEach units _group;
 
  
_group
+
|p2n= alert
</pre><small>''(Placeholder description extracted from the function header by '''LM_exportFunctionsToWiki.sqf''')''</small>
+
|p2t= number
 +
|p2d= group's alert level
 +
|p2v= 0
  
|s= [] call [[vn_ms_fnc_tracker_spawnGroup]];
+
|p3n= side
 
+
|p3t= side
|p1n=
+
|p3d= group's side
|p1t=
+
|p3v= east
|p1d=
 
|p1v=
 
  
|p2n=
+
|p4n= army
|p2t=
+
|p4t= string
|p2d=
+
|p4d= "army" as defined in "CfgTrackerArmies"
|p2v=
+
|p4v= "VN"
  
|r1t=
+
|r1t= group
|r1d=
+
|r1d= the spawned group
  
|x1= <code>-</code>
+
|x1= <code>[player modelToWorld [0,250,0], 1, east, "VN"] call [[VN_ms_fnc_tracker_spawnGroup]];</code>
 
}}
 
}}

Latest revision as of 16:23, 26 February 2021

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

Description

Spawns a group and potential vehicles based on configFile >> "CfgTrackerArmies" >> army >> "alert_alert" config entry.

Syntax

Syntax
[pos, alert, side, army] call VN_ms_fnc_tracker_spawnGroup
Parameters
pos: Position - group spawn position
alert: Number - (Optional, default 0) group's alert level
side: Side - (Optional, default east) group's side
army: String - (Optional, default "VN") "army" as defined in "CfgTrackerArmies"
Return value
Group - the spawned group

Examples

Example 1
[player modelToWorld [0,250,0], 1, east, "VN"] call VN_ms_fnc_tracker_spawnGroup;