BIS fnc spawnEnemy: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " <h3 style="display:none">Notes</h3> <dl class="command_description"> <!-- Note Section BEGIN --> <!-- Note Section END --> </dl> " to "") |
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("server" o...) |
||
Line 1: | Line 1: | ||
{{Function | {{Function | ||
| arma2oa | | arma2oa | ||
|1.51|= Game version | |1.51|= Game version | ||
|gr1= Object Manipulation | |gr1= Object Manipulation | ||
| Constantly spawns enemies around a player according to array of enemy classes. The units will try to hunt down the player. | | Constantly spawns enemies around a player according to array of enemy classes. The units will try to hunt down the player. | ||
| [aPlayer, target, side, classes, maxEnemies, delay, code] spawn [[BIS_fnc_spawnEnemy]] | | [aPlayer, target, side, classes, maxEnemies, delay, code] spawn [[BIS_fnc_spawnEnemy]] | ||
|pr= This function displays an error every time (at least in {{arma3}}) as it uses an undefined variable (typo '''line 30''', {{Inline code|_players}} ) | |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 | |p1= aPlayer: [[Object]] - player | ||
|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) | ||
|p3= side: [[Side]] - side of the spawned enemies | |p3= side: [[Side]] - side of the spawned enemies | ||
|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) | ||
|p5= maxEnemies: [[Number]] - (Optional, default 10) maximum number of enemies at once | |p5= maxEnemies: [[Number]] - (Optional, default 10) maximum number of enemies at once | ||
|p6= delay: [[Number]] - (Optional, default 30) time between spawn waves | |p6= delay: [[Number]] - (Optional, default 30) time between spawn waves | ||
|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]]) | ||
| [[Nothing]] | | [[Nothing]] | ||
|exec= spawn |Execution= | |exec= spawn |Execution= | ||
|x1= <code>[<nowiki/>[[player]], [[player]], [[opfor]], ["O_Soldier_F"]] [[spawn]] [[BIS_fnc_spawnEnemy]];</code> | |x1= <code>[<nowiki/>[[player]], [[player]], [[opfor]], ["O_Soldier_F"]] [[spawn]] [[BIS_fnc_spawnEnemy]];</code> | ||
| [[BIS_fnc_spawnGroup]], [[BIS_fnc_stalk]] | | [[BIS_fnc_spawnGroup]], [[BIS_fnc_stalk]] | ||
}} | }} | ||
Revision as of 23:46, 17 January 2021
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:
- Object Manipulation
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