BIS fnc spawnEnemy: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(The function is not broken, the line with typo is not used)
(Fix description)
Line 4: Line 4:
| arma2oa |Game name=
| arma2oa |Game name=


|1.00|= Game version
|1.51|= Game version
____________________________________________________________________________________________
____________________________________________________________________________________________


| Spawns enemies around a player according to array of enemy classes. The units will try to hunt down the player. |DESCRIPTION=
| Constantly spawns enemies around a player according to array of enemy classes. The units will try to hunt down the player. |DESCRIPTION=
____________________________________________________________________________________________
____________________________________________________________________________________________


| [aPlayer, target, side, classes, maxEnemies, delay, code] call [[BIS_fnc_spawnEnemy]] |SYNTAX=
| [aPlayer, target, side, classes, maxEnemies, delay, code] spawn [[BIS_fnc_spawnEnemy]] |SYNTAX=
 
|pr= This function displays an error every time (at least in {{arma3}}) as it uses an undefined variable (typo '''line 30''', {{Inline code|_players}} )


|p1= aPlayer: [[Object]] - player |PARAMETER1=
|p1= aPlayer: [[Object]] - player |PARAMETER1=
Line 26: Line 28:
|p7= code: [[Code]] - (Optional, default {}) - code to execute on each unit (referenced by [[_this]]) |PARAMETER7=
|p7= code: [[Code]] - (Optional, default {}) - code to execute on each unit (referenced by [[_this]]) |PARAMETER7=


| [[Array]] - spawned enemies |RETURNVALUE=
| [[Nothing]] |RETURNVALUE=
 
|exec= spawn |Execution=
____________________________________________________________________________________________
____________________________________________________________________________________________


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


Line 44: Line 48:
<h3 style="display:none">Bottom Section</h3>
<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: Spawning|{{uc:spawnEnemy}}]]
[[Category:Function Group: Spawning|{{uc:spawnEnemy}}]]
[[Category:Functions|{{uc:spawnEnemy}}]]
[[Category:{{Name|arma2oa}}: Functions|{{uc:spawnEnemy}}]]
[[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 20:19, 23 May 2020

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
Problems:
This function displays an error every time (at least in Arma 3) as it uses an undefined variable (typo line 30, _players )
Groups:
Uncategorised

Syntax

Syntax:
[aPlayer, target, side, classes, maxEnemies, delay, code] spawn 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:
Nothing

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