BIS fnc spawnEnemy: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) (Page filling) |
m (template:command argument fix) |
||
Line 8: | Line 8: | ||
| Spawns enemies around a player according to array of enemy classes. The units will try to hunt down the player. | | 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}} )}} |= | {{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}} )}} |DESCRIPTION= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| [aPlayer, target, side, classes, maxEnemies, delay, code] call [[BIS_fnc_spawnEnemy]] |= | | [aPlayer, target, side, classes, maxEnemies, delay, code] call [[BIS_fnc_spawnEnemy]] |SYNTAX= | ||
|p1= aPlayer: [[Object]] - player |= | |p1= aPlayer: [[Object]] - player |PARAMETER1= | ||
|p2= target: [[Object]] - refence object (enemies will be spawned on same direction in respect to the player) |= | |p2= target: [[Object]] - refence object (enemies will be spawned on same direction in respect to the player) |PARAMETER2= | ||
|p3= side: [[Side]] - side of the spawned enemies |= | |p3= side: [[Side]] - side of the spawned enemies |PARAMETER3= | ||
|p4= classes: [[Array]] of [[String]] - list of enemy classes (units will form a group together) |= | |p4= classes: [[Array]] of [[String]] - list of enemy classes (units will form a group together) |PARAMETER4= | ||
|p5= maxEnemies: [[Number]] - (Optional, default 10) maximum number of enemies at once |= | |p5= maxEnemies: [[Number]] - (Optional, default 10) maximum number of enemies at once |PARAMETER5= | ||
|p6= delay: [[Number]] - (Optional, default 30) time between spawn waves |= | |p6= delay: [[Number]] - (Optional, default 30) time between spawn waves |PARAMETER6= | ||
|p7= code: [[Code]] - (Optional, default {}) - code to execute on each unit (referenced by [[_this]]) |= | |p7= code: [[Code]] - (Optional, default {}) - code to execute on each unit (referenced by [[_this]]) |PARAMETER7= | ||
| [[Array]] - spawned enemies |= | | [[Array]] - spawned enemies |RETURNVALUE= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
|x1= <code><nowiki>[</nowiki>[[player]], [[player]], [[opfor]], ["O_Soldier_F"]] [[spawn]] [[BIS_fnc_spawnEnemy]];</code> |= | |x1= <code><nowiki>[</nowiki>[[player]], [[player]], [[opfor]], ["O_Soldier_F"]] [[spawn]] [[BIS_fnc_spawnEnemy]];</code> |EXAMPLE1= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| [[BIS_fnc_spawnGroup]], [[BIS_fnc_stalk]] |= | | [[BIS_fnc_spawnGroup]], [[BIS_fnc_stalk]] |SEEALSO= | ||
}} | }} | ||
Revision as of 14:33, 7 April 2019
Description
- Description:
- Spawns enemies around a player according to array of enemy classes. The units will try to hunt down the player.
- 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