BIS fnc createSimpleObject: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Add missing 'local' in Syntax) |
Lou Montana (talk | contribs) m (Text replacement - "(Optional, default [])" to "(Optional, default {{hl|[]}})") |
||
Line 21: | Line 21: | ||
*** 0: no change - any value other than 1 will result in no change | *** 0: no change - any value other than 1 will result in no change | ||
** verticalOffset: [[Number]] - (Optional, default 0) fix for non-existant physX; usually needed only for vehicles | ** verticalOffset: [[Number]] - (Optional, default 0) fix for non-existant physX; usually needed only for vehicles | ||
** animationAdjustments: [[Array]] - (Optional, default []) animation that need to be animated to given state, in format [animationName, animationState]: | ** animationAdjustments: [[Array]] - (Optional, default {{hl|[]}}) animation that need to be animated to given state, in format [animationName, animationState]: | ||
*** animationName: [[String]] - animation name | *** animationName: [[String]] - animation name | ||
*** animationState: [[Number]] - animation state | *** animationState: [[Number]] - animation state | ||
** selectionsToHide: [[Array]] - (Optional, default []) all listed selections will be hidden | ** selectionsToHide: [[Array]] - (Optional, default {{hl|[]}}) all listed selections will be hidden | ||
|p2= position: [[Array]] format [[Position#PositionASL|PositionASL]] - the object will be placed by the '''model centre'''<nowiki/>'s position (see [[getPosWorld]]) | |p2= position: [[Array]] format [[Position#PositionASL|PositionASL]] - the object will be placed by the '''model centre'''<nowiki/>'s position (see [[getPosWorld]]) |
Revision as of 14:05, 26 October 2023
Description
- Description:
- Creates non-simulated framerate and network performance friendly object - a Simple Object - and applies different adjustments to fake non-existing physX and engine interactions. The adjustments need either to be stored in the object config or provided as the function input, otherwise they need to be done manually.
Simple objects cannot be destroyed and do not interact with the environment. They are useful for creating low performance-demanding static compositions (walls, rocks, wrecks, …) and/or environments where shooting and collisions are not expected. - Execution:
- call
- Groups:
- Object Manipulation
Syntax
- Syntax:
- [input, position, direction, followTerrain, forceSuperSimpleObject, local] call BIS_fnc_createSimpleObject
- Parameters:
- input: String or Array:
- String: classname of the object to be created. This is the preferred way if the asset config definition contains the adjustment data or the data are not needed (most objects do not need adjustments).
- Array: adjustment data in format [class, model, reversed, verticalOffset, animationAdjustments, selectionsToHide]:
- class: String - (Optional, default "") asset CfgVehicles config class (at least either model or class must be provided, ideally both)
- model: String - (Optional, default "") Path to the vehicle p3d model; needs to start without backslash and must end with the proper file extension ".p3d"
- reversed: Number - (Optional, default 0) some objects, usually vehicles, are reversed in p3d; valid values are:
- 1: reverse
- 0: no change - any value other than 1 will result in no change
- verticalOffset: Number - (Optional, default 0) fix for non-existant physX; usually needed only for vehicles
- animationAdjustments: Array - (Optional, default []) animation that need to be animated to given state, in format [animationName, animationState]:
- selectionsToHide: Array - (Optional, default []) all listed selections will be hidden
- position: Array format PositionASL - the object will be placed by the model centre's position (see getPosWorld)
- direction: Number - (Optional, default 0)
- followTerrain: Boolean - (Optional, default true) true to follow terrain inclination, false to be horizontally aligned
- forceSuperSimpleObject: Boolean - (Optional, default false) true to create a Super Simple Object from p3d path (that must be provided)
- since 2.08
- local: Boolean - (Optional, default false) true to create local instance of the object
- Return Value:
- Object - the created Simple Object, objNull if creation failed
Examples
- Example 1:
- Example 2:
Additional Information
- See also:
- Arma 3: Simple Objects createSimpleObject BIS_fnc_adjustSimpleObject BIS_fnc_replaceWithSimpleObject BIS_fnc_simpleObjectData getPosWorld setPosWorld
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