DayZ Enforce
Script API
Private Member Functions | Private Attributes | List of all members
EntityAI Class Reference

#include <gameplay.h>

Inheritance diagram for EntityAI:
Entity Building InventoryItem Man PASBroadcaster ScriptedEntity Thing Transport BuildingBase UndergroundStash ItemBase ManBase SurvivorPartsFemaleWhite EN5C_PAS_Broadcaster EntityDebugSync Trigger TankOrCar

Private Member Functions

Component  CreateComponent (int comp_type, string extended_class_name="")
 
Component  GetComponent (int comp_type, string extended_class_name="")
 
bool  HasComponent (int comp_type)
 
void  Log (string msg, string fnc_name="n/a")
 
void  LogWarning (string msg, string fnc_name="n/a")
 
void  LogError (string msg, string fnc_name="n/a")
 
void  EntityAI ()
 
void  ~EntityAI ()
 
EntityEventHandler  GetEventHandler ()
 
void  SetEventHandler (EntityEventHandler event_handler)
 
array< int >  GetAgents ()
 
void  InsertAgent (int agent, int count=1)
 
bool  IsEntityAI ()
 
void  Delete ()
  Delete this object in next frame. More...
 
proto bool  GetVariable (string varName, out void var)
  Entity-variables can be used/shared with SQF scripts through EntityAI::GetVariable/SetVariable methods (the same as getVariable/setVariable on SQF side) More...
 
proto void  SetVariable (string varName, void var)
  Entity-variables can be used/shared with SQF scripts through EntityAI::GetVariable/SetVariable methods (the same as getVariable/setVariable on SQF side) More...
 
proto void  OnEvent (int eventType, Param params)
  Legacy event system can be used from enforce script through EntityAI::OnEvent method. (parameters are passed through Params class. Variables in params class must match with event handler parameters.). It's best way how to call SQF code from enforce-scripted entities. More...
 
proto Man  GetOwnerPlayer ()
  Returns player which owns this entity (top in ownership hierarchy) More...
 
proto EntityAI  GetOwner ()
  Returns direct owner of this entity (for example: if this entity is in Backpack, returns Backpack) More...
 
string  GetVariableString (string varName)
 
int  GetVariableInt (string varName)
 
float  GetVariableFloat (string varName)
 
Object  GetVariableObject (string varName)
 
void  EEInit ()
  Called upon object creation. More...
 
void  EEAnimHook (int userType, string param)
 
void  EEAnimDone (string moveName)
 
void  EEItemLocationChanged (EntityAI old_owner, EntityAI new_owner)
 
void  EEAnimStateChanged (string moveName)
 
void  EEFired (string weaponType, string muzzleType, string mode, string type, string magazineType, Object missile)
 
void  EELocal (bool isLocal)
 
void  EEEngine (bool onOff)
 
void  EEFuel (bool hasFuel)
 
void  EEDammaged (string hitpointName, float hit)
 
void  EEKilled (Object killer)
 
void  EEHitBy (TotalDamageResult damageResult, int damageType, EntityAI source, string component, string ammo, vector modelPos)
 
void  EEItemAttached (EntityAI item, string slot_name)
 
void  EEItemDetached (EntityAI item, string slot_name)
 
void  EECargoIn (EntityAI item)
 
void  EECargoOut (EntityAI item)
 
void  EECargoMove (EntityAI item)
 
void  EEOnWaterEnter ()
 
void  EEOnWaterExit ()
 
void  EEUsed (Man owner)
 
void  EEVariableSynchronized (string variable_name)
  Called on client (in multiplayer) when sqf synchronize variable is synchronized. More...
 
bool  ConditionAttachEntityAI (EntityAI child)
 
bool  ConditionAttach (EntityAI parent)
 
bool  ConditionDetachEntityAI (EntityAI child)
 
bool  ConditionDetach (EntityAI parent)
 
bool  ConditionCargoInEntityAI (EntityAI child)
 
bool  ConditionCargoIn (EntityAI parent)
 
bool  ConditionCargoOutEntityAI (EntityAI child)
 
bool  ConditionCargoOut (EntityAI parent)
 
bool  ConditionIntoInventoryEntityAI (EntityAI entity_ai)
 
bool  ConditionIntoInventory (EntityAI player)
 
bool  ConditionIntoHandsEntityAI (EntityAI entity_ai)
 
bool  ConditionIntoHands (EntityAI player)
 
bool  ConditionOutOfHandsEntityAI (EntityAI entity_ai)
 
bool  ConditionOutOfHands (EntityAI player)
 
proto int  GetSlotId ()
  Returns attachment slot where this item belongs. More...
 
proto int  GetSlotsCount ()
  Returns number of slots for attachments. More...
 
proto int  AttachmentsCount ()
  Returns count of attachments attached to this item. More...
 
proto EntityAI  GetAttachmentFromIndex (int index)
  Returns attached entity by attachment index. More...
 
proto bool  HasAttachment (EntityAI e)
  Returns True if entity is attached to this. More...
 
proto bool  HasAttachmentEx (EntityAI e, int slot)
  Returns True if entity is attached to this in slot. More...
 
proto EntityAI  FindAttachment (int slot)
  Returns attached entity in slot. More...
 
proto EntityAI  FindPlaceholderForSlot (int slot)
  Returns placeholder entity for slot (naked arms, legs etc) More...
 
proto bool  CanRemoveAttachment (EntityAI attachment)
 
proto bool  CanRemoveAttachmentEx (EntityAI attachment, int slot)
 
proto bool  CanRemoveEntity ()
  Returns if entity can be removed from its current location. More...
 
proto bool  RemoveAttachment (EntityAI attachment)
  Remove attachment. More...
 
proto bool  RemoveAttachmentEx (EntityAI attachment, int slot)
  Remove attachment from slot. More...
 
proto EntityAI  CreateOwnedEntity (string typeName)
  Create Entity of specified type inside this entity. More...
 
proto EntityAI  CreateAttachment (string typeName)
  Create Entity of specified type as attachment of entity. More...
 
bool  CanTakeEntityAsOwned (EntityAI item)
  Returns if item can be added anywhere into this entity (as attachment or into cargo, recursively) More...
 
bool  TakeEntityAsOwned (EntityAI item)
  Put item anywhere into this entity (as attachment or into cargo, recursively) More...
 
bool  TakeEntityToCargo (EntityAI item)
  Put item into into cargo. More...
 
bool  TakeEntityToCargoAtPos (EntityAI item, Cargo cargo, int row, int col)
  Put item into into cargo on specific cargo location. More...
 
bool  CanTakeEntityAsAttachmentToSlot (EntityAI item, int slot)
  Returns if item can be added as attachment on specific slot. More...
 
bool  TakeEntityAsAttachmentToSlot (EntityAI item, int slot)
  Put item into as attachment on specific slot. More...
 
bool  CanTakeEntityAsAttachment (EntityAI item)
  Returns if item can be added as attachment. More...
 
bool  TakeEntityAsAttachment (EntityAI item)
  Put item into as attachment. More...
 
bool  CanDropEntity (EntityAI item)
  Returns if item can be dropped out from this entity. More...
 
bool  DropEntity (EntityAI item)
  Drop item out of this entity. More...
 
proto bool  CanAddAttachment (EntityAI e)
  LOW LEVEL: Check if attachment can be added to any slot. More...
 
proto bool  CanAddAttachmentEx (EntityAI e, int slot)
  LOW LEVEL: Check if attachment can be added to slot. More...
 
proto Cargo  GetCargo ()
  LOW LEVEL: Get Cargo class for this entity. More...
 
proto bool  HasProxyCargo ()
 
proto int  GetProxyCargoCount ()
 
proto Cargo  GetProxyCargo (int cargoIndex)
 
proto bool  HasOwnedEntity (EntityAI item)
 
proto bool  CanAddOwnedEntity (EntityAI item)
 
proto bool  AddOwnedEntity (EntityAI item)
 
proto bool  CanRemoveOwnedEntity (EntityAI item)
 
proto bool  RemoveOwnedEntity (EntityAI item)
 
proto bool  HasEntityInCargo (EntityAI e)
 
proto bool  HasEntityInCargoEx (EntityAI e, int row, int col)
 
proto bool  CanAddEntityInCargo (EntityAI e)
 
proto bool  CanAddEntityInCargoEx (EntityAI e, int row, int col)
 
proto bool  AddEntityInCargo (EntityAI owner, EntityAI cargo)
 
proto bool  AddEntityInCargoEx (EntityAI owner, EntityAI e, int row, int col)
 
proto bool  CanRemoveEntityInCargo (EntityAI e)
 
proto bool  RemoveEntityInCargo (EntityAI owner, EntityAI e)
 
proto bool  CanLockInventoryWithKey (EntityAI key)
 
proto bool  CanUnlockInventoryWithKey (EntityAI key)
 
proto void  LockInventoryWithKey (EntityAI key)
 
proto void  UnlockInventoryWithKey (EntityAI key)
 
proto bool  HasKeys ()
 
proto void  LockInventory (int lockType)
 
proto void  UnlockInventory (int lockType)
 
proto bool  IsInventoryUnlocked ()
 
proto bool  IsInventoryLocked ()
 
proto void  SetObjectTexture (int index, string texture_name)
  Change texture in hiddenSelections. More...
 
proto void  SetObjectMaterial (int index, string mat_name)
  Change material in hiddenSelections. More...
 
proto float  GetAnimationPhase (string animation)
  Return animation phase of animation on object. More...
 
void  SetAnimationPhase (string animation, float phase)
  Process animation on object. Animation is defined in config file. Wanted animation phase is set to phase. More...
 
proto bool  IsPilotLight ()
 
proto void  SetPilotLight (bool isOn)
 
proto bool  IsWaterContact ()
 
proto EntityAI  GetVehicle ()
  Returns the vehicle in which the given unit is mounted. If there is none, the unit is returned. More...
 
proto void  SetAllowDamage (bool val)
 
proto void  GetActions (Man player, EntityAI with=NULL)
  Get list of available actions. More...
 
proto bool  HasActions (Man player, EntityAI with=NULL)
  Returns True if object has any actions. More...
 
void  OnStoreSave (ParamsWriteContext ctx)
  Engine calls this function to collect data from entity to store to game database (on server side). More...
 
void  OnStoreLoad (ParamsReadContext ctx)
  Called when data is loaded from game database (on server side). More...
 
void  SetSynchDirty ()
  Sets object synchronization dirty flag, which signalize that object wants to be synchronized (take effect only in MP on server side) More...
 
void  OnSynchronize (ParamsWriteContext ctx)
  After synchronization dirty flag is set (SetSynchDirty function), engine calls this function to collect data to synchronize from entity (on server side). More...
 
void  OnSynchronized (ParamsReadContext ctx)
  Called on clients after receiving synchronization data from server. More...
 
void  EOnFrame (_entity other, float timeSlice)
 
Shape  DebugDrawBBox (float width=-1, float length=-1, float height=-1)
 
Shape  DebugDrawDirection (float distance=1)
 
void  HideSelection (string selection_name)
 
void  ShowSelection (string selection_name)
 
ComponentElectricDevice  GetCompElec ()
  Use this to access Electricity component on your device. Returns NULL if the given object is not an Electricity device. More...
 
bool  IsElectricDevice ()
  If this item has class Electricity in its config then it returns true. Otherwise it's false. More...
 
void  OnInitElectricity ()
  Electricity event: Object's initialization. Electricity system is fully initialized by this point. More...
 
void  OnSwitchOn ()
  Electricity event: Called when the device is switched on. More...
 
void  OnSwitchOff ()
  Electricity event: Called when the device is switched OFF. More...
 
void  OnWorkStart ()
  Electricity event: Called only once when this device starts doing its work. More...
 
void  OnWork (float consumed_energy)
  Electricity event: Called every device update if its supposed to do some work. The update can be every CONSUME_ENERGY_INTERVAL second or at random, depending on its manipulation. More...
 
void  OnWorkStop ()
  Electricity event: Called when the device stops working (was switched OFF or ran out of energy) More...
 
void  OnOwnSocketTaken ()
  Electricity event: When something is plugged to this device. More...
 
void  OnOwnSocketReleased ()
  Electricity event: When something is UNPLUGGED from this device. More...
 
void  OnIsPlugged ()
  Electricity event: Called when this device is plugged into some energy source. More...
 
void  OnIsUnplugged ()
  Electricity event: Called when this device is UNPLUGGED from the energy source. More...
 

Private Attributes

private ComponentsBank  m_ComponentsBank
 
private EntityEventHandler  m_event_handler
 

Constructor & Destructor Documentation

void EntityAI::EntityAI ( )
private
void EntityAI::~EntityAI ( )
private

References m_ComponentsBank.

Member Function Documentation

Component EntityAI::CreateComponent ( int  comp_type,
string  extended_class_name = "" 
)
private

References GetComponent().

Referenced by EntityAI().

Component EntityAI::GetComponent ( int  comp_type,
string  extended_class_name = "" 
)
private
bool EntityAI::HasComponent ( int  comp_type )
private
void EntityAI::Log ( string  msg,
string  fnc_name = "n/a" 
)
private

References Object::GetType(), and Debug::Log().

void EntityAI::LogWarning ( string  msg,
string  fnc_name = "n/a" 
)
private
void EntityAI::LogError ( string  msg,
string  fnc_name = "n/a" 
)
private
EntityEventHandler EntityAI::GetEventHandler ( )
private

References m_event_handler.

void EntityAI::SetEventHandler ( EntityEventHandler  event_handler )
private
array<int> EntityAI::GetAgents ( )
private
void EntityAI::InsertAgent ( int  agent,
int  count = 1 
)
private
bool EntityAI::IsEntityAI ( )
private
void EntityAI::Delete ( )
private

Delete this object in next frame.

Returns
void
ItemBase item = GetGame().GetPlayer().CreateInInventory("GrenadeRGD5");
item.Delete();

References CallQueue::Call(), CALL_CATEGORY_SYSTEM, CGame::GetCallQueue(), and GetGame().

Referenced by ItemBase::Explode(), ItemBase::SetQuantity(), and ItemBase::SetQuantityDestroy2().

proto bool EntityAI::GetVariable ( string  varName,
out void  var 
)
private

Entity-variables can be used/shared with SQF scripts through EntityAI::GetVariable/SetVariable methods (the same as getVariable/setVariable on SQF side)

Referenced by GetVariableFloat(), GetVariableInt(), GetVariableObject(), GetVariableString(), and Consumable_Paper::OnRPC().

proto void EntityAI::SetVariable ( string  varName,
void  var 
)
private

Entity-variables can be used/shared with SQF scripts through EntityAI::GetVariable/SetVariable methods (the same as getVariable/setVariable on SQF side)

Referenced by Consumable_Paper::OnRPC(), ItemBase::SetQuantity(), ItemBase::SetTemperature(), and ItemBase::SetWet().

proto void EntityAI::OnEvent ( int  eventType,
Param  params 
)
private

Legacy event system can be used from enforce script through EntityAI::OnEvent method. (parameters are passed through Params class. Variables in params class must match with event handler parameters.). It's best way how to call SQF code from enforce-scripted entities.

Referenced by Trigger::OnEnter(), ItemTrigger::OnEnter(), and Trigger::OnLeave().

proto Man EntityAI::GetOwnerPlayer ( )
private
proto EntityAI EntityAI::GetOwner ( )
private

Returns direct owner of this entity (for example: if this entity is in Backpack, returns Backpack)

Referenced by Food_Lard::CanEat(), TrapBase::IsActivable(), and ComponentElectricDevice::UpdatePlugState().

string EntityAI::GetVariableString ( string  varName )
private

References GetVariable().

int EntityAI::GetVariableInt ( string  varName )
private

References GetVariable().

float EntityAI::GetVariableFloat ( string  varName )
private
Object EntityAI::GetVariableObject ( string  varName )
private

References GetVariable().

void EntityAI::EEInit ( )
private

Called upon object creation.

void EntityAI::EEAnimHook ( int  userType,
string  param 
)
private
void EntityAI::EEAnimDone ( string  moveName )
private
void EntityAI::EEItemLocationChanged ( EntityAI  old_owner,
EntityAI  new_owner 
)
private
// example of detecting getting item/dropping item from/to inventory
void EEItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
{
Man owner_player_old = NULL;
Man owner_player_new = NULL;
if (old_owner)
{
if (old_owner.IsPlayer())
{
owner_player_old = old_owner;
}
else
{
owner_player_old = old_owner.GetOwnerPlayer();
}
}
if (new_owner)
{
if (new_owner.IsPlayer())
{
owner_player_new = new_owner;
}
else
{
owner_player_new = new_owner.GetOwnerPlayer();
}
}
if ( !owner_player_new && owner_player_old )
{
Print("Item dropped from inventory");
}
if ( owner_player_new && !owner_player_old )
{
Print("Item taken to inventory");
}
}
void EntityAI::EEAnimStateChanged ( string  moveName )
private
void EntityAI::EEFired ( string  weaponType,
string  muzzleType,
string  mode,
string  type,
string  magazineType,
Object  missile 
)
private
void EntityAI::EELocal ( bool  isLocal )
private
void EntityAI::EEEngine ( bool  onOff )
private
void EntityAI::EEFuel ( bool  hasFuel )
private
void EntityAI::EEDammaged ( string  hitpointName,
float  hit 
)
private
void EntityAI::EEKilled ( Object  killer )
private
void EntityAI::EEHitBy ( TotalDamageResult  damageResult,
int  damageType,
EntityAI  source,
string  component,
string  ammo,
vector  modelPos 
)
private
void EntityAI::EEItemAttached ( EntityAI  item,
string  slot_name 
)
private
void EntityAI::EEItemDetached ( EntityAI  item,
string  slot_name 
)
private
void EntityAI::EECargoIn ( EntityAI  item )
private
void EntityAI::EECargoOut ( EntityAI  item )
private
void EntityAI::EECargoMove ( EntityAI  item )
private
void EntityAI::EEOnWaterEnter ( )
private
void EntityAI::EEOnWaterExit ( )
private
void EntityAI::EEUsed ( Man  owner )
private
void EntityAI::EEVariableSynchronized ( string  variable_name )
private

Called on client (in multiplayer) when sqf synchronize variable is synchronized.

bool EntityAI::ConditionAttachEntityAI ( EntityAI  child )
private
bool EntityAI::ConditionAttach ( EntityAI  parent )
private
bool EntityAI::ConditionDetachEntityAI ( EntityAI  child )
private
bool EntityAI::ConditionDetach ( EntityAI  parent )
private
bool EntityAI::ConditionCargoInEntityAI ( EntityAI  child )
private
bool EntityAI::ConditionCargoIn ( EntityAI  parent )
private
bool EntityAI::ConditionCargoOutEntityAI ( EntityAI  child )
private
bool EntityAI::ConditionCargoOut ( EntityAI  parent )
private
bool EntityAI::ConditionIntoInventoryEntityAI ( EntityAI  entity_ai )
private
bool EntityAI::ConditionIntoInventory ( EntityAI  player )
private
bool EntityAI::ConditionIntoHandsEntityAI ( EntityAI  entity_ai )
private
bool EntityAI::ConditionIntoHands ( EntityAI  player )
private
bool EntityAI::ConditionOutOfHandsEntityAI ( EntityAI  entity_ai )
private
bool EntityAI::ConditionOutOfHands ( EntityAI  player )
private
proto int EntityAI::GetSlotId ( )
private

Returns attachment slot where this item belongs.

Referenced by CanTakeEntityAsAttachment(), and TakeEntityAsAttachment().

proto int EntityAI::GetSlotsCount ( )
private
proto int EntityAI::AttachmentsCount ( )
private
proto EntityAI EntityAI::GetAttachmentFromIndex ( int  index )
private
proto bool EntityAI::HasAttachment ( EntityAI  e )
private

Returns True if entity is attached to this.

Referenced by Food_Lard::CanEat().

proto bool EntityAI::HasAttachmentEx ( EntityAI  e,
int  slot 
)
private

Returns True if entity is attached to this in slot.

proto EntityAI EntityAI::FindAttachment ( int  slot )
private

Returns attached entity in slot.

Referenced by PlayerBase::ClearInventory(), and PlayerBase::GetProtectionLevel().

proto EntityAI EntityAI::FindPlaceholderForSlot ( int  slot )
private

Returns placeholder entity for slot (naked arms, legs etc)

proto bool EntityAI::CanRemoveAttachment ( EntityAI  attachment )
private
proto bool EntityAI::CanRemoveAttachmentEx ( EntityAI  attachment,
int  slot 
)
private
proto bool EntityAI::CanRemoveEntity ( )
private

Returns if entity can be removed from its current location.

proto bool EntityAI::RemoveAttachment ( EntityAI  attachment )
private

Remove attachment.

proto bool EntityAI::RemoveAttachmentEx ( EntityAI  attachment,
int  slot 
)
private

Remove attachment from slot.

proto EntityAI EntityAI::CreateOwnedEntity ( string  typeName )
private

Create Entity of specified type inside this entity.

Warning
Low-level API, not synchronized over network!
proto EntityAI EntityAI::CreateAttachment ( string  typeName )
private

Create Entity of specified type as attachment of entity.

bool EntityAI::CanTakeEntityAsOwned ( EntityAI  item )
private

Returns if item can be added anywhere into this entity (as attachment or into cargo, recursively)

References AttachmentsCount(), CanAddAttachment(), CanAddEntityInCargo(), and GetAttachmentFromIndex().

Referenced by PlayerBase::TakeItemToInventory().

bool EntityAI::TakeEntityAsOwned ( EntityAI  item )
private

Put item anywhere into this entity (as attachment or into cargo, recursively)

References TryTakeEntityAsOwned().

Referenced by InventoryManager::TakeAsOwned(), and PlayerBase::TakeItemToInventory().

bool EntityAI::TakeEntityToCargo ( EntityAI  item )
private

Put item into into cargo.

References TryTakeEntityToCargo().

Referenced by ModuleSkinning::SkinComplete(), and TrapSpawnBase::SpawnCatch().

bool EntityAI::TakeEntityToCargoAtPos ( EntityAI  item,
Cargo  cargo,
int  row,
int  col 
)
private

Put item into into cargo on specific cargo location.

References GetCargo(), GetProxyCargo(), GetProxyCargoCount(), HasProxyCargo(), TryTakeEntityToCargoEx(), and TryTakeEntityToProxyCargoEx().

bool EntityAI::CanTakeEntityAsAttachmentToSlot ( EntityAI  item,
int  slot 
)
private

Returns if item can be added as attachment on specific slot.

References CanAddAttachmentEx().

bool EntityAI::TakeEntityAsAttachmentToSlot ( EntityAI  item,
int  slot 
)
private

Put item into as attachment on specific slot.

References TryTakeEntityAsAttachment().

bool EntityAI::CanTakeEntityAsAttachment ( EntityAI  item )
private

Returns if item can be added as attachment.

References CanAddAttachmentEx(), and GetSlotId().

Referenced by ActionTogglePlaceObject::AttachItemToTarget().

bool EntityAI::TakeEntityAsAttachment ( EntityAI  item )
private
bool EntityAI::CanDropEntity ( EntityAI  item )
private

Returns if item can be dropped out from this entity.

Referenced by TrapSpawnBase::SetupTrap(), and TrapBase::SetupTrap().

bool EntityAI::DropEntity ( EntityAI  item )
private

Drop item out of this entity.

References TryDropEntity().

Referenced by TrapBase::SetInactive().

proto bool EntityAI::CanAddAttachment ( EntityAI  e )
private

LOW LEVEL: Check if attachment can be added to any slot.

Referenced by CanTakeEntityAsOwned(), and InventoryManager::GetCombinationFlags().

proto bool EntityAI::CanAddAttachmentEx ( EntityAI  e,
int  slot 
)
private

LOW LEVEL: Check if attachment can be added to slot.

Referenced by CanTakeEntityAsAttachment(), and CanTakeEntityAsAttachmentToSlot().

proto Cargo EntityAI::GetCargo ( )
private
proto bool EntityAI::HasProxyCargo ( )
private

Referenced by TakeEntityToCargoAtPos().

proto int EntityAI::GetProxyCargoCount ( )
private

Referenced by TakeEntityToCargoAtPos().

proto Cargo EntityAI::GetProxyCargo ( int  cargoIndex )
private

Referenced by TakeEntityToCargoAtPos().

proto bool EntityAI::HasOwnedEntity ( EntityAI  item )
private
proto bool EntityAI::CanAddOwnedEntity ( EntityAI  item )
private
proto bool EntityAI::AddOwnedEntity ( EntityAI  item )
private
proto bool EntityAI::CanRemoveOwnedEntity ( EntityAI  item )
private
proto bool EntityAI::RemoveOwnedEntity ( EntityAI  item )
private
proto bool EntityAI::HasEntityInCargo ( EntityAI  e )
private
proto bool EntityAI::HasEntityInCargoEx ( EntityAI  e,
int  row,
int  col 
)
private
proto bool EntityAI::CanAddEntityInCargo ( EntityAI  e )
private
proto bool EntityAI::CanAddEntityInCargoEx ( EntityAI  e,
int  row,
int  col 
)
private
proto bool EntityAI::AddEntityInCargo ( EntityAI  owner,
EntityAI  cargo 
)
private
proto bool EntityAI::AddEntityInCargoEx ( EntityAI  owner,
EntityAI  e,
int  row,
int  col 
)
private
proto bool EntityAI::CanRemoveEntityInCargo ( EntityAI  e )
private
proto bool EntityAI::RemoveEntityInCargo ( EntityAI  owner,
EntityAI  e 
)
private
proto bool EntityAI::CanLockInventoryWithKey ( EntityAI  key )
private
proto bool EntityAI::CanUnlockInventoryWithKey ( EntityAI  key )
private
proto void EntityAI::LockInventoryWithKey ( EntityAI  key )
private
proto void EntityAI::UnlockInventoryWithKey ( EntityAI  key )
private
proto bool EntityAI::HasKeys ( )
private
proto void EntityAI::LockInventory ( int  lockType )
private
proto void EntityAI::UnlockInventory ( int  lockType )
private
proto bool EntityAI::IsInventoryUnlocked ( )
private
proto bool EntityAI::IsInventoryLocked ( )
private
proto void EntityAI::SetObjectTexture ( int  index,
string  texture_name 
)
private
proto void EntityAI::SetObjectMaterial ( int  index,
string  mat_name 
)
private
proto float EntityAI::GetAnimationPhase ( string  animation )
private
void EntityAI::SetAnimationPhase ( string  animation,
float  phase 
)
private
proto bool EntityAI::IsPilotLight ( )
private
proto void EntityAI::SetPilotLight ( bool  isOn )
private
proto bool EntityAI::IsWaterContact ( )
private
proto EntityAI EntityAI::GetVehicle ( )
private

Returns the vehicle in which the given unit is mounted. If there is none, the unit is returned.

proto void EntityAI::SetAllowDamage ( bool  val )
private
proto void EntityAI::GetActions ( Man  player,
EntityAI  with = NULL 
)
private

Get list of available actions.

Referenced by InventoryManager::ShowActionMenuCombine().

proto bool EntityAI::HasActions ( Man  player,
EntityAI  with = NULL 
)
private

Returns True if object has any actions.

Referenced by InventoryManager::GetCombinationFlags().

void EntityAI::OnStoreSave ( ParamsWriteContext  ctx )
private

Engine calls this function to collect data from entity to store to game database (on server side).

{
// dont forget to propagate this call trough class hierarchy!
super.OnStoreSave(ctx);
// write any data (using params) you want to store
autoptr Param4<bool, int, float, string> p1 = new Param4<bool, int, float, string>(true, 56, 6.28, "Pepe");
autoptr Param4<float, string, float, string> p2 = new Param4<float, string, float, string>(9.56, "ahoj", 6.28, "svet");
ctx.Write(p1);
ctx.Write(p2);
}
void EntityAI::OnStoreLoad ( ParamsReadContext  ctx )
private

Called when data is loaded from game database (on server side).

{
// dont forget to propagate this call trough class hierarchy!
super.OnStoreLoad(ctx);
// read data loaded from game database (format and order of reading must be the same as writing!)
autoptr Param4<bool, int, float, string> p1 = new Param4<bool, int, float, string>(false, 0, 0, "");
autoptr Param4<float, string, float, string> p2 = new Param4<float, string, float, string>(0, "", 0, "");
if (ctx.Read(p1))
{
Print(p1.param1);
Print(p1.param2);
Print(p1.param3);
Print(p1.param4);
}
else
{
Print("no data");
}
if (ctx.Read(p2))
{
Print(p2.param1);
Print(p2.param2);
Print(p2.param3);
Print(p2.param4);
}
else
{
Print("no data");
}
}
void EntityAI::SetSynchDirty ( )
private

Sets object synchronization dirty flag, which signalize that object wants to be synchronized (take effect only in MP on server side)

References SetFlags().

Referenced by ItemBase::ConfigVariableSet(), ItemBase::ConfigVariableSetInt(), ManBase::HideBodyStart(), PlayerBase::OnStoreLoad(), PlayerBase::ShavePlayer(), and EntityDebugSync::Update().

void EntityAI::OnSynchronize ( ParamsWriteContext  ctx )
private

After synchronization dirty flag is set (SetSynchDirty function), engine calls this function to collect data to synchronize from entity (on server side).

{
// dont forget to propagate this call trough class hierarchy!
super.OnSynchronize(ctx);
// write any data (using params) you want to pass to clients instances
autoptr Param2<int, float> p = new Param2<int, float>(m_counter, m_blood_preasure);
ctx.Write(p);
}
void EntityAI::OnSynchronized ( ParamsReadContext  ctx )
private

Called on clients after receiving synchronization data from server.

{
// dont forget to propagate this call trough class hierarchy!
super.OnSynchronized(ctx);
// read data (format and order of reading on client must be the same as writing on server side)
Param2<int, float> p = new Param2<int, float>(0, 0);
if (ctx.Read(p))
{
m_counter = p.param1;
m_blood_preasure = p.param2;
}
}
void EntityAI::EOnFrame ( _entity  other,
float  timeSlice 
)
private
Shape EntityAI::DebugDrawBBox ( float  width = -1,
float  length = -1,
float  height = -1 
)
private
Shape EntityAI::DebugDrawDirection ( float  distance = 1 )
private
void EntityAI::HideSelection ( string  selection_name )
private
void EntityAI::ShowSelection ( string  selection_name )
private
ComponentElectricDevice EntityAI::GetCompElec ( )
private

Use this to access Electricity component on your device. Returns NULL if the given object is not an Electricity device.

References COMP_TYPE_ELE_DEVICE, GetComponent(), and HasComponent().

Referenced by PowerGenerator::CanAddFuel(), ActionTurnOnTransmitterOnGround::CanDo(), EN5C_PAS_Broadcaster::CanOperate(), EN5C_StaticRadio::CanOperate(), EN5C_Transmitter_Base::CanOperate(), EN5C_BaseRadio::CanOperate(), ComponentElectricDevice::CanReceivePlugFrom(), ComponentElectricDevicePowerGenerator::CanSwitchOn(), CableReel::ConditionIntoHands(), BatteryCharger::ConditionIntoHands(), CableReel::ConditionIntoInventory(), Spotlight::ConditionIntoInventory(), BatteryCharger::ConditionIntoInventory(), ComponentElectricDevice::ConsumeEnergy(), EN5C_PAS_Broadcaster::EEItemAttached(), EN5C_RangeFinder::EEItemDetached(), EN5C_PAS_Broadcaster::EEItemDetached(), EN5C_Defibrillator::EEItemDetached(), EN5C_Flashlight::EEItemDetached(), Spotlight::EEItemLocationChanged(), PowerGenerator::EEItemLocationChanged(), ItemBase::EEItemLocationChanged(), PowerGenerator::GetFuel(), ActionTurnOnTransmitterOnGround::OnComplete(), PowerGenerator::OnInitElectricity(), Spotlight::OnPlacementFinished(), BatteryCharger::OnWork(), EN5C_RangeFinder::OnWorkStop(), EN5C_Flashlight::OnWorkStop(), EN5C_Defibrillator::OnWorkStop(), EN5C_StaticRadio::OnWorkStop(), EN5C_Megaphone::OnWorkStop(), EN5C_Transmitter_Base::OnWorkStop(), EN5C_BaseRadio::OnWorkStop(), PowerGenerator::OnWorkStop(), ComponentElectricDevice::PlugCordIntoSocket(), ComponentElectricDevice::PlugInDevice(), ComponentElectricDevice::PlugThisInto(), PowerGenerator::SetFuel(), PowerGenerator::StartLoopSound(), EN5C_FenceLight::TurnOnItem(), ComponentElectricDevice::UnplugCordFromSocket(), ComponentElectricDevice::UnplugDevice(), ComponentElectricDevice::UnplugThis(), ComponentElectricDevice::UpdateSelections(), and ComponentElectricDevice::WakeUpWholeBranch().

bool EntityAI::IsElectricDevice ( )
private

If this item has class Electricity in its config then it returns true. Otherwise it's false.

References COMP_TYPE_ELE_DEVICE, and HasComponent().

Referenced by ActionTurnOnTransmitterOnGround::CanDo(), ActionUnplug::CanDo(), and ItemBase::EEItemLocationChanged().

void EntityAI::OnInitElectricity ( )
private

Electricity event: Object's initialization. Electricity system is fully initialized by this point.

Referenced by ComponentElectricDevice::OnInitElectricity().

void EntityAI::OnSwitchOn ( )
private

Electricity event: Called when the device is switched on.

Referenced by ComponentElectricDevice::OnSwitchOn().

void EntityAI::OnSwitchOff ( )
private

Electricity event: Called when the device is switched OFF.

Referenced by ComponentElectricDevice::OnSwitchOff().

void EntityAI::OnWorkStart ( )
private

Electricity event: Called only once when this device starts doing its work.

Referenced by ComponentElectricDevice::OnWorkStart().

void EntityAI::OnWork ( float  consumed_energy )
private

Electricity event: Called every device update if its supposed to do some work. The update can be every CONSUME_ENERGY_INTERVAL second or at random, depending on its manipulation.

Referenced by ComponentElectricDevice::OnWork().

void EntityAI::OnWorkStop ( )
private

Electricity event: Called when the device stops working (was switched OFF or ran out of energy)

Referenced by ComponentElectricDevice::OnWorkStop().

void EntityAI::OnOwnSocketTaken ( )
private

Electricity event: When something is plugged to this device.

Referenced by ComponentElectricDevice::OnOwnSocketTaken().

void EntityAI::OnOwnSocketReleased ( )
private

Electricity event: When something is UNPLUGGED from this device.

Referenced by ComponentElectricDevice::OnOwnSocketReleased().

void EntityAI::OnIsPlugged ( )
private

Electricity event: Called when this device is plugged into some energy source.

Referenced by ComponentElectricDevice::OnIsPlugged().

void EntityAI::OnIsUnplugged ( )
private

Electricity event: Called when this device is UNPLUGGED from the energy source.

Referenced by ComponentElectricDevice::OnIsUnplugged().

Member Data Documentation

private ComponentsBank EntityAI::m_ComponentsBank
private
private EntityEventHandler EntityAI::m_event_handler
private

Referenced by GetEventHandler().


The documentation for this class was generated from the following files:
Converted from CHM to HTML with chm2web Pro 2.85 (unicode)