BIS fnc simpleObjectData: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Generated by BIS_fnc_exportFunctionsToWiki)
 
m (Text replacement - "(\|[pr][0-9]+ *= *[^-]+) *- *E([a-z])" to "$1 - e$2")
 
(30 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{RV|type=function


{{Function|= Comments
|game1= arma3
____________________________________________________________________________________________
|version1= 1.62


| arma3 |= Game name
|gr1= Object Manipulation


|1.00|= Game version
|descr= Get complete data needed for simple object creation.
____________________________________________________________________________________________


| <pre>/*
|s1= [classname] call [[BIS_fnc_simpleObjectData]]
Author: Jiri Wainar


Description:
|p1= classname: [[Object]] or [[String]]:
Get complete data needed for simple object creation.
* [[Object]] - existing object or simple object that will be scanned; if it is a simple object '_reversed' attribute cannot be retrieved<br>
* [[String]] - Can be either:
** Classname of the object; data are retrieved from the config definition.
** Path to the p3d; verifies and fixes model path format and returns it in an array (index 1).<br>It has very limited functionality in this mode as no data can actually be retrieved from model path.


Parameter(s):
|r1= [[Array]] in format [class, model, reversed, verticalOffset, animationAdjustments, selectionsToHide, verticalOffsetWorld, textures, randomizeAnims, randomizeTexs]:
0: STRING - classname of the object; data are retrieved from the config definition.
* class: [[String]] - (Default "") class name from CfgVehicles
  or
* model: [[String]] - (Default "") path to the vehicle p3d mode
  OBJECT - existing object or simple object that will be scanned; if it is a simple object '_reversed' attribute cannot be retrieved
* reversed: [[Number]] - (Default 0) reverse value, to fix orientation. 0: no change, 1: reverse
  or
* verticalOffset: [[Array]] - (Default 0) vertical offset
  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.
* animationAdjustments: [[Array]] - (Default []) animation to animate, every element has this format: [_animationName:string, _animationState:scalar]
* hiddenSelections: [[Array]] - (Default []) all listed selection will be hidden
* verticalOffsetWorld: [[Number]] - vertical offset in World coordinates; similar to [[ASL]] but refers to object at [0, 0, 0], not its land contacts
* textures: [[Array]] - textures currently applied to the object
* randomizeAnims: [[Boolean]] - (Default false) true if vehicle supports randomization through animations
* randomizeTexs: [[Boolean]] - (Default false) true if vehicle supports randomization of textures


Returns:
{{Feature|informative|Return values can directly be used with [[BIS_fnc_adjustSimpleObject]].}}
  0: _class:string - asset CfgVehicles config class (default: "")
  1: _model:string - path to the vehicle p3d model; needs to start without backslash and must end with the proper file extension ".p3d" (default: "")
  2: _reversed:scalar - some objects, usually vehicles, are reveresed in p3d (default: 0); valid values are 0: no change, 1: reverse, -1: unknown (behaves as 0)
  3: _verticalOffset:scalar - fix for non-existant physX; usually needed only for vehicles (default: 0)
  4: _animationsAdjustments:array - animation that need to be animated to given state (default: []); every element has this format: [_animationName:string,_animationState:scalar]
  5: _selectionsToHide:array - all listed selection will be hidden (default: [])
  6: _verticalOffsetWorld:scalar - vertical offset in World coordinates; similar to ASL but refers to object [0,0,0], not its land contacts
  7. _textures:array - textures applied to object


Example:
|x1= <sqf>
_data:array = [_vehicle:object] call BIS_fnc_simpleObjectData;
["B_Boat_Armed_01_minigun_F"] call BIS_fnc_simpleObjectData;
_data:array = [_class:string] call BIS_fnc_simpleObjectData;
/*
 
[
See also:
"B_Boat_Armed_01_minigun_F",
* bis_fnc_createSimpleObject
"A3\Boat_F\Boat_Armed_01\Boat_Armed_01_minigun_F.p3d",
* bis_fnc_replaceWithSimpleObject
1,
* bis_fnc_simpleObjectData
3.323,
* bis_fnc_exportCfgVehiclesSimpleObjectData
[
* bis_fnc_diagMacrosSimpleObjectData
["damagehide", 0],
["turret_shake", 0],
["turret_shake_aside", 0],
["magazine_hide", 0],
["mainturret", 0],
["damagehideotocvez", 0],
["maingun", 0.09],
["damagehideotochlaven", 0],
["rearturret", -3.16],
["reargun", 0.09],
["muzzleflash", 0],
["zaslehrot", 79],
["zasleh2rot", 600],
["fuel", 1],
["mph", 0],
["rpm", 0],
["amps_random", 0],
["oil_random", 0],
["trim_random", 0],
["tmp_random", 0],
["volt_random", 0],
["drivingwheel", 0],
["ammobelt_hide", 0],
["bullet001_2_hide", 0.33],
["bullet002_2_hide", 0.33],
["bullet003_2_hide", 0.33],
["bullet004_2_hide", 0.33],
["bullet005_2_hide", 0.33],
["bullet006_2_hide", 0.33],
["positionlights", 0],
["gun_revolving", 0.33],
["muzzleflash2", 0],
["reargunner", 0.09]
],
["zasleh", "p svetlo", "zadni svetlo", "brzdove svetlo", "clan", "podsvit pristroju", "poskozeni"],
-0.148,
[
"\A3\boat_f\Boat_Armed_01\data\Boat_Armed_01_ext_co.paa",
"\A3\boat_f\Boat_Armed_01\data\Boat_Armed_01_int_co.paa",
"\A3\boat_f\Boat_Armed_01\data\Boat_Armed_01_crows_blufor_co.paa"
],
false,
false
]
*/
*/
</sqf>


#define SELECTIONS_TO_HIDE ["fireanim","brakelights","clan","dashboard","showdamage","damage","backlights","offlight","redlight","whitelight","hrotorstill","hrotormove","vrotorstill","vrotormove","rotorstill","rotormove"]
|x2= <sqf>[BIS_boat] call BIS_fnc_simpleObjectData;</sqf>
#define RETURN_VALUES [_class,_model,_reversed,_verticalOffset,_animationsAdjustments,_selectionsToHide,_verticalOffsetWorld,_textures]
#define ROUND_DECIMALS(input,accuracy) round((1/accuracy)*(input))*accuracy;
 
</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
____________________________________________________________________________________________
 
| <!-- [] call [[BIS_fnc_simpleObjectData]]; --> |= Syntax
|p1= |= Parameter 1
 
| |= Return value
____________________________________________________________________________________________
 
|x1= <code></code> |=
____________________________________________________________________________________________
 
| |= See also


|seealso= [[createSimpleObject]] [[BIS_fnc_adjustSimpleObject]] [[BIS_fnc_createSimpleObject]]
}}
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: SimpleObjects|{{uc:simpleObjectData}}]]
[[Category:Functions|{{uc:simpleObjectData}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:simpleObjectData}}]]

Latest revision as of 14:06, 8 November 2023

Hover & click on the images for description

Description

Description:
Get complete data needed for simple object creation.
Execution:
call
Groups:
Object Manipulation

Syntax

Syntax:
[classname] call BIS_fnc_simpleObjectData
Parameters:
classname: Object or String:
  • Object - existing object or simple object that will be scanned; if it is a simple object '_reversed' attribute cannot be retrieved
  • String - Can be either:
    • Classname of the object; data are retrieved from the config definition.
    • 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.
Return Value:
Array in format [class, model, reversed, verticalOffset, animationAdjustments, selectionsToHide, verticalOffsetWorld, textures, randomizeAnims, randomizeTexs]:
  • class: String - (Default "") class name from CfgVehicles
  • model: String - (Default "") path to the vehicle p3d mode
  • reversed: Number - (Default 0) reverse value, to fix orientation. 0: no change, 1: reverse
  • verticalOffset: Array - (Default 0) vertical offset
  • animationAdjustments: Array - (Default []) animation to animate, every element has this format: [_animationName:string, _animationState:scalar]
  • hiddenSelections: Array - (Default []) all listed selection will be hidden
  • verticalOffsetWorld: Number - vertical offset in World coordinates; similar to ASL but refers to object at [0, 0, 0], not its land contacts
  • textures: Array - textures currently applied to the object
  • randomizeAnims: Boolean - (Default false) true if vehicle supports randomization through animations
  • randomizeTexs: Boolean - (Default false) true if vehicle supports randomization of textures
Return values can directly be used with BIS_fnc_adjustSimpleObject.

Examples

Example 1:
["B_Boat_Armed_01_minigun_F"] call BIS_fnc_simpleObjectData; /* [ "B_Boat_Armed_01_minigun_F", "A3\Boat_F\Boat_Armed_01\Boat_Armed_01_minigun_F.p3d", 1, 3.323, [ ["damagehide", 0], ["turret_shake", 0], ["turret_shake_aside", 0], ["magazine_hide", 0], ["mainturret", 0], ["damagehideotocvez", 0], ["maingun", 0.09], ["damagehideotochlaven", 0], ["rearturret", -3.16], ["reargun", 0.09], ["muzzleflash", 0], ["zaslehrot", 79], ["zasleh2rot", 600], ["fuel", 1], ["mph", 0], ["rpm", 0], ["amps_random", 0], ["oil_random", 0], ["trim_random", 0], ["tmp_random", 0], ["volt_random", 0], ["drivingwheel", 0], ["ammobelt_hide", 0], ["bullet001_2_hide", 0.33], ["bullet002_2_hide", 0.33], ["bullet003_2_hide", 0.33], ["bullet004_2_hide", 0.33], ["bullet005_2_hide", 0.33], ["bullet006_2_hide", 0.33], ["positionlights", 0], ["gun_revolving", 0.33], ["muzzleflash2", 0], ["reargunner", 0.09] ], ["zasleh", "p svetlo", "zadni svetlo", "brzdove svetlo", "clan", "podsvit pristroju", "poskozeni"], -0.148, [ "\A3\boat_f\Boat_Armed_01\data\Boat_Armed_01_ext_co.paa", "\A3\boat_f\Boat_Armed_01\data\Boat_Armed_01_int_co.paa", "\A3\boat_f\Boat_Armed_01\data\Boat_Armed_01_crows_blufor_co.paa" ], false, false ] */
Example 2:
[BIS_boat] call BIS_fnc_simpleObjectData;

Additional Information

See also:
createSimpleObject BIS_fnc_adjustSimpleObject BIS_fnc_createSimpleObject

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