48 int m_dbgAttemptCount = 0;
55 RegisterNetSyncVariableBool(
"m_IsActive");
56 RegisterNetSyncVariableBool(
"m_IsDeployed");
57 RegisterNetSyncVariableInt(
"m_YieldItemIdx");
101 super.OnStoreSave( ctx );
112 if ( !super.OnStoreLoad(ctx, version) )
117 bool b_is_active =
false;
118 if ( !ctx.
Read( b_is_active ) )
121 bool b_is_in_progress =
false;
124 if ( !ctx.
Read( b_is_in_progress ) )
125 b_is_in_progress =
false;
128 bool b_is_deployed =
false;
129 if ( !ctx.
Read( b_is_deployed ) )
130 b_is_deployed =
false;
135 if (ctx.
Read(enviroMask))
154 super.OnVariablesSynchronized();
178 if ( newState ==
true )
218 if ( GetHierarchyRootPlayer() && GetHierarchyRootPlayer().CanDropEntity(
this ) )
231 vector trapPos = player.GetPosition() + ( player.GetDirection() * 0.5 );
243 if (MemoryPointExists(
"Prey_Position"))
244 m_PreyPos = ModelToWorld(GetMemoryPointPos(
"Prey_Position"));
280 super.CanPutInCargo( parent );
286 super.CanPutIntoHands( parent );
297 m_dbgAttemptCount = 0;
324 m_Timer.Run(duration,
this, fnName);
479 bool success =
false;
490 Print(
"dbgTrapz | success!!!");
491 Print(
"---------------------");
521 Debug.
Log(
"CE not enabled, player avoidance not available!");
647 super.OnItemLocationChanged( old_owner, new_owner );
656 else if ( old_owner == NULL && new_owner != NULL )
688 super.CanDisplayAttachmentSlot( slot_id );
694 super.CanReceiveAttachment( attachment, slotId );
700 super.EEItemAttached( item, slot_name );
713 super.EEItemDetached( item, slot_name );
756 int count = GetInventory().AttachmentCount();
760 for (
int i = 0; i < count; i++)
762 att = GetInventory().GetAttachmentFromIndex(i);
774 super.OnPlacementComplete(player, position, orientation);
778 vector rotation_matrix[3];
785 if (GetInventory().GetCurrentInventoryLocation(source))
787 destination.
SetGroundEx(
this, position, direction);
790 player.ServerTakeToDst(source, destination);
795 PlayerBase.Cast(player).GetDayZPlayerInventory().RedirectToHandEvent(
InventoryMode.LOCAL, source, destination);
812 GetInventory().GetCurrentInventoryLocation(loc);
817 vector player_pos = player.GetPosition();
818 vector aim_pos = player.GetAimPosition();
848 const string m_PlaceableWaterType
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
ActionActivateTrapCB ActionContinuousBaseCB ActionActivateTrap()
ref NoiseParams m_NoisePar
void AddAction(typename actionName)
void SetTrapEnviroMask(int value)
int UpdateTrapEnviroMask()
proto native CEApi GetCEApi()
Get the CE API.
InventoryLocationType
types of Inventory Location
class NoiseSystem NoiseParams()
void SetInactive(bool stop_timer=true)
void SetupTrapPlayer(PlayerBase player, bool set_position=true)
proto native NoiseSystem GetNoiseSystem()
proto native float GetTickTime()
Returns current time from start of the game.
override ScriptCallQueue GetCallQueue(int call_category)
proto native float SurfaceRoadY(float x, float z, RoadSurfaceDetection rsd=RoadSurfaceDetection.LEGACY)
proto float SurfaceGetType3D(float x, float y, float z, out string type)
Y input: Maximum Y to trace down from; Returns: Y position the surface was found.
bool IsSurfaceDigable(string surface)
Checks if the surface is digable.
proto native Mission GetMission()
YieldItemBase GetYieldItemByIdx(int idx)
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
static float EaseInQuad(float t)
Input value between 0 and 1, returns value adjusted by easing, no automatic clamping of input(do your...
Wrapper class for managing sound through SEffectManager.
proto native int GetType()
returns type of InventoryLocation
proto native void SetGroundEx(EntityAI e, vector pos, float dir[4])
sets current inventory location type to Ground with transformation mat
ref CatchingContextTrapsBase m_CatchingContext
void InitCatchingComponent()
override void EEItemAttached(EntityAI item, string slot_name)
void AdjustDetectionRange()
float m_NoBaitCatchProb
DEPRECATED.
void SetTrapEnviroMask(int value)
void OnCatchSpawnServer()
void ResetRunningTimerProgress()
bool IsSurfaceWater(vector position)
string m_AnimationPhaseTriggered
void PlayCatchParticleSynced(YieldItemBase yItem)
bool SetCanCatch(out EntityAI bait)
string m_InfoSetup
DEPRECATED.
bool m_IsInProgress
DEPRECATED.
override bool OnStoreLoad(ParamsReadContext ctx, int version)
ref Timer m_AlignCatchTimer
DEPRECATED, no reason to keep the information as member.
void PlayCatchEffectsClient()
bool CanPutInInventory(EntityAI player)
DEPRECATED.
void PlayCatchNoise(YieldItemBase yItem)
void AlignCatch(ItemBase obj, string catch_name)
DEPRECATED.
float m_MinimalDistanceFromPlayersToCatch
Absolute damage dealt to trap when used.
void PlayCatchEffectsServer()
float m_FinalCatchProb
DEPRECATED.
void DetachAllAttachments()
detaches everything on catching end (some slots may not be accessible when folded)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
bool m_BaitNeeded
DEPRECATED.
int m_ElapsedTime
Adjusted by init wait time, when appropriate.
override bool CanPutIntoHands(EntityAI parent)
bool m_IsUsable
DEPRECATED.
void IncreaseElapsedTime()
void PlayDeployLoopSound()
override void SetActions()
int m_AdjustedMaxActiveTime
After this time after deployment, the trap is activated.
void ResetActiveProgress()
void OnCatchSpawnClient()
float m_CurrentMinimalDistance
void RunTrappingTimer(float duration, string fnName)
generic trapping launcher for traps, use this to store delta info
int m_SpawnUpdateWaitTime
Catch evaluation interval.
void SetCatchSuccessful(bool successful)
void SetupTrapPlayer(PlayerBase player, bool set_position=true)
void PlayCatchSound(YieldItemBase yItem)
ref multiMap< string, float > m_CatchesGroundAnimal
DEPRECATED.
ref EffectSound m_DeployLoopSound
DEPRECATED.
int m_MaxActiveTime
Catch spawn and player check interval (expensive-ish)
override void OnStoreSave(ParamsWriteContext ctx)
void UpdateTrapEnviroMask()
float m_BaitLossFraction
Max time of trap activity (seconds)
ref multiMap< string, float > m_CatchesSea
DEPRECATED.
int m_CatchParticleEffecterId
void ClearCatchingComponent()
bool IsPlayerInVicinity()
override void EEItemDetached(EntityAI item, string slot_name)
override void OnVariablesSynchronized()
this event is called all variables are synchronized on client
override bool CanDisplayAttachmentSlot(int slot_id)
void SetDeployed(bool newState)
float m_CurrentlyUsedDelta
ItemBase m_Catch
DEPRECATED.
EntityAI m_Bait
DEPRECATED.
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
void StartActivate(PlayerBase player)
const string m_PlaceableWaterType ref Timer m_PrevTimer
DEPRECATED.
override bool IsTakeable()
bool IsPlaceableAtPosition(vector position)
void Fold(bool keep_connected=false)
string m_AnimationPhaseSet
void StopDeployLoopSound()
DEPRECATED.
override bool CanBePlaced(Man player, vector position)
float m_DefectRate
Normalized bait qty reduction on unsuccessful catch.
bool m_WaterSurfaceForSetup
DEPRECATED.
ref multiMap< string, float > m_CatchesPond
DEPRECATED.
void CatchSetQuant(ItemBase catch)
!DEPRECATED
string m_AnimationPhaseUsed
ref array< string > m_PlaceableWaterSurfaceList
static float GetNoiseReduction(Weather weather)
proto void AddNoiseTarget(vector pos, float lifetime, NoiseParams noise_params, float external_strength_multiplier=1.0)
Will make a noise at that position which the AI will "see" for the duration of 'lifetime'.
static EffectSound PlaySoundEnviroment(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound, updating environment variables.
static void DestroyEffecterParticleServer(int effecterID)
static int CreateParticleServer(vector pos, EffecterParameters parameters)
returns unique effecter ID
static void ReinitParticleServer(int effecterID, EffecterParameters parameters)
allows re-initializing existing effecter with new parameters (extept m_EffecterType,...
static void ReactivateParticleServer(int effecterID)
Manager class for managing Effect (EffectParticle, EffectSound)
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
static bool AllowedWaterSurface(float pHeight, string pSurface, array< string > pAllowedSurfaceList)
override void InitTrapValues()
override void InitCatchingComponent()
override bool IsPlaceableAtPosition(vector position)
CatchYieldBank GetCatchYieldBank()
float GetCatchAINoiseBaseStrength()
string GetCatchDeathSoundset()
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
Serializer ParamsReadContext
proto native CGame GetGame()
Serializer ParamsWriteContext
proto void Print(void var)
Prints content of variable to console/log.
proto native void SetPosition(vector position)
Set the world position of the Effect.
static proto void MatrixToQuat(vector mat[3], out float d[4])
Converts rotation matrix to quaternion.
static proto void YawPitchRollMatrix(vector ang, out vector mat[3])
Creates rotation matrix from angles.
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static proto float InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...
class JsonUndergroundAreaTriggerData GetPosition
proto native bool IsCLIParam(string param)
Returns if command line argument is present.