mirror of
https://github.com/Ignatz-HeMan/Ignatz_Tools.git
synced 2024-08-30 16:12:11 +00:00
Added DoorOpener
This commit is contained in:
parent
9056c66021
commit
e7ee94d87e
14
CfgActionMenu_self.hpp
Normal file
14
CfgActionMenu_self.hpp
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
class Ignatz_DoorOpener
|
||||||
|
{
|
||||||
|
condition = "if (dyna_AtHome && dyna_IsDriver) then {['opencheck'] call Ignatz_Client_DoorOpener} else {false};";
|
||||||
|
action = "['open'] call Ignatz_Client_DoorOpener;";
|
||||||
|
icon = "addons\pics\Actions\Gate_Open.paa";
|
||||||
|
tooltip = "Open Gate";
|
||||||
|
};
|
||||||
|
class Ignatz_DoorCloser
|
||||||
|
{
|
||||||
|
condition = "if (dyna_AtHome && dyna_IsDriver) then {['closecheck'] call Ignatz_Client_DoorOpener} else {false};";
|
||||||
|
action = "['close'] call Ignatz_Client_DoorOpener;";
|
||||||
|
icon = "addons\pics\Actions\Gate_Close.paa";
|
||||||
|
tooltip = "Close Gate";
|
||||||
|
};
|
10
README.md
10
README.md
@ -1,8 +1,12 @@
|
|||||||
# Ignatz_Tools
|
# Ignatz_Tools for Arma3-EpochMod
|
||||||
- Earplugs<br/>
|
- Earplugs<br/>
|
||||||
- StatusBar<br/>
|
- StatusBar<br/>
|
||||||
- Autorestart<br/>
|
- Autorestart<br/>
|
||||||
Put your servercomandpassword in @epochhive\addons\ignatz_server\config.cpp<br/>
|
- Autmatic Door Opener<br/>
|
||||||
All other Settings are in Epoch.Mission\ignatz_config.hpp<br/>
|
|
||||||
|
- copy the files from epoch.mission into your mission file (if init.sqf already exist, paste the code into this file)<br/>
|
||||||
|
- Add the following lines from CfgActionMenu_self.hpp into this file: "epoch.mission\epoch_config\Configs\CfgActionMenu\CfgActionMenu_self.hpp"<br/>
|
||||||
|
- Put your servercomandpassword in @epochhive\addons\ignatz_server\config.cpp<br/>
|
||||||
|
- All other Settings are in Epoch.Mission\ignatz_config.hpp<br/>
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,6 +11,17 @@ class Ignatz_config {
|
|||||||
Statusbar_UseKeybind = "true"; /* Use SwitchKey to switch between different Status Bars */
|
Statusbar_UseKeybind = "true"; /* Use SwitchKey to switch between different Status Bars */
|
||||||
Statusbar_Keybind = 0x36; /* Key to switch between the Status Bars (right shift key) full list: https://community.bistudio.com/wiki/DIK_KeyCodes */
|
Statusbar_Keybind = 0x36; /* Key to switch between the Status Bars (right shift key) full list: https://community.bistudio.com/wiki/DIK_KeyCodes */
|
||||||
|
|
||||||
|
// DoorOpener
|
||||||
|
OpenableObjets[] = { /* Array with Objects handled by the DoorOpener */
|
||||||
|
"CinderWallGarage_EPOCH"
|
||||||
|
};
|
||||||
|
WorkingVehicleTypes[] = {"LandVehicle"}; /* Array with VehicleTypes inside Players can use the Opener */
|
||||||
|
NeededItems[] = {
|
||||||
|
{1,"CircuitParts","true"}, /* [count,"itemclass",RemoveOnUse] */
|
||||||
|
{250,"Energy","true"} /* [count,"itemclass",RemoveOnUse] */
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// Restart
|
// Restart
|
||||||
FirstRestartOnDay = 0; /* On which time the Server will restart the first time (0 = 00:00 / 2 = 02:00 ...). Only full hour restarts are supported */
|
FirstRestartOnDay = 0; /* On which time the Server will restart the first time (0 = 00:00 / 2 = 02:00 ...). Only full hour restarts are supported */
|
||||||
Restart_Intervall = 3; /* in hours */
|
Restart_Intervall = 3; /* in hours */
|
||||||
|
89
epoch.Mission/addons/Ignatz_Client_DoorOpener.sqf
Normal file
89
epoch.Mission/addons/Ignatz_Client_DoorOpener.sqf
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
_config = getmissionconfig 'Ignatz_config';
|
||||||
|
_OpenableObjets = (getArray (_config >> "OpenableObjets"));
|
||||||
|
_WorkingVehicleTypes = (getArray (_config >> "WorkingVehicleTypes"));
|
||||||
|
_NeededItems = [];
|
||||||
|
{
|
||||||
|
_x params ["_count","_item","_DoRemove"];
|
||||||
|
if ((tolower _DoRemove) isequalto "true") then {_DoRemove = true} else {_DoRemove = false};
|
||||||
|
_NeededItems pushback [_count,_item,_DoRemove];
|
||||||
|
} foreach (getArray (_config >> "NeededItems"));
|
||||||
|
|
||||||
|
params [["_do",'close']];
|
||||||
|
if ((player == vehicle player) || !(player == (driver (vehicle player)))) exitwith {false};
|
||||||
|
if !({(vehicle player) iskindof _x} count _WorkingVehicleTypes > 0) exitwith {false};
|
||||||
|
_config = 'CfgEpochClient' call EPOCH_returnConfig;
|
||||||
|
_buildingJammerRange = getNumber(_config >> "buildingJammerRange");
|
||||||
|
_value = 0;
|
||||||
|
_lockvalue = 1;
|
||||||
|
_nearjammers = nearestobjects [player,["Plotpole_EPOCH"],_buildingJammerRange];
|
||||||
|
if (_nearjammers isEqualTo []) exitwith {false};
|
||||||
|
_nearestJammer = _nearjammers select 0;
|
||||||
|
if !((_nearestJammer getVariable["BUILD_OWNER", "-1"]) in[getPlayerUID player, Epoch_my_GroupUID]) exitwith {false};
|
||||||
|
_NearestDoors = [];
|
||||||
|
_fnc_CheckDoorsToOpen = {
|
||||||
|
_NearestDoors = (nearestobjects [_nearestJammer,_OpenableObjets,_buildingJammerRange]) select {
|
||||||
|
([_x, "VIEW",vehicle player] checkVisibility [eyePos player, [(getposasl _x select 0),(getposasl _x select 1),(getposasl _x select 2) + 1.5]]) > 0.5 && (
|
||||||
|
_x animationPhase "open_left" < 0.5 && _x animationPhase "open_right" < 0.5 && _x animationPhase "Door_1_rot" < 0.5 && _x animationPhase "Open_Door" < 0.5)
|
||||||
|
};
|
||||||
|
_NearestDoors
|
||||||
|
};
|
||||||
|
_fnc_CheckDoorsToClose = {
|
||||||
|
_NearestDoors = (nearestobjects [_nearestJammer,_OpenableObjets,_buildingJammerRange]) select {
|
||||||
|
([_x, "VIEW",vehicle player] checkVisibility [eyePos player, [(getposasl _x select 0),(getposasl _x select 1),(getposasl _x select 2) + 1.5]]) > 0.5 &&
|
||||||
|
(_x animationPhase "open_left" > 0.5 || _x animationPhase "open_right" > 0.5 || _x animationPhase "Door_1_rot" > 0.5 || _x animationPhase "Open_Door" > 0.5)
|
||||||
|
};
|
||||||
|
_NearestDoors
|
||||||
|
};
|
||||||
|
switch _do do {
|
||||||
|
case "opencheck";
|
||||||
|
case "open": {
|
||||||
|
_NearestDoors = call _fnc_CheckDoorsToOpen; _value = 1; _lockvalue = 0;
|
||||||
|
};
|
||||||
|
case "closecheck";
|
||||||
|
case "close": {
|
||||||
|
_NearestDoors = call _fnc_CheckDoorsToClose; _value = 0; _lockvalue = 1;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
if (_do in ["opencheck","closecheck"]) exitwith {!(_NearestDoors isequalto [])};
|
||||||
|
if (_NearestDoors isequalto []) exitwith {[format ["No Door found to %1",_do],5] call Epoch_Message;};
|
||||||
|
|
||||||
|
_missing = [];
|
||||||
|
{
|
||||||
|
_x params ["_count","_item"];
|
||||||
|
_has = 0;
|
||||||
|
if (_item isequalto "Energy") then {
|
||||||
|
_has = Epoch_PlayerEnergy;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
_has = {_x == _item} count ((magazines player)+(items player));
|
||||||
|
};
|
||||||
|
if (_has < _count) then {
|
||||||
|
_missing pushback [_count-_has,_item];
|
||||||
|
};
|
||||||
|
} foreach _NeededItems;
|
||||||
|
if !(_missing isequalto []) exitwith {
|
||||||
|
_Msg = 'Missing:';
|
||||||
|
{
|
||||||
|
_Msg = _Msg + format [' %1 %2,', _x select 0, (_x select 1) call EPOCH_itemDisplayName];
|
||||||
|
} foreach _missing;
|
||||||
|
[_Msg,5] call Epoch_Message;
|
||||||
|
};
|
||||||
|
{
|
||||||
|
_x params ["_count","_item","_remove"];
|
||||||
|
if (_remove) then {
|
||||||
|
if (_item isequalto "Energy") then {
|
||||||
|
["Energy",-_count] call Epoch_GiveAttributes;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
[player,_item,_count] call BIS_fnc_invRemove;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
} foreach _NeededItems;
|
||||||
|
_sorted = [_NearestDoors,[],{player distance _x},'ASCEND'] call BIS_fnc_sortBy;
|
||||||
|
_DoorToHandle = _sorted select 0;
|
||||||
|
_DoorToHandle animate ['open_left', _value];
|
||||||
|
_DoorToHandle animate ['open_right', _value];
|
||||||
|
_DoorToHandle animate ['Door_1_rot', _value];
|
||||||
|
_DoorToHandle animate ['Open_Door', _value];
|
||||||
|
_DoorToHandle animate ['lock_cGarage', _lockvalue];
|
||||||
|
_DoorToHandle animate ['lock_Door', _lockvalue];
|
BIN
epoch.Mission/addons/pics/Actions/Gate_Close.paa
Normal file
BIN
epoch.Mission/addons/pics/Actions/Gate_Close.paa
Normal file
Binary file not shown.
BIN
epoch.Mission/addons/pics/Actions/Gate_Open.paa
Normal file
BIN
epoch.Mission/addons/pics/Actions/Gate_Open.paa
Normal file
Binary file not shown.
@ -3,4 +3,5 @@
|
|||||||
if (hasInterface) then {
|
if (hasInterface) then {
|
||||||
[] execVM "addons\Ignatz_EarPlugs.sqf";
|
[] execVM "addons\Ignatz_EarPlugs.sqf";
|
||||||
[] execVM "addons\Ignatz_Statusbar.sqf";
|
[] execVM "addons\Ignatz_Statusbar.sqf";
|
||||||
|
Ignatz_Client_DoorOpener = compilefinal preprocessfilelinenumbers "addons\Ignatz_Client_DoorOpener.sqf";
|
||||||
};
|
};
|
Loading…
Reference in New Issue
Block a user