49 RegisterNetSyncVariableInt(
"m_State");
50 RegisterNetSyncVariableBool(
"m_IsEntrance");
51 RegisterNetSyncVariableBool(
"m_IsWindow");
52 RegisterNetSyncVariableBool(
"m_IsToggle");
53 RegisterNetSyncVariableInt(
"m_OpeningMask");
54 RegisterNetSyncVariableBool(
"m_IsBeingPacked");
69 return "disableContainerDamage";
121 super.OnStoreSave(ctx);
129 if (!super.OnStoreLoad(ctx, version))
136 Print(
"ERROR: no opening mask found! Default openinng settings initialized.");
164 super.RefreshPhysics();
178 super.OnItemLocationChanged(old_owner, new_owner);
180 if (new_owner || old_owner)
182 if (GetInventory().CountInventory() == 1)
189 super.OnVariablesSynchronized();
215 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
221 MiscGameplayFunctions.DropAllItemsInInventoryInBounds(
this,
m_HalfExtents);
223 if (zone !=
"Body" && zone !=
"Inventory" && zone !=
"")
228 DamageSystem.GetComponentNamesFromDamageZone(
this,zone,selections);
229 for (
int j = 0; j < selections.Count(); j++)
231 if (selections.Get(j) !=
"")
233 RemoveProxyPhysics(selections.Get(j));
251 string cfg_path =
"cfgVehicles " +
GetType() +
" AnimationSources";
253 if (
g_Game.ConfigIsExisting(cfg_path))
255 int selections =
g_Game.ConfigGetChildrenCount(cfg_path);
256 string proxy_selection_name;
258 for (
int i = 0; i < selections; i++)
260 string selection_name;
261 g_Game.ConfigGetChildName(cfg_path, i, selection_name);
264 SetAnimationPhase(selection_name, 1);
267 proxy_selection_name = selection_name;
268 proxy_selection_name.
ToLower();
271 RemoveProxyPhysics(proxy_selection_name);
284 if (!super.IsTakeable())
292 if (!super.CanPutIntoHands(parent))
302 if (!super.CanPutInCargo(parent))
312 if (!super.CanRemoveFromCargo(parent))
320 if (!super.CanRemoveFromHands(parent))
343 m_CamoNet = CamoNet.Cast(GetInventory().FindAttachment(slot_id_camo));
346 eai_xlights = GetInventory().FindAttachment(slot_id_xlights);
353 if (!IsKindOf(
"MediumTent"))
355 AddProxyPhysics(
"camonet");
361 SetAnimationPhase(
"Xlights", 0);
362 SetAnimationPhase(
"Xlights_glass_r", 0);
363 SetAnimationPhase(
"Xlights_glass_g", 0);
364 SetAnimationPhase(
"Xlights_glass_b", 0);
365 SetAnimationPhase(
"Xlights_glass_y", 0);
371 super.EEItemAttached(item, slot_name);
373 if (item.IsKindOf (
"CamoNet"))
379 if (!IsKindOf (
"MediumTent"))
381 AddProxyPhysics(
"camonet");
385 if (item.IsKindOf (
"XmasLights"))
387 SetAnimationPhase(
"Xlights", 0);
388 SetAnimationPhase(
"Xlights_glass_r", 0);
389 SetAnimationPhase(
"Xlights_glass_g", 0);
390 SetAnimationPhase(
"Xlights_glass_b", 0);
391 SetAnimationPhase(
"Xlights_glass_y", 0);
393 XmasLights xlights = XmasLights.Cast(item);
394 xlights.AttachToObject(
this);
400 super.EEItemDetached(item, slot_name);
402 if (item.IsKindOf (
"CamoNet"))
408 if (!IsKindOf (
"MediumTent"))
410 RemoveProxyPhysics(
"camonet");
414 if (item.IsKindOf (
"XmasLights"))
416 SetAnimationPhase(
"Xlights", 1);
417 SetAnimationPhase(
"Xlights_glass_r", 1);
418 SetAnimationPhase(
"Xlights_glass_g", 1);
419 SetAnimationPhase(
"Xlights_glass_b", 1);
420 SetAnimationPhase(
"Xlights_glass_y", 1);
422 XmasLights xlights = XmasLights.Cast(item);
423 xlights.DetachFromObject(
this);
429 if (MemoryPointExists(
"invView2"))
432 GetInventory().GetCurrentInventoryLocation(il);
475 if (GetInventory().GetCargo().GetItemCount() == 0 && GetInventory().AttachmentCount() == 0)
522 GetInventory().LockInventory(HIDE_INV_FROM_SCRIPT);
532 MiscGameplayFunctions.DropAllItemsInInventoryInBounds(
this,
m_HalfExtents);
538 GetOnViewIndexChanged().Invoke();
553 GetInventory().UnlockInventory(HIDE_INV_FROM_SCRIPT);
564 GetOnViewIndexChanged().Invoke();
570 if (GetHierarchyRootPlayer())
572 if (
g_Game.IsDedicatedServer())
585 string proxy_selection_name;
586 string animation_name;
594 SetAnimationPhase(animation_name, 0);
605 SetAnimationPhase(animation_name, 0);
612 string proxy_selection_name;
613 string animation_name;
621 proxy_selection_name = animation_name;
622 proxy_selection_name.
ToLower();
623 AddProxyPhysics(proxy_selection_name);
634 proxy_selection_name = animation_name;
635 proxy_selection_name.
ToLower();
636 AddProxyPhysics(proxy_selection_name);
658 if (toggle_off == selection || toggle_on == selection)
661 DamageSystem.GetDamageZoneFromComponentName(
this,selection,zone);
716 if (toggle_off == selection || toggle_on == selection)
778 SetAnimationPhase(
"CamoNet", hide);
795 SetAffectPathgraph(
true,
false);
835 super.InitItemSounds();
840 handler.AddSound(SoundConstants.ITEM_TENT_OPEN,
GetSoundOpen());
843 handler.AddSound(SoundConstants.ITEM_TENT_CLOSE,
GetSoundClose());
876 DamageSystem.GetDamageZoneFromComponentName(
this,
component,zone);
910 DamageSystem.GetDamageZoneFromComponentName(
this,
component,zone);
941 return super.CanReceiveItemIntoCargo(item);
946 if (!super.CanLoadItemIntoCargo(item))
959 return super.CanReceiveAttachment(attachment, slotId);
967 return super.CanLoadAttachment(attachment);
972 vector playerpos = player.GetPosition();
973 float delta1 = playerpos[1] -
position[1];
1000 if (HasAnyAttachmentsOrCargo())
eBleedingSourceType GetType()
PlaceObjectActionReciveData ActionReciveData ActionDeployObject()
ActionPackTentCB ActionContinuousBaseCB ActionPackTent()
void AddAction(typename actionName)
override string GetInvulnerabilityTypeString()
const int ECE_PLACE_ON_SURFACE
void UpdatePhysics()
update ALL parts physics. Sets hide first, then shows the rest. Use only if the update queue system w...
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
override bool IsHologram()
ItemSoundHandler GetItemSoundHandler()
void StartItemSoundServer(int id, int slotId)
bool m_FixDamageSystemInit
void ItemSoundHandler(ItemBase parent)
enum MagnumStableStateID init
ref EffectSound m_DeployLoopSound
DEPRECATED.
Wrapper class for managing sound through SEffectManager.
proto native int GetType()
returns type of InventoryLocation
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id
provides access to slot configuration
override int GetMeleeTargetType()
override void EEItemAttached(EntityAI item, string slot_name)
bool CanToggleAnimations(string selection)
override bool CanDisplayCargo()
bool IsManipulatedWindow()
bool CanAttach(ItemBase item)
void HandleOpeningsPhysics()
void SoundTentClosePlay()
override void OnItemFallRebuilding()
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
void HandleOpeningsVisuals()
bool IsManipulatedEntrance()
void SoundTentOpenPlay()
DEPRECATED.
override int GetViewIndex()
override bool CanProxyObstructSelf()
prevents showing cargo when outside the tent geometry
override bool HasProxyParts()
override bool CanBeRepairedByCrafting()
bool ConditionOutOfHands(EntityAI player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
string GetSoundCloseWindow()
override bool CanPutIntoHands(EntityAI parent)
void PlayDeployLoopSound()
override bool IsItemTent()
override void SetActions()
void HideAllAnimationsAndProxyPhysics(bool hide_animations=true, bool hide_physics=true)
override string GetInvulnerabilityTypeString()
override bool CanLoadAttachment(EntityAI attachment)
string GetClutterCutter()
override int GetDamageSystemVersionChange()
ref array< string > m_ShowAnimationsWhenPacked
string GetSoundOpenWindow()
override bool CanRemoveFromHands(EntityAI parent)
void Pack(bool update_navmesh, bool init=false)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
void Pitch(bool update_navmesh, bool init=false)
void SoundTentOpenWindowPlay()
override bool CanLoadItemIntoCargo(EntityAI item)
void ManipulateEntrance()
void HandleCamoNetAttachment(bool hide)
override void EEItemDetached(EntityAI item, string slot_name)
void AnimateCamonetToggle(ToggleAnimations toggle)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanDisplayAttachmentSlot(int slot_id)
override bool CanRemoveFromCargo(EntityAI parent)
void SetIsBeingPacked(bool isBeingPacked)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
void RefreshAttachements()
ref array< string > m_ShowAnimationsWhenPitched
const float MAX_PLACEMENT_HEIGHT_DIFF
void TryPitch(bool update_navmesh, bool init=false)
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override bool CanDisplayAttachmentCategory(string category_name)
override bool IsTakeable()
void SoundTentCloseWindowPlay()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
ref map< ref ToggleAnimations, bool > m_ToggleAnimations
void StopDeployLoopSound()
DEPRECATED.
bool ConditionIntoInventory(EntityAI player)
override bool CanBePlaced(Man player, vector position)
void AnimateCamonetByOpeningSelection(string opening_selection)
override bool CanBeRepairedToPristine()
override bool IsDeployable()
void DestroyClutterCutter()
void ToggleAnimation(string selection)
proto bool Write(void value_out)
proto bool Read(void value_in)
override string GetSoundClose()
override void AnimateCamonetToggle(ToggleAnimations toggle)
override string GetClutterCutter()
override string GetSoundOpen()
override string GetSoundCloseWindow()
override void AnimateCamonetByOpeningSelection(string opening_selection)
override void HandleCamoNetAttachment(bool hide)
override bool HasClutterCutter()
override string GetSoundOpenWindow()
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Serializer ParamsReadContext
Serializer ParamsWriteContext
proto void Print(void var)
Prints content of variable to console/log.
vector GetPosition()
Get the world position of the Effect.
bool Contains(string sample)
Returns true if sample is substring of string.
proto int ToLower()
Changes string to lowercase. Returns length.
proto native int GetState()
returns one of STATE_...