Jump to content
tinboye

bulk adding objects

Recommended Posts

Is there a way I can import  objects into eden which were once in a sqf file, I basically if i want to take this:

Spoiler

private ["_obj","_dat","_cString","_adString"];

_obj = objNull;_dat = [];_adString = "CAN_COLLIDE";
_cString = {_obj = createVehicle [(_dat select 0), call compile (_dat select 1), [], 0, _adString];if((_dat select 4) == 0) then {_obj enableSimulation false};_obj setdir (_dat select 2);if((_dat select 3) == -100) then {_obj setposATL (call compile (_dat select 1))} else {_obj setposASL [((call compile (_dat select 1)) select 0),((call compile (_dat select 1)) select 1),(_dat select 3)]};if((_dat select 5) == 0) then {_obj setVectorUp [0,0,1]} else {_obj setVectorUp (surfacenormal (getPosATL _obj))};if(count (_dat select 6) > 0) then {{call _x} foreach (_dat select 6)}};

_dat = ["Land_nav_pier_m_F","[16345.484375,12753.331055,-4.28872]",8.34599,-3.07901,1,0,[]];call _cString;
_dat = ["Land_nav_pier_m_F","[16306.0761719,12759.116211,12.8015]",8.34599,-3.07901,1,0,[]];call _cString;
_dat = ["Land_nav_pier_m_F","[16266.916016,12764.865234,23.03]",8.34599,-3.07901,1,0,[]];call _cString;
_dat = ["Land_nav_pier_m_F","[16227.391602,12770.652344,32.4498]",8.34599,-3.08086,1,0,[]];call _cString;
_dat = ["Land_nav_pier_m_F","[16346.65332,12761.171875,0]",8.34599,-3.07901,1,0,[]];call _cString;
_dat = ["Land_nav_pier_m_F","[16307.168945,12766.984375,12.7475]",8.34599,-3.07901,1,0,[]];call _cString;

 

I opened the debug console and ran this  to see if it would import them, but it does not.

 

what would I need to add or to change the script to make it work?

 

 

Share this post


Link to post
Share on other sites

You need to use Eden commands to spawn objects. Something like...

{
    private[ "_pitch", "_bank" ];
    _x params[ "_objType", "_pos", [ "_dir", 0 ], [ "_ATL", 0 ], [ "_enabled", 1 ], [ "_up", 0 ], [ "_codes", [] ] ];
    _pos = call compile _pos;
    if ( _ATL isEqualTo -100 ) then {
        _pos set[ 2, _ATL ];
        _pos = ASLToATL _pos;
    };
    collect3DENHistory{
        _obj = create3DENEntity [ "Object", _objType, _pos, true ];
        if ( _up isEqualTo 0 ) then {
            _pitch = 0;
            _bank = 0;
        }else{
            _obj setVectorUp surfaceNormal getPosATLVisual _obj;
            _PB = _obj call BIS_fnc_getPitchBank;
            _pitch = _PB select 0;
            _bank = _PB select 1;
        };
        _obj set3DENAttribute [ "rotation", [ _pitch, _bank, _dir ] ];
        _obj set3DENAttribute [ "enableSimulation", _enabled isEqualTo 1 ];
        _obj set3DENAttribute [ "Init", format[ "{ call _x }foreach %1", _codes ] ];
    };
}forEach[
    ["Land_nav_pier_m_F","[16345.484375,12753.331055,-4.28872]",8.34599,-3.07901,1,0,[]],
    ["Land_nav_pier_m_F","[16306.0761719,12759.116211,12.8015]",8.34599,-3.07901,1,0,[]],
    ["Land_nav_pier_m_F","[16266.916016,12764.865234,23.03]",8.34599,-3.07901,1,0,[]],
    ["Land_nav_pier_m_F","[16227.391602,12770.652344,32.4498]",8.34599,-3.08086,1,0,[]],
    ["Land_nav_pier_m_F","[16346.65332,12761.171875,0]",8.34599,-3.07901,1,0,[]],
    ["Land_nav_pier_m_F","[16307.168945,12766.984375,12.7475]",8.34599,-3.07901,1,0,[]]
]

I have not test the above but should give you an idea of what is needed. Just read up on Eden object Attributes and the Eden commands

Share this post


Link to post
Share on other sites

thanks for this, i am new to eden, I was able to figure out how to import the objects successfully after I figured out that Extended Bases Mod was interfering.

 

My challenge now is importing entities like actual AI soldiers.

 

I have read over some of the 3den commands but not entirely sure what to use for some of these fields.

 

  [
  "Exile_Trader_Equipment", //Trader Uniform _objType
  "Exile_Trader_Equipment", //Trader Inventory _objType
  "GreekHead_A3_09", //Face _objType
  ["Acts_TreatingWounded01"], //_enabled
  [14585.2,16759.8,0.126438], //_pos
  225.994 // _rot
]

this is what I need to import, (I put next to each a comment on what they are in the game)

 

when I create this character in the mission.

and export it with eden I get that line along with using

_npcs 
[
  [
  "Exile_Trader_Equipment", //Trader Uniform
  "Exile_Trader_Equipment", //Trader Inventory
  "GreekHead_A3_09", //Face
  ["Acts_TreatingWounded01"], //Animation
  [14585.2,16759.8,0.126438], //Coords
  225.994 //Direction - No Comma
  ]
	
];
  
 {
      private _logic = "Logic" createVehicleLocal [0, 0, 0];
      private _trader = (_x select 0) createVehicleLocal [0, 0, 0];
      private _animations = _x select 1;

      _logic setPosWorld (_x select 5);
      _logic setVectorDirAndUp [_x select 6, _x select 7];

      _trader setVariable ["BIS_enableRandomization", false];
      _trader setVariable ["BIS_fnc_animalBehaviour_disable", true];
      _trader setVariable ["ExileAnimations", _animations];
      _trader setVariable ["ExileTraderType", _x select 2];
      _trader disableAI "ANIM";
      _trader disableAI "MOVE";
      _trader disableAI "FSM";
      _trader disableAI "AUTOTARGET";
      _trader disableAI "TARGET";
      _trader disableAI "CHECKVISIBLE";
      _trader allowDamage false;
      _trader setFace (_x select 3);
      _trader setUnitLoadOut (_x select 4);
      _trader setPosWorld (_x select 5);
      _trader setVectorDirAndUp [_x select 6, _x select 7];
      _trader reveal _logic;
      _trader attachTo [_logic, [0, 0, 0]];
      _trader switchMove (_animations select 0);
      _trader addEventHandler ["AnimDone", {_this call ExileClient_object_trader_event_onAnimationDone}];
  }
  forEach _npcs;

I could not find anything regarding how to have multiple objects/skins and animation types within an eden import.

any ideas?

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

×