33 RegisterNetSyncVariableInt(
"m_CurrentOpticMode", 0, 63);
178 if (!
GetGame().IsDedicatedServer())
184 if (!
GetGame().IsDedicatedServer())
190 if (GetCompEM() && GetCompEM().CanWork())
220 player.SetReturnToOptics(
false);
249 if (!
super.OnStoreLoad(
ctx, version))
271 super.OnVariablesSynchronized();
282 string path =
"cfgVehicles " +
GetType() +
" OpticsInfo";
288 if (
GetGame().ConfigIsExisting(
path +
" opticSightTexture"))
294 if (
GetGame().ConfigIsExisting(
path +
" opticSightMaterial"))
306 if (
GetGame().IsDedicatedServer())
346 string path =
"cfgVehicles " +
GetType() +
" OpticsInfo";
362 string path =
"cfgVehicles " +
GetType() +
" OpticsInfo";
370 string path =
"cfgVehicles " +
GetType() +
" OpticsInfo";
371 if (
GetGame().ConfigIsExisting(
path +
" nearPlaneDistanceOverride"))
380 if (
GetGame().ConfigIsExisting(
"cfgVehicles " +
GetType() +
" OpticsInfo PPDOFProperties"))
382 GetGame().ConfigGetFloatArray(
"cfgVehicles " +
GetType() +
" OpticsInfo PPDOFProperties", temp_array);
385 else if (
GetGame().ConfigIsExisting(
"cfgVehicles " +
GetType() +
" OpticsInfoWeaponOverride PPDOFProperties"))
387 GetGame().ConfigGetFloatArray(
"cfgVehicles " +
GetType() +
" OpticsInfoWeaponOverride PPDOFProperties", temp_array);
475 string path =
"cfgVehicles " +
GetType() +
" OpticsInfo preloadOpticType";
501 GetInventory().CreateAttachment(
"Battery9V");
eBleedingSourceType GetType()
void AddAction(typename actionName)
void DayZPlayerCameraOptics(DayZPlayer pPlayer, HumanInputController pInput)
override void SetTakeable(bool pState)
Super root of all classes in Enforce script.
this is main camera class
proto native bool SetStepZeroing(int step)
void OnOpticModeChange()
optic-specific behaviour to be defined here (override)
proto native bool IsUsingWeaponIronsightsOverride()
is optics using ironsights override settings or not
proto native float GetZeroingDistanceZoomMax()
Gets Zeroing distance at opticsZoomMax.
void InitOpticsPP(out array< float > mask_array, out array< float > lens_array, out float blur_float)
initializes values for optics' post-processes
proto native float GetZeroingDistanceZoomMin()
Gets Zeroing distance at opticsZoomMin.
proto native bool ExitOptics()
switches out of optics mode (if possible)
override void OnDebugSpawn()
proto native bool StepFOVDown()
sets zoom to previous (respective to current) defined value in zoom fov config array
proto native float GetZoomInit()
gets FOV value, when entering optics
int m_CurrentOpticModeLocal
override void OnWorkStart()
int GetCurrentOpticMode()
ref array< float > GetOpticsPPLens()
bool m_reddot_displayed bool m_isNVOptic
override void OnStoreSave(ParamsWriteContext ctx)
proto native bool EnterOptics()
switches to optics mode if possible
bool AllowsDOF()
returns 'true' for non-magnifying optics
proto native int GetStepZeroing()
returns position of currently used value in zeroing config array
ref array< float > GetOpticsPPMask()
proto native float GetZoomMin()
gets FOV minimum
proto native bool IsInOptics()
is weapon in optics mode or not
float GetNearPlaneValue()
proto native bool UseWeaponIronsightsOverride(bool state)
switches into ironsights override settings
proto native bool SetStepFOVIndex(int step)
sets zoom to fov value defined at given in 'discretefov' config array
ref array< float > m_mask_array
override void ShowSelection(string selection_name)
void UpdateOpticsReddotVisibility()
proto native float GetZoomMax()
gets FOV maximum
proto native void SetZeroingClampDist(float dist)
Sets zeroing clamp for the optics and updates the clamp if dist > 0. Used when attached to weapon.
proto native float GetCurrentStepFOV()
returns fov value at current index, or 'OpticsInfo.opticsZoomInit' config value (non-zooming optics)
void UpdateSelectionVisibility()
override void HideSelection(string selection_name)
bool InitDOFAvailability()
optics with more than 1x zoom do not allow DOF changes
override void OnVariablesSynchronized()
override void SetActions()
ref array< float > m_OpticsDOFProperties
bool InitOpticsDOFProperties(out array< float > temp_array)
Initializes DOF properties for optic's alternate ironsights (ACOG etc.)
proto native void GetCameraPoint(out vector pos, out vector dir)
gets camera position & direction in model space of optics entity
ref array< float > GetOpticsDOF()
void SetCurrentOpticMode(int mode)
proto native bool StepZeroingDown()
sets zeroing to previous (respective to current) defined value in zeroing config array
proto native int GetStepFOVIndex()
returns index of currently used value in 'discretefov' config array
override void OnWasAttached(EntityAI parent, int slot_id)
string m_optic_sight_material
override void OnInventoryExit(Man player)
float m_nearplane_override
void InitCameraOverrideProperties()
void ShowReddot(bool state)
proto native bool HasWeaponIronsightsOverride()
is weapon in optics mode or not
proto native bool StepZeroingUp()
sets zeroing to next defined (respective to current) value in zeroing config array
ref array< float > m_lens_array
proto native int GetStepFOVCount()
returns number of configured steps
proto native bool StepFOVUp()
sets zoom to next defined (respective to current) value in zoom fov config array
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWorkStop()
string m_optic_sight_texture
override void OnWasDetached(EntityAI parent, int slot_id)
Serialization general interface. Serializer API works with:
script counterpart to engine's class Weapon
proto native CGame GetGame()
const float DZPLAYER_CAMERA_FOV_IRONSIGHTS
const int OPTICS_STATE_DAY
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto float Max(float x, float y)
Returns bigger of two given values.