DayZ Mission System

not sure if im the only one who have this problem.
but after i upgrade from epoch 1.0.2.5 to 1.0.3.1, i cant log into the server with mission script in it.
the loading screen of "DayZ Epoch" just froze there and the loading bar is not moving
 
Can anyone help me with the clean up script(server_cleanup.fsm) to

I have tried the one from 1.0.2.5.
I have tried to modify some other mission packages. Removing the Sarge to Mission and DZAI to Mission, but still I'm receiving an error in RPT log that is spamming the shit out of my log.

1.0.3.1
Thanks for any help
smile.png


Used
if(vehicle _x != _x &&!(vehicle _x in _safety)&&(isPlayer _x)&&!((typeOf vehicle _x)in DZE_safeVehicle))then{" \n
Received
4:06:12 Error in expression <if(vehicle _x != _x && !(vehicle _x in _safety) && (isPlayer _x) && !((typeOf >
4:06:12 Error position: <_safety) && (isPlayer _x) && !((typeOf >
4:06:12 Error Undefined variable in expression: _safety
.............................................................................................................
Used
if(vehicle _x != _x && (vehicle _x getVariable [""Mission"",0] !=1) && !(vehicle _x in _safety) && (isPlayer _x) && !((typeOf vehicle _x) in DZE_SafeVehicle)) then {" \n

Received
Error in expression < ["Mission", 0] !-1) && !(vehicle _x in _safety) && (isPlayer _x) && !(typeOf >
Error position: <_safety) && (isPlayer _x) && !((typeOf >
Error Undefined variable in expression: _safety
.............................................................................................................
Used
if(vehicle _x != _x && (vehicle _x getVariable [""Mission"",0] != 1) && !(vehicle _x in _safety) && (isPlayer _x) && !&& !((typeOf vehicle _x) in DZE_safeVehicle)) then {" \n

Receiving
4:38:38 Error in expression <le _x in _safety) && (isPlayer _x) && !&& !((typeOf vehicle _x) in DZE_safeVehi>
4:38:38 Error position: <&& !((typeOf vehicle _x) in DZE_safeVehi>
4:38:38 Error Invalid number in expression

But this one only show two errors and stops spamming my RPT log. so I guess I will go with this for now.............
 
I have a question. I have the mission system working really well. I just am having a issue when the missions are left alone for a set amount of time the (maybe 20 min) loot box despawn. So when someone finally decides to finish the mission the box is gone even if it was there to start out with. I was wondering if there is anything I can do to make it so the box is there longer or even till the server reset.
 
I have a question. I have the mission system working really well. I just am having a issue when the missions are left alone for a set amount of time the (maybe 20 min) loot box despawn. So when someone finally decides to finish the mission the box is gone even if it was there to start out with. I was wondering if there is anything I can do to make it so the box is there longer or even till the server reset.

What variable do they get? Mission or Sarge? Anyways:
In server_functions.sqf
change
Code:
_keep = (_x getVariable ["permaLoot",false]);
to
Code:
_keep = (_x getVariable ["permaLoot",false]) || (_x getVariable ["Sarge",0] == 1);
if they got the variable MIssion obviously change ot to Mission instead of Sarge
 
Can anyone put me on the right track to make the AI use spawned vehicles? e.g. let a few of them sit in an armed humvee, or a static tripod. Just to spice things up a little :)
 
Can anyone put me on the right track to make the AI use spawned vehicles? e.g. let a few of them sit in an armed humvee, or a static tripod. Just to spice things up a little :)
This AI isn't written to do that. If you want something like that and run Epoch I'd try out Wicked AI.
 
Should beworking just fine.. Are you using the normal Mission System or an "improved" version like EMS (http://epochmod.com/forum/index.php?/topic/4202-ems-epoch-mission-system-release-021/)? Because if you're using EMS (which is based on the regular one) you'd need to do a bit more than that ;D


The piece of code actually worked. I have sarge, in its place where the mission would go for everything, because of the roaming ai on the map. Also the mission system I have I have customized the whole thing. I have 29 different missions all pretty unique. I have about 10 different box sqf's and 14 minor and 15 major missions. ranging from pretty easy to pretty hard to do.

thanks again for the code to prevent boxes from despawning it made it so when downtime happens people re still able to do a mission after its been there for a while.

thumbs up
 
Okay glad it worked. I was just asking because in case of EMS some of the missions dont have the sarge variable and therefore must be added afterwards
 
EMS has been updated to v.0.2.3

I will try to integrate dzai .

HEMS should b released by mimic when he has done his work for it.

He will use Sarge

EMS has 26 Missions and is optimized for the use on epoch servers.

But i have a backup of the dayz/rMod mission system if anyone wants...
 
My loot boxes are disappearing the majority of the time. Im running vanilla dayz 1.8.0.3 with Sarge AI and all of my missions have been changed to reflect the Sarge AI

Code:
_crate setVariable ["Sarge",1,true];

someone suggested finding this

Code:
_keep = (_x getVariable ["permaLoot",false]);

in the server_functions.sqf but I don't have anything like this at all in mine.

Also want to add that Im using this randomizer for the loot in the crates in my fillboxes

Code:
_crate = _this select 0;
clearWeaponCargoGlobal _crate;
clearMagazineCargoGlobal _crate;
//define lists
_pistolList = ["Colt1911","glock17_EP1","M9","M9SD","Makarov","MakarovSD","revolver_EP1"];
_sniperList = ["SVD_CAMO","DMR","SVD","huntingrifle","M14_EP1","M24","M40A3","SVD_des_EP1"];
_mgList = ["M240_DZ","m240_scoped_EP1","M249_DZ","Mk_48_DZ","UZI_EP1","bizon_silenced","MP5A5","MP5SD"];
_primaryList = ["M4SPR","Sa58P_EP1","Sa58V_CCO_EP1","Sa58V_EP1","Sa58V_RCO_EP1","AKS_74_kobra","AKS_74_U","AK_107_PSO","AK_47_M","AK_74","FN_FAL","FN_FAL_ANPVS4","G36A_camo","G36a","G36C",
"G36C_camo","G36K_camo","M24_des_EP1","AK_107_Kobra","LeeEnfield","M16A2","M16A2GL","M16A4_ACG","M4A1","M4A1_Aim","M4A1_AIM_SD_camo","M4A1_HWS_GL_camo","M4A3_CCO_EP1",
"Winchester1866","M1014","MR43","Remington870_lamp"];
_gearList = ["Binocular_Vector","ItemCrowbar","ItemFishingPole","ItemFlashlightRed","ItemKnife","ItemMatchbox",
"ItemRadio","ItemToolbox","ItemWatch","Binocular","ItemMap","ItemGPS","ItemEtool","ItemCompass","ItemMachete","ItemFlashlight","NVGoggles","ItemMachete"];
_bpackList = ["CZ_VestPouch_EP1","DZ_ALICE_Pack_EP1","DZ_Assault_Pack_EP1","DZ_Backpack_EP1","DZ_British_ACU","DZ_CivilBackpack_EP1"];
_gshellList = ["HandGrenade_west","FlareGreen_M203","FlareWhite_M203"];
// other
_crate addMagazineCargoGlobal ["HandGrenade", 2];
// _crate addMagazineCargoGlobal ["HandGrenade_west", 8];
// _crate addMagazineCargoGlobal ["HandRoadFlare", 8];
// _crate addMagazineCargoGlobal ["PipeBomb", 1];
// load gear
_scount = count _gearList;
    for "_x" from 0 to 2 do {
        _sSelect = floor(random _sCount);
        _item = _gearList select _sSelect;
        _crate addWeaponCargoGlobal [_item,(round(random 2))];
    };
// load grenades
_scount = count _gshellList;
    for "_x" from 0 to 2 do {
        _sSelect = floor(random _sCount);
        _item = _gshellList select _sSelect;
        _crate addMagazineCargoGlobal [_item,(round(random 2))];
    };
// load packs
_scount = count _bpackList;
    for "_x" from 0 to 1 do {
        _sSelect = floor(random _sCount);
        _item = _bpackList select _sSelect;
        _crate addBackpackCargoGlobal [_item,2];
    };
// load pistols
_scount = count _pistolList;
    for "_x" from 0 to 2 do {
        _sSelect = floor(random _sCount);
        _item = _pistolList select _sSelect;
        _crate addWeaponCargoGlobal [_item,1];
        _ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
            if (count _ammo > 0) then {
            _crate addMagazineCargoGlobal [(_ammo select 0),8];
            };
    };
//load sniper
_scount = count _sniperList;
    for "_x" from 0 to 1 do {
        _sSelect = floor(random _sCount);
        _item = _sniperList select _sSelect;
        _crate addWeaponCargoGlobal [_item,1];
        _ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
            if (count _ammo > 0) then {
            _crate addMagazineCargoGlobal [(_ammo select 0),8];
            };
    };
//load mg
_scount = count _mgList;
    for "_x" from 0 to 2 do {
        _sSelect = floor(random _sCount);
        _item = _mgList select _sSelect;
        _crate addWeaponCargoGlobal [_item,1];
        _ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
            if (count _ammo > 0) then {
            _crate addMagazineCargoGlobal [(_ammo select 0),8];
            };
    };
//load primary
_scount = count _primaryList;
    for "_x" from 0 to 3 do {
        _sSelect = floor(random _sCount);
        _item = _primaryList select _sSelect;
        _crate addWeaponCargoGlobal [_item,1];
        _ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
        if (count _ammo > 0) then {
            _crate addMagazineCargoGlobal [(_ammo select 0),8];
        };
    };
 
Last edited:
if you go read the post 447 i think then it might help you, it helped me and now boxes stay until the reset and people are very grateful. it also made it so the helis that people shoot down that ai are flying no longer despawn and people can repair them and fly them till the server reset for a chance to sale them or just fly around.
 
if you go read the post 447 i think then it might help you, it helped me and now boxes stay until the reset and people are very grateful. it also made it so the helis that people shoot down that ai are flying no longer despawn and people can repair them and fly them till the server reset for a chance to sale them or just fly around.
I appreciate the response and Im not trying to sound like a dick here but I clearly address that in the first part of my question.....
Code:
_keep = (_x getVariable ["permaLoot",false]);
there is nothing even remotely close to this in my server_functions.sqf . Im guessing these instructions are for epoch or something else.


This is my server_functions.sqf

Code:
//[] spawn {[] execVM "\z\addons\dayz_server\init\AH.sqf";};
#include "\z\addons\dayz_server\compile\server_toggle_debug.hpp"
waituntil {!isnil "bis_fnc_init"};
 
BIS_MPF_remoteExecutionServer = {
    if ((_this select 1) select 2 == "JIPrequest") then {
        [nil,(_this select 1) select 0,"loc",rJIPEXEC,[any,any,"per","execVM","ca\Modules\Functions\init.sqf"]] call RE;
    };
};
 
BIS_Effects_Burn =            {};
server_playerLogin =        compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerLogin.sqf";
server_playerSetup =        compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerSetup.sqf";
server_onPlayerDisconnect = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_onPlayerDisconnect.sqf";
server_updateObject =        compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_updateObject.sqf";
server_playerDied =            compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerDied.sqf";
server_publishObj =         compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishObject.sqf";    //Creates the object in DB
server_publishBld =         compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishBuilding.sqf";    //Creates the building in DB
server_deleteObj =            compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_deleteObj.sqf";     //Removes the object from the DB
server_playerSync =            compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerSync.sqf";
zombie_findOwner =            compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\zombie_findOwner.sqf";
server_updateNearbyObjects =    compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_updateNearbyObjects.sqf";
server_spawnCrashSite  =    compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_spawnCrashSite.sqf";
server_sendToClient =        compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_sendToClient.sqf";
server_Wildgenerate =        compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\zombie_Wildgenerate.sqf";
server_plantSpawner =        compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_plantSpawner.sqf";
 
//Get instance name (e.g. dayz_1.chernarus)
fnc_instanceName = {
    "dayz_" + str(dayz_instance) + "." + worldName
};
spawnComposition = compile preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"; //"\z\addons\dayz_code\compile\object_mapper.sqf";
fn_bases = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\fn_bases.sqf";
fnc_hTime = compile preprocessFile "\z\addons\dayz_server\Missions\misc\fnc_hTime.sqf"; //Random integer selector for mission wait time
 
vehicle_handleServerKilled = {
    private["_unit","_killer"];
    _unit = _this select 0;
    _killer = _this select 1;
       
    [_unit, "killed"] call server_updateObject;
   
    _unit removeAllMPEventHandlers "MPKilled";
    _unit removeAllMPEventHandlers "mphit";
    _unit removeAllMPEventHandlers "mprespawn";
    _unit removeAllEventHandlers "FiredNear";
    _unit removeAllEventHandlers "Killed";
    _unit removeAllEventHandlers "HandleDamage";
    _unit removeAllEventHandlers "GetIn";
    _unit removeAllEventHandlers "GetOut";
    _unit removeAllEventHandlers "Fired";
        _unit removeAllEventHandlers "Local";
};
 
check_publishobject = {
    private ["_allowed","_allowedObjects","_object","_playername"];
 
    _object = _this select 0;
    _playername = _this select 1;
    _allowedObjects = ["TentStorage", "Hedgehog_DZ", "Sandbag1_DZ", "BearTrap_DZ", "Wire_cat1", "StashSmall", "StashMedium", "DomeTentStorage", "CamoNet_DZ", "Trap_Cans", "TrapTripwireFlare", "TrapBearTrapSmoke", "TrapTripwireGrenade", "TrapTripwireSmoke", "TrapBearTrapFlare"];
    _allowed = false;
 
#ifdef OBJECT_DEBUG
    diag_log format ["DEBUG: Checking if Object: %1 is allowed published by %2", _object, _playername];
#endif
 
    if ((typeOf _object) in _allowedObjects) then {
#ifdef OBJECT_DEBUG
        diag_log format ["DEBUG: Object: %1 published by %2 is Safe",_object, _playername];
#endif
        _allowed = true;
    };
 
    _allowed;
};
 
//event Handlers
eh_localCleanup = {
   
private ["_object","_type","_unit"];
_object = _this select 0;
    _object addEventHandler ["local", {
        if(_this select 1) then {
            _unit = _this select 0;
            _type = typeOf _unit;
             _myGroupUnit = group _unit;
             _unit removeAllMPEventHandlers "mpkilled";
             _unit removeAllMPEventHandlers "mphit";
             _unit removeAllMPEventHandlers "mprespawn";
             _unit removeAllEventHandlers "FiredNear";
            _unit removeAllEventHandlers "HandleDamage";
            _unit removeAllEventHandlers "Killed";
            _unit removeAllEventHandlers "Fired";
            _unit removeAllEventHandlers "GetOut";
            _unit removeAllEventHandlers "GetIn";
            _unit removeAllEventHandlers "Local";
            clearVehicleInit _unit;
            deleteVehicle _unit;
            deleteGroup _myGroupUnit;
            _unit = nil;
            diag_log ("CLEANUP: DELETED A " + str(_type) );
        };
    }];
};
 
server_hiveWrite = {
    private["_data"];
    //diag_log ("ATTEMPT WRITE: " + _this);
    _data = "HiveExt" callExtension _this;
    //diag_log ("WRITE: " +str(_data));
};
 
server_hiveReadWrite = {
    private["_key","_resultArray","_data"];
    _key = _this;
    //diag_log ("ATTEMPT READ/WRITE: " + _key);
    _data = "HiveExt" callExtension _key;
    //diag_log ("READ/WRITE: " +str(_data));
    _resultArray = call compile format ["%1",_data];
    _resultArray;
};
 
onPlayerDisconnected         "[_uid,_name] call server_onPlayerDisconnect;";
 
server_getDiff =    {
    private["_variable","_object","_vNew","_vOld","_result"];
    _variable = _this select 0;
    _object =     _this select 1;
    _vNew =     _object getVariable[_variable,0];
    _vOld =     _object getVariable[(_variable + "_CHK"),_vNew];
    _result =     0;
    if (_vNew < _vOld) then {
        //JIP issues
        _vNew = _vNew + _vOld;
        _object getVariable[(_variable + "_CHK"),_vNew];
    } else {
        _result = _vNew - _vOld;
        _object setVariable[(_variable + "_CHK"),_vNew];
    };
    _result;
};
 
server_getDiff2 =    {
    private["_variable","_object","_vNew","_vOld","_result"];
    _variable = _this select 0;
    _object =     _this select 1;
    _vNew =     _object getVariable[_variable,0];
    _vOld =     _object getVariable[(_variable + "_CHK"),_vNew];
    _result = _vNew - _vOld;
    _object setVariable[(_variable + "_CHK"),_vNew];
    _result;
};
 
dayz_objectUID2 = {
    private["_position","_dir","_key"];
    _dir = _this select 0;
    _key = "";
    _position = _this select 1;
    {
        _x = _x * 10;
        if ( _x < 0 ) then { _x = _x * -10 };
        _key = _key + str(round(_x));
    } forEach _position;
    _key = _key + str(round(_dir));
    _key;
};
 
dayz_recordLogin = {
    private["_key"];
    _key = format["CHILD:103:%1:%2:%3:",_this select 0,_this select 1,_this select 2];
    _key call server_hiveWrite;
};
//----------InitMissions--------//
MissionGo = 0;
MissionGoMinor = 0;
if (isServer) then {
SMarray = ["SM1","SM2","SM3","SM4","SM5","SM6"];
[] execVM "\z\addons\dayz_server\missions\major\SMfinder.sqf"; //Starts major mission system
SMarray2 = ["SM1","SM2","SM3","SM4","SM5","SM6"];
[] execVM "\z\addons\dayz_server\missions\minor\SMfinder.sqf"; //Starts minor mission system
};
//---------EndInitMissions------//
 
call compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\fa_hiveMaintenance.sqf";
 
i think how i found mine was i looked for just the permaloot section. when adding in scripts i usualy only look for a word or so it helps out instead of trying to find the whole line

this is what mine looks like where i placed it and im playing on epoch 1.0.3.1

_missionObjs = allMissionObjects "ReammoBox";
_delQty = 0;
_dateNow = (DateToNumber date);
{
_keep = (_x getVariable ["permaLoot",false]) || (_x getVariable ["Sarge",0] == 1);
 
I am having a new issue. I was wondering how to get eh AI to shoot at armored vehicles and what not.. people seem to be able to walk into the mission if they don't shoot and just complete the mission and get the loot and leave the AI alone.. however if they shoot at the AI then it aggro them and then finally start to shoot the people
 
Like I said, none of that is in there. Feel free to do a word search in the server_functions.sqf I posted. Im not running epoch so this is probably why mine is different.

I am having a new issue. I was wondering how to get eh AI to shoot at armored vehicles and what not.. people seem to be able to walk into the mission if they don't shoot and just complete the mission and get the loot and leave the AI alone.. however if they shoot at the AI then it aggro them and then finally start to shoot the people

You need to change the team the mission AI are on. They are probably set to the side of resistance. Try looking at the DZAI and see what team they bandits are on. For me (using Sarge AI) the bandits are on east, but the AI on the missions were set to the side of resistance. Once I changed them to east, they acted like bandits.
 
Back
Top