Jump to content
  • 0
Sign in to follow this  
RonSwanson

how do i convert a SQM to SQF?

Question

hi there i am trying to make a custom map area and i have Sandbox and i am editing in 3d and producing a .SQM file. i am looking to convert it to .SQF so i can then launch in via my init file and see it on the map.

 

Any help or tips? if i get this to work i will add a tutorial for beginners on the entire process. Would really like some help on this many.

 

Thanks Ron

 

- hope this is posted in the correct place it is my first thread.

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Download E3DEN Editor from workshop (https://steamcommunity.com/sharedfiles/filedetails/?id=630702051) and enable it in your Mods.

Start the game, open editor and select the Map you want to add buildings at.

 

Place all the stuff you want to add and save your project from time to time.

Create a file called buildings.sqf (just an example you can name it as you like). Open it and get back into editor. Click tools and press Save project as SQF. Your map addons are now copied to clipboard.

Open the buildings.sqf and insert the code with ctrl+v. Save it and close.

Open your mission file (epoch.Altis for example), create a folder named addons if you dont have already, create another one called mapaddons inside of addons folder. Place the buildings.sqf in this folder.

Now open your init.sqf or create it in the mission root folder if you dont have one and insert the following code:

 

 if (isserver) then {

     [] execVM "addons\mapaddons\buildings.sqf";

};

 

Save, repbo and upload. This should add all the stuff you created in the Editor to your map.

 

To add more, you can just create a second one for other map stuff by create a new buildings2.sqf with your other buildings and call them like this

 

 if (isserver) then {

     [] execVM "addons\mapaddons\buildings.sqf";

     [] execVM "addons\mapaddons\buildings2.sqf";

};

 

Or edit your old project and overwrite the buildings.sqf

 

 

Hope this helps

Share this post


Link to post
Share on other sites
  • 0

Create your Map Changes with the Standard Eden Editor.

Open the debug-console (Tools -> debug console)

Paste this code in it and execute it:

Spoiler

_allobj = allmissionobjects "";
_tempobj = [];
_offset = 0;
_ExportObjects = [];
{
    if (!(isplayer _x) && !(_x iskindof "logic") && !(_x iskindof "CamCurator") && !(_x iskindof "CBA_NamespaceDummy")) then {
        _tempobj pushback _x;
    };
} foreach _allobj;
{
    _pos = getposWorld _x;
    _pos set [2,(_pos select 2)+_offset];
    _type = typeof _x;
    if (_type isequalto "") then {
        _type = _x;
    };
    _obj = [_type,_pos,getdir _x,[vectorDir _x, vectorup _x]];
    _ExportObjects pushback _obj;
} foreach _tempobj;

_createcode = "
if (!isserver) exitwith {};
{
    private ['_object'];
    _x params ['_type','_pos','_dir','_vectordirandup'];
    _simulate = false;
    _allowdamage = true;
    _object = objnull;
    if (_type iskindof 'house') then {
        if (_type in ['Land_Pier_F']) exitwith {
            _simulate = false;
        };
        _simulate = true;
    }
    else {
        {
            if !(((tolower _type) find (tolower _x)) isequalto -1) exitwith {
                _simulate = true;
                _allowdamage = false;
            };
        } foreach ['lamp','light','fuel','fire','gate','helipad'];
    };
    
    if (_simulate) then {
        _object = createVehicle [_type,[0,0,0],[],0,'CAN_COLLIDE'];
        if (!_allowdamage) then {
            _object allowdamage false;
        };
    }
    else {
        _object = createsimpleobject [_type,[0,0,0]];
    };
    _object setPosWorld _pos;
    _object setdir _dir;
    _object setVectorDirAndUp _vectordirandup;
} forEach _objects;
";

_ExportCode = "_objects = " + (str _ExportObjects) + ";" + _createcode; 
copytoclipboard _ExportCode;
 

Then you have a stand alone spawn code in your Clipboard.

Open a new txt file, and paste it in (ctrl+v).

save this file and rename it to mybuildings.sqf (or what you want).

Put this file in your mission root and load it by

[] execVM "mybuildings.sqf";

 

Share this post


Link to post
Share on other sites
  • 0

Hi Guys I cant seem to get this to work. I copied the code above into debugg press local exc and nothing happens no code is generated to clipboard. I have added just a couple of items to the map and just want the items to spawn on map. Below is the file i created:

Spoiler

version=53;
class EditorData
{
    moveGridStep=1;
    angleGridStep=0.2617994;
    scaleGridStep=1;
    autoGroupingDist=10;
    toggles=577;
    class ItemIDProvider
    {
        nextID=13;
    };
    class Camera
    {
        pos[]={30854.641,33.584633,9673.8984};
        dir[]={-0.055778015,-0.65546072,-0.7532534};
        up[]={-0.048405748,0.7551958,-0.65369165};
        aside[]={-0.99733013,1.3483805e-007,0.073849894};
    };
};
binarizationWanted=0;
addons[]=
{
    "A3_Characters_F",
    "A3_Structures_F_Exp_Naval_Piers",
    "A3_Structures_F_Exp_Civilian_Slum_02",
    "A3_Props_F_Exp_Naval_Boats",
    "A3_Structures_F_Mil_Helipads"
};
class AddonsMetaData
{
    class List
    {
        items=5;
        class Item0
        {
            className="A3_Characters_F";
            name="Arma 3 Alpha - Characters and Clothing";
            author="Bohemia Interactive";
            url="https://www.arma3.com";
        };
        class Item1
        {
            className="A3_Structures_F_Exp";
            name="Arma 3 Apex - Buildings and Structures";
            author="Bohemia Interactive";
            url="https://www.arma3.com";
        };
        class Item2
        {
            className="A3_Structures_F_Exp_Civilian";
            name="Arma 3 Apex - Civilian Buildings";
            author="Bohemia Interactive";
            url="https://www.arma3.com";
        };
        class Item3
        {
            className="A3_Props_F_Exp";
            name="Arma 3 Apex - Decorative and Mission Objects";
            author="Bohemia Interactive";
            url="https://www.arma3.com";
        };
        class Item4
        {
            className="A3_Structures_F_Mil";
            name="Arma 3 - Military Buildings and Structures";
            author="Bohemia Interactive";
            url="https://www.arma3.com";
        };
    };
};
randomSeed=13264025;
class ScenarioData
{
    author="MegaZ";
};
class Mission
{
    class Intel
    {
        timeOfChanges=1800.0002;
        startWeather=0.30000001;
        startWind=0.1;
        startWaves=0.1;
        forecastWeather=0.30000001;
        forecastWind=0.1;
        forecastWaves=0.1;
        forecastLightnings=0.1;
        year=2014;
        month=1;
        day=6;
        hour=14;
        minute=15;
        startFogDecay=0.014;
        forecastFogDecay=0.014;
    };
    class Entities
    {
        items=8;
        class Item0
        {
            dataType="Group";
            side="West";
            class Entities
            {
                items=1;
                class Item0
                {
                    dataType="Object";
                    class PositionInfo
                    {
                        position[]={30871.564,2.602361,9643.1182};
                        angles[]={0,0.04297144,0};
                    };
                    side="West";
                    flags=7;
                    class Attributes
                    {
                        isPlayer=1;
                    };
                    id=1;
                    type="B_soldier_LAT_F";
                };
            };
            class Attributes
            {
            };
            id=0;
        };
        class Item1
        {
            dataType="Object";
            class PositionInfo
            {
                position[]={30869.707,-17.363375,9620.1895};
                angles[]={0,0.0090700453,0};
            };
            side="Empty";
            flags=1;
            class Attributes
            {
            };
            id=2;
            type="Land_PierWooden_02_16m_F";
            atlOffset=1.4405993;
        };
        class Item2
        {
            dataType="Object";
            class PositionInfo
            {
                position[]={30869.795,-17.462549,9632.2949};
            };
            side="Empty";
            flags=5;
            class Attributes
            {
            };
            id=7;
            type="Land_PierWooden_02_barrel_F";
            atlOffset=-0.22540379;
        };
        class Item3
        {
            dataType="Object";
            class PositionInfo
            {
                position[]={30869.586,-17.462549,9608.1689};
                angles[]={0,3.1451228,0};
            };
            side="Empty";
            flags=1;
            class Attributes
            {
            };
            id=8;
            type="Land_PierWooden_02_barrel_F";
            atlOffset=4.2785711;
        };
        class Item4
        {
            dataType="Object";
            class PositionInfo
            {
                position[]={30857.15,0.37590575,9630.5791};
                angles[]={0,4.7696657,0};
            };
            side="Empty";
            flags=5;
            class Attributes
            {
            };
            id=9;
            type="Land_Slum_02_F";
            atlOffset=0.10776293;
        };
        class Item5
        {
            dataType="Object";
            class PositionInfo
            {
                position[]={30846.611,1.8267087,9637.3643};
                angles[]={6.165525,0,0.011262327};
            };
            side="Empty";
            flags=4;
            class Attributes
            {
            };
            id=10;
            type="Land_Boat_04_wreck_F";
        };
        class Item6
        {
            dataType="Object";
            class PositionInfo
            {
                position[]={30865.889,2.8325081,9640.3691};
                angles[]={6.1477346,3.5874598,0.098670416};
            };
            side="Empty";
            flags=4;
            class Attributes
            {
            };
            id=11;
            type="Land_Boat_03_abandoned_F";
        };
        class Item7
        {
            dataType="Object";
            class PositionInfo
            {
                position[]={30851.635,0,9600.752};
            };
            side="Empty";
            class Attributes
            {
            };
            id=12;
            type="Land_HelipadCivil_F";
            atlOffset=5.1029344;
        };
    };
};
 

If i add as is i get error:

Spoiler

12:49:29 Error in expression <\addons\mapaddons\BoatTrader.sqf"
class Item1
{
dataType="Object";
class Positio>
12:49:29   Error position: <Item1
{
dataType="Object";
class Positio>
12:49:29   Error Missing ;
12:49:29 File mpmissions\__cur_mp.Australia\addons\mapaddons\BoatTrader.sqf, line 1

I know in A2 when i made map addons i needed

Spoiler

if (isServer) then {

_vehicle_0 = objNull;
if (true) then
{
  _this = createVehicle ["MAP_R2_RockWall", [4748.8867, 16623.162, -4.5776367e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_0 = _this;
  _this setDir -60.521305;
  _this setPos [4748.8867, 16623.162, -4.5776367e-005];
};

};

What do i need to remove or add to my export. Or can someone upload a small map addon for me to compare ?

I tried removing all the other data and just leaving the Building bits but still get errors

Thanks

MegaZ

Share this post


Link to post
Share on other sites
  • 0

Ok a little bit more i found this link from He-man https://pastebin.com/Cc0CtX36 which worked and i got a code: see below

Spoiler

_objects = [["Land_HelipadCivil_F",[30851.6,9600.75,0],0,[[0,1,0],[0,0,1]]],["Land_PierWooden_02_16m_F",[30869.7,9620.19,-17.3634],0.519675,[[0.00906992,0.999959,0],[0,0,1]]],["Land_Slum_02_F",[30857.2,9630.58,0.375906],273.282,[[-0.99836,0.0572454,0],[0,0,1]]],["Land_PierWooden_02_barrel_F",[30869.8,9632.29,-17.4625],0,[[0,1,0],[0,0,1]]],["Land_PierWooden_02_barrel_F",[30869.6,9608.17,-17.4625],180.202,[[-0.00353011,-0.999994,0],[0,0,1]]],["Land_Boat_04_wreck_F",[30846.6,9637.36,1.82671],0,[[0,0.993086,0.117389],[-0.0112621,-0.117382,0.993023]]],["Land_Boat_03_abandoned_F",[30865.9,9640.37,2.83251],205.787,[[-0.429143,-0.888236,-0.163928],[-0.0985104,-0.13438,0.986021]]],["B_soldier_LAT_F",[30871.6,9643.12,2.60236],2.46208,[[0.0429582,0.999077,0],[0,0,1]]]]; 
if (!isserver) exitwith {}; 

    private ['_object']; 
    _p3d = ['.p3d', _x select 0] call BIS_fnc_inString; 
    if (_p3d) then { 
        _object = createsimpleobject [_x select 0,[0,0,0]]; 
    } 
    else {     
        _object = createVehicle [ _x select 0, [0,0,0], [], 0 , 'CAN_COLLIDE']; 
    }; 
    if (count _x > 2) then { 
        if (typename (_x select 2) == 'SCALAR') then { 
            _object setdir (_x select 2); 
        }; 
        if (typename (_x select 2) == 'array') then { 
            _object setVectorDirAndUp (_x select 2); 
        }; 
    }; 
    if (count _x > 3) then { 
        if (typename (_x select 3) == 'array') then { 
            _object setVectorDirAndUp (_x select 3); 
        }; 
    }; 
    _object setPosWorld (_x select 1); 
    _type = _x select 0; 
    _simulate = true; 
    if !(_type iskindof 'house') then { 
        _object enableSimulationGlobal true; 
    } 
    else { 
        _simulate = false; 
        { 
            _isin = [_x, tolower _type] call BIS_fnc_inString; 
            if (_isin) exitwith { 
                _simulate = true; 
            };  
        } foreach ['lamp','light','fuel','fire']; 
        if (_simulate) then { 
            _object enableSimulationGlobal true; 
        } 
        else { 
            _object enableSimulationGlobal false; 
        }; 
    }; 
} forEach _objects; 
 

so i set up a pbo to run from hive/addons like this

Spoiler

_objects = [["Land_HelipadCivil_F",[30851.6,9600.75,0],0,[[0,1,0],[0,0,1]]],["Land_PierWooden_02_16m_F",[30869.7,9620.19,-17.3634],0.519675,[[0.00906992,0.999959,0],[0,0,1]]],["Land_Slum_02_F",[30857.2,9630.58,0.375906],273.282,[[-0.99836,0.0572454,0],[0,0,1]]],["Land_PierWooden_02_barrel_F",[30869.8,9632.29,-17.4625],0,[[0,1,0],[0,0,1]]],["Land_PierWooden_02_barrel_F",[30869.6,9608.17,-17.4625],180.202,[[-0.00353011,-0.999994,0],[0,0,1]]],["Land_Boat_04_wreck_F",[30846.6,9637.36,1.82671],0,[[0,0.993086,0.117389],[-0.0112621,-0.117382,0.993023]]],["Land_Boat_03_abandoned_F",[30865.9,9640.37,2.83251],205.787,[[-0.429143,-0.888236,-0.163928],[-0.0985104,-0.13438,0.986021]]],["B_soldier_LAT_F",[30871.6,9643.12,2.60236],2.46208,[[0.0429582,0.999077,0],[0,0,1]]]]; 
if (!isserver) exitwith {}; 

    private ['_object']; 
    _p3d = ['.p3d', _x select 0] call BIS_fnc_inString; 
    if (_p3d) then { 
        _object = createsimpleobject [_x select 0,[0,0,0]]; 
    } 
    else {     
        _object = createVehicle [ _x select 0, [0,0,0], [], 0 , 'CAN_COLLIDE']; 
    }; 
    if (count _x > 2) then { 
        if (typename (_x select 2) == 'SCALAR') then { 
            _object setdir (_x select 2); 
        }; 
        if (typename (_x select 2) == 'array') then { 
            _object setVectorDirAndUp (_x select 2); 
        }; 
    }; 
    if (count _x > 3) then { 
        if (typename (_x select 3) == 'array') then { 
            _object setVectorDirAndUp (_x select 3); 
        }; 
    }; 
    _object setPosWorld (_x select 1); 
    _type = _x select 0; 
    _simulate = true; 
    if !(_type iskindof 'house') then { 
        _object enableSimulationGlobal true; 
    } 
    else { 
        _simulate = false; 
        { 
            _isin = [_x, tolower _type] call BIS_fnc_inString; 
            if (_isin) exitwith { 
                _simulate = true; 
            };  
        } foreach ['lamp','light','fuel','fire']; 
        if (_simulate) then { 
            _object enableSimulationGlobal true; 
        } 
        else { 
            _object enableSimulationGlobal false; 
        }; 
    }; 
} forEach _objects; 

all working now

MegaZ

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...