BIS fnc spawnEnemy: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Generated by BIS_fnc_exportFunctionsToWiki)
 
m (Remove 'broken' warning)
 
(35 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{RV|type=function


{{Function|= Comments
|game1= arma2oa
____________________________________________________________________________________________
|version1= 1.50


| arma2oa |= Game name
|game2= tkoh
|version2= 1.00


|1.00|= Game version
|game3= arma3
____________________________________________________________________________________________
|version3= 0.50


| <pre>
|gr1= Object Manipulation
/*


Description:
|descr= Constantly spawns enemies around a player according to array of enemy classes. The units will try to hunt down the player.
Spawns enemies around players


Parameter(s):
|exec= spawn
_this select 0: OBJECT - player
_this select 1: OBJECT - refence object (enemies will be spawned on opposite direction)
_this select 2: SIDE - side of enemies
_this select 3 (Optional): ARRAY - list of enemy classes
_this select 4 (Optional): NUMBER - delay between spawning
_this select 5 (Optional): CODE - code executed on every soldier. Unit is passed as _this


Returns:
|s1= [aPlayer, target, side, classes, maxEnemies, delay, code] spawn [[BIS_fnc_spawnEnemy]]
ARRAY - list of all spawned crows
*/


</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
|p1= aPlayer: [[Object]] - a unit that [[isPlayer|is a player]]
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_spawnEnemy]]; --> |= Syntax
|p2= target: [[Object]] - reference object (enemies will be spawned on same direction in respect to the player)


|p1= |= Parameter 1
|p3= side: [[Side]] - side of the spawned enemies


| |= Return value
|p4= classes: [[Array]] of [[String]]s - list of enemy classes (units will form a group together)
____________________________________________________________________________________________
{{Feature|important|Classes must be of the defined ''side'', otherwise they will attack each other.}}


|x1= <code></code> |=
|p5= maxEnemies: [[Number]] - (Optional, default 10) maximum number of enemies at once
____________________________________________________________________________________________


| |= See also
|p6= delay: [[Number]] - (Optional, default 30) time between spawn waves


}}
|p7= code: [[Code]] - (Optional, default {}) - code to execute on each unit (referenced by [[Magic Variables#this|_this]])


<h3 style="display:none">Notes</h3>
|r1= [[Nothing]]
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|x1= <sqf>[player, player, opfor, ["O_Soldier_F"]] spawn BIS_fnc_spawnEnemy;</sqf>
</dl>


<h3 style="display:none">Bottom Section</h3>
|seealso= [[BIS_fnc_spawnGroup]] [[BIS_fnc_stalk]]
[[Category:Function Group: Spawning|{{uc:spawnEnemy}}]]
}}
[[Category:Functions|{{uc:spawnEnemy}}]]
[[Category:{{Name|arma2oa}}: Functions|{{uc:spawnEnemy}}]]
[[Category:{{Name|tkoh}}: Functions|{{uc:spawnEnemy}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:spawnEnemy}}]]

Latest revision as of 23:19, 3 February 2023

Hover & click on the images for description

Description

Description:
Constantly spawns enemies around a player according to array of enemy classes. The units will try to hunt down the player.
Execution:
spawn
Groups:
Object Manipulation

Syntax

Syntax:
[aPlayer, target, side, classes, maxEnemies, delay, code] spawn BIS_fnc_spawnEnemy
Parameters:
aPlayer: Object - a unit that is a player
target: Object - reference object (enemies will be spawned on same direction in respect to the player)
side: Side - side of the spawned enemies
classes: Array of Strings - list of enemy classes (units will form a group together)
Classes must be of the defined side, otherwise they will attack each other.
maxEnemies: Number - (Optional, default 10) maximum number of enemies at once
delay: Number - (Optional, default 30) time between spawn waves
code: Code - (Optional, default {}) - code to execute on each unit (referenced by _this)
Return Value:
Nothing

Examples

Example 1:
[player, player, opfor, ["O_Soldier_F"]] spawn BIS_fnc_spawnEnemy;

Additional Information

See also:
BIS_fnc_spawnGroup BIS_fnc_stalk

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