Jump to content
Guest

createSimpleobject - can't get it to work properly

Recommended Posts

Guest

Hey guys,

 

i'm foolin around with the new createSimpleobeject command but can't seem getting it to work properly.

 

By trying following code i always get an error but i can't seem to find the problem here - always get the error: 2 provided 5 excepted - is it possible createSimpleObject isn't it workin serversided?

private ["_objs"];
_objs = [
    ["a3\structures_f_bootcamp\items\electronics\watercooler_01_f.p3d", [8502.212891,12477.015625,169.447159],79.358,[0,0,1],false]
];
 
{
    private ["_obj"];
    _obj = createSimpleObject [_x select 0, [0,0,0], [], 0, "CAN_COLLIDE"];
    if (_x select 4) then {
        _obj setDir (_x select 2);
        _obj setPos (_x select 1);
    } else {
        _obj setPosATL (_x select 1);
        _obj setVectorDirAndUp (_x select 3);
    };
} foreach _objs;

Share this post


Link to post
Share on other sites

From what I saw I found two issues:

  1. The "_x select 3" for setVectorDirAndUp is incorrectly defined. It should be an array with two arrays like this: [[0,0,0], [0,0,0]] (BIS Wiki)
  2. createSimpleObject doesn't accept the same parameters as createVehicle, only model and location. (createSimpleObject, createVehicle

Here is a working version (Changes are on lines 3 & 8): 

private ["_objs"];
_objs = [
    ["a3\structures_f_bootcamp\items\electronics\watercooler_01_f.p3d", [0,0,0], 79.358, [[0,0,0],[0,0,0]], false]
];

{
    private ["_obj"];
    _obj = createSimpleObject [_x select 0, [0,0,0]];
    if (_x select 4) then {
        _obj setDir (_x select 2);
        _obj setPos (_x select 1);
    } else {
        _obj setPosATL (_x select 1);
        _obj setVectorDirAndUp (_x select 3);
    };
} foreach _objs;

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×