BIS fnc spawnEnemy: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
(Page filling)
Line 1: Line 1:
{{Function|= Comments
{{Function|= Comments
____________________________________________________________________________________________
____________________________________________________________________________________________
Line 8: Line 7:
____________________________________________________________________________________________
____________________________________________________________________________________________


| <pre>
| Spawns enemies around a player according to array of enemy classes. The units will try to hunt down the player.
/*
{{warning|This function is broken (at least in {{arma3}}) as it uses an undefined variable, displaying an error on each use!  (typo '''line 30''', {{Inline code|_players}}&nbsp;)}} |= Description
____________________________________________________________________________________________
 
| [aPlayer, target, side, classes, maxEnemies, delay, code] call [[BIS_fnc_spawnEnemy]] |= Syntax
 
|p1= aPlayer: [[Object]] - player |= Parameter 1


Description:
|p2= target: [[Object]] - refence object (enemies will be spawned on same direction in respect to the player) |= Parameter 2
Spawns enemies near player according to array of enemy classes.
        The units will try to hunt down the player


Parameter(s):
|p3= side: [[Side]] - side of the spawned enemies |= Parameter 3
_this select 0: OBJECT - player
_this select 1: OBJECT - refence object (enemies will be spawned on same direction in respect to the player)
_this select 2: SIDE - side of enemies
_this select 3: ARRAY - list of enemy classes (units will form a group together)
_this select 4 (Optional): NUMBER - delay between spawning
_this select 5 (Optional): CODE - code executed on every soldier. Unit is passed as _this


Returns:
|p4= classes: [[Array]] of [[String]] - list of enemy classes (units will form a group together) |= Parameter 4
ARRAY - list of all spawned crows
*/


</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
|p5= maxEnemies: [[Number]] - (Optional, default 10) maximum number of enemies at once |= Parameter 5
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_spawnEnemy]]; --> |= Syntax
|p6= delay: [[Number]] - (Optional, default 30) time between spawn waves |= Parameter 6


|p1= |= Parameter 1
|p7= code: [[Code]] - (Optional, default {}) - code to execute on each unit (referenced by [[_this]]) |= Parameter 7


| |= Return value
| [[Array]] - spawned enemies |= Return value
____________________________________________________________________________________________
____________________________________________________________________________________________


|x1= <code></code> |=  
|x1= <code><nowiki>[</nowiki>[[player]], [[player]], [[opfor]], ["O_Soldier_F"]] [[spawn]] [[BIS_fnc_spawnEnemy]];</code> |= Example 1
____________________________________________________________________________________________
____________________________________________________________________________________________


| |= See also
| [[BIS_fnc_spawnGroup]], [[BIS_fnc_stalk]] |= See also
 
}}
}}


Line 57: Line 49:
[[Category:{{Name|tkoh}}: Functions|{{uc:spawnEnemy}}]]
[[Category:{{Name|tkoh}}: Functions|{{uc:spawnEnemy}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:spawnEnemy}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:spawnEnemy}}]]
[[Category:Broken_Functions]]

Revision as of 22:08, 6 May 2018

Hover & click on the images for description

Description

Description:
Spawns enemies around a player according to array of enemy classes. The units will try to hunt down the player.
This function is broken (at least in Arma 3) as it uses an undefined variable, displaying an error on each use! (typo line 30, _players )
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
[aPlayer, target, side, classes, maxEnemies, delay, code] call BIS_fnc_spawnEnemy
Parameters:
aPlayer: Object - player
target: Object - refence object (enemies will be spawned on same direction in respect to the player)
side: Side - side of the spawned enemies
classes: Array of String - list of enemy classes (units will form a group together)
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:
Array - spawned enemies

Examples

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

Additional Information

See also:
BIS_fnc_spawnGroupBIS_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

Notes

Bottom Section