createSimpleObject: Difference between revisions
Jump to navigation
Jump to search
Killzone Kid (talk | contribs) No edit summary |
Killzone Kid (talk | contribs) (example) |
||
Line 45: | Line 45: | ||
<dt class="note">[[User:Killzone Kid|Killzone Kid]]</dt> | <dt class="note">[[User:Killzone Kid|Killzone Kid]]</dt> | ||
<dd class="note">The easiest way to correctly place simple 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: | <dd class="note">The easiest way to correctly place simple 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: | ||
<code>_heli = "B_Heli_Light_01_F" [[createVehicleLocal]] ([[player]] [[getRelPos]] [10, 0]); | |||
_position = [[getPosWorld]] _heli; | |||
_vectorDirUp = <nowiki>[</nowiki>[[vectorDir]] _heli, [[vectorUp]] _heli]; | |||
_model = [[getModelInfo]] _heli [[select]] 1; | |||
[[deleteVehicle]] _heli; | |||
_simpleHeli = [[createSimpleObject]] [_model, _position]; | |||
_simpleHeli [[setVectorDirAndUp]] _vectorDirUp;</code> | |||
</dd> | </dd> | ||
</dl> | </dl> | ||
<!-- DISCONTINUE Notes --> | <!-- DISCONTINUE Notes --> |
Revision as of 21:08, 18 April 2016
Description
- Description:
- Creates object with given shape defined as path to .p3d model. The object will not be simulated, i.e. no PhysX, no sounds, no interest for AI targeting. Such limitations allow to create global decorative objects with very little network traffic. Simple object cannot be destroyed.
Objects that could be exclusively created with this command are: trees, bushes, rocks, bridges, roads, vehicle wrecks and other objects without a class in config. The height of the placement position might need to be adjusted experimentally. Some of the model examples could be found here: createSimpleObject/objects - Groups:
- Uncategorised
Syntax
- Syntax:
- createSimpleObject [shapeName, position];
- Parameters:
- shapeName: String - Path to the 3d model (can be obtained with getModelInfo command)
- position: Array - placement position in format PositionWorld
- 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", 1, true]; _tank animate ["Wheel_podkoloL6", 1, true];
Additional Information
- See also:
- hideSelectionselectionPositiongetModelInfogetObjectTypecursorObjectselectionNamesanimationNamescreateVehicleenableSimulationhideObject
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
Notes
Bottom Section
- Posted on April 18, 2016 - 20:03 (UTC)
- Killzone Kid
- The easiest way to correctly place simple 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;