BIS fnc createSimpleObject: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Created page with "{{Function|= Comments ____________________________________________________________________________________________ | Arma 3 |= Game |1.62|= Game Version ____________________...")
No edit summary
Line 7: Line 7:
____________________________________________________________________________________________
____________________________________________________________________________________________


|Get complete data needed for simple object creation.|= 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.<br><br>
 
Simple objects cannot be destroyed and do not interact with the environment. They are usefull for creation low performance demanding static compositions (walls, rocks, wrecks, ...) and/or environments where shooting and collisions are not expected.|= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


| [classname] [[call]] '''BIS_fnc_simpleObjectData''' |= Syntax
| [class] [[call]] '''BIS_fnc_createSimpleObject''' |= Syntax


|p1=
|p1=
[[String]] - Classname of the object; data are retrieved from the config definition.<br>
[[String]]: Classname of the object to be created. This is preffered way if the asset config definition contains the adjustment data or the data are not needed (most objects do not need adjustments).<br>
or<br>
[[Object]] - Existing object or simple object that will be scanned; if it is a simple object '_reversed' attribute cannot be retrieved<br>
or<br>
or<br>
[[String]] - Path to the p3d; verifies and fixes model path format and returns it in an array (index 1). It has very limited functionality in this mode as no data can actually be retrieved from model path.
|p2= [[Array]]: Adjustment data in format:<br><br>
|= Parameter 1
0: [[String]]: class - Asset CfgVehicles config class (default: ""; but at least either _model or _class must be provided, ideally both)<br>
1: [[String]]: model - Path to the vehicle p3d model; needs to start without backslash and must end with the proper file extension ".p3d" (default: ""; but at least either _model or _class must be provided, ideally both)<br>
2: [[Number]]: reversed - Some objects, usually vehicles, are reveresed in p3d (default: 0); valid values are 0: no change, 1: reverse, -1: unknown (behaves as 0)<br>
3: [[Array]]: verticalOffset - Fix for non-existant physX; usually needed only for vehicles (default: 0)<br>
4: [[Array]]: animationAdjustments -  Animation that need to be animated to given state (default: []); every element has this format: [_animationName:string,_animationState:scalar]<br>
5: [[Array]]: selectionsToHide - All listed selection will be hidden (default: [])<br>|= Parameter 2
____________________________________________________________________________________________
____________________________________________________________________________________________


|
|[[Object]] or [[objNull]]|= Return value
[[Array]] in format:<br>
0: [[String]] - Class name from CfgVehicles<br>
1: [[String]] - Model - Path to the vehicle p3d model<br>
2: [[Number]] - Reversed - Reverse value, to fix orientation<br>
3: [[Array]]  - Vertical offset<br>
4: [[Array]] - Animation adjustments<br>
5: [[Array]] - Hidden selections<br>
 
{{note|Return values can be used in [[BIS_fnc_adjustSimpleObject]]}}|= Return value


____________________________________________________________________________________________
____________________________________________________________________________________________


|x1= <code>["B_Boat_Armed_01_minigun_F"] [[call]] '''BIS_fnc_simpleObjectData''';</code>|= EXAMPLE1
|x1= <code>["B_Boat_Armed_01_minigun_F"] [[call]] '''BIS_fnc_createSimpleObject''';</code>|= EXAMPLE1
|x2= <code>[BIS_boat] [[call]] '''BIS_fnc_simpleObjectData''';</code>|= EXAMPLE2
 
____________________________________________________________________________________________
____________________________________________________________________________________________


| [[createSimpleObject]], [[BIS_fnc_adjustSimpleObject]], [[BIS_fnc_createSimpleObject]]|= See Also
|[[BIS_fnc_adjustSimpleObject]], [[BIS_fnc_createSimpleObject]], [[BIS_fnc_replaceWithSimpleObject]], [[BIS_fnc_simpleObjectData]]|= See Also


}}
}}

Revision as of 19:20, 14 September 2016

Hover & click on the images for description

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 usefull for creation low performance demanding static compositions (walls, rocks, wrecks, ...) and/or environments where shooting and collisions are not expected.
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
[class] call BIS_fnc_createSimpleObject
Parameters:
String: Classname of the object to be created. This is preffered way if the asset config definition contains the adjustment data or the data are not needed (most objects do not need adjustments).
or
Array: Adjustment data in format:

0: String: class - Asset CfgVehicles config class (default: ""; but at least either _model or _class must be provided, ideally both)
1: String: model - Path to the vehicle p3d model; needs to start without backslash and must end with the proper file extension ".p3d" (default: ""; but at least either _model or _class must be provided, ideally both)
2: Number: reversed - Some objects, usually vehicles, are reveresed in p3d (default: 0); valid values are 0: no change, 1: reverse, -1: unknown (behaves as 0)
3: Array: verticalOffset - Fix for non-existant physX; usually needed only for vehicles (default: 0)
4: Array: animationAdjustments - Animation that need to be animated to given state (default: []); every element has this format: [_animationName:string,_animationState:scalar]
5: Array: selectionsToHide - All listed selection will be hidden (default: [])
Return Value:
Object or objNull

Examples

Example 1:
["B_Boat_Armed_01_minigun_F"] call BIS_fnc_createSimpleObject;

Additional Information

See also:
BIS_fnc_adjustSimpleObjectBIS_fnc_createSimpleObjectBIS_fnc_replaceWithSimpleObjectBIS_fnc_simpleObjectData

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

Bottom Section