Jump to content

0.3.6 Safes & Lockboxes - Cannot always open


ReDBaroN

Recommended Posts

Hi, since the 0.3.6 update, accessing safes and lockboxes seems to be random. Running version 0.3.6.024

Sometimes you can, sometimes you can't. When you can't, you only get the examine option which does nothing.

Can't seem to work out the difference between when it works or not. have tried unlocking everything around etc. Doesn't seem to make a difference.

Link to comment
Share on other sites

25 minutes ago, kk4pi said:

last server update:

[Changed] Disable simulation of locked storage devices. This also prevents removal of items until device is unlocked/re-simulated.

 

in 

a3_epoch_server\compile\epoch_vehicle\EPOCH_load_storage.sqf

Ligne 112 > _vehicle enableSimulationGlobal true;

 

 

well spotted, no doubt something to do with the issue....

Seems odd but, some players, including me say that running off some considerable distance, looting and returning and they get the ability to open them again. But, other players say that's not working for them.

Did you remove this line? has it worked for you?

Link to comment
Share on other sites

From the sounds of it it could simply be the addition of enableSimulationGlobal false on these objects at first spawn. However that was added with 0.3.5.055 server build.

I have commented out these lines and repacked the pbo found here:https://github.com/EpochModTeam/Epoch/blob/experimental/Server_Install_Pack/@epochhive/addons/a3_epoch_server.pbo?raw=true

Please give this a test and let me know if that does anything.

Thanks!

Link to comment
Share on other sites

3 hours ago, vbawol said:

From the sounds of it it could simply be the addition of enableSimulationGlobal false on these objects at first spawn. However that was added with 0.3.5.055 server build.

I have commented out these lines and repacked the pbo found here:https://github.com/EpochModTeam/Epoch/blob/experimental/Server_Install_Pack/@epochhive/addons/a3_epoch_server.pbo?raw=true

Please give this a test and let me know if that does anything.

Thanks!

This fixed it.  @vbawl for the win!

Link to comment
Share on other sites

6 hours ago, vbawol said:

From the sounds of it it could simply be the addition of enableSimulationGlobal false on these objects at first spawn. However that was added with 0.3.5.055 server build.

I have commented out these lines and repacked the pbo found here:https://github.com/EpochModTeam/Epoch/blob/experimental/Server_Install_Pack/@epochhive/addons/a3_epoch_server.pbo?raw=true

Please give this a test and let me know if that does anything.

Thanks!

Thanks. This fixed it for me too! 

Link to comment
Share on other sites

in our last EPOCH_load_storage.sqf was "_vehicle enablesimulationGlobal false" already integrated and it worked.

Now, after update to 0.3.6, the EPOCH_load_storage.sqf is exacly the same then before, but we have also the Problems, that Safes / Lockboxes have sometime no cursortarget.

So it can't be only a problem with enablesimulationglobal.

Any Idea, why there is sometimes no cursortarget for safes / lockboxes?

Link to comment
Share on other sites

Enable simulation. To fix the bug with the glitch that you can look inside when its locked use this here in client init.

[] spawn {
    disableSerialization;

    while { true } do {
        waitUntil { !isNull findDisplay 602 };
        _open = 0;
        _near = 0;
        {
            _near = _near + 1;
            if !(_x getVariable ['EPOCH_Locked', true]) then {
                _open = _open + 1;
            };
        } forEach (nearestObjects[player,['Safe_EPOCH','Lockbox_EPOCH'],4]);
        if (_near > 0 && _open == 0) then {
            ((findDisplay 602) displayCtrl 6401) ctrlSetPosition [-9999 * safeZoneW,-9999 * SafeZoneH,0,0];
            ((findDisplay 602) displayCtrl 6401) ctrlCommit 0;
            ctrlSetFocus ((findDisplay 602) displayCtrl 6321);
            ctrlActivate ((findDisplay 602) displayCtrl 6321);
        };
        waitUntil { isNull findDisplay 602 };            
    };
};

Link to comment
Share on other sites

Works great, but Shelfes / Workbenches next to locked Safes / Lockboxes can't be accessed.

For that, you can modify it as follow:

[] spawn {
    disableSerialization;
    while {true} do {
        waitUntil {!isNull findDisplay 602};
        if (cursortarget iskindof "WeaponHolderSimulated" || cursortarget iskindof "GroundWeaponHolder" || isnull cursortarget) then {
            _open = 0;
            _near = 0;
            { 
                _near = _near + 1;
                if !(_x getVariable ['EPOCH_Locked', true]) then { 
                    _open = _open + 1;
                }; 
            } forEach (nearestObjects[player,['Safe_EPOCH','Lockbox_EPOCH'],4]);
            if (_near > 0 && _open == 0) then {
                ((findDisplay 602) displayCtrl 6401) ctrlSetPosition [-9999 * safeZoneW,-9999 * SafeZoneH,0,0];
                ((findDisplay 602) displayCtrl 6401) ctrlCommit 0;
                ctrlSetFocus ((findDisplay 602) displayCtrl 6321);
                ctrlActivate ((findDisplay 602) displayCtrl 6321);
            };
        };
        waitUntil {isNull findDisplay 602};
    };
};
 

Link to comment
Share on other sites

Still doesnt work , with he mans one either unless i did something wrong, i have it in the init and if a shelf is right next to a safe you cant access it if the safe is locked once you unlock the safe the shelf is able to be access

 

UPDATE<> ok i fixed it this call in the code needs to be changed <> } forEach (nearestObjects[player,['Safe_EPOCH','Lockbox_EPOCH'],4]);< The 4 needs to be changed to 1

Link to comment
Share on other sites

11 hours ago, viper179 said:

Still doesnt work , with he mans one either unless i did something wrong, i have it in the init and if a shelf is right next to a safe you cant access it if the safe is locked once you unlock the safe the shelf is able to be access

 

UPDATE<> ok i fixed it this call in the code needs to be changed <> } forEach (nearestObjects[player,['Safe_EPOCH','Lockbox_EPOCH'],4]);< The 4 needs to be changed to 1

By changing it to 1, the glitching-bug will stay!

4m is correct, but the shelf must be in cursortarget to become access!

Link to comment
Share on other sites

That workaround He-man posted should work but is also adding another endless loop to the scheduler. Ideally it should be event driven, and to do that properly we need to get BI to extend the InventoryOpened event handler to also return other connected containers. Please Vote this up: http://feedback.arma3.com/view.php?id=23192

But in the mean time I will figure something out as I would prefer not to use the old method that was using setpos as it was often very slow for detecting cursorTarget changes. 

The Epoch AH already has a temp workaround that checks for nearby locked supplies however its not working well so here is another take on it. This solution is mostly event driven but does have to use spawn and waituntil so its not perfect. This is sort of a hybrid from what has been shared by He-man in this thread. 

New security_checks.h line:

InventoryOpened = "_this spawn EPOCH_initUI;_container = _this select 1;_lockedNear = false;if (_container isKindOf 'GroundWeaponHolder') then {{if (locked _x in [2, 3] ||_x getVariable['EPOCH_Locked', false]) exitWith {_lockedNear = true}} forEach (player nearSupplies 10);};if (locked _container in [2, 3] || _container getVariable['EPOCH_Locked', false] || _lockedNear) then {[] spawn {disableSerialization;waitUntil {!isNull findDisplay 602};_display = findDisplay 602;_ctrl_cargo = _display displayCtrl 6401;_ctrl_ground = _display displayCtrl 6321;_ctrl_cargo ctrlEnable  false;ctrlSetFocus _ctrl_ground;ctrlActivate _ctrl_ground;};};";

I have also updated the server settings pbo found here: https://github.com/EpochModTeam/Epoch/blob/f196d8461fd014820499b224b7157bc3a929cb12/Server_Install_Pack/@epochhive/addons/a3_epoch_server_settings.pbo?raw=true

The idea here is to use event handlers as we have before and simply detect if access to a container should be blocked. If so, we force the player to the ground inventory tab and disable the cargo tab. 

Please give this a test and report back, Thanks!

Link to comment
Share on other sites

19 minutes ago, vbawol said:

Make sure you are testing it without admin and you are using the Epoch AH. Whatever proves to work good will become a part of the main gamemode code in the next update.

Ahh, thanks for the reminder. Yes, now the crate tab is disabled correctly. 

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

×
×
  • Create New...