Adding to a existing custom config

Sazarac

New Member
I was wondering if anyone could help me out. What it the correct method of adding to a custom config? Every time I just cut and paste the addition, it breaks the script(s). Obviously I am doing it wrong, but I can't find a tutorial on what I image is fairly straight forward. I suck at scripting BTW. I can follow directions, but I need to understand the custom config before I can really get anywhere. It's probably the same with custom variables so if that could be included as well that would be great!

Here is what I am starting with (it's the only thing in the custom config)...and a lot of the bits I am trying to add say they go in the (isDedicated) part of the config. Any help would be greatly appreciated. Thanks so much!

if (!isDedicated) then {
player_build = compile preprocessFileLineNumbers "custom\snap_pro\player_build.sqf";
snap_build = compile preprocessFileLineNumbers "custom\snap_pro\snap_build.sqf";
dayz_spaceInterrupt = compile preprocessFileLineNumbers "custom\snap_pro\dayz_spaceInterrupt.sqf";

fnc_usec_selfActions = compile preprocessFileLineNumbers "custom\fn_selfActions.sqf"; //Checks which actions for self
player_unlockVault = compile preprocessFileLineNumbers "custom\BuildVectors\compile\player_unlockVault.sqf";
player_lockVault = compile preprocessFileLineNumbers "custom\BuildVectors\compile\player_lockVault.sqf";
fnc_SetPitchBankYaw = compile preprocessFileLineNumbers "custom\BuildVectors\fnc_SetPitchBankYaw.sqf";
DZE_build_vector_file = "custom\BuildVectors\build_vectors.sqf";
build_vectors = compile preprocessFileLineNumbers DZE_build_vector_file;
};
 
ok since your using a custom fn_selfactions you make the changes in there

find the lines in fn selfactions and change them to your custom redirects/overwrites
 
Thank you so much for answering!

I am not editing fn selfactions in any way. Adding to that is easy since I am using the entire original fn selfactions file. I just place the piece of code where the instructions tell me too. It's the same if I am using the entire original compile code, I just place the piece of code where instructed too.

The trouble arises when I am attempting to add to an existing custom compile that already has the above bit of code which is for snap pro vectors and ONLY that bit of code. I put it up there just to show what I have in the current custom compile. Only that piece of code. Does that make sense?

I have a custom compile that has one piece of code in it, what I have shown above, that piece from snap pro with vectors.

My problem is when I add to that. For example I added this piece here:
https://github.com/deannreid/DayZ-Epoch/commit/547ba0018f8e71de641223397099da90f65f2d8d

I cut and pasted this code for the black screen fix below the existing snap pro code and this code broke the vector builds. I remove the black screen fix and they work. And as I have added ANYthing to the custom compile it breaks other things on the server. So I am doing SOMEthing wrong. So I wondering if there a correct method to adding to a custom compile when it is not using the entire original compile file. I.E. the placement, syntax, ect.

I hope I am explaining this correctly. :(
 
ok the easiest way for me to help you would be if you could send me your server pbo and mission files and tell exactly what you are trying to add
(you can PM so there not public)

but you can try using this

Code:
if (!isDedicated) then {

    player_build = compile preprocessFileLineNumbers "custom\snap_pro\player_build.sqf";
    snap_build = compile preprocessFileLineNumbers "custom\snap_pro\snap_build.sqf";
    dayz_spaceInterrupt = compile preprocessFileLineNumbers "custom\snap_pro\dayz_spaceInterrupt.sqf";
  
    fnc_usec_selfActions =            compile preprocessFileLineNumbers "custom\fn_selfActions.sqf";        //Checks which actions for self
    player_unlockVault =            compile preprocessFileLineNumbers "custom\BuildVectors\compile\player_unlockVault.sqf";
    player_lockVault =            compile preprocessFileLineNumbers "custom\BuildVectors\compile\player_lockVault.sqf";
    fnc_SetPitchBankYaw =       compile preprocessFileLineNumbers "custom\BuildVectors\fnc_SetPitchBankYaw.sqf";
    DZE_build_vector_file =         "custom\BuildVectors\build_vectors.sqf";
    build_vectors =                 compile preprocessFileLineNumbers DZE_build_vector_file;

//Black screen Fix
[] spawn {
        private["_timeOut","_display","_control1","_control2"];
        disableSerialization;
        _timeOut = 0;
        dayz_loadScreenMsg = "";
        diag_log "DEBUG: loadscreen guard started.";
        _display = uiNameSpace getVariable "BIS_loadingScreen";
        if (!isNil "_display") then {
                _control1 = _display displayctrl 8400;
                _control2 = _display displayctrl 102;
        };
        if (!isNil "dayz_DisplayGenderSelect") then {
            waitUntil {!dayz_DisplayGenderSelect};
        };

        // 120 sec timeout (12000 * 0.01)
        while { _timeOut < 12000 } do {
           if (dayz_clientPreload && dayz_authed) exitWith {
                    diag_log "PLOGIN: Login loop completed!";
                    endLoadingScreen;
                };
            if (!isNil "_display") then {
                if ( isNull _display ) then {
                        waitUntil { !dialog; };
                        startLoadingScreen ["","RscDisplayLoadCustom"];
                        _display = uiNameSpace getVariable "BIS_loadingScreen";
                        _control1 = _display displayctrl 8400;
                        _control2 = _display displayctrl 102;
                };

                if ( dayz_loadScreenMsg != "" ) then {
                        _control1 ctrlSetText dayz_loadScreenMsg;
                        dayz_loadScreenMsg = "";
                };

                _control2 ctrlSetText format["%1",round(_timeOut*0.01)];
            };

            _timeOut = _timeOut + 1;

            if (_timeOut >= 12000) then {
                1 cutText [localize "str_player_login_timeout", "PLAIN DOWN"];
                sleep 10;
                endLoadingScreen;
                endMission "END1";
            };

            sleep 0.01;
        };
    };
        progressLoadingScreen 0.9;
};

ive found the easiest way to do this is use the entire compiles.sqf and make your changes to that
 
I absolutely appreciate you offering to do it for me, but I need to learn how it's done. Otherwise I will always be asking for help.

Also I no longer need the black screen fix as I have found another way to fix it. But...what have you added above and below?! Is that part of the original compiles or something you just know should be there?! See that is exactly what stumps me about adding to a custom compile! :mad:

Argh...I have seen several posts that suggest NOT using the entire compiles file as it's adding server load because it is in essence loading the same thing twice. I don't think I have the head to learn scripting so I agree I should probably just deal with it and use the whole original compile file. **sigh** Now I need to figure out where the snap pro bit goes into the compiles file.

Thank you so very much for answering my post, it's been very helpful. :D
 
if you use the entire compiles file just remove the original call from the INIT.sqf and use only the custom one :)

the code you were adding was not the entire fix it was only a commit the entire section for the fix is here

https://github.com/deannreid/DayZ-E...9da90f65f2d8d/SQF/dayz_code/init/compiles.sqf

search the file and find the black screen fix section, you will see that there is code above and below it, its a hard learning curve but well worth it glad to see some one willing to put in the hard yards!

feel free to ask any questions!
 
OK you asked for it! heh heh. Lets start at the very beginning. WHAT does the compile DO? I THINK it's "calling" to .sgf files which preforms specific actions? Correct, not correct, partially correct? You can be as detailed as you like.

So then, looking at the compiles...is the

//Player only
if (!isDedicated) then {

part from line 7 to 48? Or...what? Is it the whole thing? I THINK the }; are ending a bit of code? I certainly know you don't want to leave one out! Or commas.. &^%$@#$ commas! :mad:

So specifically if I am to add a new piece of code into the custom compile and it says it goes into the (!isDedicated) section, where is that exactly? I mean, and I'm not really complaining, but some script instructions assume you understand scripting. And an awful lot of us do not. *I* do not! It really is another language. C++ I think? (shrug)

I need to add that part I have in the start of the thread, for snap pro vector, into the original compile and the instructions say..."compiles.sqf can be either found in project folder here on github or you can just create new file and add these lines:". So I created a new file. Which works fine UNTIL I need to add new bits of code. Which I do now. So I want to add it to the ORIGINAL compile, but it does not say WHERE. So I am left guessing and poking around breaking things. I am REALLY good at breaking things. :(

I always get things working again, but it sure is time consuming when you have no idea what you are doing.
 
ill try explain compiles (may not be right but it will help you understand what it does...i hope :p )

basically the compiles turns a SQF into a function that can be called by other SQF's
it sets up all the files to be used as varablies/functions that can be used by other sqfs

you should also get notepad++ it will greatly help you with brackets and seeing where code starts and ends.

//Player only
if (!isDedicated) then {


this code starts at line 4 and actually ends at line 479 (for me at least i have more code yours may be different but it should end around line 400 -500 )
but this is what the end of the code looks like

dayz_originalPlayer = player;

progressLoadingScreen 0.8;
};

(in notepad++ click next to the first { bracket it should turn red then scroll down and look for the } bracket this also red this is the end of that code section)

EXAMPLE:
fnc_usec_selfActions = custom\fnc_usec_selfActions.sqf;

now when ever i use fnc_usec_selfActions in my code it will call the file "custom\playerbuild.sqf"
now i can execute the file just by calling the variable name (fnc_usec_selfActions )

EXAMPLE
[] call fnc_usec_selfActions;

this will call the fnc_usec_selfActions.sqf and run the code in it


if (!isDedicated) then { <---- this means the code will only be run on the client and not the server
if(isDedicated) then { <---- this means the code will only be run on the server

putting a ! infront of a variable means "if not" or "if is false"
EXAMPLE
if (!running)then { <----means "if not running"

now when adding a new bit of code to compiles i generally add it at the very top of it just after
if (!isDedicated) then {


EXAMPLE
if i have a PAINT script that wants me to add SprayPaint = custom\SprayPaint.sqf; to my compiles,
so i would put it in like so
//Player only
if (!isDedicated) then {

//PAINT SCRIPT
SprayPaint= custom\SprayPaint.sqf;



hope this helps, im self taught and like you i broke many many pieces of code trying to figure out what did what :p

if you need me to be clearer or more detailed on anything just ask away :)
 
Well dammit! I really THOUGHT I had this figured out. But nope.

I can't add anything to the custom compile with just snap pro build in it because it breaks, and now when I try to add it to the original compiles it breaks. Fer f*cks sake...

I thought I "got it". The custom compile
if (!isDedicated) then {
player_build = compile preprocessFileLineNumbers "custom\snap_pro\player_build.sqf";
snap_build = compile preprocessFileLineNumbers "custom\snap_pro\snap_build.sqf";
dayz_spaceInterrupt = compile preprocessFileLineNumbers "custom\snap_pro\dayz_spaceInterrupt.sqf";

fnc_usec_selfActions = compile preprocessFileLineNumbers "custom\fn_selfActions.sqf"; //Checks which actions for self
player_unlockVault = compile preprocessFileLineNumbers "custom\BuildVectors\compile\player_unlockVault.sqf";
player_lockVault = compile preprocessFileLineNumbers "custom\BuildVectors\compile\player_lockVault.sqf";
fnc_SetPitchBankYaw = compile preprocessFileLineNumbers "custom\BuildVectors\fnc_SetPitchBankYaw.sqf";
DZE_build_vector_file = "custom\BuildVectors\build_vectors.sqf";
build_vectors = compile preprocessFileLineNumbers DZE_build_vector_file;
};
I am using for snap pro has the "if (!isDedicated) then { " part at the top because it's all alone in there. Ok, that makes sense. And the }; is there because it's finishing off that bit of code? Alright, so I figured if I removed the top and bottom part, and just inserted the middle onto the top of the original compile, that would do. But nope! The snap pro is broken yet again. Joy. I literally have till midnight to figure this out.

Here is what I have done (this is the not the whole compile just the top bit)
/*
FUNCTION COMPILES
*/
//Player only
if (!isDedicated) then {

"filmic" setToneMappingParams [0.07, 0.31, 0.23, 0.37, 0.011, 3.750, 6, 4]; setToneMapping "Filmic";

//snap pro vectors
player_build = compile preprocessFileLineNumbers "custom\snap_pro\player_build.sqf";
snap_build = compile preprocessFileLineNumbers "custom\snap_pro\snap_build.sqf";
dayz_spaceInterrupt = compile preprocessFileLineNumbers "custom\snap_pro\dayz_spaceInterrupt.sqf";

fnc_usec_selfActions = compile preprocessFileLineNumbers "custom\fn_selfActions.sqf";
player_lockVault = compile preprocessFileLineNumbers "custom\player_lockVault.sqf";
player_unlockVault = compile preprocessFileLineNumbers "custom\player_unlockVault.sqf";

BIS_Effects_Burn = compile preprocessFile "\ca\Data\ParticleEffects\SCRIPTS\destruction\burn.sqf";
player_zombieCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf"; //Run on a players computer, checks if the player is near a zombie
player_zombieAttack = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieAttack.sqf"; //Run on a players computer, causes a nearby zombie to attack them
fnc_usec_damageActions = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageActions.sqf"; //Checks which actions for nearby casualty
fnc_inAngleSector = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_inAngleSector.sqf"; //Checks which actions for nearby casualty
fnc_usec_selfActions = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_selfActions.sqf"; //Checks which actions for self
fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";
player_temp_calculation = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_temperatur.sqf"; //Temperatur System //TeeChange
player_weaponFiredNear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_weaponFiredNear.sqf";
player_animalCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_animalCheck.sqf";
player_spawnCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_spawnCheck.sqf";
player_dumpBackpack = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_dumpBackpack.sqf";
building_spawnLoot = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\building_spawnLoot.sqf";
building_spawnZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\building_spawnZombies.sqf";
dayz_spaceInterrupt = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\dayz_spaceInterrupt.sqf";
player_fired = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_fired.sqf"; //Runs when player fires. Alerts nearby Zeds depending on calibre && audial rating
player_harvest = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_harvest.sqf";
player_packTent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_packTent.sqf";
player_packVault = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_packVault.sqf";
player_unlockVault = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_unlockVault.sqf";

player_removeObject = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\remove.sqf";
player_removeNearby =

I am using Notepad++ and I just started using DiffMerg. Both awesome programs. I wouldn't have gotten as far as I have without them.

Here is what part of my init looks like...could there be anything wrong here?
//Load in compiled functions
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf"; //Initilize the Variables (IMPORTANT: Must happen very early)
call compile preprocessFileLineNumbers "custom\variables.sqf"; //custom variable

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

call compile preprocessFileLineNumbers "addons\bike\init.sqf"; //deployable bike
call compile preprocessFileLineNumbers "custom\compiles.sqf"; //snap pro + lock-unlock
progressLoadingScreen 0.5;
call compile preprocessFileLineNumbers "server_traders.sqf"; //Compile trader configs
progressLoadingScreen 1.0;

OK, so I give up! Where do I put the files for snap pro in the original compiles file?!
 
ok you need to remove the old functions in this section because your custom stuff is being over written by the old ones

below is what you need to remove (or comment out but i would remove it to save space :p )


fnc_usec_selfActions = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_selfActions.sqf";

THIS LINE IS BREAKING YOUR SNAP BUILD IT OVERRIDES THE SNAP ONE!!!
dayz_spaceInterrupt = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\dayz_spaceInterrupt.sqf";

player_unlockVault = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_unlockVault.sqf";

player_lockVault = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_lockVault.sqf";

player_build = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_build.sqf";



these are scattered threw the compiles so you will have to search for them

also i noticed your trying to add build vectors AND snap build, now they wont work together nicely there is a custom version that has both in one you can get it here you will need to remove your current snap pro and follow the install guide

https://github.com/strikerforce/SnapPro-BuildVectors


init is good
 
Wait, what it WORKS?! Have I finally figured it out? Ok so I was in a hurry, I admit that...time crunch. So I was annoyed and took a bit to look at the compile, yeah, I know, should have done that to begin with. So I snapped (pun intended) that the snap pro code was the same as what was already in the compile with the exception of one snippet. So I thought...welllll....it is overriding what was in anyway...so why not comment out the original bit. And now it works! But before I put it on the live server, is this the proper way to do it? Or does it really matter as long as it works? I bolded my edits to make them easier to see. I did not put the whole thing in there, the forum said "no". :/
/*
FUNCTION COMPILES
*/
//Player only
if (!isDedicated) then {

"filmic" setToneMappingParams [0.07, 0.31, 0.23, 0.37, 0.011, 3.750, 6, 4]; setToneMapping "Filmic";

//snap pro vectors
player_build = compile preprocessFileLineNumbers "custom\snap_pro\player_build.sqf";
snap_build = compile preprocessFileLineNumbers "custom\snap_pro\snap_build.sqf";
dayz_spaceInterrupt = compile preprocessFileLineNumbers "custom\snap_pro\dayz_spaceInterrupt.sqf";

fnc_usec_selfActions = compile preprocessFileLineNumbers "custom\fn_selfActions.sqf";
player_lockVault = compile preprocessFileLineNumbers "custom\player_lockVault.sqf";
player_unlockVault = compile preprocessFileLineNumbers "custom\player_unlockVault.sqf";


BIS_Effects_Burn = compile preprocessFile "\ca\Data\ParticleEffects\SCRIPTS\destruction\burn.sqf";
player_zombieCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf"; //Run on a players computer, checks if the player is near a zombie
player_zombieAttack = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieAttack.sqf"; //Run on a players computer, causes a nearby zombie to attack them
fnc_usec_damageActions = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageActions.sqf"; //Checks which actions for nearby casualty
fnc_inAngleSector = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_inAngleSector.sqf"; //Checks which actions for nearby casualty
//fnc_usec_selfActions = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_selfActions.sqf"; //Checks which actions for self
fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";
player_temp_calculation = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_temperatur.sqf"; //Temperatur System //TeeChange
player_weaponFiredNear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_weaponFiredNear.sqf";
player_animalCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_animalCheck.sqf";
player_spawnCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_spawnCheck.sqf";
player_dumpBackpack = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_dumpBackpack.sqf";
building_spawnLoot = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\building_spawnLoot.sqf";
building_spawnZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\building_spawnZombies.sqf";
//dayz_spaceInterrupt = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\dayz_spaceInterrupt.sqf";
player_fired = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_fired.sqf"; //Runs when player fires. Alerts nearby Zeds depending on calibre && audial rating
player_harvest = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_harvest.sqf";
player_packTent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_packTent.sqf";
player_packVault = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_packVault.sqf";
//player_unlockVault = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_unlockVault.sqf";
 
I didn't see your post FallingSheep! So I did figure it out?

I am using the updated custom vector version. :D
yes you did!

well done mate!

also comment out the lock one to not just the unlock one (delete them as they are no longer used :) ) its further down in compiles
 
yes you did!

well done mate!

also comment out the lock one to not just the unlock one (delete them as they are no longer used :) ) its further down in compiles

Awesome! I did comment it out, that's what I meant about not posting the whole thing, it was so far down in the compile, the forum said my message was too large. I usually removed commented lines after a day or so just to make sure everything is copacetic. Cool, and right at the wire too. I really couldn't have done it without your guidance. :)
 
Sure! The IP is 162.223.29.138:2352
It's locked at the moment, so if you want the password PM me.

Pretty much anything you see, from the splash screen to the map edits, I did. So be kind! It's been one hell of a learning curve. I also did the website, forum and facebook page.

Now here is one thing that is irritating and confusing. We initially installed that black screen fix because one of co-owners couldn't join the server except after a restart. From what research I did, I found that removing the mpmission cache is supposed to work just as well and doesn't require a script running on the server. So I removed that script, well now it's happening to me! The one time it happened before I deleted the mpmission cache and got right in. Now it's not working. My research says it's a client side problem, but if that is the case, why is the problem only this one server?! ***sigh*** Dayz tests my patience I can tell ya. :(
 
add this to your init its a black screen fix from my repack :p

endLoadingScreen; // Work around for loadscreen freeze

add it above

if (!isDedicated) then {

and also just after

#include "\z\addons\dayz_code\system\BIS_Effects\init.sqf";
 
Back
Top