65 protected bool m_IsResultOfSplit
132 if (!
g_Game.IsHeadlessOrDedicatedServer())
148 m_OldLocation = null;
155 m_IsResultOfSplit =
false;
160 super.InitItemVariables();
191 RegisterNetSyncVariableInt(
"m_VarLiquidType");
192 RegisterNetSyncVariableInt(
"m_Cleanness",0,1);
194 RegisterNetSyncVariableBoolSignal(
"m_WantPlayImpactSound");
195 RegisterNetSyncVariableFloat(
"m_ImpactSpeed");
196 RegisterNetSyncVariableInt(
"m_ImpactSoundSurfaceHash");
198 RegisterNetSyncVariableInt(
"m_ColorComponentR", 0, 255);
199 RegisterNetSyncVariableInt(
"m_ColorComponentG", 0, 255);
200 RegisterNetSyncVariableInt(
"m_ColorComponentB", 0, 255);
201 RegisterNetSyncVariableInt(
"m_ColorComponentA", 0, 255);
203 RegisterNetSyncVariableBool(
"m_IsBeingPlaced");
204 RegisterNetSyncVariableBool(
"m_IsTakeable");
205 RegisterNetSyncVariableBool(
"m_IsHologram");
212 RegisterNetSyncVariableInt(
"m_SoundSyncSlotID",
int.
MIN,
int.
MAX);
226 if (!m_InputActionMap)
265 typename ai = action.GetInputType();
281 Debug.
ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
285 if (action_array.Find(action) != -1)
287 Debug.
Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
291 action_array.Insert(action);
298 ActionBase action = player.GetActionManager().GetAction(actionName);
299 typename ai = action.GetInputType();
304 action_array.RemoveItem(action);
321 string config_to_search =
"CfgVehicles";
322 string muzzle_owner_config;
327 config_to_search =
"CfgWeapons";
329 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
331 string config_OnFire_class = muzzle_owner_config +
"Particles " +
"OnFire ";
333 int config_OnFire_subclass_count =
g_Game.ConfigGetChildrenCount(config_OnFire_class);
335 if (config_OnFire_subclass_count > 0)
339 for (
int i = 0; i < config_OnFire_subclass_count; i++)
341 string particle_class =
"";
342 g_Game.ConfigGetChildName(config_OnFire_class, i, particle_class);
343 string config_OnFire_entry = config_OnFire_class + particle_class;
344 WeaponParticlesOnFire WPOF =
new WeaponParticlesOnFire(
this, config_OnFire_entry);
345 WPOF_array.Insert(WPOF);
355 config_to_search =
"CfgWeapons";
356 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
358 string config_OnBulletCasingEject_class = muzzle_owner_config +
"Particles " +
"OnBulletCasingEject ";
360 int config_OnBulletCasingEject_count =
g_Game.ConfigGetChildrenCount(config_OnBulletCasingEject_class);
362 if (config_OnBulletCasingEject_count > 0 && IsInherited(
Weapon))
366 for (i = 0; i < config_OnBulletCasingEject_count; i++)
368 string particle_class2 =
"";
369 g_Game.ConfigGetChildName(config_OnBulletCasingEject_class, i, particle_class2);
370 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
371 WeaponParticlesOnBulletCasingEject WPOBE =
new WeaponParticlesOnBulletCasingEject(
this, config_OnBulletCasingEject_entry);
372 WPOBE_array.Insert(WPOBE);
389 string config_to_search =
"CfgVehicles";
392 config_to_search =
"CfgWeapons";
394 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
395 string config_OnOverheating_class = muzzle_owner_config +
"Particles " +
"OnOverheating ";
397 if (
g_Game.ConfigIsExisting(config_OnOverheating_class))
405 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
415 int config_OnOverheating_subclass_count =
g_Game.ConfigGetChildrenCount(config_OnOverheating_class);
418 for (
int i = 0; i < config_OnOverheating_subclass_count; i++)
420 string particle_class =
"";
421 g_Game.ConfigGetChildName(config_OnOverheating_class, i, particle_class);
422 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
423 int entry_type =
g_Game.ConfigGetType(config_OnOverheating_entry);
425 if (entry_type == CT_CLASS)
427 WeaponParticlesOnOverheating WPOF =
new WeaponParticlesOnOverheating(
this, config_OnOverheating_entry);
428 WPOOH_array.Insert(WPOF);
508 ItemBase.PlayOverheatingParticles(
this,
ammoType,
this, suppressor,
"CfgWeapons");
514 ItemBase.UpdateOverheatingParticles(
this,
ammoType,
this, suppressor,
"CfgWeapons");
521 ItemBase.StopOverheatingParticles(weapon,
ammoType, muzzle_owner, suppressor, config_to_search);
553 for (
int i = count; i > 0; --i)
562 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
664 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(
this);
669 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
671 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
675 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
684 player.GetHumanInventory().ClearUserReservedLocation(
this);
701 return ItemBase.m_DebugActionsMask & mask;
711 ItemBase.m_DebugActionsMask |= mask;
716 ItemBase.m_DebugActionsMask &= ~mask;
734 if (GetEconomyProfile())
736 float q_max = GetEconomyProfile().GetQuantityMax();
739 float q_min = GetEconomyProfile().GetQuantityMin();
763 EntityAI parent = GetHierarchyParent();
768 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
769 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
776 EntityAI parent = GetHierarchyParent();
781 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
782 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
804 ctx.
Write(use_stack_max);
814 else if (!
g_Game.IsMultiplayer())
912 if (!is_being_placed)
982 super.OnMovedInsideCargo(container);
984 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(
this, {
Bolt_Base});
989 super.EEItemLocationChanged(oldLoc, newLoc);
994 if (newLoc.GetParent())
995 newPlayer =
PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
997 if (oldLoc.GetParent())
998 oldPlayer =
PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
1002 int rIndex = oldPlayer.GetHumanInventory().FindUserReservedLocationIndex(
this);
1007 oldPlayer.GetHumanInventory().GetUserReservedLocation(rIndex, rIl);
1009 oldPlayer.GetHumanInventory().ClearUserReservedLocationAtIndex(rIndex);
1013 rIl.
GetParent().GetOnReleaseLock().Invoke(
this);
1026 newPlayer.ForceStandUpForHeavyItems(newLoc.GetItem());
1028 if (newPlayer == oldPlayer)
1030 if (oldLoc.GetParent() && newPlayer.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
1034 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc,
false,
false,
false,
true,
false,
false))
1036 newPlayer.GetHumanInventory().SetUserReservedLocation(
this,oldLoc);
1041 newPlayer.GetHumanInventory().SetUserReservedLocation(
this,oldLoc);
1045 if (newPlayer.GetHumanInventory().FindUserReservedLocationIndex(
this) >= 0)
1047 int type = oldLoc.GetType();
1050 oldLoc.GetParent().GetOnSetLock().Invoke(
this);
1054 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(
this, oldLoc.GetSlot());
1061 m_OldLocation.Copy(oldLoc);
1067 m_OldLocation.Reset();
1071 g_Game.GetAnalyticsClient().OnItemAttachedAtPlayer(
this,
"Hands");
1077 int resIndex = newPlayer.GetHumanInventory().FindCollidingUserReservedLocationIndex(
this, newLoc);
1081 newPlayer.GetHumanInventory().GetUserReservedLocation(resIndex, il);
1083 newPlayer.GetHumanInventory().ClearUserReservedLocationAtIndex(resIndex);
1087 il.
GetParent().GetOnReleaseLock().Invoke(it);
1104 m_OldLocation.Reset();
1110 PluginInventoryRepair.Cast(
GetPlugin(PluginInventoryRepair)).Remove(oldLoc.GetItem());
1115 PluginInventoryRepair.Cast(
GetPlugin(PluginInventoryRepair)).Add(oldLoc.GetItem());
1123 int liquidType = -1;
1125 float impactSpeed = ProcessImpactSoundEx(other, extra, itemBaseType.m_ConfigWeight,
m_ImpactSoundSurfaceHash, liquidType);
1126 if (impactSpeed > 0.0)
1142 if (GetCompEM() && GetCompEM().IsPlugged())
1145 GetCompEM().UnplugThis();
1164 super.OnItemLocationChanged(old_owner, new_owner);
1169 if (!relatedPlayer && playerNew)
1170 relatedPlayer = playerNew;
1172 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
1177 ActionBase currentAction = actionMgr.GetRunningAction();
1179 currentAction.OnItemLocationChanged(
this);
1183 Man ownerPlayerOld = null;
1184 Man ownerPlayerNew = null;
1188 if (old_owner.
IsMan())
1190 ownerPlayerOld = Man.Cast(old_owner);
1194 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
1203 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.GetID())
1205 GetCompEM().UnplugThis();
1212 if (new_owner.
IsMan())
1214 ownerPlayerNew = Man.Cast(new_owner);
1218 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
1222 if (ownerPlayerOld != ownerPlayerNew)
1228 for (
int i = 0; i < subItemsExit.Count(); i++)
1239 for (
int j = 0; j < subItemsEnter.Count(); j++)
1246 else if (ownerPlayerNew != null)
1249 if (
PlayerBase.CastTo(nplayer, ownerPlayerNew))
1253 for (
int k = 0; k < subItemsUpdate.Count(); k++)
1256 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
1262 old_owner.OnChildItemRemoved(
this);
1264 new_owner.OnChildItemReceived(
this);
1270 super.EEDelete(parent);
1276 if (player.IsAlive())
1278 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(
this);
1282 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
1284 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
1288 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
1292 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
1297 player.RemoveQuickBarEntityShortcut(
this);
1304 super.EEKilled(killer);
1313 if (Magazine.Cast(
this).GetAmmoCount() > 0)
1328 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(
this, {
Bolt_Base});
1330 super.OnWasAttached(parent, slot_id);
1341 super.OnWasDetached(parent, slot_id);
1356 ConfigGetTextArray(
"ChangeInventorySlot",inventory_slots);
1357 if (inventory_slots.Count() < 1)
1359 inventory_slots.Insert(ConfigGetString(
"ChangeInventorySlot"));
1360 attach_types.Insert(ConfigGetString(
"ChangeIntoOnAttach"));
1364 ConfigGetTextArray(
"ChangeIntoOnAttach",attach_types);
1367 idx = inventory_slots.Find(slot);
1371 return attach_types.Get(idx);
1382 this.ConfigGetTextArray(
"ChangeInventorySlot",inventory_slots);
1383 if (inventory_slots.Count() < 1)
1385 inventory_slots.Insert(this.ConfigGetString(
"ChangeInventorySlot"));
1386 detach_types.Insert(this.ConfigGetString(
"ChangeIntoOnDetach"));
1390 this.ConfigGetTextArray(
"ChangeIntoOnDetach",detach_types);
1391 if (detach_types.Count() < 1)
1392 detach_types.Insert(this.ConfigGetString(
"ChangeIntoOnDetach"));
1395 for (
int i = 0; i < inventory_slots.Count(); i++)
1397 slot = inventory_slots.
Get(i);
1402 if (detach_types.Count() == 1)
1405 idx = inventory_slots.Find(slot);
1410 return detach_types.Get(idx);
1423 explode_timer.Run(delay,
this,
"DoAmmoExplosion");
1428 Magazine magazine = Magazine.Cast(
this);
1429 int pop_sounds_count = 6;
1430 string pop_sounds[ 6 ] = {
"ammopops_1",
"ammopops_2",
"ammopops_3",
"ammopops_4",
"ammopops_5",
"ammopops_6" };
1434 string sound_name = pop_sounds[ sound_idx ];
1435 g_Game.CreateSoundOnObject(
this, sound_name, 20,
false);
1438 magazine.ServerAddAmmoCount(-1);
1441 float min_temp_to_explode = 100;
1443 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
1452 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
1454 const int CHANCE_DAMAGE_CARGO = 4;
1455 const int CHANCE_DAMAGE_ATTACHMENT = 1;
1456 const int CHANCE_DAMAGE_NOTHING = 2;
1460 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
1464 if (GetInventory().GetCargo())
1466 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
1469 if (rnd < CHANCE_DAMAGE_CARGO)
1473 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
1480 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
1483 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
1493 CargoBase cargo = GetInventory().GetCargo();
1501 if (!item.IsExplosive())
1503 item.AddHealth(
"",
"",damage);
1515 if (attachment_count > 0)
1519 if (!attachment.IsExplosive())
1521 attachment.AddHealth(
"",
"",damage);
1536 return GetInventory().CanRemoveEntity();
1572 ctx.
Write(destination_entity);
1578 else if (!
g_Game.IsMultiplayer())
1586 float split_quantity_new;
1595 split_quantity_new = stack_max;
1601 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
1604 new_item.SetResultOfSplit(
true);
1605 MiscGameplayFunctions.TransferItemProperties(
this, new_item);
1607 new_item.
SetQuantity(split_quantity_new,
false,
true);
1611 else if (destination_entity && slot_id == -1)
1613 if (quantity > stack_max)
1614 split_quantity_new = stack_max;
1616 split_quantity_new = quantity;
1620 GameInventory destinationInventory = destination_entity.GetInventory();
1629 new_item.SetResultOfSplit(
true);
1630 MiscGameplayFunctions.TransferItemProperties(
this, new_item);
1632 new_item.
SetQuantity(split_quantity_new,
false,
true);
1645 if (split_quantity_new == 0)
1647 if (!
g_Game.IsMultiplayer())
1648 player.PhysicalPredictiveDropItem(
this);
1650 player.ServerDropEntity(
this);
1660 new_item.SetResultOfSplit(
true);
1661 MiscGameplayFunctions.TransferItemProperties(
this, new_item);
1664 new_item.PlaceOnSurface();
1673 float split_quantity_new;
1682 split_quantity_new = stack_max;
1688 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
1691 new_item.SetResultOfSplit(
true);
1692 MiscGameplayFunctions.TransferItemProperties(
this, new_item);
1694 new_item.
SetQuantity(split_quantity_new,
false,
true);
1698 else if (destination_entity && slot_id == -1)
1700 if (quantity > stack_max)
1701 split_quantity_new = stack_max;
1703 split_quantity_new = quantity;
1707 GameInventory destinationInventory = destination_entity.GetInventory();
1716 new_item.SetResultOfSplit(
true);
1717 MiscGameplayFunctions.TransferItemProperties(
this, new_item);
1719 new_item.
SetQuantity(split_quantity_new,
false,
true);
1738 new_item.SetResultOfSplit(
true);
1739 MiscGameplayFunctions.TransferItemProperties(
this, new_item);
1742 new_item.PlaceOnSurface();
1760 dst.WriteToContext(ctx);
1765 else if (!
g_Game.IsMultiplayer())
1782 ctx.
Write(destination_entity);
1790 else if (!
g_Game.IsMultiplayer())
1804 float split_quantity_new;
1808 int slot_id = dst.GetSlot();
1811 if (quantity > stack_max)
1812 split_quantity_new = stack_max;
1814 split_quantity_new = quantity;
1825 new_item.SetResultOfSplit(
true);
1826 MiscGameplayFunctions.TransferItemProperties(
this,new_item);
1828 new_item.
SetQuantity(split_quantity_new,
false,
true);
1841 float split_quantity_new;
1843 if (destination_entity)
1846 if (quantity > stackable)
1847 split_quantity_new = stackable;
1849 split_quantity_new = quantity;
1853 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
1856 new_item.SetResultOfSplit(
true);
1857 MiscGameplayFunctions.TransferItemProperties(
this,new_item);
1859 new_item.
SetQuantity(split_quantity_new,
false,
true);
1876 ItemBase destination_entity =
this;
1877 ctx.
Write(destination_entity);
1883 else if (!
g_Game.IsMultiplayer())
1892 float split_quantity_new;
1897 if (quantity > stackable)
1898 split_quantity_new = stackable;
1900 split_quantity_new = quantity;
1904 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
1905 new_item =
ItemBase.Cast(in_hands);
1908 new_item.SetResultOfSplit(
true);
1909 MiscGameplayFunctions.TransferItemProperties(
this,new_item);
1911 new_item.SetQuantity(split_quantity_new,
false,
true);
1920 float split_quantity_new =
Math.
Floor(quantity * 0.5);
1932 if (new_item.GetQuantityMax() < split_quantity_new)
1934 split_quantity_new = new_item.GetQuantityMax();
1937 new_item.SetResultOfSplit(
true);
1938 MiscGameplayFunctions.TransferItemProperties(
this, new_item);
1948 new_item.
SetQuantity(split_quantity_new,
false,
true);
1956 float split_quantity_new =
Math.
Floor(quantity / 2);
1965 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(
this,
true);
1969 if (new_item.GetQuantityMax() < split_quantity_new)
1971 split_quantity_new = new_item.GetQuantityMax();
1981 new_item.
SetQuantity(split_quantity_new,
false,
true);
1993 parent.OnAttachmentQuantityChangedEx(
this, delta);
2003 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
2023 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
2030 EntityAI parent = GetHierarchyParent();
2031 if (parent && parent.IsFireplace())
2033 CargoBase cargo = GetInventory().GetCargo();
2051 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
2061 super.OnRightClick();
2069 EntityAI root = GetHierarchyRoot();
2070 Man playerOwner = GetHierarchyRootPlayer();
2074 if (!playerOwner && root && root ==
this)
2081 GetInventory().GetCurrentInventoryLocation(dst);
2094 if (
g_Game.GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
2116 else if (!
g_Game.IsMultiplayer())
2128 root.GetTransform(m4);
2129 dst.SetGround(
this, m4);
2133 GetInventory().GetCurrentInventoryLocation(dst);
2140 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
2151 Magazine mag = Magazine.Cast(
this);
2154 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
2157 if (stack_max_limit)
2159 Magazine other_mag = Magazine.Cast(other_item);
2162 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
2179 if (CastTo(player, GetHierarchyRootPlayer()))
2181 if (player.GetInventory().HasAttachment(
this))
2184 if (player.IsItemsToDelete())
2188 if (reservation_check && (GetInventory().HasInventoryReservation(
this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
2193 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
2206 return m_IsResultOfSplit;
2211 m_IsResultOfSplit = value;
2221 float other_item_quantity = other_item.GetQuantity();
2222 float this_free_space;
2228 if (other_item_quantity > this_free_space)
2230 return this_free_space;
2234 return other_item_quantity;
2248 if (!IsMagazine() && other_item)
2251 if (quantity_used != 0)
2253 float hp1 = GetHealth01(
"",
"");
2254 float hp2 = other_item.GetHealth01(
"",
"");
2255 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
2256 hpResult = hpResult / (
GetQuantity() + quantity_used);
2258 hpResult *= GetMaxHealth();
2260 SetHealth(
"",
"Health", hpResult);
2263 other_item.AddQuantity(-quantity_used);
2272 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
2273 GetHierarchyParent().IncreaseLifetimeUp();
2282 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
2283 if (moduleRecipesManager)
2285 EntityAI itemInHands = player.GetEntityInHands();
2286 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
2289 for (
int i = 0;i < recipesIds.Count(); i++)
2291 int key = recipesIds.Get(i);
2292 string recipeName = moduleRecipesManager.GetRecipeName(key);
2300 super.GetDebugActions(outputList);
2344 GetInventory().GetCurrentInventoryLocation(loc);
2347 if (Gizmo_IsSupported())
2360 super.OnAction(action_id, player, ctx);
2387 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
2389 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
2390 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
2392 if (
EActions.RECIPES_RANGE_START < 1000)
2394 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
2395 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
2399 else if (action_id ==
EActions.WATCH_PLAYER)
2401 PluginDeveloper.SetDeveloperItemClientEx(player);
2406 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
2408 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
2409 OnDebugButtonPressServer(
id + 1);
2412 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
2414 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
2418 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
2420 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
2424 else if (action_id ==
EActions.ADD_QUANTITY)
2428 Magazine mag = Magazine.Cast(
this);
2429 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
2438 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
2443 else if (action_id ==
EActions.REMOVE_QUANTITY)
2447 Magazine mag2 = Magazine.Cast(
this);
2448 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
2456 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
2461 else if (action_id ==
EActions.SET_QUANTITY_0)
2471 else if (action_id ==
EActions.SET_MAX_QUANTITY)
2477 m_EM.SetEnergy(m_EM.GetEnergyMax());
2481 else if (action_id ==
EActions.ADD_HEALTH)
2483 AddHealth(
"",
"",GetMaxHealth(
"",
"Health")/5);
2485 else if (action_id ==
EActions.REMOVE_HEALTH)
2487 AddHealth(
"",
"",-GetMaxHealth(
"",
"Health")/5);
2489 else if (action_id ==
EActions.DESTROY_HEALTH)
2491 SetHealth01(
"",
"",0);
2493 else if (action_id ==
EActions.WATCH_ITEM)
2498 SetDebugDeveloper_item(
this);
2502 else if (action_id ==
EActions.ADD_TEMPERATURE)
2508 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
2510 AddTemperature(-20);
2514 else if (action_id ==
EActions.FLIP_FROZEN)
2516 SetFrozen(!GetIsFrozen());
2520 else if (action_id ==
EActions.ADD_WETNESS)
2526 else if (action_id ==
EActions.REMOVE_WETNESS)
2532 else if (action_id ==
EActions.LIQUIDTYPE_UP)
2540 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
2546 else if (action_id ==
EActions.MAKE_SPECIAL)
2548 auto debugParams = DebugSpawnParams.WithPlayer(player);
2549 OnDebugSpawnEx(debugParams);
2591 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
2592 return g_Game.ConfigIsExisting(config_path);
2618 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
2619 return module_repairing.CanRepair(
this, item_repair_kit);
2625 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
2626 return module_repairing.Repair(player,
this, item_repair_kit, specialty_weight);
2671 player.MessageStatus(text);
2689 player.MessageAction(text);
2707 player.MessageFriendly(text);
2725 player.MessageImportant(text);
2738 string item_name = this.
GetType();
2740 g_Game.ConfigGetTextArray(
"cfgVehicles " + item_name +
" itemInfo", item_tag_array);
2742 int array_size = item_tag_array.Count();
2743 for (
int i = 0; i < array_size; i++)
2745 if (item_tag_array.Get(i) == tag)
2758 super.OnRPC(sender, rpc_type,ctx);
2765 case ERPCs.RPC_SOUND_LOCK_ATTACH:
2772 bool play = p.param1;
2773 string soundSet = p.param2;
2796 case ERPCs.RPC_ITEM_SOUND_PLAY:
2799 if (!ctx.
Read(count))
2802 for (
int i = 0; i < count; i++)
2804 int soundIdPlay, slotIdPlay;
2805 if (!ctx.
Read(soundIdPlay))
2808 if (!ctx.
Read(slotIdPlay))
2816 case ERPCs.RPC_ITEM_SOUND_STOP:
2819 if (!ctx.
Read(soundIdStop))
2842 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
2843 return plugin.GetID(
name);
2848 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
2849 return plugin.GetName(
id);
2858 if (!ctx.
Read(varFlags))
2870 super.SerializeNumericalVars(floats_out);
2906 super.DeSerializeNumericalVars(floats);
2910 int mask =
Math.
Round(floats.Get(index));
2922 float quantity = floats.Get(index);
2930 float wet = floats.Get(index);
2937 int liquidtype =
Math.
Round(floats.Get(index));
2956 int cleanness =
Math.
Round(floats.Get(index));
2964 super.WriteVarsToCTX(ctx);
3000 if (!super.ReadVarsFromCTX(ctx,version))
3008 if (!ctx.
Read(intValue))
3011 m_VariablesMask = intValue;
3016 if (!ctx.
Read(value))
3033 if (!ctx.
Read(value))
3035 SetTemperatureDirect(value);
3041 if (!ctx.
Read(value))
3048 if (!ctx.
Read(intValue))
3070 if (!ctx.
Read(intValue))
3075 if (version >= 138 && version < 140)
3079 if (!ctx.
Read(intValue))
3081 SetFrozen(intValue);
3097 if (!super.OnStoreLoad(ctx, version))
3105 bool hasQuickBarIndexSaved;
3107 if (!ctx.
Read(hasQuickBarIndexSaved))
3113 if (hasQuickBarIndexSaved)
3118 if (!ctx.
Read(itmQBIndex))
3125 if (itmQBIndex != -1 && parentPlayer)
3126 parentPlayer.SetLoadedQuickBarItemBind(
this, itmQBIndex);
3134 if (version ==
int.
MAX)
3136 if (!ctx.
Read(itemQBIndex))
3142 else if (
Class.
CastTo(player, GetHierarchyRootPlayer()))
3145 if (!ctx.
Read(itemQBIndex))
3150 if (itemQBIndex != -1 && player)
3151 player.SetLoadedQuickBarItemBind(
this,itemQBIndex);
3158 if (!LoadVariables(ctx, version))
3192 super.OnStoreSave(ctx);
3195 if (
PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
3199 int itemQBIndex = -1;
3200 itemQBIndex = player.FindQuickBarEntityIndex(
this);
3201 ctx.
Write(itemQBIndex);
3220 super.AfterStoreLoad();
3236 super.EEOnAfterLoad();
3258 #ifdef PLATFORM_CONSOLE
3288 super.OnVariablesSynchronized();
3315 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
3317 if (!IsServerCheck(allow_client))
3326 if (value <= (min + 0.001))
3333 bool dstr = ConfigGetBool(
"varQuantityDestroyOnMin");
3341 else if (destroy_forced)
3354 EntityAI parent = GetHierarchyRoot();
3362 int iLocSlot = iLoc.
GetSlot();
3389 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
3409 float value_clamped =
Math.
Clamp(value, 0, 1);
3411 SetQuantity(result, destroy_config, destroy_forced);
3457 if (attSlotID != -1)
3500 float weightEx = GetWeightEx();
3501 float special = GetInventoryAndCargoWeight();
3502 return weightEx - special;
3516 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
3525 else if (HasEnergyManager())
3528 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
3531 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
3534 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
3539 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
3542 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
3545 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
3563 for (
int i = 0; i < nAttachments; ++i)
3567 item_count += item.GetNumberOfItems();
3577 if (include_wetness)
3581 weight = wetness *
ItemBaseType.Cast(GetEntityType()).m_ConfigWeight;
3595 if ((
g_Game.IsServer() || !
g_Game.IsMultiplayer()) && inventory)
3599 for (
int i = 0; i < items.Count(); ++i)
3604 g_Game.ObjectDelete(item);
3616 if (HasEnergyManager())
3618 energy = GetCompEM().GetEnergy();
3626 super.OnEnergyConsumed();
3633 super.OnEnergyAdded();
3668 [
Obsolete(
"1.30: replaced by GetDryingIncrement taking enum/int arguments")]
3671 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
3672 if (
g_Game.ConfigIsExisting(paramPath))
3673 return g_Game.ConfigGetFloat(paramPath);
3678 [
Obsolete(
"1.30: replaced by GetSoakingIncrement taking enum/int arguments")]
3681 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
3682 if (
g_Game.ConfigIsExisting(paramPath))
3683 return g_Game.ConfigGetFloat(paramPath);
3688 override void SetWet(
float value,
bool allow_client =
false)
3690 if (!IsServerCheck(allow_client))
3741 if (newLevel != oldLevel)
3754 return GetWetLevelInternal(
m_VarWet);
3783 return ItemBaseType.Cast(GetEntityType()).m_ItemModelLength;
3793 if (!IsServerCheck(allow_client))
3840 override void GetColor(out
int r,out
int g,out
int b,out
int a)
3862 return MiscGameplayFunctions.GetColorString(r, g, b, a);
3869 if (!IsServerCheck(allow_client))
3897 player.SetEnableQuickBarEntityShortcut(
this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
3908 nplayer.SetEnableQuickBarEntityShortcut(
this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
3919 nplayer.SetEnableQuickBarEntityShortcut(
this,
false);
3922 player.GetHumanInventory().ClearUserReservedLocationForContainer(
this);
3924 if (HasEnergyManager())
3926 GetCompEM().UpdatePlugState();
3933 super.OnPlacementStarted(player);
3942 m_AdminLog.OnPlacementComplete(player,
this);
4062 super.CheckForRoofLimited(timeTresholdMS);
4064 float time =
g_Game.GetTime();
4065 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
4067 m_PreviousRoofTestTime = time;
4068 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(
this));
4078 string subclassPath, entryName;
4083 entryName =
"biological";
4086 entryName =
"chemical";
4089 entryName =
"dust_particle_breath";
4092 entryName =
"dust_particle_eyes";
4095 entryName =
"biological";
4099 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
4101 return g_Game.ConfigGetFloat(subclassPath + entryName);
4143 if (!parent.IsRuined())
4152 if (!super.CanPutAsAttachment(parent))
4157 if (!IsRuined() && !parent.IsRuined())
4171 return super.CanReceiveItemIntoCargo(item);
4183 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(
PlayerBase))
4188 attachment.GetInventory().GetCurrentInventoryLocation(loc);
4189 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
4192 return super.CanReceiveAttachment(attachment, slotId);
4197 if (!super.CanReleaseAttachment(attachment))
4200 return GetInventory().AreChildrenAccessible();
4225 int id = muzzle_owner.GetMuzzleID();
4230 for (
int i = 0; i < WPOF_array.Count(); i++)
4232 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
4236 WPOF.OnActivate(weapon, muzzle_index,
ammoType, muzzle_owner, suppressor, config_to_search);
4245 int id = muzzle_owner.GetMuzzleID();
4250 for (
int i = 0; i < WPOBE_array.Count(); i++)
4252 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
4256 WPOBE.OnActivate(weapon, 0,
ammoType, muzzle_owner, suppressor, config_to_search);
4265 int id = muzzle_owner.GetMuzzleID();
4270 for (
int i = 0; i < WPOOH_array.Count(); i++)
4272 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
4276 WPOOH.OnActivate(weapon, 0,
ammoType, muzzle_owner, suppressor, config_to_search);
4285 int id = muzzle_owner.GetMuzzleID();
4290 for (
int i = 0; i < WPOOH_array.Count(); i++)
4292 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
4296 WPOOH.OnUpdate(weapon,
ammoType, muzzle_owner, suppressor, config_to_search);
4305 int id = muzzle_owner.GetMuzzleID();
4310 for (
int i = 0; i < WPOOH_array.Count(); i++)
4312 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
4316 WPOOH.OnDeactivate(weapon,
ammoType, muzzle_owner, suppressor, config_to_search);
4326 if (
ItemBaseType.Cast(GetEntityType()).m_ItemBehaviour == 0)
4334 if (
ItemBaseType.Cast(GetEntityType()).m_ItemBehaviour == 1)
4342 if (
ItemBaseType.Cast(GetEntityType()).m_ItemBehaviour == 2)
4382 string att_type =
"None";
4384 if (ConfigIsExisting(
"soundAttType"))
4386 att_type = ConfigGetString(
"soundAttType");
4438 if (!
GetGame().IsServer() ||
id <= 0)
4473 rpc.
Write(ev.m_SoundId);
4474 rpc.
Write(ev.m_SlotId);
4476 rpc.
Send(
this,
ERPCs.RPC_ITEM_SOUND_PLAY,
true);
4502 rpc.
Send(
this,
ERPCs.RPC_ITEM_SOUND_STOP,
true);
4532 SetDynamicPhysicsLifeTime(0.01);
4539 GetDamageZones(zone_names);
4540 for (
int i = 0; i < zone_names.Count(); i++)
4542 SetHealthMax(zone_names.Get(i),
"Health");
4544 SetHealthMax(
"",
"Health");
4550 float global_health = GetHealth01(
"",
"Health");
4552 GetDamageZones(zones);
4554 for (
int i = 0; i < zones.Count(); i++)
4556 SetHealth01(zones.Get(i),
"Health",global_health);
4563 return IsExclusionFlagPresent(
PlayerBase.GetFaceCoverageShaveValues());
4568 if (!hasRootAsPlayer)
4577 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
ItemBaseType.Cast(GetEntityType()).m_VarWetMax))
4596 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
4597 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
4599 float heatPermCoef = 1.0;
4603 heatPermCoef *= ent.GetHeatPermeabilityCoef();
4604 ent = ent.GetHierarchyParent();
4615 EntityAI parent = GetHierarchyParent();
4619 hasRootAsPlayer =
false;
4624 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
4625 refParentIB =
ItemBase.Cast(parent);
4656 return !GetIsFrozen() &&
IsOpen();
4661 bool hasParent =
false, hasRootAsPlayer =
false;
4664 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
4665 bool foodDecay =
g_Game.IsFoodDecayEnabled();
4667 if (wwtu || foodDecay)
4673 if (processWetness || processTemperature || processDecay)
4680 if (processTemperature)
4700 return super.GetTemperatureFreezeThreshold();
4708 return super.GetTemperatureThawThreshold();
4716 return super.GetItemOverheatThreshold();
4724 return super.GetTemperatureFreezeTime();
4732 return super.GetTemperatureThawTime();
4742 return (item.IsKindOf(
"Cauldron") || item.IsKindOf(
"Pot") || item.IsKindOf(
"FryingPan") || item.IsKindOf(
"SmallProtectorCase") || (item.IsKindOf(
"PortableGasStove") && item.FindAttachmentBySlotName(
"CookingEquipment")));
4747 MiscGameplayFunctions.TransferItemProperties(oldItem,
this);
4790 explosive.PairRemote(trg);
4794 trg.SetPersistentPairID(persistentID);
4795 explosive.SetPersistentPairID(persistentID);
4808 ret *= GetHealth01();
4814 override void SetDebugItem()
4816 super.SetDebugItem();
4822 string text = super.GetDebugText();
4825 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
4844 playerBase.NotifyPlayerLoadChanged();
4898 [
Obsolete(
"Use ItemSoundHandler instead")]
4902 if (!
g_Game.IsHeadlessOrDedicatedServer())
4904 if (ConfigIsExisting(
"attachSoundSet"))
4906 string cfg_path =
"";
4907 string soundset =
"";
4912 ConfigGetTextArray(
"attachSoundSet",cfg_soundset_array);
4913 ConfigGetTextArray(
"attachSoundSlot",cfg_slot_array);
4915 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
4917 for (
int i = 0; i < cfg_soundset_array.Count(); i++)
4919 if (cfg_slot_array[i] == slot_type)
4921 soundset = cfg_soundset_array[i];
4957 bool is_item = entity.IsInherited(
ItemBase);
4958 if (is_item && full_quantity)
4977 item.SetHealth(
"",
"", health);
4979 if (item.CanHaveTemperature())
4982 if (item.CanFreeze())
4983 item.SetFrozen(
false);
4986 if (item.HasEnergyManager())
4990 item.GetCompEM().SetEnergy0To1(quantity);
4997 else if (item.IsMagazine())
4999 Magazine mag = Magazine.Cast(item);
5002 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
5014 item.SetQuantityNormalized(quantity,
false);
ActionOverrideData TSelectableActionInfo
Param4< int, int, string, int > TSelectableActionInfoWithColor
bool SetAttachSoundEvent()
bool SetDetachSoundEvent()
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
override bool CanReleaseAttachment(EntityAI attachment)
bool IsDamageDestroyed(ActionTarget target)
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void SetQuantity()
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool IsPrepareToDelete()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
proto GizmoApi GetGizmoApi()
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool IsSplitable()
override bool IsHologram()
void ClearStopItemSoundServer()
void SetResultOfSplit(bool value)
override float GetSingleInventoryItemWeightEx()
override float GetItemOverheatThreshold()
bool DamageItemInCargo(float damage)
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void ProcessDecay(float delta, bool hasRootAsPlayer)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
ref TIntArray m_SingleUseActions
void LegacyStopItemSoundServer(int id)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
override void SetStoreLoadedQuantity(float value)
ScriptedLightBase GetLight()
ref array< ref OverheatingParticle > m_OverheatingParticles
float GetDryingIncrement(EEnvironmentDryingCategories pCategory)
float GetHeatIsolationInit()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
bool m_IsSoundSynchRemote
void LoadParticleConfigOnOverheating(int id)
void StopItemDynamicPhysics()
override void NotifyPlayerLoadChanged(EntityAI owner)
bool m_RecipesInitialized
bool IsActionTargetVisible()
float GetDeployTime()
how long it takes to deploy this item in seconds
override void RemoveAllAgentsExcept(int agent_to_keep)
void StartItemSoundClient(int id, int slotId=InventorySlots.INVALID)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
override float GetTemperatureFreezeThreshold()
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_InteractActions
override void InsertAgent(int agent, float count=1)
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
override float GetTemperatureFreezeTime()
void OnLiquidTypeChanged(int oldType, int newType)
override void EOnContact(IEntity other, Contact extra)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
override void SetCleanness(int value, bool allow_client=false)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
override float GetWetMax()
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
bool m_CanBeMovedOverride
override bool IsDetectableByVicinityCone()
float GetDisinfectQuantity(int system=0, Param param1=null)
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
array< string > GetHeadHidingSelection()
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
int m_ShotsToStartOverheating
bool IsExternalLockType()
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsPlayerInsideEx(DayZPlayer player, string selection)
useful for construction and inventory related systems
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
override string ChangeIntoOnAttach(string slot)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
void SoundSynchRemoteReset()
ItemSoundHandler GetItemSoundHandler()
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
override bool IsStoreLoad()
void ConvertEnergyToQuantity()
int GetLiquidContainerMask()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void RemoveAgent(int agent_id)
bool CanPlayDetachSound()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
bool m_CanPlayImpactSound
static void ToggleDebugActionsMask(int mask)
void OnActivatedByTripWire()
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
override int GetQuantityMin()
ref array< ref ItemSoundEvent > m_SoundEventQueue
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
override void RemoveAllAgents()
void LegacyItemSoundSync()
override float GetQuantity()
const int ITEM_SOUNDS_MAX
override bool HasQuantity()
override void OnWetChanged(float newVal, float oldVal)
override string GetAttachmentSoundType()
override void SetStoreLoad(bool value)
override string ChangeIntoOnDetach()
void ClearStartItemSoundServer()
string GetLoopDeploySoundset()
override void OnEnergyAdded()
override float GetWetInit()
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
int NameToID(string name)
override bool IsBeingPlaced()
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
override void SetWetMax()
override void SetTakeable(bool pState)
void SetIsHologram(bool is_hologram)
override void OnRightClick()
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ref TIntArray m_ContinuousActions
void UpdateAllOverheatingParticles()
bool AllowFoodConsumption()
void SaveAgents(ParamsWriteContext ctx)
float GetOverheatingCoef()
int m_ImpactSoundSurfaceHash
override void SetWet(float value, bool allow_client=false)
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
void KillAllOverheatingParticles()
string GetPlaceSoundset()
override void ProcessVariables(float elapsedTime)
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
override bool IsOneHandedBehaviour()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
ItemBase GetLightSourceItem()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
float m_OverheatingDecayInterval
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool LoadAgents(ParamsReadContext ctx, int version)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void PlayDetachSound(string slot_type)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureThawTime()
bool can_this_be_combined
array< int > GetValidFinishers()
returns an array of possible finishers
override int GetLiquidType()
override void SetQuantityToMinimum()
EffectSound m_SoundDeploy
void SetIsPlaceSound(bool is_place_sound)
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
override float GetTemperatureThawThreshold()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
bool m_WantPlayImpactSound
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
EntityAI SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float m_StoreLoadedQuantity
override float GetWetMin()
override int GetQuickBarBonus()
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void SplitIntoStackMaxHands(PlayerBase player)
void SetIsDeploySound(bool is_deploy_sound)
bool CanBeMovedOverride()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
float GetItemAttachOffset()
float GetFilterDamageRatio()
static bool HasDebugActionsMask(int mask)
void RemoveAudioVisualsOnClient()
void RemoveLightSourceItem()
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
ref Timer m_CheckOverheating
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
string GetDeploySoundset()
void OnApply(PlayerBase player)
static int GetDebugActionsMask()
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
void OnOverheatingDecay()
bool ShouldSplitQuantity(float quantity)
void StopItemSoundServer(int id)
void PerformDamageSystemReinit()
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
bool CanBeUsedForSuicide()
static void SetDebugActionsMask(int mask)
override void ClearInventory()
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void SetCEBasedQuantity()
bool ContainsAgent(int agent_id)
void SetIsBeingPlaced(bool is_being_placed)
override void AddWet(float value)
override void OnMovedInsideCargo(EntityAI container)
bool HidesSelectionBySlot()
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
float GetWeightSpecialized(bool forceRecalc=false)
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
EffectSound m_DeployLoopSoundEx
void StopDeployLoopSoundEx()
override bool IsHeavyBehaviour()
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
string GetExplosiveTriggerSlotName()
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
float GetItemModelLength()
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
override int GetTargetQuantityMax(int attSlotID=-1)
override bool KindOf(string tag)
void PlayDeployFinishSound()
void FlushItemSoundQueue()
class ItemSoundEvent m_ItemTypeActionsMap
bool m_IsOverheatingEffectActive
bool DamageItemAttachments(float damage)
override void DeSerializeNumericalVars(array< float > floats)
bool CanBeCookedOnStick()
void StartItemSoundServer(int id, int slotId)
bool CanPlayDeployLoopSound()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
bool CanPlayAttachSound()
static void AddDebugActionsMask(int mask)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
static int m_LastRegisteredWeaponID
void SetCanBeMovedOverride(bool setting)
override void WriteVarsToCTX(ParamsWriteContext ctx)
static void RemoveDebugActionsMask(int mask)
float GetOverheatingValue()
void TransferAgents(int agents)
transfer agents from another item
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void PlayDeployLoopSoundEx()
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
bool CanRepair(ItemBase item_repair_kit)
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
static int m_DebugActionsMask
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
bool m_ItemBeingDroppedPhys
override int GetCleanness()
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
bool m_FixDamageSystemInit
float GetSoakingIncrement(EEnvironmentSoakingCategories pCategory)
bool IsSoundSynchRemote()
void LoadParticleConfigOnFire(int id)
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
ItemBase m_LightSourceItem
override bool IsFacingPlayerEx(DayZPlayer player, string selection)
void SplitItem(PlayerBase player)
override void SetLiquidType(int value, bool allow_client=false)
float GetSingleInventoryItemWeight()
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
override EWetnessLevel GetWetLevel()
override void SerializeNumericalVars(array< float > floats_out)
override float GetStoreLoadedQuantity()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
string GetDeployFinishSoundset()
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
bool IsOverheatingEffectActive()
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override bool IsItemBase()
ref ItemSoundHandler m_ItemSoundHandler
void CopyScriptPropertiesFrom(EntityAI oldItem)
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
override bool IsTwoHandedBehaviour()
bool PairWithDevice(notnull ItemBase otherDevice)
override int GetQuantityMax()
override void OnEnergyConsumed()
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
represents base for cargo storage for entities
Super root of all classes in Enforce script.
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
bool HasConversionOfEnergyToQuantity()
Energy manager: Returns true if this item automatically converts its energy to quantity.
float GetEnergy0To1()
Energy manager: Returns % of stored energy this device has as float (from 0.0 to 1....
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
static void LogError(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message as error message.
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 void ActionLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
Wrapper class for managing sound through SEffectManager.
proto native EntityAI GetAttachmentFromIndex(int index)
proto native bool GetCurrentInventoryLocation(out notnull InventoryLocation loc)
returns information about current item location
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
const int c_InventoryReservationTimeoutShortMS
static proto native EntityAI LocationCreateEntity(notnull InventoryLocation inv_loc, string type, int iSetupFlags, int iRotation)
creates new item directly at location
proto native int AttachmentCount()
Returns count of attachments attached to this item.
proto native bool FindFreeLocationFor(notnull EntityAI item, FindInventoryLocationType flags, out notnull InventoryLocation loc)
FindFreeLocationFor.
script counterpart to engine's class Inventory
proto void SelectObject(Object object)
proto void SelectPhysics(Physics physics)
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
const int INVALID
Invalid slot (-1)
static proto native bool IsSlotIdValid(int slotId)
verifies existence of the slot id
static proto native int GetStackMaxForSlotId(int slot_Id)
provides access to slot configuration
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
int m_LiquidContainerMask
ref TStringArray m_HeadHidingSelections
int m_CleannessInit
Cleanness config.
int m_LockType
Attachment locking.
float m_VarWetInit
Wetness config.
ref TIntFloatMap m_DryingIncrements
bool m_HideSelectionsBySlot
float m_TemperaturePerQuantityWeight
float m_ItemModelLength float m_ItemAttachOffset
ref TIntFloatMap m_SoakingIncrements
void ItemSoundEvent(int soundId, int slotId)
static bool IsActionLogEnable()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
Legacy way of using particles in the game.
The class that will be instanced (moddable)
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
static int GeneratePersistentID()
static EffectSound PlaySound(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound.
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
Manager class for managing Effect (EffectParticle, EffectSound)
proto native void Send(Object target, int rpc_type, bool guaranteed, PlayerIdentity recipient=NULL)
Initiate remote procedure call. When called on client, RPC is evaluated on server; When called on ser...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
const float DEFAULT_DEPLOY
script counterpart to engine's class Weapon
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
Serializer ParamsWriteContext
const int DEF_DUST_PARTICLE_BREATH
const int DEF_DUST_PARTICLE_EYES
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
const float WETNESS_RATE_WETTING_INSIDE
const float ITEM_TEMPERATURE_TO_EXPLODE_MIN
misc
const float WETNESS_RATE_WETTING_LIQUID
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
class array< Class T > TStringArray
void Obsolete(string msg="")
EntityEvent
Entity events for event-mask, or throwing event from code.
const float TEMP_COEF_WORLD
static const float TEMPERATURE_TIME_THAW_MIN
static const float TEMPERATURE_TIME_FREEZE_MIN
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const float ITEM_TEMPERATURE_QUANTITY_WEIGHT_MULTIPLIER
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
const float STATE_SOAKING_WET
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 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 Round(float f)
Returns mathematical round of value.
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].
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,...
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
vector GetPosition()
Get the world position of the Effect.
proto string Get(int index)
Gets n-th character from string.
static proto string Format(string fmt, 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)
Gets n-th character from string.