BIS fnc taskDefend: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " \| arma2 \| *([0-9]\.[0-9]{2}) * " to " | arma2 |$1 |game2= arma2oa |version2= 1.50 |game3= tkoh |version3= 1.00 |game4= arma3 |version4= 0.50 ")
m (Some wiki formatting)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{RV|type=function
{{RV|type=function


| arma2
|game1= arma2
|1.00
|version1= 1.00


|game2= arma2oa
|game2= arma2oa
Line 15: Line 15:
|gr1= Tasks
|gr1= Tasks


|arg=|eff=| Group will man nearby static defenses within a 100 metre radius of the defense position and guard the position. Some units will man weapons, others will patrol and the remainder will sit on the ground.
|descr= Group will man nearby static defenses within a 100 metre radius of the defense position and guard the position. Some units will man weapons, others will patrol and the remainder will sit on the ground.


| [group,position] call '''BIS_fnc_taskDefend'''
|s1= [group, position] call [[BIS_fnc_taskDefend]]


|p1= group (Group)
|p1= group: [[Group]]


|p2= position (Array)
|p2= position: [[Array]] in format [[Position]]


| Success Flag (Boolean) |Return1=
|r1= [[Boolean]]


|x1= <code>[group this, getPos this] call bis_fnc_taskDefend</code>
|x1= <sqf>[group player, getPosATL leader player] call BIS_fnc_taskDefend;</sqf>


|seealso= [[Functions Library]] [[BIS_fnc_taskAttack]] [[BIS_fnc_taskPatrol]]
|seealso= [[Functions Library]] [[BIS_fnc_taskAttack]] [[BIS_fnc_taskPatrol]]
}}
}}


The easiest way to use this function is to create a group, then add the following code to the group leader's init field:
{{Note
|user= Preacher
|timestamp= 20091220120000
|text= The easiest way to use this function is to create a group, then add the following code to the group leader's init field:
<sqf>[group this, getPosATL this] call BIS_fnc_taskDefend;</sqf>
}}


:<code>[group this, getPos this] call BIS_fnc_taskDefend;</code>
{{Note
|user= McHide
|timestamp= 20091209015900
|text= The '''more correct way''' is to:


'''The more correct way is to:'''
# Place function module on map ({{arma2}} only)
 
# Make one waypoint for group and put this code in Waypoints  On.Act. field<sqf>[group this, getPosATL this] call BIS_fnc_taskDefend;</sqf>
'''1. Place function module on map'''
#* You can use triggers for this function too, but your groups must be named<sqf>{ [_x, getPosATL leader _x] call BIS_fnc_taskDefend } forEach [grpName1, grpName2];</sqf>
 
}}
'''2.''' Make one waypoint for group and put this code in Waypoints  On.Act. field  
 
:<code>nul=[group this, position this] call BIS_fnc_taskDefend;</code>
 
'''2.1''' You can use triggers for this function too, but your groups must be named
 
:<code>nul=[group GrpName2, position GrpName2] call BIS_fnc_taskDefend; nul=[group GrpName1, position GrpName1] call BIS_fnc_taskDefend</code>
 
 
 
[[Category:{{Name|arma2}}: Functions|{{uc:taskDefend}}]]
[[Category:{{Name|arma2oa}}: Functions|{{uc:taskDefend}}]]
[[Category:{{Name|tkoh}}: Functions|{{uc:taskDefend}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:taskDefend}}]]

Latest revision as of 13:28, 1 July 2022

Hover & click on the images for description

Description

Description:
Group will man nearby static defenses within a 100 metre radius of the defense position and guard the position. Some units will man weapons, others will patrol and the remainder will sit on the ground.
Execution:
call
Groups:
Tasks

Syntax

Syntax:
[group, position] call BIS_fnc_taskDefend
Parameters:
group: Group
position: Array in format Position
Return Value:
Boolean

Examples

Example 1:
[group player, getPosATL leader player] call BIS_fnc_taskDefend;

Additional Information

See also:
Functions Library BIS_fnc_taskAttack BIS_fnc_taskPatrol

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
Preacher - c
Posted on Dec 20, 2009 - 12:00 (UTC)
The easiest way to use this function is to create a group, then add the following code to the group leader's init field:
[group this, getPosATL this] call BIS_fnc_taskDefend;
McHide - c
Posted on Dec 09, 2009 - 01:59 (UTC)
The more correct way is to:
  1. Place function module on map (Arma 2 only)
  2. Make one waypoint for group and put this code in Waypoints On.Act. field
    [group this, getPosATL this] call BIS_fnc_taskDefend;
    • You can use triggers for this function too, but your groups must be named
      { [_x, getPosATL leader _x] call BIS_fnc_taskDefend } forEach [grpName1, grpName2];