createSimpleObject: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " {3,}\|" to " |") |
Lou Montana (talk | contribs) m (Text replacement - "{{Command " to "{{RV|type=command ") |
||
Line 1: | Line 1: | ||
{{ | {{RV|type=command | ||
|arma3 | |arma3 | ||
|1.58 | |1.58 |
Revision as of 22:58, 22 January 2021
Description
- Description:
- Description needed
- Groups:
- Object Manipulation
Syntax
- Syntax:
- Syntax needed
- Parameters:
- [shapeName, positionWorld, local]: Array
- shapeName: String - Path to the 3d model (can be obtained with getModelInfo command)
- positionWorld: Array - placement position in format PositionWorld
- local (Optional): Boolean - true to create local instance only. Default: false (since Arma 3 v1.94.145903)
- Return Value:
- Return value needed
Alternative Syntax
- Syntax:
- createSimpleObject [className, positionASL, local]
- Parameters:
- [className, positionASL, local] : Array
- className: String - CfgVehicles config class name
- positionASL: Array - placement position in format PositionASL
- local (Optional): Boolean - true to create local instance only. Default: false (since Arma 3 v1.95.145741)
- Return Value:
- Object - Created simple object
Examples
- Example 1:
_pos = player getRelPos [10, 0]; _tank = createSimpleObject ["a3\armor_f_beta\apc_tracked_01\apc_tracked_01_rcws_f.p3d", _pos]; _tank setPos (_pos vectorAdd (getPosWorld _tank vectorDiff (_tank modelToWorld [0,0,0]))); _tank hideSelection ["zasleh", true]; _tank hideSelection ["zasleh2", true]; _tank hideSelection ["clan", true]; _tank animate ["Wheel_podkoloL3", 0.5, true]; _tank animate ["Wheel_podkoloL6", 0.5, true];
- Example 2:
_pos = player getRelPos [10, 0]; _tank = createSimpleObject ["B_APC_Tracked_01_CRV_F", AGLtoASL _pos]; _tank setObjectTexture [0, "#(rgb,8,8,3)color(0,1,0,0.01)"]; _tank hideSelection ["zasleh", true]; _tank hideSelection ["zasleh2", true]; _tank hideSelection ["clan", true]; _tank animate ["Wheel_podkoloL3", 0.5, true]; _tank animate ["Wheel_podkoloL6", 0.5, true];
Additional Information
- See also:
- See also needed
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
- Posted on April 18, 2016 - 20:03 (UTC)
- Killzone Kid
- The easiest way to correctly place simple object is to create normal object of the same shape from class (if possible), then copy getPosWorld, vectorDir and vectorUp from it. Then create the simple object and apply copied values to it, this will position simple object exactly as normal object was positioned:
_heli = "B_Heli_Light_01_F" createVehicleLocal (player getRelPos [10, 0]); _position = getPosWorld _heli; _vectorDirUp = [vectorDir _heli, vectorUp _heli]; _model = getModelInfo _heli select 1; deleteVehicle _heli; _simpleHeli = createSimpleObject [_model, _position]; _simpleHeli setVectorDirAndUp _vectorDirUp;
- Posted on April 28, 2016 - 18:10 (UTC)
- Waffle SS.
- Models from within the mission file/folder can be created, but full system path is needed. Use: getMissionPath
- Posted on May 11, 2016 - 01:28 (UTC)
- Waffle SS.
- simulationEnabled returns false.
- Posted on September 5, 2016 - 15:10 (UTC)
- Warka
-
There is a section in function library dedicated to simple object creation and interaction. It's purpose is to simplify the operations:
- BIS_fnc_createSimpleObject
- creates simple object according to the supplied data
- you can supply p3d path, class name or data you get from scanning a non-simple object
- BIS_fnc_simpleObjectData
- gathers and returns data about the non-simple object
- data can be then used to create simple object
- BIS_fnc_replaceWithSimpleObject
- replaces non-simple object with simple object on the scene
- do not use it in large scale in MP missions as it is not network efficient
- BIS_fnc_adjustSimpleObject
- adjusts simple object to looks as close to the non-simple object as possible
- function is internally called from the 'bis_fnc_createSimpleObject', you won't probably need to call this function directly
- BIS_fnc_createSimpleObject