BIS fnc wpLand: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Default start for BIS_fnc_wpLand)
m (pf)
Line 1: Line 1:
 
{{Function|Comments=
{{Function|= Comments
____________________________________________________________________________________________
____________________________________________________________________________________________


| arma3 |= Game name
| arma3 |Game name=


|1.00|= Game version
|1.00|Game version=
____________________________________________________________________________________________
____________________________________________________________________________________________


| <pre>
| Let group members land at the waypoint position.|Description=
 
____________________________________________________________________________________________
/*
Author: Karel Moricky
 
Description:
Let group members land at the waypoint position
 
Parameters:
0: GROUP
1: ARRAY - waypoint position
2: OBJECT - target to which waypoint is attached to
 
Returns:
BOOL
*/


private ["_group","_pos","_target","_wp"];
| [group, position, target]] spawn [[BIS_fnc_wpLand]] |Syntax=
_group = _this param [0,grpnull,[grpnull]];
_pos = _this param [1,[],[[]],3];
_target = _this param [2,objnull,[objnull]];
_wp = [_group,currentwaypoint _group];
_wp setwaypointdescription localize "STR_A3_CfgWaypoints_Land";


private ["_vehsMove","_vehsLand"];
_vehsMove = [];
_vehsLand = [];


waituntil {
|p1= group: [[Group]] - Group which is supposed to land|Parameter 1=
private ["_countReady","_vehsGroup"];
_countReady = 0;
_vehsGroup = [];


//--- Check state of group members
|p2= position: [[Position]] - Waypoint position|Parameter 2=
{
private ["_veh"];
_veh = vehicle _x;
if (_x == effectivecommander _x) then {
if (!(_veh in _vehsMove)) then {


//--- Move to landing position
|p3= target: [[Object]] - Object the waypoint is attached to|Parameter 3=
_veh domove _pos;
_vehsMove set [count _vehsMove,_veh];
} else {
if !(istouchingground _veh) then {
if (unitready _veh && !(_veh in _vehsLand)) then {


//--- van 't Land
| [[Boolean]] |Return value=
_veh land "land";
_vehsLand set [count _vehsLand,_veh];
};
} else {
//--- Ready (keep the engine running)
_veh engineon true;
_countReady = _countReady + 1;
};
};
_vehsGroup set [count _vehsGroup,_veh];
};
} foreach units _group;


//--- Remove vehicles which are no longer in the group
_vehsMove = _vehsMove - (_vehsMove - _vehsGroup);
_vehsLand = _vehsLand - (_vehsLand - _vehsGroup);


sleep 1;
|exec= spawn |= Execution
count _vehsGroup == _countReady
};
true


</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_getCfgDataArray]]; --> |= Syntax
|x1= <code>[ [[group]] [[player]] ], [0,0,0], BIS_vehicle ] [[spawn]] [[BIS_fnc_wpLand]];</code>|Example 1=
 
|p1= |= Parameter 1
 
| |= Return value
____________________________________________________________________________________________
____________________________________________________________________________________________


|x1= <code></code> |=  
| [[BIS_fnc_scriptedWaypointType]], [[BIS_fnc_wpTransport]] |See also=
____________________________________________________________________________________________
}}


| |= See also
}}


<h3 style="display:none">Notes</h3>
<h3 style="display:none">Notes</h3>
Line 103: Line 41:


<h3 style="display:none">Bottom Section</h3>
<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: Configs|{{uc:getCfgDataArray}}]]
[[Category:Function Group: Waypoints|{{uc:wpLand}}]]
[[Category:Functions|{{uc:getCfgDataArray}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:wpLand}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:getCfgDataArray}}]]

Revision as of 02:09, 17 June 2018

Hover & click on the images for description

Description

Description:
Let group members land at the waypoint position.
Execution:
spawn
Groups:
Uncategorised

Syntax

Syntax:
[group, position, target]] spawn BIS_fnc_wpLand
Parameters:
group: Group - Group which is supposed to land
position: Position - Waypoint position
target: Object - Object the waypoint is attached to
Return Value:
Boolean

Examples

Example 1:
[ group player ], [0,0,0], BIS_vehicle ] spawn BIS_fnc_wpLand;

Additional Information

See also:
BIS_fnc_scriptedWaypointTypeBIS_fnc_wpTransport

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note


Notes

Bottom Section