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

Object class. More...

#include <gameplay.h>

Inheritance diagram for Object:
_entity ObjectTyped Plant Entity ProxyInventory PlantBase WoodBase Camera EntityAI ProxyCrew ProxySubpart SoundOnVehicle StreetLamp BushHard BushSoft TreeHard TreeSoft

Private Member Functions

proto vector  GetPosition ()
  Retrieve position. More...
 
proto void  SetPosition (vector vPos)
  Set position. More...
 
proto vector  GetOrientation ()
  Retrieve orientation (yaw, pitch, roll) More...
 
vector  GetDirection ()
  Retrieve direction vector. More...
 
proto void  SetOrientation (vector vOrientation)
  Set orientation. More...
 
proto vector  GetLocalPos (vector vPos)
  Calculate local position of other entity to this entity. More...
 
proto vector  GetGlobalPos (vector vPos)
  Calculate global position to this entity from local position. More...
 
proto vector  GetSpeed ()
  Retrieve object's speed in global space. More...
 
proto vector  GetModelSpeed ()
  Retrieve object's speed in local space. More...
 
proto float  ClippingInfo (out vector minMax[2])
 
proto void  SetDamage (float damage)
  Set object damage (high level, network aware), call only from server. More...
 
proto float  GetDamage ()
  Get total damage (clipped to range 0..1) More...
 
float  AddDamage (float damage, bool auto_delete=false)
  Add damage to total damage (clipped to range 0..1) auto_delete = true If damage is 1 or more, object will be deleted automaticly. More...
 
proto void  GetSelectionList (out TStringArray selectionList)
 
proto int  GetMemoryPointIndex (string memoryPointName)
 
void  OnGetActions (ActionMenuContext ctx, Man player)
  [Client] This function is called by engine to get list of scripted actions More...
 
bool  OnAction (int action_id, Man player, ParamsReadContext ctx)
  [Server] Function called by engine to execute scripted action More...
 
string  GetType ()
  Get config class of object. More...
 
string  GetName ()
  Get display name of entity. More...
 
int  Release ()
 
proto int  AddRef ()
 
bool  IsKindOf (string type)
  Check config class name of the object. More...
 
bool  IsMan ()
  Returns if this entity is Man. More...
 
bool  IsEntityAI ()
  Returns if this entity is EntityAI. More...
 
bool  IsItemBase ()
  Returns if this entity is ItemBase. More...
 
bool  IsInventoryItem ()
  Returns if this entity is InventoryItem. More...
 
bool  IsClothing ()
  Returns if this entity is Clothing. More...
 
bool  IsFireplace ()
  Returns if this entity is fireplacebase. More...
 
bool  IsTree ()
  Returns if this entity is tree. More...
 
bool  IsRock ()
  Returns if this entity is rock. More...
 
bool  IsWoodBase ()
  Returns whether object is PlanBase. More...
 
bool  IsBush ()
  Returns if this entity is bush. More...
 
bool  IsWeapon ()
  Returns if this entity is Weapon. More...
 
void  RPC (int rpc_type, array< Param > params, Man recipient=NULL)
  Remote procedure call shortcut, see CGame.RPC / CGame.RPCSingleParam. More...
 
void  RPCSingleParam (int rpc_type, Param param, Man recipient=NULL)
  Remote procedure call shortcut, see CGame.RPCSingleParam / CGame.RPC. More...
 
void  OnRPC (int rpc_type, ParamsReadContext ctx)
  Called after remote procedure call is recieved for this object. More...
 
vector  GetSelectionPosition (string name)
 
vector  ModelToWorld (vector modelPos)
 
vector  WorldToModel (vector worldPos)
 
proto string  ConfigGetString (string entryName)
 
proto int  ConfigGetInt (string entryName)
 
bool  ConfigGetBool (string entryName)
 
proto float  ConfigGetFloat (string entryName)
 
proto vector  ConfigGetVector (string entryName)
 
proto void  ConfigGetTextArray (string entryName, out TStringArray values)
  Get array of strings from config entry. More...
 
proto void  ConfigGetFloatArray (string entryName, out TFloatArray values)
  Get array of floats from config entry. More...
 
proto void  ConfigGetIntArray (string entryName, out TIntArray values)
  Get array of integers from config entry. More...
 
proto bool  ConfigIsExisting (string entryName)
  Checks if given entry exists. More...
 
proto bool  IsDamageDestroyed ()
  Checks if object is destroyed. More...
 
proto float  GetHealth (string zoneName, string healthType)
  Returns current state of health. More...
 
proto float  GetMaxHealth (string zoneName, string healthType)
  Returns maximum value of health. More...
 
proto void  SetHealth (string zoneName, string healthType, float value)
  Sets current state of health. More...
 
proto void  AddHealth (string zoneName, string healthType, float value)
  Adds health. More...
 
proto void  DecreaseHealth (string zoneName, string healthType, float value)
  Decreases health. More...
 
proto void  ProcessDirectDamage (int damageType, EntityAI source, string componentName, string ammoName, vector modelPos, float damageCoef=1.0)
  Applies damage on object. More...
 

Detailed Description

Object class.

Member Function Documentation

proto vector Object::GetPosition ( )
private
proto void Object::SetPosition ( vector  vPos )
private
proto vector Object::GetOrientation ( )
private
vector Object::GetDirection ( )
private
proto void Object::SetOrientation ( vector  vOrientation )
private

Set orientation.

Referenced by Trap_RabbitSnare::SetupTrap().

proto vector Object::GetLocalPos ( vector  vPos )
private

Calculate local position of other entity to this entity.

proto vector Object::GetGlobalPos ( vector  vPos )
private

Calculate global position to this entity from local position.

proto vector Object::GetSpeed ( )
private

Retrieve object's speed in global space.

proto vector Object::GetModelSpeed ( )
private

Retrieve object's speed in local space.

proto float Object::ClippingInfo ( out vector  minMax[2] )
private

Get Clipping info

Parameters
minMax array[2] of vectors, into minMax[0] is returned min, into minMax[1] is returned max
Returns
radius of bounding box
vector minMax[2];
float radius = GetGame().GetPlayer().ClippingInfo(minMax);
Print(minMax);
Print(radius);
proto void Object::SetDamage ( float  damage )
private

Set object damage (high level, network aware), call only from server.

Referenced by AddDamage(), TrapBase::AddDamageToVictim(), TrapSpawnBase::AddDefect(), TrapBase::AddDefect(), and ActionOnTargetContinuousMine::OnTick().

proto float Object::GetDamage ( )
private
float Object::AddDamage ( float  damage,
bool  auto_delete = false 
)
private

Add damage to total damage (clipped to range 0..1) auto_delete = true If damage is 1 or more, object will be deleted automaticly.

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

Referenced by TrapBase::AddDamageToVictim(), EN5C_HescoBox::Fill(), EN5C_HescoBox::Fold(), and EN5C_HescoBox::Unfold().

proto void Object::GetSelectionList ( out TStringArray  selectionList )
private
proto int Object::GetMemoryPointIndex ( string  memoryPointName )
private
void Object::OnGetActions ( ActionMenuContext  ctx,
Man  player 
)
private

[Client] This function is called by engine to get list of scripted actions

Parameters
ctx action menu context
player which is asking for actions
usage :
{
super.OnGetActions(ctx, player);
if (IsActionCopyAvalible())
{
autoptr Param4<string, int, EntityAI, EntityAI> p = new Param4<string, int, EntityAI, EntityAI>("ahoj", 5, this, player);
ctx.AddAction("Copy", ACTION_ID_COPY, p, 1000, true, true);
}
}
bool Object::OnAction ( int  action_id,
Man  player,
ParamsReadContext  ctx 
)
private

[Server] Function called by engine to execute scripted action

Parameters
action_id ID of action given in OnGetActions
player which is executing action
params custom action params given in OnGetActions
usage :
bool OnAction(int action_id, Man player, ParamsReadContext ctx)
{
switch (action_id)
{
case ACTION_ID_COPY:
if (IsActionCopyAvalible())
{
autoptr Param4<string, int, EntityAI, EntityAI> copy_action_params = Param4<string, int, EntityAI, EntityAI>("", int, NULL, NULL);
if (ctx.Read(copy_action_params))
{
PrintString("Copy test: " + copy_action_params.param1 + " " + itoa(copy_action_params.param2));
Print(copy_action_params.param3);
Print(copy_action_params.param4);
GetGame().CreateObject("Trap_Bear", player.GetPosition(), false);
return true;
}
}
return false;
}
return super.OnAction(action_id, player, ctx);
}
string Object::GetType ( )
private
string Object::GetName ( )
private

Get display name of entity.

References GetGame(), and CGame::ObjectGetDisplayName().

int Object::Release ( )
private

References GetGame(), and CGame::ObjectRelease().

Referenced by ManBase::HideBodyEnd().

proto int Object::AddRef ( )
private
bool Object::IsKindOf ( string  type )
private

Check config class name of the object.

References GetGame(), and CGame::ObjectIsKindOf().

bool Object::IsMan ( )
private
bool Object::IsEntityAI ( )
private

Returns if this entity is EntityAI.

Referenced by PlayerBase::GetUserActions().

bool Object::IsItemBase ( )
private

Returns if this entity is ItemBase.

bool Object::IsInventoryItem ( )
private

Returns if this entity is InventoryItem.

bool Object::IsClothing ( )
private

Returns if this entity is Clothing.

bool Object::IsFireplace ( )
private
bool Object::IsTree ( )
private
bool Object::IsRock ( )
private

Returns if this entity is rock.

Referenced by ActionMineRock::CanDo().

bool Object::IsWoodBase ( )
private

Returns whether object is PlanBase.

Referenced by ActionOnTargetContinuousMine::Can(), and ActionPickBerry::CanDo().

bool Object::IsBush ( )
private

Returns if this entity is bush.

Referenced by ActionMineBush::CanDo().

bool Object::IsWeapon ( )
private

Returns if this entity is Weapon.

void Object::RPC ( int  rpc_type,
array< Param params,
Man  recipient = NULL 
)
private

Remote procedure call shortcut, see CGame.RPC / CGame.RPCSingleParam.

References GetGame(), and CGame::RPC().

void Object::RPCSingleParam ( int  rpc_type,
Param  param,
Man  recipient = NULL 
)
private

Remote procedure call shortcut, see CGame.RPCSingleParam / CGame.RPC.

References GetGame(), and CGame::RPCSingleParam().

void Object::OnRPC ( int  rpc_type,
ParamsReadContext  ctx 
)
private

Called after remote procedure call is recieved for this object.

Parameters
rpc_type user defined identification of RPC
ctx read context for params

Referenced by DayZGame::OnRPC().

vector Object::GetSelectionPosition ( string  name )
private
vector Object::ModelToWorld ( vector  modelPos )
private
vector Object::WorldToModel ( vector  worldPos )
private
proto string Object::ConfigGetString ( string  entryName )
private
proto int Object::ConfigGetInt ( string  entryName )
private

Referenced by ConfigGetBool().

bool Object::ConfigGetBool ( string  entryName )
private

References ConfigGetInt().

proto float Object::ConfigGetFloat ( string  entryName )
private
proto vector Object::ConfigGetVector ( string  entryName )
private
proto void Object::ConfigGetTextArray ( string  entryName,
out TStringArray  values 
)
private

Get array of strings from config entry.

Parameters
entryName
value output
proto void Object::ConfigGetFloatArray ( string  entryName,
out TFloatArray  values 
)
private

Get array of floats from config entry.

Parameters
entryName
value output
proto void Object::ConfigGetIntArray ( string  entryName,
out TIntArray  values 
)
private

Get array of integers from config entry.

Parameters
entryName
value output
proto bool Object::ConfigIsExisting ( string  entryName )
private

Checks if given entry exists.

Parameters
entryName
proto bool Object::IsDamageDestroyed ( )
private

Checks if object is destroyed.

proto float Object::GetHealth ( string  zoneName,
string  healthType 
)
private

Returns current state of health.

Parameters
zoneName if empty string, returns state of global health
healthType if empty string, returns state of main health

Referenced by ItemBase::OnAction().

proto float Object::GetMaxHealth ( string  zoneName,
string  healthType 
)
private

Returns maximum value of health.

Parameters
zoneName if empty string, returns state of global health
healthType if empty string, returns state of main health
proto void Object::SetHealth ( string  zoneName,
string  healthType,
float  value 
)
private

Sets current state of health.

Parameters
zoneName if empty string, sets state of global health
healthType if empty string, sets state of main health
proto void Object::AddHealth ( string  zoneName,
string  healthType,
float  value 
)
private

Adds health.

Parameters
zoneName if empty string, sets state of global health
healthType if empty string, sets state of main health
proto void Object::DecreaseHealth ( string  zoneName,
string  healthType,
float  value 
)
private

Decreases health.

Parameters
zoneName if empty string, sets state of global health
healthType if empty string, sets state of main health
proto void Object::ProcessDirectDamage ( int  damageType,
EntityAI  source,
string  componentName,
string  ammoName,
vector  modelPos,
float  damageCoef = 1.0 
)
private

Applies damage on object.

Parameters
damageType DT_CLOSE_COMBAT/DT_FIRE_ARM/DT_EXPLOSION/DT_CUSTOM
source source of damage
compomentName which component was hit
ammoName ammoType, which defines how much damage should be applied
directHitModelPos local position of hit
damageCoef multiplier of applied damage

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