XMortX Posted July 18, 2015 Report Share Posted July 18, 2015 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 vbawol and DirtySanchez 2 Link to comment Share on other sites More sharing options...
BetterDeadThanZed Posted July 19, 2015 Report Share Posted July 19, 2015 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. Link to comment Share on other sites More sharing options...
XMortX Posted July 19, 2015 Author Report Share Posted July 19, 2015 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 :) Link to comment Share on other sites More sharing options...
DirtySanchez Posted July 19, 2015 Report Share Posted July 19, 2015 Nope we have been using 2 ways server side since last year. 1. In the map.h 2. In a a3_custom_pbo added into the epoch hive addon folder Either way is the best. Map.h no physx Link to comment Share on other sites More sharing options...
XMortX Posted July 19, 2015 Author Report Share Posted July 19, 2015 Ok so have you got a link to the tutorial that explains how to do both of those DirtySanchez? At least then people arent misled by the OP of mine :) Link to comment Share on other sites More sharing options...
XMortX Posted July 19, 2015 Author Report Share Posted July 19, 2015 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 :) Link to comment Share on other sites More sharing options...
XMortX Posted July 19, 2015 Author Report Share Posted July 19, 2015 ok so this is the link for the maps.h edits Link to comment Share on other sites More sharing options...
XMortX Posted July 19, 2015 Author Report Share Posted July 19, 2015 And the other way is here, using the a3_epoch_custom.zip, extract and add to addons in epoch hive right? Link to comment Share on other sites More sharing options...
XMortX Posted July 19, 2015 Author Report Share Posted July 19, 2015 And the other way is here, using the a3_epoch_custom.zip, extract and add to addons in epoch hive right? confirmed this myself lol ill edit the original post Link to comment Share on other sites More sharing options...
XMortX Posted July 19, 2015 Author Report Share Posted July 19, 2015 ****Original Post Edited**** Link to comment Share on other sites More sharing options...
DirtySanchez Posted July 19, 2015 Report Share Posted July 19, 2015 Sorry bud, I don't usually sit waiting for a reply back.Resource forums are your friend.I would get picking through there! Link to comment Share on other sites More sharing options...
XMortX Posted July 19, 2015 Author Report Share Posted July 19, 2015 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 :) Link to comment Share on other sites More sharing options...
BetterDeadThanZed Posted July 20, 2015 Report Share Posted July 20, 2015 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 :) Link to comment Share on other sites More sharing options...
XMortX Posted July 20, 2015 Author Report Share Posted July 20, 2015 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! Link to comment Share on other sites More sharing options...
BetterDeadThanZed Posted July 20, 2015 Report Share Posted July 20, 2015 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: Link to comment Share on other sites More sharing options...
XMortX Posted July 20, 2015 Author Report Share Posted July 20, 2015 I used to use call compile, but I was told to use execvm instead: ah so its a performance thing, ok ill edit the main post, thanks again Link to comment Share on other sites More sharing options...
XMortX Posted July 20, 2015 Author Report Share Posted July 20, 2015 Actually, did you just want to add the stuff about the textures to your thread and then we could simply delete this one? Link to comment Share on other sites More sharing options...
bismarck100 Posted December 24, 2015 Report Share Posted December 24, 2015 On 18.07.2015 at 4:40 AM, XMortX said: Download the "a3_epoch_custom.zip" found here and extract it - where the link?where the link?where the link?where the link? Link to comment Share on other sites More sharing options...
BetterDeadThanZed Posted December 24, 2015 Report Share Posted December 24, 2015 5 hours ago, bismarck100 said: where the link?where the link?where the link?where the link? http://epochmod.com/forum/index.php?/topic/36574-put-your-server-addons-in-a-server-side-pbo/ bismarck100 1 Link to comment Share on other sites More sharing options...
bismarck100 Posted December 24, 2015 Report Share Posted December 24, 2015 oh, thanks Link to comment Share on other sites More sharing options...
Hux Posted June 9, 2016 Report Share Posted June 9, 2016 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. Link to comment Share on other sites More sharing options...
rvg?! Posted June 9, 2016 Report Share Posted June 9, 2016 Why dont you just set a condition for the addaction? Define a cursortarget and then: player distance cursortarget < 10 Link to comment Share on other sites More sharing options...
Hux Posted June 9, 2016 Report Share Posted June 9, 2016 1 hour ago, rvg?! said: Why dont you just set a condition for the addaction? Define a cursortarget and then: player distance cursortarget < 10 How would I do that? Link to comment Share on other sites More sharing options...
rvg?! Posted June 9, 2016 Report Share Posted June 9, 2016 Did you read this already? https://community.bistudio.com/wiki/addAction Link to comment Share on other sites More sharing options...
Hux Posted June 10, 2016 Report Share Posted June 10, 2016 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? Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now