Difference between revisions of "VN ms fnc aiHeliTransportSkip"

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
 
|author= Wyqer, veteran29
  
|e=
+
|a= global
 +
 
 +
|e= global
  
 
|g1= general
 
|g1= general
  
|d= <pre>/*
+
|d= Skip AI insertion travel - uses the group leader's vehicle. The fade to black lasts 1 second, the default black screen duration is 5 seconds and the black in takes 8 seconds.
    Author: Wyqer, veteran29
 
    Date: 2020-02-28
 
 
 
    Description:
 
        Skip AI insertion travel.
 
 
 
    Parameter(s):
 
        _group - Group doing the insertion [GROUP, defaults to grpNull]
 
 
 
    Returns:
 
        Function reached the end [BOOL]
 
*/
 
 
 
if (!canSuspend) exitWith {
 
    _this spawn (missionNamespace getVariable _fnc_scriptName);
 
};
 
 
 
params [
 
    ["_group", grpNull, [grpNull]],
 
    ["_delay", 0, [0]]
 
];
 
 
 
private _vehicle = vehicle leader _group;
 
 
 
private _canSkip = _vehicle getVariable ['vn_aiHeliTransport_canSkip', false];
 
_vehicle setVariable ['vn_aiHeliTransport_canSkip', false, true];
 
if (!_canSkip) exitWith {};
 
 
 
private _playerCrew = (crew _vehicle select {isPlayer _x});
 
[[localize "STR_VN_MISSIONS_MISC_TELEPORTTITLE", "BLACK", 1]] remoteExec ["titleText", _playerCrew];
 
 
 
sleep 3 + _delay;
 
 
 
private _synchronizedGroups = synchronizedObjects leader _group apply {group _x};
 
{
 
    [_x, 8 * (_forEachIndex+1)] spawn (missionNamespace getVariable _fnc_scriptName);
 
} forEach _synchronizedGroups;
 
 
 
private _routeWps = _group getVariable ["vn_aiHeliTransport_routeWps", []];
 
// get last route waypoint (or LZ if no route)
 
private _lastWp = nil;
 
if (_routeWps isEqualTo []) then {
 
    _lastWp = [_group, currentWaypoint _group];
 
} else {
 
    _lastWp = _routeWps deleteAt (count _routeWps - 1);
 
};
 
 
 
private _skipPos = waypointPosition _lastWp;
 
_skipPos set [2, 50];
 
 
 
// skip waypoints
 
private _firstRouteWp = _routeWps select 0;
 
{
 
    // the waypoint index decrements with every deleted WP
 
    // So we're always deleting currently first WP of the route
 
    deleteWaypoint _firstRouteWp;
 
} forEach _routeWps;
 
 
 
private _velocity = velocityModelSpace _vehicle;
 
// move vehicle
 
</pre><small>''(Placeholder description extracted from the function header by '''LM_exportFunctionsToWiki.sqf''')''</small>
 
  
|s= [] call [[vn_ms_fnc_aiHeliTransportSkip]];
+
|s= [group, delay] call [[VN_ms_fnc_aiHeliTransportSkip]]
  
|p1n=
+
|p1n= group
|p1t=
+
|p1t= group
|p1d=
+
|p1d= group doing the insertion
 
|p1v=
 
|p1v=
  
|p2n=
+
|p2n= delay
|p2t=
+
|p2t= number
|p2d=
+
|p2d= black screen additional duration
|p2v=
+
|p2v= 0
  
|r1t=
+
|r1t= boolean
|r1d=
+
|r1d= function's success
  
|x1= <code>-</code>
+
|x1= <code>[group player, 5] call [[VN_ms_fnc_aiHeliTransportSkip]];</code>
 
}}
 
}}

Latest revision as of 17:21, 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

Skip AI insertion travel - uses the group leader's vehicle. The fade to black lasts 1 second, the default black screen duration is 5 seconds and the black in takes 8 seconds.

Syntax

Syntax
[group, delay] call VN_ms_fnc_aiHeliTransportSkip
Parameters
group: Group - group doing the insertion
delay: Number - (Optional, default 0) black screen additional duration
Return value
Boolean - function's success

Examples

Example 1
[group player, 5] call VN_ms_fnc_aiHeliTransportSkip;