-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
187 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
z\afmf\addons\staticspawn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
class Extended_PreStart_EventHandlers { | ||
class ADDON { | ||
init = QUOTE(call COMPILE_FILE(XEH_preStart)); | ||
}; | ||
}; | ||
class Extended_PreInit_EventHandlers { | ||
class ADDON { | ||
init = QUOTE(call COMPILE_FILE(XEH_preInit)); | ||
}; | ||
}; | ||
class Extended_PostInit_EventHandlers { | ||
class ADDON { | ||
init = QUOTE(call COMPILE_FILE(XEH_postInit)); | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include "script_component.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
PREP(EH); | ||
PREP(hide); | ||
PREP(init); | ||
PREP(unhide); | ||
PREP(unhideConditionLoop); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include "script_component.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#include "script_component.hpp" | ||
ADDON = false; | ||
#include "XEH_PREP.hpp" | ||
ADDON = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#include "script_component.hpp" | ||
#include "XEH_PREP.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include "script_component.hpp" | ||
class CfgPatches { | ||
class ADDON { | ||
name = COMPONENT; | ||
units[] = {}; | ||
weapons[] = {}; | ||
requiredVersion = REQUIRED_VERSION; | ||
requiredAddons[] = {}; | ||
author = "Madin"; | ||
VERSION_CONFIG; | ||
}; | ||
}; | ||
|
||
|
||
#include "CfgEventHandlers.hpp" | ||
|
||
#include "CfgModuleCategories.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
params [["_unit", objNull], ["_suppressedTime", 30]]; | ||
|
||
// hide when fired at | ||
_unit addEventHandler ["Suppressed", { | ||
params ["_unit", "_distance", "_shooter", "_instigator", "_ammoObject", "_ammoClassName", "_ammoConfig"]; | ||
if !(local _unit) exitWith {}; | ||
if (_unit distance _shooter < 25 + random 25) exitWith {}; | ||
_unit lookAt _shooter; | ||
[_unit] call FUNC(Hide); | ||
|
||
_unit setVariable ["AF_suppressedTime", time + random _suppressedTime]; | ||
}]; | ||
|
||
// hide on reload | ||
_unit addEventHandler ["Fired", { | ||
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"]; | ||
if (_unit ammo _muzzle > 0) exitWith {}; | ||
[_unit] call FUNC(Hide); | ||
// [ | ||
// { | ||
// _this ammo currentWeapon _this > 0 | ||
// }, | ||
// { | ||
// _this call FUNC(Unhide); | ||
// }, | ||
// _unit, | ||
// 10 | ||
// ] call CBA_fnc_waitUntilAndExecute; | ||
}]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
params [["_unit", objNull]]; | ||
private _hidden = _unit getVariable ["AF_unitHidden", false]; | ||
if (_hidden) exitWith {}; | ||
|
||
private _unitPos = unitPos _unit; | ||
if (_unitPos isEqualTo "Down") exitWith {}; | ||
|
||
if (_unitPos isEqualTo "Middle") then { | ||
_unit playActionNow "PlayerProne"; | ||
_unit setUnitPos "Down"; | ||
_unit setVariable ["AF_unitStanceHide", _unitPos]; | ||
} else { | ||
_unit playActionNow "PlayerCrouch"; | ||
_unit setUnitPos "Middle"; | ||
// _unit setUnitPos "Down"; | ||
_unit setVariable ["AF_unitStanceHide", "Up"]; | ||
}; | ||
|
||
_unit setVariable ["AF_unitHidden", true]; | ||
|
||
private _suppressedTime = _unit getVariable ["AF_suppressedTime", 30]; | ||
|
||
[ | ||
{ | ||
_this call FUNC(unhideConditionLoop); | ||
}, | ||
_unit, | ||
random _suppressedTime max 2 | ||
] call CBA_fnc_waitAndExecute; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
params [["_unit", objNull], ["_suppressedTime", 30]]; | ||
_unit setVariable ["AF_suppressedTime", _suppressedTime]; | ||
|
||
// disable lambs | ||
_unit setVariable ["lambs_danger_disableAI", true]; | ||
if (isFormationLeader _unit) then { | ||
group _unit setVariable ["lambs_danger_disableGroupAI", true]; | ||
}; | ||
|
||
if (unitPos _unit == "Auto") then { | ||
_unit setUnitPos "Up"; | ||
}; | ||
|
||
[_unit, _suppressedTime] call FUNC(EH); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
params [["_unit", objNull]]; | ||
|
||
_unit setVariable ["AF_unitHidden", false]; | ||
private _unitPos = _unit getVariable ["AF_unitStanceHide", "Up"]; | ||
_unit setUnitPos _unitPos; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
params [["_unit", objNull]]; | ||
|
||
if !(alive _unit) exitWith {}; | ||
|
||
private _suppressedTime = _unit getVariable ["AF_suppressedTime", 30]; | ||
private _currentAmmo = _unit ammo currentWeapon _unit; | ||
|
||
if (time < _suppressedTime || _currentAmmo == 0) exitWith { | ||
[ | ||
{_this call FUNC(unhideConditionLoop)}, | ||
_this, | ||
0 | ||
] call CBA_fnc_waitAndExecute; | ||
}; | ||
_unit call AF_fnc_suppressUnhide; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#define COMPONENT staticspawn | ||
#include "\z\afmf\addons\main\script_mod.hpp" | ||
|
||
#define DEBUG_MODE_FULL | ||
#define DISABLE_COMPILE_CACHE | ||
|
||
#ifdef DEBUG_ENABLED_STATICSPAWN | ||
#define DEBUG_MODE_FULL | ||
#endif | ||
#ifdef DEBUG_SETTINGS_STATICSPAWN | ||
#define DEBUG_SETTINGS DEBUG_SETTINGS_STATICSPAWN | ||
#endif | ||
|
||
#include "\z\afmf\addons\main\script_macros.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project name="MAI_2"> | ||
<Key ID="STR_MAI_sphereSize"> | ||
<Original>Distance</Original> | ||
<Polish>Dystans</Polish> | ||
</Key> | ||
<Key ID="STR_MAI_sphereSizeShort"> | ||
<Original>The distance of checking the presence of players</Original> | ||
<Polish>Dystans sprawdzania obecności graczy</Polish> | ||
</Key> | ||
<Key ID="STR_MAI_sphereDespawnDistance"> | ||
<Original>Despawn distance</Original> | ||
<Polish>Dystans despawnu</Polish> | ||
</Key> | ||
<Key ID="STR_MAI_sphereDespawnDistanceShort"> | ||
<Original>The distance of checking the presence of players above which units will be removed. Added to spawn value.</Original> | ||
<Polish>Dystans sprawdzania obecności graczy powyżej którego jednostki zostaną usunięte. Dodane do wartości spawnu.</Polish> | ||
</Key> | ||
<Key ID="STR_MAI_checkVisibility"> | ||
<Original>Visibility check</Original> | ||
<Polish>Sprawdzanie widoczności</Polish> | ||
</Key> | ||
<Key ID="STR_MAI_checkVisibilityShort"> | ||
<Original>Unactive</Original> | ||
<Polish>Nieaktywne</Polish> | ||
</Key> | ||
<Key ID="STR_MAI_sphereBackDistance"> | ||
<Original>Offset checking</Original> | ||
<Polish>Przsunięcie sprawdzania</Polish> | ||
</Key> | ||
<Key ID="STR_MAI_sphereBackDistanceShort"> | ||
<Original>How far back will players be checked.</Original> | ||
<Polish>Jak daleko do tyłu będzie sprawdzane obecność graczy.</Polish> | ||
</Key> | ||
</Project> |