Jump to content
XMortX

[Tutorial] How to add buildings to epoch without editing mission.sqm

Recommended Posts

Hey guys, first tutorial so be kind, also before i begin, this isn't my code and i take no credit for it whatsoever, i have made a few adjustments but mostly to tidy up. Please if your the original author, contact me and i shall credit you accordingly!

Ok so here goes -

 

Credits:

macca134 - Files on the linked post

DirtySanchez - Pointing out the possible ways to add the objects

BetterDeadThanZed - Pointing out the original post was useless + pointing out code optimisations

Halvhjearne & KiloSwiss - Help figuring out how to add textures

 

Step 1:

Download the "a3_epoch_custom.zip" found here and extract it - 

 

Step 2: 
Add the folder to "@epochhive/addons"
 
Step 3:
Edit and rename "@epochhive/addons/a3_epoch_custom/mapcontent/somecontent1.sqf"
for example my renamed file is - billboards.sqf
 
Step 4:
Edit the renamed file to include the objects you wish to add and their position, for example i changed - 
 
diag_log format['Custom %1 - Starting somecontent1.sqf',time];
 
_pos = [630.292419,1808.09729,0.0749831];
_object = createVehicle ["Land_LampStreet_F", _pos, [], 0, "CAN_COLLIDE"];
_object setDir 280.171;
_object setPosATL _pos;
 
to
 
diag_log format['Custom %1 - Starting billboards.sqf',time];
 
_pos = [13102.2, 10143.8, 0];
_object = createVehicle ["Land_Billboard_F", _pos, [], 0, "CAN_COLLIDE"];
_object setDir 185.52;
_object setPosATL _pos;
 
To edit the texture of say a billboard then add this to the bottom of your entry in billboards.sqf so it looks like this -
 
diag_log format['Custom %1 - Starting billboards.sqf',time];
 
_pos = [13102.2, 10143.8, 0];
_object = createVehicle ["Land_Billboard_F", _pos, [], 0, "CAN_COLLIDE"];
_object setDir 185.52;
_object setPosATL _pos;
_object setObjectTextureGlobal [0, "textures\test.jpg"];
 
Step 5:
Open .../a3_epoch_custom/init/fn_init.sqf and edit this line-
[] execVM "\x\addons\custom\mapcontent\somecontent1.sqf";
to -
[] execVM "\x\addons\custom\mapcontent\billboards.sqf"; (replace billboards.sqf with what you renamed your file to)
 
Step 6:
Pack "a3_epoch_custom" into a .pbo and enjoy
 
Step 7:
If you added the texture line, then open your mission .pbo in your mpmissions folder and add a new folder call "textures", in this folder is where you place the image you want as a texture.
Remember to change the name in the line you added earlier (_object setObjectTextureGlobal [0, "textures\test.jpg"];) to match the name of the image in the textures folder.
 
Step 8:
Repack mission .pbo
 
Notes:
 
To get the coordinates i just teleport to the position i want and look in the infistar logs, but you could use the editor to find these positions.
You can add seperate files in the ".../mapcontent/...." folder by adding another "call compile......" line to the "fn_init.sqf".
 
Cheers guys, hope this helped!
 
XMortX

Share this post


Link to post
Share on other sites

I didn't realize people edited their mission.sqm to add stuff. This tutorial puts everything client-side, which increases your mission file, and allows other players to take what you have created. There are methods to do this server side that will keep your mission file small and keep your custom addons secure.

Share this post


Link to post
Share on other sites

Ah well this may be useless info for people then lol. The only other way iv seen to add stuff is by using derapify to edit the mission.sqm. If theres a way to do this server side id love to know, im absolutely no expert at ArmA code, i only took it up because our coder left lol and its a pretty steep learning curve. But yeah, i thought id let people know that this is one way to do it :)

Share this post


Link to post
Share on other sites

im assuming you add "custom_buildings" folder, add "fn_billboards.sqf" and insert this code.....

 

if (isServer) then {

  _this = createVehicle ["Land_Billboard_F", [13102.2, 10143.8, 0], [], 0, "CAN_COLLIDE"];
  _this setDir 185.52;
  _this setPos [13102.2, 10143.8, 0];
};
 
and then make into a .pbo inside the addons folder?
im probably mistaken though :)

Share this post


Link to post
Share on other sites

Sorry bud, I don't usually sit waiting for a reply back.

Resource forums are your friend.

I would get picking through there!

 

haha yeah thats no problem, iv found it all now anyway and its running on my server so i know its working :)

Share this post


Link to post
Share on other sites

Ah well this may be useless info for people then lol. The only other way iv seen to add stuff is by using derapify to edit the mission.sqm. If theres a way to do this server side id love to know, im absolutely no expert at ArmA code, i only took it up because our coder left lol and its a pretty steep learning curve. But yeah, i thought id let people know that this is one way to do it :)

 

Share this post


Link to post
Share on other sites

 

That looks like a pretty clean way to do it! Nice one dude! DirtySanchez helped me find a way yesterday, almost exactly the same but 'call compile' not 'execVM', anyway i already updated the original post yesterday, but thankyou anyway! 

Share this post


Link to post
Share on other sites

That looks like a pretty clean way to do it! Nice one dude! DirtySanchez helped me find a way yesterday, almost exactly the same but 'call compile' not 'execVM', anyway i already updated the original post yesterday, but thankyou anyway! 

 

I used to use call compile, but I was told to use execvm instead: 

Share this post


Link to post
Share on other sites

I'm trying to use this script to just add a flag so I can use AI Recruit: http://www.armaholic.com/page.php?id=26312

The flag should have an addaction to recruit units.

This line is supposed to be in the init field of flag object: init="this addAction[""<t color='#ff9900'>Recruit Infantry</t>"", ""bon_recruit_units\open_dialog.sqf""];";

Here is how I have it in the custom content sqf:

Spoiler

diag_log format['Custom %1 - Starting recruitflag.sqf',time];


_pos = [13575.9,12212.8,0];
_object = createVehicle ["Flag_BI_F", _pos, [], 0, "CAN_COLLIDE"];
_object setDir 280.171;
_object setPosATL _pos;
init="this addAction[""<t color='#ff9900'>Recruit Infantry</t>"", ""bon_recruit_units\open_dialog.sqf""];";

The flag is where I wanted it but I get no option when near the flag so I'm guessing the code isn't compatible.

In the sample mission for AI recruit,  init="this addAction[""<t color='#ff9900'>Recruit Infantry</t>"", ""bon_recruit_units\open_dialog.sqf""];";  is in the mission.sqm like this:

Spoiler

class Vehicles
    {
        items=1;
        class Item0
        {
            position[]={13585.211,15.325845,12210.971};
            azimut=20.344;
            id=5;
            side="EMPTY";
            vehicle="Flag_BI_F";
            leader=1;
            skill=0.60000002;
            init="this addAction[""<t color='#ff9900'>Recruit Infantry</t>"", ""bon_recruit_units\open_dialog.sqf""];";
        };
    };
};

Is there any way I can make it work with the code this script uses?

Thank you.

Share this post


Link to post
Share on other sites

Yes I was looking at that but no idea how to put it together...

I tried this: Flag_BI_F addAction["<t color='#ff9900'>Recruit Infantry</t>", "bon_recruit_units\open_dialog.sqf"];  but it didn't work...

I just don't get how to attach it to the flag object.

The original line was meant for the mission.sqm which was:

this addAction["<t color='#ff9900'>Recruit Infantry</t>", "bon_recruit_units\open_dialog.sqf"];

How would it work with this script?

 

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
Reply to this topic...

×   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...

  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...