Help with owcleanup.sqf

SchwEde

OpenDayZ Rockstar!
Hey,

I'm trying to get storage-boxes on the server. So far with no results.

I'm trying to get an exception for the box in the owcleanup.sqf but i cant get the right form.

Code:
            if (((diag_tickTime - _lastItemCheck) > 450)) then
            {
                _lastItemCheck = diag_tickTime;
                private ["_delQty","_keep","_nearby","_myGroupX","_delQtyAnimalR","_delQtyAnimal","_xtypeanimal","_missionObjs","_qty","_animaltype"];
 
                //Server Cleanup
                _missionObjs = allMissionObjects "ReammoBox";
                _qty = count _missionObjs;
                {
                    if ((local _x) or (_qty > 750)) then {
                        _keep = _x getVariable ["permaLoot",false];
                                _nearby = {isPlayer _x} count (_x nearEntities [["CAManBase"], 100]);
                        if ( (!_keep) && (_nearby==0)) then {
                            deleteVehicle _x;
                            _x = nil;
                        };
                    };
                } forEach _missionObjs;
            };

I've tried it with this line and many more but without any results:
Code:
if ( (!_keep) && (_nearby==0) && (typeOf vehicle _x) != ""USBasicAmmunitionBox_EP1"" ) then {

Hope one of you guys can help me :)
 
Code:
                        _keep = _x getVariable ["permaLoot",false];
change to:
Code:
                        _keep = _x getVariable ["permaLoot",true];
 
Have you tried adding them through the 3d editor then uploading SQF to mission PBO?

example (just a theory, untested):

Use the 3d editor to place your weapon/ammo crates...then save...

Navigate in Windows Explorer to your saves...

Mine are here...yours may be similiar: \Documents\ArmA 2 Other Profiles\ProfileNameHere\missions

I saved my 3d map edit with the crates as WeaponCrates...so now I open it. 2 files inside the folder, mission.biedi and mission.sqf

mission.sqf has the code for where you placed the crates. I placed mine near Devils Castle for this example.

My mission.sqf looks like this:

activateAddons [
"vilas_wwp_co"
];

activateAddons ["vilas_wwp_co"];
initAmbientLife;

_this = createCenter west;
_center_0 = _this;

_group_0 = createGroup _center_0;

_unit_0 = objNull;
if (true) then
{
_this = _group_0 createUnit ["Survivor3_DZ", [6856.0015, 11488.218, 3.0517578e-005], [], 0, "CAN_COLLIDE"];
_unit_0 = _this;
_this setUnitAbility 0.60000002;
if (true) then {_group_0 selectLeader _this;};
if (true) then {selectPlayer _this;};
if (true) then {setPlayable _this;};
};

_vehicle_0 = objNull;
if (true) then
{
_this = createVehicle ["USBasicWeaponsBox", [6856.228, 11492.099, -3.0517578e-005], [], 0, "CAN_COLLIDE"];
_vehicle_0 = _this;
_this setPos [6856.228, 11492.099, -3.0517578e-005];
};

_vehicle_1 = objNull;
if (true) then
{
_this = createVehicle ["vil_eu_weaponsbox", [6896.0815, 11478.856, 9.1552734e-005], [], 0, "CAN_COLLIDE"];
_vehicle_1 = _this;
_this setPos [6896.0815, 11478.856, 9.1552734e-005];
};

_vehicle_2 = objNull;
if (true) then
{
_this = createVehicle ["vil_US_weaponsboxnew", [6988.2505, 11511.87, 0.00033569336], [], 0, "CAN_COLLIDE"];
_vehicle_2 = _this;
_this setDir -32.223537;
_this setPos [6988.2505, 11511.87, 0.00033569336];
};

processInitCommands;
runInitScript;
finishMissionInit;

We need to remove some stuff and add some lines of code....

Remove:
activateAddons [
"vilas_wwp_co"
];

activateAddons ["vilas_wwp_co"];
initAmbientLife;

_this = createCenter west;
_center_0 = _this;

_group_0 = createGroup _center_0;

_unit_0 = objNull;
if (true) then
{
_this = _group_0 createUnit ["Survivor3_DZ", [6856.0015, 11488.218, 3.0517578e-005], [], 0, "CAN_COLLIDE"];
_unit_0 = _this;
_this setUnitAbility 0.60000002;
if (true) then {_group_0 selectLeader _this;};
if (true) then {selectPlayer _this;};
if (true) then {setPlayable _this;};
};

and remove:
processInitCommands;
runInitScript;
finishMissionInit;

Once all that is removed, go back to the top and add:

if (isServer) then {
and at the very bottom on the last line add:

After that you'll need to put this SQF file into a custom folder in your mission PBO.

Next, open your init.sqf, and at the bottom add:
[] execVM "Custom\WeaponCrate.sqf";

______________________________

The WeaponCrate.sqf should look like this when you put it in a custom folder:
if (isServer) then {

_vehicle_0 = objNull;
if (true) then
{
_this = createVehicle ["USBasicWeaponsBox", [6856.228, 11492.099, -3.0517578e-005], [], 0, "CAN_COLLIDE"];
_vehicle_0 = _this;
_this setPos [6856.228, 11492.099, -3.0517578e-005];
};

_vehicle_1 = objNull;
if (true) then
{
_this = createVehicle ["vil_eu_weaponsbox", [6896.0815, 11478.856, 9.1552734e-005], [], 0, "CAN_COLLIDE"];
_vehicle_1 = _this;
_this setPos [6896.0815, 11478.856, 9.1552734e-005];
};

_vehicle_2 = objNull;
if (true) then
{
_this = createVehicle ["vil_US_weaponsboxnew", [6988.2505, 11511.87, 0.00033569336], [], 0, "CAN_COLLIDE"];
_vehicle_2 = _this;
_this setDir -32.223537;
_this setPos [6988.2505, 11511.87, 0.00033569336];
};
};

Not sure if this will work, but in theory, it should. Depends on if the cleanup file(s) will delete the boxes...I haven't tried it this way, but I am curious if it will work.

Sorry for the long example. Someone may be able to explain it better or have a no-hassle way of making your request work.

You may even be able to replace the "vil_US_weaponsboxnew" with "USBasicAmmunitionBox_EP1" in order to get the storage boxes to work.
 
I have them spawned in my mission.sqm, the problem is I have got them working on my vanilla DayZ server. but it's using the cleanup.fsm and it's working the way like I posted it in the first post. If I do it this way on the owcleanup.sqf I'm getting the requesting authentication error
 
Have you tried commenting out the lines for the owcleanup? owcleanup ISN'T a must have. The 2.5 update is royally screwed up, and the owcleanup being one of the files that is royally screwed up. I'd try just using the server_cleanuop.fsm and comment out the lines that execute the owcleanup.fsm and see if that makes a difference.
 
ok I will try that and tell the results :)
oh and I'm using 0.2.4

I've added a couple crates a whiles ago (I've since removed them) and it seems that no matter what, after som eodd minutes the crates timeout/despawn/dissappear. However on every restart the crates would appear where they were placed, but like before, they just dissappear after a short time. This is one trick I haven't solved yet either. Not a big deal, but I would just like empty crates for storing items. Just can't get it working 100%.
 
This project was for a friend, but somehow i got this managed. I will try to give you the way how i did this :)
 
Back
Top