BIS fnc spawnEnemy: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "= <code>([^<]*)\[\[([a-zA-Z][a-zA-Z0-_]+)\]\]([^<]*)<\/code>" to "= <code>$1$2$3</code>") |
Lou Montana (talk | contribs) m (Remove 'broken' warning) |
||
(6 intermediate revisions by the same user not shown) | |||
Line 18: | Line 18: | ||
|s1= [aPlayer, target, side, classes, maxEnemies, delay, code] spawn [[BIS_fnc_spawnEnemy]] | |s1= [aPlayer, target, side, classes, maxEnemies, delay, code] spawn [[BIS_fnc_spawnEnemy]] | ||
| | |p1= aPlayer: [[Object]] - a unit that [[isPlayer|is a player]] | ||
|p2= target: [[Object]] - reference object (enemies will be spawned on same direction in respect to the player) | |||
|p2= target: [[Object]] - | |||
|p3= side: [[Side]] - side of the spawned enemies | |p3= side: [[Side]] - side of the spawned enemies | ||
|p4= classes: [[Array]] of [[String]]s - list of enemy classes (units will form a group together) | |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.}} | |||
|p5= maxEnemies: [[Number]] - (Optional, default 10) maximum number of enemies at once | |p5= maxEnemies: [[Number]] - (Optional, default 10) maximum number of enemies at once | ||
Line 36: | Line 35: | ||
|r1= [[Nothing]] | |r1= [[Nothing]] | ||
|x1= < | |x1= <sqf>[player, player, opfor, ["O_Soldier_F"]] spawn BIS_fnc_spawnEnemy;</sqf> | ||
|seealso= [[BIS_fnc_spawnGroup]] [[BIS_fnc_stalk]] | |seealso= [[BIS_fnc_spawnGroup]] [[BIS_fnc_stalk]] | ||
}} | }} |
Latest revision as of 23:19, 3 February 2023
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)
- 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:
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