Difference between revisions of "VN ms fnc dropOrdnance"

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
 +
 
 +
|a= global
  
|e=
+
|e= global
  
 
|g1= general
 
|g1= general
  
|d= <pre>/*
+
|d= Drop (air) ordnance from the provided vehicle.
    File: fn_dropOrdnance.sqf
 
    Author: Wyqer, veteran29
 
    Date: 2020-07-17
 
    Last Update: 2020-11-27
 
    Public: Yes
 
  
    Description:
+
|s= [bomber, bombClasses, amount] call [[VN_ms_fnc_dropOrdnance]]
        Drop ordnance from vehicle position.
 
  
    Parameter(s):
+
|p1n= bomber
        _vehicle  - Vehicle to drop ordnance from [OBJECT, defaults to objNull]
+
|p1t= object
        _ordnances - Classes of ordnance to drop [ARRAY, defaults to ORDNANCES_RANDOM]
+
|p1d= ordnance dropper
        _amount    - Amount of ordnances to drop (min 1) [NUMBER, defaults to 3]
+
|p1v=
 
 
    Returns:
 
        Ordnance drop script [BOOL]
 
 
 
    Example(s):
 
        [vehicle this] call vn_ms_fnc_dropOrdnance
 
*/
 
#define BASE_DROP_SPEED 250
 
#define DROP_DELAY_MIN 0.15
 
#define DROP_DELAY_MAX 0.8
 
 
 
_this spawn {
 
    params [
 
        ["_vehicle", objNull, [objNull]],
 
        ["_ordnances", ORDNANCES_ARRAY, [[]]],
 
        ["_amount", 2, [0]]
 
    ];
 
 
 
    private _ordnance = selectRandom _ordnances;
 
  
    sleep DROP_DELAY_MIN;
+
|p2n= bombClasses
 
+
|p2t= {{Biki|Array}} of {{Biki|String}}
    for '_i' from 1 to (_amount max 1) do {
+
|p2d= array from which will be picked the ordnance class
        private _bombPos = ASLToATL (_vehicle modelToWorldWorld [0,-10,-20]);
+
|p2v= ORDNANCES_ARRAY
        private _b = _ordnance createVehicle _bombPos;
 
 
 
        #ifdef VN_DEBUG
 
            _s = "Sign_Arrow_F" createVehicle _bombPos;
 
            _s setPosATL _bombPos;
 
            systemChat str (DROP_DELAY_MIN max (BASE_DROP_SPEED / speed _vehicle) min DROP_DELAY_MAX);
 
        #endif
 
 
 
        _b setVectorDirAndUp [[0.001,0.001,-1], [0,-1,-1]];
 
        _b setVelocity [0,0,-40];
 
 
 
        // the faster the plane goes the smaller delay between bombs
 
        sleep (DROP_DELAY_MIN max (BASE_DROP_SPEED / speed _vehicle) min DROP_DELAY_MAX);
 
    };
 
 
 
    #ifdef VN_DEBUG
 
        {
 
            _x addCuratorEditableObjects [allMissionObjects "Sign_Arrow_F"];
 
        } forEach allCurators;
 
    #endif
 
};
 
</pre><small>''(Placeholder description extracted from the function header by '''LM_exportFunctionsToWiki.sqf''')''</small>
 
 
 
|s= [] call [[vn_ms_fnc_dropOrdnance]];
 
 
 
|p1n=
 
|p1t=
 
|p1d=
 
|p1v=
 
  
|p2n=
+
|p3n= amount
|p2t=
+
|p3t= number
|p2d=
+
|p3d= amount of dropped ordnances
|p2v=
+
|p3v= 3
  
|r1t=
+
|r1t= handle
|r1d=
+
|r1d= the bombing script handle
  
|x1= <code>-</code>
+
|x1= <code>[casAirplane, nil, 30] call [[VN_ms_fnc_dropOrdnance]];</code>
 
}}
 
}}

Latest revision as of 22:14, 23 February 2021

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

Description

Drop (air) ordnance from the provided vehicle.

Syntax

Syntax
[bomber, bombClasses, amount] call VN_ms_fnc_dropOrdnance
Parameters
bomber: Object - ordnance dropper
bombClasses: Array of String - (Optional, default ORDNANCES_ARRAY) array from which will be picked the ordnance class
amount: Number - (Optional, default 3) amount of dropped ordnances
Return value
Script (Handle) - the bombing script handle

Examples

Example 1
[casAirplane, nil, 30] call VN_ms_fnc_dropOrdnance;