BIS fnc spawnObjects: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "^ \{\{(Command|Function)" to "{{$1") |
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 | ||
| arma3 | | arma3 | ||
|1.00|= Game version | |1.00|= Game version | ||
|gr1= Object Manipulation | |gr1= Object Manipulation | ||
| Create a stack of objects at given position or on top of given object (eg. table). | | Create a stack of objects at given position or on top of given object (eg. table). | ||
| [position, className, count, offsetMatrix, offsetDir, dirNoise, enableSimulation] call [[BIS_fnc_spawnObjects]] | | [position, className, count, offsetMatrix, offsetDir, dirNoise, enableSimulation] call [[BIS_fnc_spawnObjects]] | ||
|p1= position: [[PositionASL]], or [[Array]] as [referenceObject, placement] | |p1= position: [[PositionASL]], or [[Array]] as [referenceObject, placement] | ||
Line 17: | Line 17: | ||
** "TOP" = top of the objects boundingbox | ** "TOP" = top of the objects boundingbox | ||
** "GROUND" = sitting just on the ground | ** "GROUND" = sitting just on the ground | ||
** "ROADWAY" = sitting just on the ground | ** "ROADWAY" = sitting just on the ground | ||
|p2= className: [[String]] - class of the object(s) to spawn; all will use the same class | |p2= className: [[String]] - class of the object(s) to spawn; all will use the same class | ||
|p3= count: [[Number]] (Optional, default: 1) - how many objects will be spawned | |p3= count: [[Number]] (Optional, default: 1) - how many objects will be spawned | ||
|p4= offsetMatrix: [[Array]] (Optional, default: [0,0,0]) - starting spawning position offset | |p4= offsetMatrix: [[Array]] (Optional, default: [0,0,0]) - starting spawning position offset | ||
|p5= offsetDir: [[Number]] (Optional, default: 0) - starting spawning direction offset | |p5= offsetDir: [[Number]] (Optional, default: 0) - starting spawning direction offset | ||
|p6= dirNoise: [[Code]] (Optional, default: {0}) - spawned object direction delta from the starting direction, defined as code returning dir delta value | |p6= dirNoise: [[Code]] (Optional, default: {0}) - spawned object direction delta from the starting direction, defined as code returning dir delta value | ||
|p7= enableSimulation: [[Boolean]] (Optional, default: false) - shall the simulation of the spawned objects be enabled or not | |p7= enableSimulation: [[Boolean]] (Optional, default: false) - shall the simulation of the spawned objects be enabled or not | ||
| [[Array]] of created [[Object|Objects]] | | [[Array]] of created [[Object|Objects]] | ||
|x1= <code>_randomPos = [([[random]] 0.2) -0.1, ([[random]] 0.2) -0.1, 0]; | |x1= <code>_randomPos = [([[random]] 0.2) -0.1, ([[random]] 0.2) -0.1, 0]; | ||
_objects = [<nowiki/>[_table, "TOP"], "Box_NATO_Wps_F", 3, _randomPos,([[random]] 20)-10] [[call]] [[BIS_fnc_spawnObjects]];</code> | _objects = [<nowiki/>[_table, "TOP"], "Box_NATO_Wps_F", 3, _randomPos,([[random]] 20)-10] [[call]] [[BIS_fnc_spawnObjects]];</code> | ||
| [[createVehicle]], [[createSimpleObject]], [[enableSimulation]] | | [[createVehicle]], [[createSimpleObject]], [[enableSimulation]] | ||
}} | }} |
Revision as of 23:44, 17 January 2021
Description
- Description:
- Create a stack of objects at given position or on top of given object (eg. table).
- Execution:
- call
- Groups:
- Object Manipulation
Syntax
- Syntax:
- [position, className, count, offsetMatrix, offsetDir, dirNoise, enableSimulation] call BIS_fnc_spawnObjects
- Parameters:
- position: PositionASL, or Array as [referenceObject, placement]
- className: String - class of the object(s) to spawn; all will use the same class
- count: Number (Optional, default: 1) - how many objects will be spawned
- offsetMatrix: Array (Optional, default: [0,0,0]) - starting spawning position offset
- offsetDir: Number (Optional, default: 0) - starting spawning direction offset
- dirNoise: Code (Optional, default: {0}) - spawned object direction delta from the starting direction, defined as code returning dir delta value
- enableSimulation: Boolean (Optional, default: false) - shall the simulation of the spawned objects be enabled or not
- Return Value:
- Array of created Objects
Examples
- Example 1:
_randomPos = [(random 0.2) -0.1, (random 0.2) -0.1, 0]; _objects = [[_table, "TOP"], "Box_NATO_Wps_F", 3, _randomPos,(random 20)-10] call BIS_fnc_spawnObjects;
Additional Information
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