Jump to content
  • 0

Creating a custom compiles.sqf


BetterDeadThanZed

Question

Frequently I've seen people posting mods and instructing other players to "copy your compiles.sqf to your fixes/custom folder". Well, I've been doing this differently since I first started modding my server so I thought I'd share my knowledge here.

 

The problem with copying your compiles.sqf to your custom folder is that with each new release, you have to copy the latest version and go through and edit it again. With this solution, you just have to add a line to init.sqf and copy your custom compiles.sqf into your custom folder with each update.

 

Some people call their folder that contains their custom addons/scripts something other than "custom". Many use the name "fixes". In my example, I use "custom".

 

1. In your "custom" folder, create a blank file called compiles.sqf. This is the file where anything that is supposed to be added/modified in the compiles.sqf file will go.

2. In your init.sqf file, find this line:

call compile preprocessFileLineNumbers "server_traders.sqf"; //Compile trader configs

Below it, put this code:

call compile preprocessFileLineNumbers "custom\compiles.sqf"; //Compile custom compiles

It should look similar to this:

//Load in compiled functions
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf"; //Initilize the Variables (IMPORTANT: Must happen very early)
progressLoadingScreen 0.1;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\publicEH.sqf"; //Initilize the publicVariable event handlers
progressLoadingScreen 0.2;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\setup_functions_med.sqf"; //Functions used by CLIENT for medical
progressLoadingScreen 0.4;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf"; //Compile regular functions
progressLoadingScreen 0.5;
call compile preprocessFileLineNumbers "server_traders.sqf"; //Compile trader configs
call compile preprocessFileLineNumbers "custom\compiles.sqf"; //Compile custom compiles
progressLoadingScreen 1.0;
The only change I've had to make in my compiles.sqf is a redirect to a customized fn_selfActions.sqf, so as such, my entire custom compiles.sqf looks like this. Any time an addon/script tells you to "modify" your compiles.sqf, simply add that line to your custom compiles.sqf:
fnc_usec_selfActions = compile preprocessFileLineNumbers "custom\fn_selfActions.sqf";            // fnc_usec_selfActions - adds custom actions to dayz code
Link to comment
Share on other sites

Recommended Posts

  • 0

hogscraper, on 13 May 2014 - 9:02 PM, said:snapback.png

Glad I could be of help. I wish I could take credit for coming up with this. I only spread the word! :)

Ok Im trying to wrap my brain around the post from Hogscraper.. :) .. Is the above to merge compiles .. of the same name for different scripts / addons ??? 

If so this is what I was needing besides the great article of yours..  that I got told by zupa the other day I needed to do .. but he gave no ref to a page .. or anything .. not much help when a clue you not have .. and u dont really quite no where to find a clue or a vowel .. lol  .. Could you post a full example of this or link to some documentation for me to better grasp the concept .. tried google .. didnt get very far  :rolleyes:

Link to comment
Share on other sites

  • 0

It's really not that difficult. Once you've set your init to load the default compiles.sqf and the custom compiles.sqf, anything added to the custom compiles.sqf will overwrite what is in the default compiles.sqf.

 

So, for example, right now in my compiles.sqf, I have the following lines:

fnc_usec_selfActions  = compile preprocessFileLineNumbers "custom\fn_selfActions.sqf";            // fnc_usec_selfActions - adds custom actions to dayz code
player_selectSlot = compile preprocessFileLineNumbers "custom\ui_selectSlot.sqf";
local_lockUnlock  = compile preprocessFileLineNumbers "custom\mf-tow\local_lockUnlock.sqf";
wild_spawnZombies  = compile preprocessFileLineNumbers "custom\zombies\wild_spawnZombies.sqf";
zombie_generate  = compile preprocessFileLineNumbers "custom\zombies\zombie_generate.sqf";
player_zombieAttack = compile preprocessFileLineNumbers "custom\zombies\player_zombieAttack.sqf";
player_build  = compile preprocessFileLineNumbers "custom\snap_pro\player_build.sqf";
snap_build  = compile preprocessFileLineNumbers "custom\snap_pro\snap_build.sqf";
DZE_SNAP_PRO_USE_COMMAND_MENU = false;
DZE_SNAP_BUILD_NUMKEYS  = [0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B];
player_wearClothes  = compile preprocessFileLineNumbers "custom\clothes\player_wearClothes.sqf";
player_updateGui   = compile preprocessFileLineNumbers "custom\gui\player_updateGui.sqf";
player_switchModel = compile preprocessFileLineNumbers "custom\dzgm\player_switchModel.sqf";
dayz_spaceInterrupt  = compile preprocessFileLineNumbers "custom\dzgm\dayz_spaceInterrupt.sqf";
mv22_pack  = compile preprocessFileLineNumbers "\ca\air2\mv22\scripts\pack.sqf";
player_death  = compile preprocessFileLineNumbers "custom\death\player_death.sqf";

Each of those entries overwrites what is in the default compiles.sqf. This way you don't have to copy compiles.sqf to your mission file and edit it. You simply add the modified lines. I do the same thing with variables.sqf. In init I have this:

call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf"; 
call compile preprocessFileLineNumbers "custom\variables.sqf"; 

My custom variables.sqf looks like this currently:

dayz_allowedObjects = dayz_allowedObjects + ["HeliHRescue"];
DZE_safeVehicle = ["MMT_Civ","ParachuteWest","ParachuteC"];
DZE_maintainClasses = ["ModularItems","DZE_Housebase","LightPole_DZ","BuiltItems","Plastic_Pole_EP1_DZ","Fence_corrugated_DZ","CanvasHut_DZ","ParkBench_DZ","MetalGate_DZ","StickFence_DZ","DesertCamoNet_DZ","ForestCamoNet_DZ","DesertLargeCamoNet_DZ","ForestLargeCamoNet_DZ","DeerStand_DZ","Scaffolding_DZ","FireBarrel_DZ"];
dayz_resetSelfActions = {
mv22_fold = -1;
mv22_unfold = -1;
mv22_open = -1;
mv22_close = -1;
suv_close = -1;
suv_open = -1;
};
call dayz_resetSelfActions;

These settings all overwrite the default variables.sqf settings. 

 

Is that clear enough? :)

Link to comment
Share on other sites

  • 0

I didn't want to create a new topic on this, so basically I was trying to install P4L/Snap pro. I noticed it came with a variables.sqf/compiles.sqf but it was a copy of the dayz_code version + some added lines. Now what I am trying to do is make my own custom variables.sqf/compiles.sqf without having that excess code for a smaller mission file size. I've tried to do it many ways, but for some reason I cannot get it to work. Any help would be greatly appreciated on how to make a custom variables.sqf/compiles.sqf without having all that extra bulk. 

 

This is my current variables.sqf  - Please criticize on what I did wrong and help me fix it.

disableSerialization;
dayz_resetSelfActions = {
	s_player_plot_boundary_on = -1;
	s_player_plot_boundary_off = -1;
	s_player_plot_take_ownership = -1;
};
call dayz_resetSelfActions;

if (isNil "DZE_APlotforLife") then {
	DZE_APlotforLife = false;
};
if (isNil "DZE_PlotOwnership") then {
	DZE_PlotOwnership = false;
};

DZE_snap_build_file = "";

if (isNil "DZE_plotOwnershipExclusions") then {
	DZE_plotTakeOwnershipItems = dayz_allowedObjects - (DZE_LockableStorage + ["Plastic_Pole_EP1_DZ","TentStorage","TentStorageDomed","TentStorageDomed2"]);
};
Link to comment
Share on other sites

  • 0

You need to make sure they are being called in your init.sqf

call compile preprocessFileLineNumbers "\z\addons\dayz_code\Variables.sqf";
call compile preprocessFileLineNumbers "path\to\your\custom\variables.sqf";
progressLoadingScreen 0.1;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\publicEH.sqf";
progressLoadingScreen 0.2;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\setup_functions_med.sqf";
progressLoadingScreen 0.4;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\compiles.sqf";
call compile preprocessFileLineNumbers "\path\to your\custom\compiles.sqf";
progressLoadingScreen 0.5;
Link to comment
Share on other sites

  • 0

 

You need to make sure they are being called in your init.sqf

 

 

I have it already being called in the init.sqf and set to the correct file path. I am getting no errors in the .rpt either. It works if I use the P4L/Snap Pro variables perfectly, but when I take out the copied over code and just add in the stuff that's been added into variables.sqf like I posted above, it stops working. Plot pole doesn't register as being placed. Take ownership doesn't work and etc. So it had to be something with my variables.sqf as that's the only file I've condensed atm for a smaller file size.

Link to comment
Share on other sites

  • 0

Few quesitons, have you tried just defining the variables like below? have you made sure that you aren't trying to call this custom one before the main one in the init or have the default one commented out? and have you checked both the server and client rpts? Errors can show in one and not the other.

 

s_player_plot_boundary_on = -1;
s_player_plot_boundary_off = -1;
s_player_plot_take_ownership = -1;


DZE_APlotforLife = false;
DZE_PlotOwnership = false;

DZE_snap_build_file = "";

DZE_plotTakeOwnershipItems = dayz_allowedObjects - (DZE_LockableStorage + ["Plastic_Pole_EP1_DZ","TentStorage","TentStorageDomed","TentStorageDomed2"]);

 
 
 
 
I'm not exactly sure if epoch calls dayz_resetselfactions later on in code or fsms but you may want to look through the github and see if its ever called again. I would just change like I did above if it does. You can then go through the actions and add a variable reset at the end if it needs it or redefine dayz_resetselfactions and include all of the old stuff plus the new.
Link to comment
Share on other sites

  • 0

Few quesitons, have you tried just defining the variables like below? have you made sure that you aren't trying to call this custom one before the main one in the init or have the default one commented out? and have you checked both the server and client rpts? Errors can show in one and not the other.

 

s_player_plot_boundary_on = -1;

s_player_plot_boundary_off = -1;

s_player_plot_take_ownership = -1;

DZE_APlotforLife = false;

DZE_PlotOwnership = false;

DZE_snap_build_file = "";

DZE_plotTakeOwnershipItems = dayz_allowedObjects - (DZE_LockableStorage + ["Plastic_Pole_EP1_DZ","TentStorage","TentStorageDomed","TentStorageDomed2"]);

 

 

 

 

I'm not exactly sure if epoch calls dayz_resetselfactions later on in code or fsms but you may want to look through the github and see if its ever called again. I would just change like I did above if it does. You can then go through the actions and add a variable reset at the end if it needs it or redefine dayz_resetselfactions and include all of the old stuff plus the new.

 

First thing I did was double check the init.sqf and everything was loaded correctly. I then made my custom variables.sqf the exact way as you have it, I started gettings errors in my client.rpt, I'm not sure if I got errors before using my code as I did not look into my client rpt file as I totally forgot about that. Next I tried calling dayz_resetSelfActions again and was a no go, same thing happening. So then I redefined dayz_resetSelfActions and still the same errors in the client rpt. Any further ideas would be appreciated.

 

 

 

Edit: I think I found the problem. I did what you suggested and I kept getting errors with variables not defined, so I went in and found those variables and made sure they had a variable. I added those at the very bottom and also changed DZE_APlotforLife & DZE_PlotOwnership to true. This gave me absolutely no errors what so ever in server or client rpt logs and the script works the way it's post to. I have not tried to remove the default code from dayz_resetSelfActions but I saved so much kb on the mission file I'm already happy. I'll prob try it again without it but if it doesn't work, then I know for sure the below code does work.

dayz_resetSelfActions = {
	s_player_fire =			-1;
	s_player_cook =			-1;
	s_player_boil =			-1;
	s_player_fireout =		-1;
	s_player_butcher =		-1;
	s_player_packtent = 	-1;
	s_player_packvault = 	-1;
	s_player_lockvault = 	-1;
	s_player_unlockvault = 	-1;
	s_player_fillwater =	-1;
	s_player_fillwater2 = 	-1;
	s_player_fillfuel = 	-1;
	s_player_grabflare = 	-1;
	s_player_dropflare =	-1;
	s_player_callzombies = 	-1;
	s_player_showname = 	-1;
	s_player_debuglootpos = 	-1;
	s_player_pzombiesattack = 	-1;
	s_player_pzombiesvision =	-1;
	s_player_pzombiesfeed = 	-1;
	s_player_removeflare = 	-1;
	s_player_painkiller =	-1;
	s_player_studybody = 	-1;
	s_player_tamedog =		-1;
	s_player_madsci_crtl =	-1;
	s_player_parts_crtl =	-1;
	s_build_Sandbag1_DZ = 	-1;
	s_build_Hedgehog_DZ =	-1;
	s_build_Wire_cat1 =		-1;
	s_player_deleteBuild =	-1;
	s_player_forceSave = 	-1;
	s_player_checkGear = 	-1;
	s_player_flipveh = 		-1;
	s_player_stats =		-1;
	s_player_sleep =		-1;
	s_player_movedog =		-1;
	s_player_speeddog =		-1;
	s_player_calldog = 		-1;
	s_player_feeddog = 		-1;
	s_player_waterdog = 	-1;
	s_player_staydog = 		-1;
	s_player_trackdog = 	-1;
	s_player_barkdog = 		-1;
	s_player_warndog = 		-1;
	s_player_followdog = 	-1;
	s_player_repair_crtl =  -1;
	s_player_information =  -1;
	s_player_fuelauto    =  -1;
	s_player_fuelauto2    =  -1;
	s_player_fillgen	 =  -1;
	s_player_upgrade_build	 =  -1;
	s_player_maint_build	 =  -1;
	s_player_downgrade_build	 =  -1;
	s_player_towing		 =  -1;
	s_halo_action =         -1;
	s_player_SurrenderedGear = -1;
	s_player_maintain_area = -1;
	s_player_maintain_area_preview = -1;
	s_player_heli_lift = -1;
	s_player_heli_detach = -1;
	s_player_lockUnlock_crtl = -1;
	s_player_toggleSnap = -1;
    s_player_toggleSnapSelect = -1;
    s_player_toggleSnapSelectPoint=[];
    snapActions = -1;
	s_player_plot_boundary_on = -1;
	s_player_plot_boundary_off = -1;
	s_player_plot_take_ownership = -1;
};
call dayz_resetSelfActions;

DZE_APlotforLife = true;

DZE_PlotOwnership = true;

DZE_snap_build_file = "";

DZE_plotTakeOwnershipItems = dayz_allowedObjects - (DZE_LockableStorage + ["Plastic_Pole_EP1_DZ","TentStorage","TentStorageDomed","TentStorageDomed2"]);


Dayz_Dark_UI = false;
DZE_checkNearbyRadius = 100;
DayZ_UseSteamID = true;
dze_snapextrarange = 0;
Link to comment
Share on other sites

  • 0
Hi!
 
i have a good question
 
for adding maca's right click options
 
it tell me to do :
 
In compiles.sqf you need to override player_selectSlot
 
CODE: SELECT ALL
player_selectSlot = compile preprocessFileLineNumbers "dayz_code\compile\ui_selectSlot.sqf"
 
but if i have a empty file with only a few line like you say.. i dont have this..
its only in dayz_code.pbo..
 
i dont know where to overide those lines 
 
can someone help me?
Link to comment
Share on other sites

  • 0

this is the link

 

http://www.epochservers.com/viewtopic.php?f=14&t=13&sid=4d68d5283b8d5635f8323b5ed02979bf

 

but i think i have find something.. a guy have the same problem

 

 

Re: [Release] Add Right Click Options To Items
 by speaR » Sun Jun 15, 2014 7:03 pm
 
I'm having some issues. You are talking about Compiles.sqf. Can i simply copy the one from my dayz_code.pbo\init? Same with ui_selectSlot.sqf if I want to use my own one and just replace the named links? Would be happy about some helping answers :-)
 
and this guy reply
 
Re: [Release] Add Right Click Options To Items
 by maxpayne25 » Mon Jun 16, 2014 2:07 pm
 
Exactly. Place new compiles whereever you want on mission side.
Then just add custom compiles to your init.sqf with this code under old call.
call compile preprocessFileLineNumbers "yourfolder\compiles.sqf";
 
i think this could help me but im not sure to understand.. (english not first language..)
Link to comment
Share on other sites

  • 0

 

this is the link

 

http://www.epochservers.com/viewtopic.php?f=14&t=13&sid=4d68d5283b8d5635f8323b5ed02979bf

 

but i think i have find something.. a guy have the same problem

 

 

Re: [Release] Add Right Click Options To Items
 by speaR » Sun Jun 15, 2014 7:03 pm
 
I'm having some issues. You are talking about Compiles.sqf. Can i simply copy the one from my dayz_code.pbo\init? Same with ui_selectSlot.sqf if I want to use my own one and just replace the named links? Would be happy about some helping answers :-)
 
and this guy reply
 
Re: [Release] Add Right Click Options To Items
 by maxpayne25 » Mon Jun 16, 2014 2:07 pm
 
Exactly. Place new compiles whereever you want on mission side.
Then just add custom compiles to your init.sqf with this code under old call.
call compile preprocessFileLineNumbers "yourfolder\compiles.sqf";
 
i think this could help me but im not sure to understand.. (english not first language..)

 

 

He is telling to do what the instructions say on the first page.

Link to comment
Share on other sites

  • 0

Hey Man what about on a custom variable .. like rimblock plot4life  2.5 i was using compare and he removes a block from the dayz code , and add others .. the adds look to be fairly simple ..  you would just add those changes or ads in order.. but how would you comment out the original daz code variable.sqf lines.. would you just block out those and it will update the orig code with the blocked code ?? 

 

example this is the only lines removed, from his modified variables.sqf ... 

 

dayz_maxLocalZombies = 30; // max quantity of Z controlled by local gameclient, used by player_spawnCheck. Below this limit we can spawn Z
//Current NearBy

 

would I just do this  to block the code in the custom varibles ??

/*

dayz_maxLocalZombies = 30; // max quantity of Z controlled by local gameclient, used by player_spawnCheck. Below this limit we can spawn Z
//Current NearBy

*/

Link to comment
Share on other sites

  • 0

At this point in A2 Epoch's development, it's probably a moot point, but back when there were chances for updates very few months, a custom compiles was a good idea because you didn't have to go in and edit your compiles.sqf when a new new Epoch version was released. I still like it this way to keep it neater and to avoid having to pull files from the client files.

Link to comment
Share on other sites

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
  • Advertisement
  • Discord

×
×
  • Create New...