14enum EConstructionDirCheckType
22enum EConstructionDebugModes
50 protected Shape m_CollisionBox;
51 protected Shape m_PlayerInsideTestCylinder;
74 ErrorEx(
"invalid EntityType or ConstructionDataTypeHolder for entity instance: " + parent);
100 #ifdef DIAG_DEVELOPER
103 RebuildingSpawner.RebuildAllWoodenPartsFiltered(
this,
m_EntityParent);
110 m_ConstructionParts = null;
114 #ifdef DIAG_DEVELOPER
115 m_InsideTestBoxes = null;
193 DamageSystem.GetDamageZoneFromComponentName(
m_EntityParent,part_name,damageZone);
209 void DestroyPartServer(Man player,
string part_name,
int action_id,
bool destroyed_by_connected_part =
false)
227 if (partNames && partNames.Count() > 0)
229 foreach (
string partName : partNames)
255 ErrorEx(
string.Format(
"Wrong collision_data configuration of %1 for object %2; valid collision_data must contain exactly 2 strings (min/max) or must be a base building object for auto evaluation for boundings!", partName,
m_EntityParent),
ErrorExSeverity.INFO);
269 if (
g_Game.IsBoxCollidingGeometryProxy(params, excludes, results))
271 foreach (BoxCollidingResult res : results)
276 Physics objPhysics = res.obj.GetPhysics();
298 item.OnItemFallRebuilding();
315 if (part.IsBuilt() && part.CanPartDecay())
318 DamageSystem.GetDamageZoneFromComponentName(
m_EntityParent,part.GetPartName(),damageZone);
319 if (damageZone !=
"")
322 threshold = part.GetPartDecayThreshold() *
m_EntityParent.GetMaxHealth(damageZone,
"Health");
323 if (currentHP > threshold)
336 if (
g_Game.GetWeather().GetSandstorm().IsActive())
354 super.OnHealthLevelChanged(oldLevel, newLevel, zone);
356 string partName = zone;
386 if (DamageSystem.GetDamageZoneFromComponentName(
m_EntityParent,part_name,damageZone))
497 if (anyPart.IsBuilt())
498 builtArray.Insert(anyPart);
519 m_ConstructionParts.Clear();
531 typename customInstanceTypename = typeData.GetCustomInstanceType();
543 m_ConstructionParts.Insert(typeData.GetPartName(), part);
558 ErrorEx(
"missing valid override!");
575 return m_ConstructionParts;
580 return m_ConstructionParts.Get(part_name);
634 if (attachment && attachment.IsRuined())
644 construction_parts.Clear();
648 if ((main_part_name == part.GetMainPartName() || main_part_name == part.GetPartName()) &&
CanBuildPart(part.GetPartName(), tool, use_tool))
650 construction_parts.Insert(part);
658 constructionParts.Clear();
662 if (actionComponentName == part.GetMainPartName() && !
CanBuildPart(part.GetPartName(), tool, useTool))
664 constructionParts.Insert(part);
688 foreach (
string partName : requiredParts)
706 string conflictingPartName =
"";
713 conflictingPartName =
"";
716 foreach (
string partNameTest : conflictedParts)
720 conflictingPartName = partNameTest;
743 #ifdef DIAG_DEVELOPER
746 ConstructionDebug.ResetDismantlePartData();
752 #ifdef DIAG_DEVELOPER
757 ConstructionDismantleDebugData data =
new ConstructionDismantleDebugData();
758 data.partName = part_name;
763 ConstructionDebug.SetCanDismantlePartData(data);
776 if (!part.IsUtilityPart() && part.GetRequiredParts().Find(part_name) > -1)
794 if (constructionPart)
798 if (!DamageSystem.GetDamageZoneFromComponentName(
m_EntityParent, partName, zoneName))
801 float currentZoneHealthLevel =
m_EntityParent.GetHealthLevel(zoneName);
806 if (!part.
CanBeRepaired(currentZoneHealthLevel, tool, player))
820 if (!
m_EntityParent.IsFacingPlayerEx(player, partName) && !player.GetInputController().CameraIsFreeLook())
823 if (!
g_Game.IsDedicatedServer())
844 const float CYLINDER_HEIGHT = 0.01;
845 const float CYLINDER_RADIUS = 0.01;
847 #ifdef DIAG_DEVELOPER
849 if (fullDebugEnabled || (!fullDebugEnabled && m_InsideTestBoxes.Count() > 0))
850 DestroyDebugInsideTestBoxes();
859 vector adjustedPos = player.GetPosition();
860 adjustedPos[1] = adjustedPos[1] + CYLINDER_HEIGHT / 2;
861 matPlayer[3] = adjustedPos;
863 #ifdef DIAG_DEVELOPER
864 if (fullDebugEnabled)
866 if (m_PlayerInsideTestCylinder)
867 m_PlayerInsideTestCylinder.Destroy();
869 m_PlayerInsideTestCylinder.SetMatrix(matPlayer);
875 bool success =
false;
879 vector min = minMaxPair[0];
880 vector max = minMaxPair[1];
882 bool playerInside =
false;
890 #ifdef DIAG_DEVELOPER
891 if (fullDebugEnabled)
893 DrawDebugInsideTestBox(min, max,
ARGB(90, 128, 128, 128));
900 #ifdef DIAG_DEVELOPER
903 if (fullDebugEnabled)
905 DrawDebugInsideTestBox(min, max,
ARGB(90, 128, 0, 128));
911 #ifdef DIAG_DEVELOPER
912 if (fullDebugEnabled)
915 ConstructionDebug.SetInsideboxCheckDebugData(part.
GetPartName());
917 ConstructionDebug.SetInsideboxCheckDebugData(
"");
928 string memStart =
"" +
name +
"_pos";
935 case EConstructionDirCheckType.INDOORS:
936 memEnd =
"" +
name +
"_inside";
939 case EConstructionDirCheckType.REFERENCE_DIRECTION:
940 memEnd =
"" +
name +
"_ref";
951 memStart =
"" +
name +
"_pos";
957 case EConstructionDirCheckType.INDOORS:
958 memEnd =
"" +
name +
"_inside";
961 case EConstructionDirCheckType.REFERENCE_DIRECTION:
962 memEnd =
"" +
name +
"_ref";
973 return MiscGameplayFunctions.MemPointDirectionalCheck(player,
m_EntityParent, memStart, memEnd);
987 name = part.GetPartName();
990 if (part.IsBuilt() && reqPartsArray && reqPartsArray.Find(part_name) > -1)
995 if (!recurs || (recurs.Find(
name) == -1))
996 dependentParts.Insert(
name);
1000 return dependentParts;
1006 string cfgPath =
"cfgVehicles" +
" " +
m_EntityParent.GetType() +
" " +
"Construction" +
" " + main_part_name +
" " + part_name +
" " +
"required_parts";
1008 g_Game.ConfigGetTextArray(cfgPath, requiredParts);
1010 return requiredParts;
1083 #ifdef DIAG_DEVELOPER
1089 if (player.GetConstructionActionData().GetFastConstructionMode())
1099 float quantity = dta.m_MaterialQuantity;
1100 if (quantity == 0.0)
1113 requiredQuantity = quantity;
1124 string dumpSlotName;
1126 return HasMaterialsEx(part_name, repairing, dumpSlotName, dumpQty);
1132 if (attachment && ((
int)quantity == -1 || attachment.GetQuantity() >= quantity))
1149 if (repairing && dta.m_SkipOnRepair)
1152 if (dta.m_MaterialLockable)
1156 attachment.GetInventory().GetCurrentInventoryLocation(invloc);
1162 if (dta.m_MaterialQuantity > 0.0)
1164 float quantity = dta.m_MaterialQuantity;
1171 attachment.AddQuantity(-quantity);
1173 else if (dta.m_MaterialQuantity == -1.0)
1175 g_Game.ObjectDelete(attachment);
1186 bool isBase = part.
IsBase();
1188 string cfgPath =
"cfgVehicles" +
" " +
m_EntityParent.GetType() +
" "+
"Construction" +
" " + mainPartName +
" " + part_name +
" " +
"Materials";
1190 if (
g_Game.ConfigIsExisting(cfgPath))
1209 if (dta.m_MaterialLockable)
1212 attachment.GetInventory().GetCurrentInventoryLocation(invloc);
1216 g_Game.ObjectDelete(attachment);
1237 if (dta.m_SkipOnDismantle)
1240 int slotId = dta.m_MaterialSlotID;
1243 ErrorEx(
string.Format(
"DropNonUsableMaterialsServer: invalid cached slot id for '%1' on part %2", dta.m_MaterialSlotName, part_name));
1250 ErrorEx(
string.Format(
"Attachment is not present for material type '%1' on part %2", dta.m_MaterialType, part_name));
1262 if (dta.m_MaterialQuantity == -1.0 && !dta.m_MaterialLockable)
1267 g_Game.ObjectDelete(attachment);
1272 attachment.GetInventory().GetCurrentInventoryLocation(invloc);
1284 bool hasMemPoint = parent.MemoryPointExists(partName +
"_materials");
1286 basePos =
g_Game.ObjectModelToWorld(parent, parent.GetMemoryPointPos(partName +
"_materials"));
1288 basePos = player.GetPosition();
1290 basePos = attachment.GetPosition();
1293 string itemType = attachment.GetType();
1294 float health = attachment.GetHealth(
"",
"Health");
1295 int total = attachment.GetQuantity();
1296 int stackMax = attachment.GetTargetQuantityMax(-1);
1301 int pileCount =
Math.
Ceil((
float)total / stackMax);
1309 int remaining = total;
1310 for (
int i = 0; i < pileCount; ++i)
1312 int thisQty = stackMax;
1313 if (remaining < stackMax)
1314 thisQty = remaining;
1322 ErrorEx(
"MoveMaterialAttachmentToGround: failed to create '" + itemType +
"' on part " + partName +
", aborting drop!");
1327 newItem.SetHealth(
"",
"Health", health);
1328 newItem.PlaceOnSurface();
1330 remaining -= thisQty;
1334 attachment.Delete();
1356 if (
g_Game.IsMultiplayer())
1365 groundPos = player.GetPosition();
1369 groundPos = attachment.GetPosition();
1390 if (attachment && dta.m_MaterialLockable)
1393 attachment.GetInventory().GetCurrentInventoryLocation(inventoryLocation);
1406 #ifdef DIAG_DEVELOPER
1412 if (player.GetConstructionActionData().GetFastConstructionMode())
1420 if (actionMask != EConstructionTools.TOOL_NO_ACTION)
1424 string toolCfgPath =
"cfgVehicles" +
" " + tool.GetType() +
" " +
"build_action_type";
1425 if (
g_Game.ConfigIsExisting(toolCfgPath))
1427 int toolActionType =
g_Game.ConfigGetInt(toolCfgPath);
1428 if ((actionMask & toolActionType) > 0)
1434 else if (actionMask & EConstructionTools.TOOL_HANDS)
1447 if (actionMask != EConstructionTools.TOOL_NO_ACTION)
1451 string toolCfgPath =
"cfgVehicles" +
" " + tool.GetType() +
" " +
"dismantle_action_type";
1453 if (
g_Game.ConfigIsExisting(toolCfgPath))
1455 int toolActionType =
g_Game.ConfigGetInt(toolCfgPath);
1456 if ((actionMask & toolActionType) > 0)
1462 else if (actionMask & EConstructionTools.TOOL_HANDS)
1490 float absoluteOfset = 0.05;
1497 if (check_data.m_AdditionalExcludes.Count() > 0)
1499 excludedObjects.InsertAll(check_data.m_AdditionalExcludes);
1507 #ifdef DIAG_DEVELOPER
1510 if (
g_Game.IsBoxCollidingGeometry(
Vector(center[0], center[1] + absoluteOfset, center[2]),
m_EntityParent.GetOrientation(), edgeLength, check_data.m_PrimaryGeometry, check_data.m_SecondaryGeometry, excludedObjects, collidedObjects))
1512 bool validCollision =
false;
1513 #ifdef DIAG_DEVELOPER
1517 for (
int i = 0; i < collidedObjects.Count(); ++i)
1520 if (entity && !entity.IsIgnoredByConstruction())
1522 validCollision =
true;
1523 #ifdef DIAG_DEVELOPER
1524 if (collisionDebugEnabled)
1526 validEntityCollisions.Insert(entity.GetType());
1534 #ifdef DIAG_DEVELOPER
1535 if (collisionDebugEnabled)
1539 ConstructionDebug.SetCollisionPrintoutData(check_data.m_PartName, validEntityCollisions);
1540 DrawDebugCollisionBox(minMax,
ARGB(150, 0, 0, 255));
1544 ConstructionDebug.ResetCollisionPrintoutData();
1545 DrawDebugCollisionBox(minMax,
ARGB(150, 255, 255, 255));
1548 else if (m_CollisionBox)
1550 DestroyDebugCollisionBox();
1554 return validCollision;
1556 #ifdef DIAG_DEVELOPER
1559 if (collisionDebugEnabled)
1561 ConstructionDebug.ResetCollisionPrintoutData();
1562 DrawDebugCollisionBox(minMax,
ARGB(150, 255, 255, 255));
1564 else if (m_CollisionBox)
1566 DestroyDebugCollisionBox();
1578 boxSize[0] =
Math.
AbsFloat(min_max[1][0] - min_max[0][0]);
1579 boxSize[1] =
Math.
AbsFloat(min_max[1][1] - min_max[0][1]);
1580 boxSize[2] =
Math.
AbsFloat(min_max[1][2] - min_max[0][2]);
1590 if (dta.Count() == 2)
1601 else if (dta.Count() > 0)
1603 ErrorEx(
string.Format(
"Wrong collision_data configuration of %1 for object %2; valid collision_data must contain exactly 2 strings (min/max)!", part_name,
m_EntityParent),
ErrorExSeverity.INFO);
1612 if (dta.Count() == 2)
1625 else if (dta.Count() > 0)
1627 ErrorEx(
string.Format(
"Wrong collision_data configuration of %1 for object %2; valid item_falling_data must contain exactly 2 strings (min/max)!", partName,
m_EntityParent),
ErrorExSeverity.INFO);
1638 center[0] = (min_max[1][0] - min_max[0][0]) / 2;
1639 center[1] = (min_max[1][1] - min_max[0][1]) / 2;
1640 center[2] = (min_max[1][2] - min_max[0][2]) / 2;
1641 center =
Vector(min_max[1][0] - center[0], min_max[1][1] - center[1], min_max[1][2] - center[2]);
1649 extents[0][0] = -egdeLength[0] / 2;
1650 extents[0][1] = -egdeLength[1] / 2;
1651 extents[0][2] = -egdeLength[2] / 2;
1652 extents[1][0] = egdeLength[0] / 2;
1653 extents[1][1] = egdeLength[1] / 2;
1654 extents[1][2] = egdeLength[2] / 2;
1657 #ifdef DIAG_DEVELOPER
1659 protected void DrawDebugCollisionBox(vector min_max[2],
int color)
1661 DestroyDebugCollisionBox();
1666 m_CollisionBox =
Debug.DrawBox(min_max[0], min_max[1], color);
1667 m_CollisionBox.SetMatrix(mat);
1670 protected void DestroyDebugCollisionBox()
1674 m_CollisionBox.Destroy();
1675 m_CollisionBox = NULL;
1679 protected void DrawDebugInsideTestBox(vector min, vector max,
int color)
1686 m_InsideTestBoxes.
Insert(box);
1689 protected void DestroyDebugInsideTestBoxes()
1691 foreach (
Shape box : m_InsideTestBoxes)
1696 m_InsideTestBoxes.Clear();
1702 [
Obsolete(
"call BuildPartServerEx instead")]
1710 [
Obsolete(
"call DismantlePartServerEx instead")]
1718 [
Obsolete(
"call IsCollidingEx instead")]
1728 float absolute_ofset = 0.05;
1743 if (
g_Game.IsBoxCollidingGeometry(
Vector(center[0], center[1] + absolute_ofset, center[2]),
m_EntityParent.GetOrientation(), edge_length, ObjIntersectView, ObjIntersectGeom, excludedObjects, collidedObjects))
1745 for (
int i = 0; i < collidedObjects.Count(); ++i)
1748 if (entity && !entity.IsIgnoredByConstruction())
1811 string partName = mainPartName;
1812 int childCount =
g_Game.ConfigGetChildrenCount(cfgPath);
1814 for (
int i = 0; i < childCount; ++i)
1817 g_Game.ConfigGetChildName(cfgPath, i, child_name);
1823 configPath = cfgPath +
" " + child_name +
" " +
"type";
1824 g_Game.ConfigGetText(configPath, type);
1825 configPath = cfgPath +
" " + child_name +
" " +
"slot_name";
1826 g_Game.ConfigGetText(configPath, slot_name);
1827 configPath = cfgPath +
" " + child_name +
" " +
"quantity";
1828 float quantity =
g_Game.ConfigGetFloat(configPath);
1829 configPath = cfgPath +
" " + child_name +
" " +
"lockable";
1830 bool lockable =
g_Game.ConfigGetInt(configPath);
1831 configPath = cfgPath +
" " + child_name +
" " +
"skipOnDismantle";
1832 bool skipOnDismantle =
g_Game.ConfigGetInt(configPath);
1834 if (skipOnDismantle)
1838 ItemBase attachment =
ItemBase.Cast(entity.FindAttachmentBySlotName(slot_name));
1847 attachment.GetInventory().GetCurrentInventoryLocation(src);
1849 entity.GetInventory().SetSlotLock(src.
GetSlot() ,
false);
1854 if (
g_Game.IsMultiplayer() && player)
1858 player.ServerTakeToDst(src, dst);
1862 entity.GetInventory().DropEntity(
InventoryMode.PREDICTIVE, entity, attachment);
1871 vector destination = entity.GetPosition();
1876 playerPosition = player.GetPosition();
1877 destination = playerPosition;
1880 if (entity.MemoryPointExists(
"" + partName +
"_materials"))
1882 destination = entity.GetMemoryPointPos(
"" + partName +
"_materials");
1883 destination =
g_Game.ObjectModelToWorld(entity, destination);
1885 else if (entity.MemoryPointExists(partName))
1887 destination = entity.GetMemoryPointPos(partName);
1888 destination =
g_Game.ObjectModelToWorld(entity, destination);
1890 pileHealth = entity.GetHealth01(damagezoneName,
"Health") * MiscGameplayFunctions.GetTypeMaxGlobalHealth(type);
1891 qtyCoef = 1 - (entity.GetHealthLevel(damagezoneName) *
Construction.DECONSTURCT_MATERIAL_LOSS) -
Construction.DECONSTURCT_MATERIAL_LOSS;
1892 quantity *= qtyCoef;
1897 vector posHead = MiscGameplayFunctions.GetPlayerHeadPosition(
PlayerBase.Cast(player));
1898 MiscGameplayFunctions.CreateItemBasePilesDispersed(type, posHead, destination,
UAItemsSpreadRadius.
NARROW, quantity, pileHealth, player);
1902 MiscGameplayFunctions.CreateItemBasePilesEx(type, destination, quantity, pileHealth,
true, throwPiles);
1908 [
Obsolete(
"1.30: Use SpawnConstructionMaterialPilesEx instead")]
1948 super.UpdateInsiders(20);
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
const int AT_DESTROY_PART
ConstructionPart GetConstructionPart()
class BaseBuildingBase extends ItemBase bsbDebugPrint(string s)
const int ECE_PLACE_ON_SURFACE
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
void DropNonUsableMaterialsServer(Man player, string part_name)
void HideConstructionPartPhysics(string part_name)
sets physics LOCALLY
bool CanDestroyPart(string part_name)
void ConstructionBase(EntityAI parent)
vector GetBoxCenter(vector min_max[2])
bool CanBuildPart(string part_name, ItemBase tool, bool use_tool)
bool UpdatePartSyncStateLocal(ConstructionPart part)
Returns 'true' if part state was locally changed.
bool m_AnyPartBuildableByHands
static const float DECONSTURCT_MATERIAL_LOSS
void ProcessOnPartDestroyedServer(Man player, string part_name, int action_id, bool destroyed_by_connected_part=false)
void BuildPartServer(notnull Man player, string part_name, int action_id)
override bool CanUseHandConstruction()
static const float SANDSTORM_DECAY_RATE_COEF
Default decay speed coef.
bool IsCollidingEx(CollisionCheckData check_data)
Collision check for building part.
ConstructionDataTypeHolder m_TypeLevelHolder
Sandstorm decay speed coef.
ConstructionPart GetBaseConstructionPart()
ConstructionPart GetConstructionPartToDestroy(string part_name)
enum ConstructionMaterialType MAX_MATERIAL_PILES
void HandleEntityFalling(string partName)
when supporting part is removed, entities on top of it should transform to surface Y height
void UpdateSpecificPartVisuals(ConstructionPart part)
update SPECIFIC ConstructionPart visuals
bool HasMaterials(string part_name, bool repairing=false)
vector GetCollisionBoxSize(vector min_max[2])
bool ConstructionInsiderBoxCheck(PlayerBase player, ConstructionPart part)
Check character positioning with a box check (character must be inside at least one of the defined bo...
void GetCollisionBoxData(string part_name, out vector min_max[2])
class StaticConstructionMethods m_AdditionalExcludes
Data structure for passing parameters (extendable, modable)
bool MaterialIsRuined(string part_name)
bool HasConflictPart(string part_name)
ConstructionPart GetConstructionPartToDismantle(string part_name, ItemBase tool)
void DropEssentialAttachments(Man player, string partName)
Drop other, non-material attachments tied to the construction part.
void UpdateSpecificPartPhysics(ConstructionPart part)
update SPECIFIC part's physics
void GetTriggerExtents(vector min_max[2], out vector extents[2])
static const float REPAIR_MATERIAL_PERCENTAGE
void ProcessOnPartDismantledServer(Man player, string part_name, int action_id)
void ProcessOnPartBuiltServer(Man player, string part_name, int action_id)
void ReceiveMaterialsServer(notnull Man player, string part_name, string damagezone_name)
void GetConstructionPartsToBuild(string main_part_name, out array< ConstructionPart > construction_parts, ItemBase tool, out string real_constructionTarget, bool use_tool)
bool GetItemFallDetectionBoxData(string partName, out vector minMax[2])
void ShowConstructionPart(string part_name)
Animates AnimationSource. Use on server only, AUTO-SYNCED.
ref array< ConstructionPart > m_ConstructionPartArray
INSTANCED construction part data;.
bool IsTriggerColliding()
static const float DEFAULT_DECAY_RATE
enum ConstructionMaterialType INDOORS
void HandleSyncDataDismantle(ConstructionPart part)
void UpdateConstructionParts()
Parse type data and create part instance data objects.
bool IsPartConstructed(string part_name)
returns true if part constructed
void BuildPartServerEx(Man player, string part_name, int action_id)
new build part method
ref array< ConstructionPart > m_BuiltConstructionPartArray
void DestroyConnectedParts(string part_name)
float GetCurrentDecayCoef()
void QueueFullUpdateParts(array< ConstructionPart > changedParts)
bool CanUseToolToBuildPart(string part_name, ItemBase tool)
ConstructionPart CreatePartInstanceObject(typename partTypename)
map< string, ref ConstructionPart > GetConstructionParts()
static const float DEFAULT_DECAY_RATE_COEF
Percentage of max health where the decay stops.
bool CanBuildPartEx(string partName, ItemBase tool, out EConstructionInfoCategories failureReasonsMask)
not meant to replace, but rather extend the functionality for specific use
void HandleSyncDataBuild(ConstructionPart part)
override void OnHealthLevelChanged(int oldLevel, int newLevel, string zone)
GetDefaultPartInstanceTypename()
Override on lower implements to create desired part types.
ConstructionBoxTrigger m_ConstructionBoxTrigger
bool HasDependentPart(string part_name)
checks if construction part has dependent part (that is already built) because of which it cannot be ...
void CollisionCheckData()
bool HasRequiredPart(string part_name)
checks if construction part has all the required parts built
static const float DEFAULT_DECAY_THRESHOLD
HP/s change.
void DestroyPartServer(Man player, string part_name, int action_id, bool destroyed_by_connected_part=false)
destroy part method
void InitVisuals()
init ConstructionPart visuals
array< ConstructionPart > GetConstructionPartArray()
bool SupportRemovalCheck(string part_name)
Checks if all supports would hold on part removal. Returns 'false' if some would fail.
void DismantlePartServer(notnull Man player, string part_name, int action_id)
ConstructionMaterialType
used to guide action sound selection, mostly. Could be also used for particles and stuff,...
void MoveMaterialAttachmentToGround(notnull EntityAI parent, Man player, notnull ItemBase attachment, notnull InventoryLocation invloc, string partName)
void CreateCollisionTrigger(string part_name, vector min_max[2], vector center)
void AddToConstructedParts(string part_name)
array< string > GetValidDepenentPartsArray(string part_name, array< string > recurs=null)
bool PartHasAnySupportFulfilled(string part_name)
checks if construction part has all the required support
void HandleSyncDataDestroy(ConstructionPart part)
enum ConstructionMaterialType REFERENCE_DIRECTION
void DismantlePartServerEx(Man player, string part_name, int action_id)
new dismantle part method
void RemoveFromConstructedParts(string part_name)
bool CanRepairPart(string partName, ItemBase tool=null, PlayerBase player=null, bool facingCheck=false)
void UpdatePhysics()
update ALL parts physics. Sets hide first, then shows the rest. Use only if the update queue system w...
void TakeMaterialsServer(string part_name, bool repairing=false)
bool HasMaterialsEx(string part_name, bool repairing=false, out string slotName="", out float requiredQuantity=0.0)
returns true if materials to build the part are available
void GetConstructionPartsUnableToBuild(string actionComponentName, out array< ConstructionPart > constructionParts, ItemBase tool, out string realConstructionTarget, bool useTool)
bool CanUseToolToDismantlePart(string part_name, ItemBase tool)
bool ExceptionCheck(string part_name)
Exceptions from 'dependent parts' hierarchy are handled here.
override void EEInitConstruction()
bool ConstructionDirectionCheck(PlayerBase player, ConstructionPart part, EConstructionDirCheckType type)
bool IsColliding(string part_name)
bool CanBuildUtilityPart(string partName)
Simplified condition for utility (non-)parts.
void DestroyMaterialsServer(Man player, string part_name)
bool HasMaterialWithQuantityAttached(string slot_name, float quantity)
void ItemFall(string partName)
void SetLockOnAttachedMaterials(string part_name, bool lock_slot)
void DestroyCollisionTrigger()
void ShowConstructionPartPhysics(string part_name)
sets physics LOCALLY
void HideConstructionPart(string part_name)
Animates AnimationSource. Use on server only, AUTO-SYNCED.
override void ProcessConstructionDecay(float dTime)
Handles decay for constructed parts, if enabled.
bool CanDismantlePart(string part_name, ItemBase tool)
EConstructionInfoCategories
int GetMaterialType()
rough material type, used for effect playback
array< string > GetRequiredParts()
array< ref array< vector > > TConstructionPartInsiderBoxData
void SetParent(Object parent_obj, int pivot)
Set parent of the Effect.
proto native void SetParams(vector center, vector orientation, vector edgeLength, ObjIntersect primaryType, ObjIntersect secondaryType, bool fullComponentInfo)
Set the parameters.
Class that holds parameters to feed into CGame.IsBoxCollidingGeometryProxy.
static bool GetDisableItemFalling()
static bool GetDisableIsCollidingCheck()
Super root of all classes in Enforce script.
void SetTargetPart(ConstructionPart target_part)
just declared for module 3 use
void UpdateInsiders(int timeout)
void SetPartName(string part_name)
array< ConstructionPartTypeData > GetConstructionPartTypeDataArray()
holder object for entity type-level parts info
static void AddPartToProcess(ConstructionBase con, ConstructionPart part)
static void RemoveFromProcessing(ConstructionBase con)
Unremoved objects can become NULL.
Static part of the construction system, for global handling mostly.
instanced data holder for single construction material
void OnBuiltServer(EntityAI parent, Man builder)
void HandleShowConstructionPart(EntityAI parent)
void HandleHideConstructionPart(EntityAI parent)
void OnBeforeDismantleServer(EntityAI parent, Man dismantler)
void InitAdditionalPartInstanceInfo(PartInstanceInitData initData)
intended to fill in additional INSTANCE info AFTER basic info is filled (which is tied to constructor...
void OnBeforeBuildServer(EntityAI parent, Man builder)
bool HasEssentialAttachmentSlots()
void TryHandleUtilityParts(EntityAI parent)
int GetBuildIndicationTypeMask()
int GetMaterialType()
rough material type, used for effect playback
array< string > GetEssentialAttachmentSlots()
void OnDestroyedServer(EntityAI parent, Man destroyer)
array< string > GetConflictedParts()
int GetDismantleActionTypeMask()
void SetBuiltState(bool is_built)
array< string > GetCollisionData()
strings of min/max selections (should be single points in memory LOD)
void HandleAddPhysics(EntityAI parent)
bool CanBeRepaired(int zoneHealthLevel, ItemBase tool=null, PlayerBase player=null)
bool CanSimulateItemFalling()
void PlayConstructionEffects(EntityAI parent)
void SetPartTypeData(ConstructionPartTypeData ptd)
TConstructionPartInsiderBoxData GetInsiderBoxData()
translated MODELSPACE positions of min/max memory points (should be single points in memory LOD)
int GetBuildActionTypeMask()
void OnDismantledServer(EntityAI parent, Man dismantler)
void OnBeforeDestroyServer(EntityAI parent, Man destroyer)
array< string > GetRequiredParts()
void HandleRemovePhysics(EntityAI parent)
array< ref ConstructionMaterialData > GetMaterialsData()
Instanced construction part data classes for dynamic data, statics now stored on EntityType level in ...
static parts info, lives on EntityType level. Instanced data in 'ConstructionPart' class
static Shape DrawCylinder(vector pos, float radius, float height=1, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.NOOUTLINE)
ConstructionDataTypeHolderBasic GetConstructionDataHolderBasic()
Cast to 'ConstructionDataTypeHolder' before using in higher modules.
bool DropEntityWithTransform(InventoryMode mode, EntityAI owner, notnull EntityAI item, vector transform[4])
static bool SetGroundPosByOwner(EntityAI owner, notnull EntityAI item, out InventoryLocation ground)
proto native bool SetSlotLock(int slot, bool locked)
proto native EntityAI FindAttachment(int slot)
Returns attached entity in slot (you can use InventorySlots.GetSlotIdFromString(name) to get slot id)
script counterpart to engine's class Inventory
proto native int GetSlot()
returns slot id if current type is Attachment
proto native EntityAI GetItem()
returns item of current inventory location
const int INVALID
Invalid slot (-1)
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id
provides access to slot configuration
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
static bool IsBaseBuildingLogEnable()
Trigger only accepting Object which IsMan()
proto external SimulationState GetSimulationState()
Returns simulation state of the physics body.
proto external void ApplyImpulse(vector impulse)
Applies impulse on the physics body.
static void SpawnConstructionMaterialPiles(notnull EntityAI entity, Man player, string cfg_path, string main_part_name, string damagezone_name="", bool is_base=false)
static void SpawnConstructionMaterialPilesEx(notnull EntityAI entity, Man player, string cfgPath, string mainPartName, string damagezoneName="", bool isBase=false, bool throwPiles=false)
spawns material from any construction; 'player' parameter optional; 'main_part_name' is actually a PA...
Native class for boats - handles physics simulation.
array< ref TriggerInsider > GetInsiders()
Get the current TriggerInsider array, left for backwards compatibility, moved down from ManTrigger.
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
void Obsolete(string msg="")
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto bool IntersectCylinderOBB(vector mins, vector maxs, vector obbMat[4], vector cylMat[4], float cylinderRadius, float cylinderHeight)
Tests whether cylinder is intersecting oriented box.
static void MatrixIdentity4(out vector mat[4])
Creates identity matrix.
static proto float Max(float x, float y)
Returns bigger of two given values.
static proto float Floor(float f)
Returns floor of value.
static proto float Cos(float angle)
Returns cosinus of angle in radians.
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 Sin(float angle)
Returns sinus of angle in radians.
static proto float Ceil(float f)
Returns ceil of value.
static const float DEG2RAD
static proto float AbsFloat(float f)
Returns absolute value.
proto native void dBodyActive(notnull IEntity ent, ActiveState activeState)
proto void Insert(int index, string input)
Inserts a string into the n-th index, increasing the string length by the size of the input.
proto int ToLower()
Changes string to lowercase. Returns length.
proto native bool IsCLIParam(string param)
Returns if command line argument is present.
int ARGB(int a, int r, int g, int b)