Fendo

Move Trader into mission.sqm

3 posts in this topic

Hey guys,

i have a question to all the pro scripter out there.

Can i move the trader spawn to the mission.sqm? I simply want all the stuff (objects, trader, zones) in a single file that i can edit in the Arma 3 editor. So you can edit the mission.sqm like you do it in the AltisLife mission. I know that the zones are already in the mission.sqm and the objects can be moved easy to the file. But what about the Trader?

Can i simply add to an NPC:

Quote

this addAction["Equipment Trader", Exile_Trader_Equipment]

I hope you can help me.

Fendo

Edited by Fendo

Share this post


Link to post
Share on other sites

you can use a script to import the objects so they are editable, or you can import them so they simply show as part of the map. so you can use them as reference.

actual traders themselves I have not found a way where i was able to actually add them where i could move them around, rotate them etc.

Spoiler

   collect3DENHistory{
    {
        private[ "_obj" ];
        _x params[ "_type", "_pos", "_rot" ];

        _obj = create3DENEntity [ "Object", _type, _pos, true ];
        _obj set3DENAttribute [ "rotation",[ 0,0,_rot ] ];

    }forEach [
["Exile_Sign_TraderCity",[11465.883,7488.998,12.408],197.445,0,0,false]
];
};

 


would import the actual object but the rotation and elevation is usually off.

or if you open your initserver.sqf you can open the debug console and paste something like:

Spoiler

private _vehicles = [
["Exile_Sign_TraderCity", [6660.75, 3564.63, 249.778], [-0.696467, 0.717589, 0], [0, 0, 1], false],
["MetalBarrel_burning_F", [6674.44, 3557.95, 247.995], [-0.991726, 0.105667, 0.0729013], [0.0731366, -0.00165145, 0.997321], true],
["Land_LampStreet_F", [6662.27, 3558.63, 254.149], [0.723859, 0.689948, 0], [0, 0, 1], true],
["Exile_Sign_TraderCity", [6706.61, 3864.68, 251.071], [0.015643, 0.999878, 0], [0, 0, 1], false],
["Exile_Sign_TraderCity", [6752.66, 3868.94, 248.961], [-0.999477, 0.0321988, 0.00294217], [0.000296895, -0.0818526, 0.996644], false],
["Land_LampStreet_F", [6744.94, 3861.78, 252.607], [0.000590475, -1, 0], [0, 0, 1], true],
["Land_LampStreet_F", [6721.71, 3862.42, 253.727], [0.000590475, -1, 0], [0, 0, 1], true],
["Exile_Sign_Office", [6716.33, 3878.86, 253.88], [-0.9999, -0.0141363, 0], [0, 0, 1], false],
["Land_Laptop_unfolded_F", [6714.55, 3880.2, 253.815], [-0.595058, -0.803683, 0.000649674], [0.00109178, 0, 0.999999], false],
["Land_WaterCooler_01_new_F", [6712.85, 3880.24, 253.445], [0, 1, 0], [0.00109178, 0, 0.999999], false],
["Exile_Sign_Office", [6707.8, 3880.89, 253.807], [0.0172813, -0.999851, 0], [0, 0, 1], false],
["Exile_Sign_Locker", [6698.51, 3880.7, 253.809], [0.0140731, -0.999901, 0], [0, 0, 1], false],
["Exile_Locker", [6702.68, 3878.53, 252.75], [0.999819, 0.0189731, -0.00109159], [0.00109178, 0, 0.999999], true],
["Exile_Locker", [6698.55, 3877, 252.759], [0.0188942, -0.999821, -2.06283e-005], [0.00109178, 0, 0.999999], true]
];

{
    private _vehicle = (_x select 0) createVehicle (_x select 1);
    _vehicle allowDamage false;
    _vehicle setPosWorld (_x select 1);
    _vehicle setVectorDirAndUp [_x select 2, _x select 3];
    _vehicle enableSimulationGlobal (_x select 4);
    _vehicle setVariable ["ExileIsLocked", -1, true];
    
    if (_vehicle isKindOf "Exile_RussianRouletteChair") then
    {
        ExileRouletteChairs pushBack _vehicle;
        ExileRouletteChairPositions pushBack [_x select 1, getDir _vehicle];
    };
}
forEach _vehicles;

 

then local exec. then it will add the objects to the map, but there is no way to edit those objects this way.

just remember if your placing anything in the debug console, you must remove any // or /*   */ type tags or it will not work.

  • Like 1

Share this post


Link to post
Share on other sites

forgot this code, its another example that was shared with me, but i could never get it to work properly

Spoiler

{
    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,[]]
];

 

 

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.