Difference between revisions of "VN ms fnc waypoint artillery"

From Savage Game Design Wiki
Jump to navigation Jump to search
m (Text replacement - "]]; |p1n=" to "]] |p1n=")
(Page filling)
 
Line 1: Line 1:
[[Category:TODO]]
 
 
{{Function
 
{{Function
  
Line 6: Line 5:
 
|author= Wyqer, veteran29
 
|author= Wyqer, veteran29
  
|a=
+
|a= global
  
|e=
+
|e= global
  
 
|g1= waypoint
 
|g1= waypoint
  
|d= <pre>/*
+
|d= Tells the group to fire artillery barrage on waypoint/position.<br>
    Author: Wyqer, veteran29
+
File path for scripted waypoint: <tt>vn\missions_f_vietnam\functions\waypoint\fn_waypoint_Artillery.sqf</tt>
    Date: 2019-09-23
 
    Public: Yes
 
  
    Description:
+
Uses [[VN_ms_fnc_waypoint_doArtilleryFire]].
        Tells the group to fire artillery barrage on waypoint/position.
 
  
    Path (for scripted WP):
+
|s= [group, position, owner, amount, magazine, radius] call [[VN_ms_fnc_waypoint_artillery]]
        vn\missions_f_vietnam\functions\waypoint\fn_waypoint_Artillery.sqf
 
  
    Parameter(s):
+
|p1n= group
        _group    - Group to do the barrage                                [GROUP, defaults to grpNull]
+
|p1t= group
        _pos      - Position to fire at                                    [ARRAY, defaults to [0,0,0]]
+
|p1d= artillery group
        _owner    - Waypoint owner, optional                                [OBJECT, defaults to objNull]
+
|p1v=
        _rounds  - Number of rounds to fire per artillery vehicle in group [NUMBER, defaults to 5 + random 3]
 
        _magazine - Magazine type to fire                                  [STRING, defaults to ""]
 
        _precision- Artillery precision in meters                          [NUMBER, defaults to 50]
 
  
    Returns:
+
|p2n= position
        Script reached the end [BOOL]
+
|p2t= array
*/
+
|p2d= artillery strike location
 
+
|p2v=
if (!canSuspend) exitWith {
 
    _this spawn (missionNamespace getVariable _fnc_scriptName);
 
};
 
 
 
params [
 
    ["_group", grpNull, [grpNull]],
 
    ["_pos", [0,0,0], [[]], 3],
 
    ["_owner", objNull, [objNull]],
 
    ["_rounds", 5 + random 3, [0]],
 
    ["_magazine", "", [""]],
 
    ["_precision", 50, [0]]
 
];
 
 
 
if (_owner isEqualTo objNull) then {
 
    _owner = leader _group;
 
};
 
 
 
waitUntil {simulationEnabled _owner};
 
 
 
#ifdef VN_DEBUG
 
    systemChat format ["[VN_WP_Artillery] Grp:%1, Pos:%2, Owner:%3, Rnds:%4, Mag:%5", _group, _pos, _owner, _rounds, _magazine];
 
#endif
 
 
 
private _wp = [_group, currentWaypoint _group];
 
_wp setWaypointDescription localize "STR_A3_CfgWaypoints_Artillery";
 
 
 
// get group vehicles
 
private _vehicles = [];
 
{
 
    _vehicles pushBackUnique vehicle _x;
 
} forEach units _group;
 
 
 
// filter out humans
 
_vehicles = _vehicles select {!(_x isKindOf "CAManBase")};
 
  
// fire rounds
+
|p3n= owner
private _scriptHandles = _vehicles apply {
+
|p3t= object
    sleep 1 + random 1;
+
|p3d= will wait until ''owner'' has its simulation enabled
    [_x, _pos, _rounds, _magazine, _precision] spawn vn_ms_fnc_waypoint_doArtilleryFire // return
+
|p3v= {{Biki|leader}} ''group''
};
 
  
// wait until all scripts are finished
+
|p4n= amount
waitUntil {
+
|p4t= number
    _scriptHandles findIf {!scriptDone _x} == -1
+
|p4d= number of rounds to be fired by ''every'' artillery weapon
};
+
|p4v= 5 + random 3
  
#ifdef VN_DEBUG
+
|p5n= magazine
</pre><small>''(Placeholder description extracted from the function header by '''LM_exportFunctionsToWiki.sqf''')''</small>
+
|p5t= string
 +
|p5d= magazine to fire
 +
|p5v= first found magazine
  
|s= [] call [[vn_ms_fnc_waypoint_artillery]]
+
|p6n= precision
 
+
|p6t= number
|p1n=
+
|p6d= strike precision radius, in meter
|p1t=
+
|p6v= 50
|p1d=
 
|p1v=
 
 
 
|p2n=
 
|p2t=
 
|p2d=
 
|p2v=
 
  
|r1t=
+
|r1t= boolean
|r1d=
+
|r1d= function's success
  
|x1= <code>-</code>
+
|x1= <code>[artiGrp, getMarkerPos "enemyBase", objNull, 50, , 125] call [[VN_ms_fnc_waypoint_artillery]];</code>
 
}}
 
}}

Latest revision as of 18:35, 22 February 2021

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

Description

Tells the group to fire artillery barrage on waypoint/position.
File path for scripted waypoint: vn\missions_f_vietnam\functions\waypoint\fn_waypoint_Artillery.sqf

Uses VN_ms_fnc_waypoint_doArtilleryFire.

Syntax

Syntax
[group, position, owner, amount, magazine, radius] call VN_ms_fnc_waypoint_artillery
Parameters
group: Group - artillery group
position: Array - artillery strike location
owner: Object - (Optional, default leader group) will wait until owner has its simulation enabled
amount: Number - (Optional, default 5 + random 3) number of rounds to be fired by every artillery weapon
magazine: String - (Optional, default first found magazine) magazine to fire
precision: Number - (Optional, default 50) strike precision radius, in meter
Return value
Boolean - function's success

Examples

Example 1
[artiGrp, getMarkerPos "enemyBase", objNull, 50, , 125] call VN_ms_fnc_waypoint_artillery;