BIS fnc stalk: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (1 revision imported: BIS Functions update 1/7)
m (Text replacement - " |s1=[" to " |s1= [")
 
(34 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{RV|type=function


{{Function|= Comments
|game1= arma3
____________________________________________________________________________________________
|version1= 1.00


| arma3 |= Game name
|gr1= Object Manipulation


|1.00|= Game version
|gr2= Combat
____________________________________________________________________________________________


| <pre>/*
|descr= Continuously set WP of one group to a different group to hunt it. It does not change the group's behaviour.<br>
Author: Vaclav "WattyWatts" Oliva
Script terminates if one of the groups is eliminated or if the optional condition is activated.


Description:
|s1= [stalker, stalked, refresh, radius, endCondition, endDestination] spawn [[BIS_fnc_stalk]]
Continuously set WP of one group to a different group to hunt it. It does not change the group's behaviour.
Script terminates if one of the groups is eliminated or if the optional condition is activated.


If the optional condition is activated, you can either:
|p1= stalker: [[Group]] - the group that will move towards the other
- return the group to its original waypoints
- make the group search at current position (cycle in 50m radius)
- send the group back to position from where it started to stalk (waypoint MOVE)
- send to position of a marker (waypoint MOVE)
- send to position of an object (waypoint MOVE)
- send to [x,y,z] position (waypoint MOVE)


Parameters:
|p2= stalked: [[Group]] - the group that will be followed
Select 0 = GROUP that will stalk
Select 1 = GROUP that will be stalked
Select 2 = (OPTIONAL) NUMBER: How often should the WP be refreshed, default 10 seconds, min 5 seconds
Select 3 = (OPTIONAL) NUMBER: Radius of the WP, default 0 meters
Select 4 = (OPTIONAL) CODE: Condition for ending the stalking process, default {false}
Select 5 = (OPTIONAL) STRING or POSITION or OBJECT or NUMBER (0 for return to original waypoints (default), 1 to search at current position, 2 to return to position where they started to stalk)


Returns:
|p3= refresh: [[Number]] - (Optional, default 10, minimum 5) time between waypoint updates
Boolean


Examples:
|p4= radius: [[Number]] - (Optional, default 0, minimum 0) waypoint "precision"
_stalking = [BIS_grpStalkers,BIS_grpPlayer] spawn BIS_fnc_stalk;
_stalking = [BIS_grpStalkers,BIS_grpPlayer,nil,nil,{BIS_player distance BIS_Heli < 100},"BIS_mrkRetreatMarker"] spawn BIS_fnc_stalk;
_stalking = [BIS_grpStalkers,BIS_grpPlayer,20,10,{BIS_Return},1] spawn BIS_fnc_stalk;
_stalking = [BIS_grpStalkers,BIS_grpPlayer,5,0,{dayTime > 20},[3600,600,0]] spawn BIS_fnc_stalk;
*/


// Params
|p5= endCondition: [[Code]] - (Optional, default {[[false]]}) condition that if true stops ''stalker'' to follow ''stalked''
</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_stalk]]; --> |= Syntax
|p6= endDestination: [[String]] or [[Position]] or [[Object]] or [[Number]] - (Optional, default 0) destination ''stalker'' will go after ''endCondition'' is met (or ''stalked'' is killed)
|p1= |= Parameter 1
* [[String]] - destination marker name
* [[Position]] - destination
* [[Object]] - destination
* [[Number]]
** 0: return to original group waypoints
** 1: search around their current stalking position, in a 50m radius
** 2: return to the original position before stalking


| |= Return value
|r1= [[Boolean]] - [[true]] when done
____________________________________________________________________________________________


|x1= <code></code> |=
|x1= <sqf>private _stalking = [BIS_grpStalkers, BIS_grpPlayer] spawn BIS_fnc_stalk;</sqf>
____________________________________________________________________________________________


| |= See also
|x2= <sqf>private _stalking = [grp1, group player, nil, nil, { player distance BIS_Heli < 100 }, "BIS_mrkRetreatMarker"] spawn BIS_fnc_stalk;</sqf>


}}
|x3= <sqf>private _stalking = [BIS_grpStalkers, BIS_grpPlayer, 20, 10, { BIS_Return }, 1] spawn BIS_fnc_stalk;</sqf>


<h3 style="display:none">Notes</h3>
|x4= <sqf>private _stalking = [BIS_grpStalkers, BIS_grpPlayer, 5, 0, { dayTime > 20 }, [3600,600,0]] spawn BIS_fnc_stalk;</sqf>
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|exec= spawn
</dl>


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

Latest revision as of 00:12, 13 July 2022

Hover & click on the images for description

Description

Description:
Continuously set WP of one group to a different group to hunt it. It does not change the group's behaviour.
Script terminates if one of the groups is eliminated or if the optional condition is activated.
Execution:
spawn
Groups:
Object ManipulationCombat

Syntax

Syntax:
[stalker, stalked, refresh, radius, endCondition, endDestination] spawn BIS_fnc_stalk
Parameters:
stalker: Group - the group that will move towards the other
stalked: Group - the group that will be followed
refresh: Number - (Optional, default 10, minimum 5) time between waypoint updates
radius: Number - (Optional, default 0, minimum 0) waypoint "precision"
endCondition: Code - (Optional, default {false}) condition that if true stops stalker to follow stalked
endDestination: String or Position or Object or Number - (Optional, default 0) destination stalker will go after endCondition is met (or stalked is killed)
  • String - destination marker name
  • Position - destination
  • Object - destination
  • Number
    • 0: return to original group waypoints
    • 1: search around their current stalking position, in a 50m radius
    • 2: return to the original position before stalking
Return Value:
Boolean - true when done

Examples

Example 1:
private _stalking = [BIS_grpStalkers, BIS_grpPlayer] spawn BIS_fnc_stalk;
Example 2:
private _stalking = [grp1, group player, nil, nil, { player distance BIS_Heli < 100 }, "BIS_mrkRetreatMarker"] spawn BIS_fnc_stalk;
Example 3:
private _stalking = [BIS_grpStalkers, BIS_grpPlayer, 20, 10, { BIS_Return }, 1] spawn BIS_fnc_stalk;
Example 4:
private _stalking = [BIS_grpStalkers, BIS_grpPlayer, 5, 0, { dayTime > 20 }, [3600,600,0]] spawn BIS_fnc_stalk;

Additional Information

See also:
BIS_fnc_spawnGroup

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