Linux server errors on startup: 1.8.8-d9b2d6a (Steam dev branch) #732

Closed
denisio opened this Issue Sep 5, 2016 · 5 comments

Projects

None yet

2 participants

@denisio
denisio commented Sep 5, 2016

Error in expression <;
_recompile = (count _this) > 0;

if (BIS_fnc_init && !_recompile) exitwith {t>
Error position: <BIS_fnc_init && !_recompile) exitwith {t>
Error Undefined variable in expression: bis_fnc_init
File ca\Modules\Functions\init.sqf, line 28

@ebayShopper
Contributor

@denisio you need to update to current A2OA stable (1.63.131129 or newer) on both the client and server for 1.8.8. That error was fixed in the core patch, which is why the ca\ folder was removed from the mission. a7ce16f

@ebayShopper ebayShopper closed this Sep 5, 2016
@denisio
denisio commented Sep 14, 2016

Updated corepatch is not fix it...

expansion/addons/corepatch.pbo - 31000873 bytes

@ebayShopper
Contributor

Check your client RPT file @denisio.
C:\Users\YourName\AppData\Local\ArmA 2 OA\arma2oa.RPT

Does it say this at the top? The error was with version 125548 and older.
Version 1.63.131129

You can also check the bottom right corner of the Arma 2 OA main menu screen. It shows the version number there as well.

@denisio
denisio commented Sep 14, 2016

I have 1.63.131129 on client and 1.63.130836 on linux server.

@ebayShopper
Contributor
ebayShopper commented Sep 14, 2016 edited

It looks like you will need to add back the \ca\ folder in your mission until the Linux server gets updated then. In your mission create this file: ca/modules/functions/init.sqf

And inside copy paste this:

scriptName "Functions\init.sqf";
//textLogFormat ["PRELOAD_ Functions\init.sqf %1", _this];
/*
    File: init.sqf
    Author: Karel Moricky

    Description:
    Function library initialization.
    All files have to start with 'fn_' prefix and they name have to be same as name of function.
    Don't forget to exclude comma after last item in array!

    Caution:
    Do not execute this init directly - there is dependency with MPF and need to run on all machines.

    Parameter(s):
    _this select 0: 'Function manager' logic

    Returns:
    Nothing
*/

//--- DEBUG
//hint "Function Module Patch Activated!";
//---

if (!isServer) then {textLogFormat ["MPF_Client FUNCTIONS init.sqf ..."];};

private ["_recompile"];
_recompile = (count _this) > 0;

//--- Functions are already running
if (!isNil "BIS_fnc_init") then {if (BIS_fnc_init && !_recompile) exitwith {};};

//textLogFormat ["Log: [Functions] Init script executed at %1",time];


//--------------------------------------------------------------------------------------------------------
//--- PREPROCESS -----------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------

//--- Create variables for all functions (and preprocess them after first call)
for "_t" from 0 to 2 do {
    _pathConfig = [configfile,campaignconfigfile,missionconfigfile] select _t;
    _pathFile = ["ca\modules\functions","functions","functions"] select _t;

    _cfgFunctions = (_pathConfig >> "cfgfunctions");
    for "_c" from 0 to (count _cfgFunctions - 1) do {
        _currentTag = _cfgFunctions select _c;

        //--- Is Tag
        if (isclass _currentTag) then {
            _tagName = configname _currentTag;
            _itemPathTag = gettext (_currentTag >> "file");

            for "_i" from 0 to (count _currentTag - 1) do {
                _currentCategory = _currentTag select _i;

                //--- Is Category
                if (isclass _currentCategory) then {
                    _categoryName = configname _currentCategory;
                    _itemPathCat = gettext (_currentCategory >> "file");

                    for "_n" from 0 to (count _currentCategory - 1) do {
                        _currentItem = _currentCategory select _n;

                        //--- Is Item
                        if (isclass _currentItem) then {

                            _itemName = configname _currentItem;
                            _itemPathItem = gettext (_currentItem >> "file");
                            _itemPath = if (_itemPathItem != "") then {_itemPathItem} else {
                                if (_itemPathCat != "") then {_itemPathCat + "\fn_" + _itemName + ".sqf"} else {
                                    if (_itemPathTag != "") then {_itemPathTag + "\fn_" + _itemName + ".sqf"} else {""};
                                };
                            };
                            _itemPath = if (_itemPath == "") then {_pathFile + "\" + _categoryName + "\fn_" + _itemName + ".sqf"} else {_itemPath};
                            call compile format ["
                                if (isnil '%2_fnc_%3' || %4) then {
                                    %2_fnc_%3 = {
                                        if (!%4) then {debuglog ('Log: [Functions] %2_fnc_%3 loaded (%1)')};
                                        %2_fnc_%3 = compile preprocessFileLineNumbers '%1';
                                        _this call %2_fnc_%3;
                                    };
                                    %2_fnc_%3_path = '%1';
                                };
                            ",_itemPath,_tagName,_itemName,_recompile];
                        };
                    };
                };
            };
        };
    };
};

//--- CorePatch: overload function
BIS_fnc_selectRandom = {
    private "_ret";

    _ret = objNull;                 //objNull as default value

    if ((count _this) > 0) then {
        _ret = count _this;         //number of elements in the array
        _ret = floor (random _ret); //choose random index
        _ret = _this select _ret;       //get the element
    };

    _ret    
};

//"

private ["_test", "_test2"];
_test = (_this select 0) setPos (position (_this select 0)); if (isnil "_test") then {_test = false};
_test2 = (_this select 0) playMove ""; if (isnil "_test2") then {_test2 = false};
(_test || _test2) call {
    #include "fn_initCounter.sqf"
};

//--------------------------------------------------------------------------------------------------------
//--- INIT COMPLETE --------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------

waitUntil {!isNil "BIS_MPF_InitDone"}; //functions init must be after MPF init
BIS_fnc_init = true;

//if ((missionStart select 0) != 0) then {endLoadingScreen;textLogFormat["PRELOAD_ HACK isServer %1 endLoadingScreen (init functions EH)", isServer];}; //TODO:FIXME:HACK: - in multiplayer game freezes because init.sqf is not launched in MP preload



//textLogFormat ["Log: [Functions] Init script terminated at %1",time];

This is the updated version from the corepatch git with a few changes for paths.

Then create fn_initCounter.sqf in the same folder and paste this inside:
https://raw.githubusercontent.com/DayZMod/DayZ/1e0013803ab775ec3f02ee807efc304ef2390ad2/SQF/dayz_code/system/ca/functions/fn_initCounter.sqf

@ebayShopper ebayShopper changed the title from Errors on server startup: 1.8.8-d9b2d6a (Steam dev branch) to Linux server errors on startup: 1.8.8-d9b2d6a (Steam dev branch) Sep 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment