BIS fnc wpLand: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Default start for BIS_fnc_wpLand)
m (Text replacement - "= <code>([^<{]+)<\/code>" to "= <sqf>$1</sqf>")
 
(26 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{TabView|selected= 2


{{Function|= Comments
|title1= {{TabView/GameTitle|tkoh}}
____________________________________________________________________________________________
|content1=


| arma3 |= Game name
{{RV|type=function


|1.00|= Game version
|game1= tkoh
____________________________________________________________________________________________
|version1= 1.00


| <pre>
|gr1= Waypoints


/*
|descr= "LAND" [[Custom_Waypoints|custom waypoint]]. Land on specific spot.
Author: Karel Moricky


Description:
|s1= [[Custom Waypoints#Function|arguments]]: [dirParam, visualize]
Let group members land at the waypoint position


Parameters:
|p1= dirParam: [[Array]] - in format [dir, dirDiff]:
0: GROUP
* dir: [[Number]] - required landing direction in degrees
1: ARRAY - waypoint position
* dirDiff: [[Number]] - direction tolerance (to both sides)
2: OBJECT - target to which waypoint is attached to


Returns:
|p2= visualize: [[Boolean]] - true to show hint (default: false)
BOOL
*/


private ["_group","_pos","_target","_wp"];
|r1= [[Nothing]]
_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"];
|x1= <sqf>[player, position dude, 10, [42, 20], true] spawn BIS_fnc_wpLand;</sqf>
_vehsMove = [];
_vehsLand = [];


waituntil {
|exec= spawn
private ["_countReady","_vehsGroup"];
_countReady = 0;
_vehsGroup = [];


//--- Check state of group members
|seealso= [[BIS_fnc_scriptedWaypointType]] [[BIS_fnc_wpTransport]]
{
}}
private ["_veh"];
_veh = vehicle _x;
if (_x == effectivecommander _x) then {
if (!(_veh in _vehsMove)) then {


//--- Move to landing position
|title2= {{TabView/GameTitle|arma3}}
_veh domove _pos;
|content2=
_vehsMove set [count _vehsMove,_veh];
} else {
if !(istouchingground _veh) then {
if (unitready _veh && !(_veh in _vehsLand)) then {


//--- van 't Land
{{RV|type=function
_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
|game1= arma3
_vehsMove = _vehsMove - (_vehsMove - _vehsGroup);
|version1= 1.00
_vehsLand = _vehsLand - (_vehsLand - _vehsGroup);


sleep 1;
|gr1= Waypoints
count _vehsGroup == _countReady
};
true


</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
|descr= Let group members land at the waypoint position.
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_getCfgDataArray]]; --> |= Syntax
|s1= [group, position, target] spawn [[BIS_fnc_wpLand]]


|p1= |= Parameter 1
|p1= group: [[Group]] - group which is supposed to land


| |= Return value
|p2= position: [[Position]] - waypoint position
____________________________________________________________________________________________


|x1= <code></code> |=
|p3= target: [[Object]] - object the waypoint is attached to
____________________________________________________________________________________________


| |= See also
|r1= [[Boolean]]


}}
|exec= spawn


<h3 style="display:none">Notes</h3>
|x1= <sqf>[group player, [0,0,0], BIS_vehicle] spawn BIS_fnc_wpLand;</sqf>
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|seealso= [[BIS_fnc_scriptedWaypointType]] [[BIS_fnc_wpTransport]]
</dl>
}}


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

Latest revision as of 17:00, 13 July 2022

tkoh logo small.png Take On Helicopters
Arma 3 logo black.png Arma 3
Hover & click on the images for description

Description

Description:
"LAND" custom waypoint. Land on specific spot.
Execution:
spawn
Groups:
Waypoints

Syntax

Syntax:
arguments: [dirParam, visualize]
Parameters:
dirParam: Array - in format [dir, dirDiff]:
  • dir: Number - required landing direction in degrees
  • dirDiff: Number - direction tolerance (to both sides)
visualize: Boolean - true to show hint (default: false)
Return Value:
Nothing

Examples

Example 1:
[player, position dude, 10, [42, 20], true] spawn BIS_fnc_wpLand;

Additional Information

See also:
BIS_fnc_scriptedWaypointType BIS_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
Hover & click on the images for description

Description

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

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_scriptedWaypointType BIS_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