Difference between revisions of "VN ms fnc tracker spawnGroup"

From Savage Game Design Wiki
Jump to navigation Jump to search
m (Text replacement - " {{Function" to "Category:TODO {{Function")
(Page filling)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Category:TODO]]
 
 
{{Function
 
{{Function
  
Line 8: Line 7:
 
|a=
 
|a=
  
|e=
+
|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
+
|p2n= alert
{
+
|p2t= number
    private _infantryUnit = _group createUnit [_x, _position, [], 5, "FORM"];
+
|p2d= group's alert level
    _infantryUnit call vn_ms_fnc_aiSetSkill;
+
|p2v= 0
} forEach selectRandom getArray (_alertCfg >> "units");
 
  
{
+
|p3n= side
    _x triggerDynamicSimulation false;
+
|p3t= side
} forEach units _group;
+
|p3d= group's side
 
+
|p3v= east
_group
 
</pre><small>''(Placeholder description extracted from the function header by '''LM_exportFunctionsToWiki.sqf''')''</small>
 
 
 
|s= [] call [[vn_ms_fnc_tracker_spawnGroup]];
 
 
 
|p1n=
 
|p1t=
 
|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;