BIS fnc adjustSimpleObject: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Generated by BIS_fnc_exportFunctionsToWiki)
 
m (Text replacement - "(Optional, default {{hl|[]}})" to "(Optional, default <sqf inline>[]</sqf>)")
 
(41 intermediate revisions by 5 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=Adjust simple object vertical position, animations and selection according to provided data.<br>
____________________________________________________________________________________________
In case both adjustment data and class are being used, data has higher priority and only undefined parts are filled from config.


| <pre>/*
{{Feature|important|This function is automatically called by [[BIS_fnc_createSimpleObject]].}}
Author: Jiri Wainar


Description:
|s1= [object, [class, model, reversed, verticalOffset, animAdjustments, selectionToHide]] call [[BIS_fnc_adjustSimpleObject]]
Adjust simple object vertical position, animations and selection according to provided data.


Remarks:
|p1= object: [[Object]] - simple object that will be adjusted
Function is automatically called by bis_fnc_createSimpleObject. In case both adjustment data and class are being used, data has higher priority and only undefined parts are filled from config.


Parameter(s):
|p2= class: [[String]] - (Optional, default "") asset {{hl|CfgVehicles}} config class ('''at least either ''model'' or ''class'' must be provided, ideally both''')
0: OBJECT - simple object that will be adjusted
1: ARRAY - adjustment data
  or
  STRING - classname that is used to determine adjustment data


Returns:
|p3= model: [[String]] - (Optional, default "") path to the vehicle p3d model; needs to start without backslash and must end with the proper file extension ".p3d"
-


Example:
|p4= reversed: [[Number]] - (Optional, default 0) some objects, usually vehicles, are reveresed in p3d; valid values are:
[_simpleObject:object(,_data:array/string)] call BIS_fnc_adjustSimpleObject;
* &nbsp;0: no change
* &nbsp;1: reverse
* -1: unknown (behaves as 0)


See also:
|p5= verticalOffset: [[Array]] - (Optional, default 0) fix for non-existant physX; usually needed only for vehicles
* bis_fnc_createSimpleObject
* bis_fnc_replaceWithSimpleObject
* bis_fnc_simpleObjectData
* bis_fnc_exportCfgVehiclesSimpleObjectData
* bis_fnc_diagMacrosSimpleObjectData


*/
|p6= animationAdjustments: [[Array]] - (Optional, default <sqf inline>[]</sqf>) animation that need to be animated to given state, in format [animationName, animationState]:
* animationName: [[String]] - animation name
* animationState: [[Number]] - animation state


</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
|p7= selectionsToHide: [[Array]] - (Optional, default <sqf inline>[]</sqf>) all listed selections will be hidden
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_adjustSimpleObject]]; --> |= Syntax
|r1= [[Nothing]]
|p1= |= Parameter 1


| |= Return value
|x1= <sqf>[myCar, ["B_MyCar_F", "path\to\file.p3d"]] call BIS_fnc_adjustSimpleObject;</sqf>
____________________________________________________________________________________________
 
|x1= <code></code> |=
____________________________________________________________________________________________
 
| |= See also


|seealso= [[createSimpleObject]] [[BIS_fnc_createSimpleObject]] [[BIS_fnc_simpleObjectData]]
}}
}}
<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:adjustSimpleObject}}]]
[[Category:Functions|{{uc:adjustSimpleObject}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:adjustSimpleObject}}]]

Latest revision as of 18:09, 8 November 2023

Hover & click on the images for description

Description

Description:
Adjust simple object vertical position, animations and selection according to provided data.
In case both adjustment data and class are being used, data has higher priority and only undefined parts are filled from config.
This function is automatically called by BIS_fnc_createSimpleObject.
Execution:
call
Groups:
Object Manipulation

Syntax

Syntax:
[object, [class, model, reversed, verticalOffset, animAdjustments, selectionToHide]] call BIS_fnc_adjustSimpleObject
Parameters:
object: Object - simple object that will be adjusted
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 reveresed in p3d; valid values are:
  •  0: no change
  •  1: reverse
  • -1: unknown (behaves as 0)
verticalOffset: Array - (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]:
  • animationName: String - animation name
  • animationState: Number - animation state
selectionsToHide: Array - (Optional, default []) all listed selections will be hidden
Return Value:
Nothing

Examples

Example 1:
[myCar, ["B_MyCar_F", "path\to\file.p3d"]] call BIS_fnc_adjustSimpleObject;

Additional Information

See also:
createSimpleObject BIS_fnc_createSimpleObject BIS_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