Jump to content
  • 0

Origins buildables into epoch


LunchboxCharlie

Question

Well Andrew_S90 and I have been working on the base buildings to be brought into origins and we're about 85% done. We are hitting a snag with strongholds. As of right now, if you place a stronghold, it will supply a randomly generated code for an unlock. The person who built the structure can open and close it freely, however, a person when they place in the randomly generated code, will not unlock the structure. So we're at a bit if a snag. What are we missing here? This is the code we are using thus far (Andrew_S90 edited the safe unlock script from epoch): 
 
if((typeOf cursorTarget == "krepost") && (player distance cursorTarget < 23)) then {
        if (s_player_unlockstronghold < 0) then {
            if((typeOf cursorTarget == "krepost") then {
                if ((cursorTarget getVariable ["CharacterID","0"] == dayz_combination) or (cursorTarget getVariable ["CharacterID","0"] == dayz_playerUID)) then {
                _sCombo = player addAction [format[ "Open %1",getText (configFile >> "CfgVehicles" >> typeOf cursorTarget >> "displayName")], "custom\build\stronghold\s_open.sqf",cursorTarget, 0, false, true];
                s_player_str set [count s_player_str,_sCombo];
            } else {
                _sCombo = player addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "custom\build\stronghold\s_unlock.sqf",_cursorTarget, 0, false, true, "",""];
                s_player_str set [count s_player_str,_sCombo];
            };
            s_player_unlockstronghold = 1;
        } else {
            if((cursorTarget getVariable ["CharacterID","0"] != dayz_combination) or (cursorTarget getVariable ["CharacterID","0"] != dayz_playerUID)) then {
                    _sCombo = player addAction [localize "STR_EPOCH_ACTIONS_RECOMBO", "custom\build\stronghold\s_unlock.sqf",_cursorTarget, 0, false, true, "",""];
                    s_player_str set [count s_player_str,_sCombo];
                    s_player_unlockstronghold = 1;
                };
            };
        };
    } else {
        {player removeAction _x} count s_player_str;s_player_str = [];
        player removeAction s_player_unlockstronghold;
        s_player_unlockstronghold = -1;
        player removeAction _sCombo;
        _sCombo -1;
};

s_unlock.sqf

private ["_ok"];
 
if(DZE_ActionInProgress) exitWith { cutText [(localize "STR_EPOCH_PLAYER_21") , "PLAIN DOWN"]; };
DZE_ActionInProgress = true;
 
dayz_selectedVault = _this select 3;
dayz_combination = "";
 
 
if((typeOf cursorTarget == "krepost") and (player distance cursorTarget < 23)) then {
_ok = createdialog "SafeKeyPad";
} else {
_ok = createdialog "KeypadUI";
};
 
 
DZE_ActionInProgress = false;

s_open.sqf

// our target
_building = cursorTarget;
 
sleep 1;
titleText ["Opening..", "PLAIN DOWN"];
titleFadeOut 5;
 
_building say ["origins_door_heavy"];
_building animate ["vrata", 1];
_building animate ["hride1", 1];
_building animate ["kolo1", 1];
_building animate ["vaha", 1];
_building animate ["kolo2", 1];
Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Your action has a formatting error. You have an IF without a closing bracket. Let me give you the visual.

if((typeOf cursorTarget == "krepost") && (player distance cursorTarget < 23)) then {
    if (s_player_unlockstronghold < 0) then {
        if((typeOf cursorTarget == "krepost") then {
            if ((cursorTarget getVariable ["CharacterID","0"] == dayz_combination) or (cursorTarget getVariable ["CharacterID","0"] == dayz_playerUID)) then {
                _sCombo = player addAction [format[ "Open %1",getText (configFile >> "CfgVehicles" >> typeOf cursorTarget >> "displayName")], "custom\build\stronghold\s_open.sqf",cursorTarget, 0, false, true];
                s_player_str set [count s_player_str,_sCombo];
            } else {
                _sCombo = player addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "custom\build\stronghold\s_unlock.sqf",_cursorTarget, 0, false, true, "",""];
                s_player_str set [count s_player_str,_sCombo];
            };
            s_player_unlockstronghold = 1;
        } else {
            if ((cursorTarget getVariable ["CharacterID","0"] != dayz_combination) or (cursorTarget getVariable ["CharacterID","0"] != dayz_playerUID)) then {
                _sCombo = player addAction [localize "STR_EPOCH_ACTIONS_RECOMBO", "custom\build\stronghold\s_unlock.sqf",_cursorTarget, 0, false, true, "",""];
                s_player_str set [count s_player_str,_sCombo];
                s_player_unlockstronghold = 1;
                //}; <-----
            };
        };
    } else {
        {player removeAction _x} count s_player_str;
        s_player_str = [];
        player removeAction s_player_unlockstronghold;
        s_player_unlockstronghold = -1;
        player removeAction _sCombo;
        _sCombo -1;
    };
}; // <---
Link to comment
Share on other sites

  • 0

You coding looks a lot like epoch's safe unlock script. That's where it came from.

 

You admit it then, the plan was to make the stronghold work like a safe.

On my server i have this working 100%, you seem to be using an older version of my fn_selfactions code.

 

the other files are my coding.

 

if you plan to release it for your epoch Origins pack, then i would like atleast some credits.

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

×
×
  • Create New...