Difference between revisions of "createSimpleObject"

From Bohemia Interactive Community
Jump to navigation Jump to search
(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

Template:Command

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;