DIFF

Functions 365

void actionDebugPrint(string s)
proto HLIGHT AddLight(IEntity owner, LightType type, LightFlags flags, float radius, vector color)

creates light

proto native bool AddPointToLandMarkDecal(hDecal lmDecal, vector point, vector normal, float alpha)

add new point to decal, internally, new point is added when previous point is in some distance or the angle is more than some threshold

lmDecal
entity to add new landmark point
point
contact point
normal
normal of contact
alpha
translucency in point

Returns: true if everything was OK, false if not. In this case, the application MUST not used later the pointer to decal, it's finalized internally !

int AWHITE(int a)
proto native ParseHandle BeginParse(string filename)
void bsbDebugSpam(string s)
References PrintToRPT()
proto native int CanAddToLandMarkDecal(hDecal lmDecal, IEntity entity, string mat, vector newPoint)

is it possible to add new point to landmark decal?

lmDecal
entity to add new landmark point
entity
entity to add new landmark point
mat
material of decal
newpoint
new point to add

Returns: LMD_ERROR = error when adding new point (invalid decal) LMD_VALID = can add new point LMD_DIFF_ENT = new point is on different entity LMD_TOO_FAR = new point is too far from previous point

proto native void ChangeAnimSlotFPS(notnull IEntity ent, int slot, int fps)
proto native void ChangeAnimSlotMask(notnull IEntity ent, int slot, float blendin, BoneMask mask)
proto native int ClearAnimMask(notnull IEntity ent, int mask)
proto native void ClearKey(KeyCode key)

Clears the key state. Call this function if you want to overcome autorepeating in reporting key state. If called, the KeyState returns pressed only after the key is released and pressed again.

proto native int ClearLightFlags(HLIGHT light, LightFlags flags)
proto native void CloseFindFile(FindFileHandle handle)
void CompileBreak()

Triggers breakpoint in C++ in compile time(when app is running in debug enviroment)

proto void copyarray(void destArray, void srcArray)
proto native bool CopyFile(string sourceName, string destName)

copy file. destName must be "$profile:" or "$saves:" location

proto native hDecal CreateDecal(IEntity entity, vector origin, vector project, float nearclip, float angle, float size, string materialName, float lifetime, int flags)

Creates single visual mark, e.g. from shots //when lifetime=0, pointer to decal is returned, that can be removed by RemoveDecal then

entity
entity where the landmark should be created
origin
first point of the decal, nothing is done now
project
projection direction (length is far clipping distance)
nearclip
near clipping distance
materialName
Material used for decal
lifetime
Lifetime in seconds
flags
Not used ATM

Returns: Decal pointer or null

CGame CreateGame()
proto void CreateGizmoApi()
proto native Hive CreateHive()
proto native JsonApi CreateJsonApi()
proto native hDecal CreateLandMarkDecal(IEntity entity, vector origin, vector normal, float edgeSize, float lifeTime, string materialName, hDecal prevDecal, float alpha)

Creates continous visual mark, e.g. from wheel when a car is moving on the ground

entity
entity where the landmark should be created (only terrain is supported ATM)
origin
first point of the decal, nothing is done now
normal
normal of surface
edgesize
Edge size of decal
lifetime
Lifetime in seconds
materialName
Material used for decal
prev
Previous decal, we are connecting to
alpha
translucency of point

Returns: Decal pointer or null

proto native RestApi CreateRestApi()
proto vobject CreateXOB(int nsurfaces, int nverts[], int numindices[], string materials[])

Dynamic MeshObject

void DayZPlayerTypeCreate(DayZPlayerType pType)
proto native void dBodyActive(notnull IEntity ent, ActiveState activeState)
proto void dBodyApplyForce(notnull IEntity body, vector force)

Applies constant force on a rigidbody (origin)

proto void dBodyApplyForceAt(notnull IEntity body, vector pos, vector force)

Applies constant force on a position

proto void dBodyApplyImpulse(notnull IEntity body, vector impulse)

Applies impuls on a rigidbody (origin)

proto void dBodyApplyImpulseAt(notnull IEntity body, vector impulse, vector pos)

Applies impuls on a pos position in world coordinates

proto native void dBodyApplyTorque(notnull IEntity body, vector torque)
proto native void dBodyApplyTorqueImpulse(notnull IEntity ent, vector torqueImpulse)
proto native dBlock dBodyCollisionBlock(notnull IEntity ent1, notnull IEntity ent2)

Disables collisions between two entities

proto native float dBodyComputeAngularImpulseDenominator(notnull IEntity ent, vector axis)
proto native float dBodyComputeImpulseDenominator(notnull IEntity ent, vector position, vector normal)
proto bool dBodyCreateDynamicEx(notnull IEntity ent, vector centerOfMass, float mass, PhysicsGeomDef geoms[])

Creates RigidBody from custom made geometries. The geometries are deleted when rigid body is destroyed

centerOfMass
Offset from object-pivot to center of mass
mass
Body mass
geoms
array of custom made geometries
autoptr PhysicsGeomDef geoms[] = {PhysicsGeomDef("", dGeomCreateBox(size), "material/default", 0xffffffff)};
dBodyCreateDynamicEx(this, center, 1.0, geoms);
proto bool dBodyCreateGhostEx(notnull IEntity ent, PhysicsGeomDef geoms[])
proto bool dBodyCreateStaticEx(notnull IEntity ent, PhysicsGeomDef geoms[])

Creates RigidBody from custom made geometries. The geometries are deleted when rigid body is destroyed

geoms
array of custom made geometries
autoptr PhysicsGeomDef geoms[] = {PhysicsGeomDef("", dGeomCreateBox(size), "material/default", 0xffffffff)};
dBodyCreateStaticEx(this, geoms);
proto native void dBodyDestroy(notnull IEntity ent)

Destroys attached physics body

proto native void dBodyDynamic(notnull IEntity ent, bool dynamic)
proto native void dBodyEnableCCD(notnull IEntity body, float maxMotion, float sphereCastRadius)

If both maxMotion and shapeCastRadius is >=0 then the continuous collision detection is enabled. If you want to disable it, use -1

maxMotion
max motion threshold when sphere-cast is performed, to find time of impact. It should be little bit less than size of the geometry to catch the situation when tunelling can happen
sphereCastRadius
The radius of the largest possible sphere, that is completelly inside the body geometry.
proto native bool dBodyEnableGravity(notnull IEntity ent, bool enable)
proto vector dBodyGetAngularVelocity(notnull IEntity body)

Gets angular velocity for a rigidbody

proto native vector dBodyGetCenterOfMass(notnull IEntity body)

returns center of mass offset

proto native void dBodyGetDirectWorldTransform(notnull IEntity body, out vector matrix[4])
proto native int dBodyGetGeom(notnull IEntity ent, string name)
proto native int dBodyGetGeomInteractionLayer(notnull IEntity ent, int index)
proto native int dBodyGetInteractionLayer(notnull IEntity ent)
proto native vector dBodyGetInvInertiaDiagLocal(notnull IEntity ent)
proto void dBodyGetInvInertiaTensorWorld(notnull IEntity body, out vector inertiaTensorWS[3])
proto native float dBodyGetKineticEnergy(notnull IEntity body)
proto native vector dBodyGetLocalInertia(notnull IEntity ent)
proto native float dBodyGetMass(notnull IEntity ent)
proto native int dBodyGetNumGeoms(notnull IEntity ent)
proto native void dBodyGetWorldTransform(notnull IEntity body, out vector matrix[4])
proto native bool dBodyIsActive(notnull IEntity ent)
proto native bool dBodyIsDynamic(notnull IEntity ent)
proto native bool dBodyIsSet(notnull IEntity ent)

Has the entity attached physics body?

proto native bool dBodyIsSolid(notnull IEntity ent)
proto native void dBodyRemoveBlock(notnull IEntity worldEntity, dBlock block)
proto void dBodySetAngularVelocity(notnull IEntity body, vector angvel)

Changed an angular velocity

body
Rigid body
angvel
Angular velocity, rotation around x, y and z axis (not yaw/pitch/roll)
proto native void dBodySetDamping(notnull IEntity ent, float linearDamping, float angularDamping)
proto native void dBodySetGeomInteractionLayer(notnull IEntity ent, int index, int mask)
proto native void dBodySetInertiaTensorM(notnull IEntity body, vector m[3])
proto native void dBodySetInertiaTensorV(notnull IEntity body, vector v)
proto native void dBodySetInteractionLayer(notnull IEntity ent, int mask)
proto native void dBodySetLinearFactor(notnull IEntity body, vector linearFactor)

Sets scale factor for all impulses/velocities/forces. Default is <1,1,1>. Zero any axis if you want to do 2D physics

proto native void dBodySetMass(notnull IEntity body, float mass)
proto native void dBodySetSleepingTreshold(notnull IEntity body, float linearTreshold, float angularTreshold)
proto native void dBodySetSolid(notnull IEntity ent, bool solid)
proto native void dBodySetTargetMatrix(notnull IEntity body, vector matrix[4], float timeslice)

Sets target transformation. If timeslice == dt (simulation step delta time), it will happen in next step, otherwise in time = timeslice

proto void DebugBreak(bool condition = true, 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)

Triggers breakpoint in C++ in run time(when app is running in debug enviroment)

proto native bool DeleteFile(string name)

delete file. Works only on "$profile:" and "$saves:" locations

proto void DestroyGizmoApi()
proto native void DestroyHive()
proto native void DestroyJsonApi()
proto native void DestroyRestApi()
proto native dGeom dGeomCreateBox(vector size)

Creates box geometry

proto native dGeom dGeomCreateCapsule(float radius, vector extent)

Creates capsule geometry

proto native dGeom dGeomCreateCylinder(float radius, vector extent)

Creates cylinder geometry

proto native dGeom dGeomCreateSphere(float radius)

Creates sphere geometry

proto native void dGeomDestroy(dGeom geom)

Destroys geometry

proto native IEntity dGetDynamicBody(notnull IEntity worldEnt, int index)
proto native vector dGetGravity(notnull IEntity worldEntity)

Gets global gravity

proto native bool dGetInteractionLayer(notnull IEntity worldEntity, int mask1, int mask2)
proto native int dGetNumDynamicBodies(notnull IEntity worldEnt)
proto native void dJoint6DOFSetAngularLimits(dJoint joint, vector angularLower, vector angularUpper)
proto native void dJoint6DOFSetLimit(dJoint joint, int axis, float lo, float hi)
proto native void dJoint6DOFSetLinearLimits(dJoint joint, vector linearLower, vector linearUpper)

- free means upper < lower, - locked means upper == lower - limited means upper > lower - axis: first 3 are linear, next 3 are angular

proto native void dJoint6DOFSpringSetSpring(dJoint joint, int axis, float stiffness, float damping)
proto native void dJointConeTwistSetAngularOnly(dJoint joint, bool angularOnly)
proto native void dJointConeTwistSetLimit(dJoint joint, int limitIndex, float limitValue)
proto native void dJointConeTwistSetLimits(dJoint joint, float _swingSpan1, float _swingSpan2, float _twistSpan, float _softness, float _biasFactor, float _relaxationFactor)
proto native dJoint dJointCreate6DOF(notnull IEntity ent1, notnull IEntity ent2, vector matrix1[4], vector matrix2[4], bool block, float breakThreshold)
proto native dJoint dJointCreate6DOFSpring(notnull IEntity ent1, notnull IEntity ent2, vector matrix1[4], vector matrix2[4], bool block, float breakThreshold)
proto native dJoint dJointCreateBallSocket(notnull IEntity ent1, notnull IEntity ent2, vector point1, vector point2, bool block, float breakThreshold)
proto native dJoint dJointCreateConeTwist(notnull IEntity ent1, notnull IEntity ent2, vector matrix1[4], vector matrix2[4], bool block, float breakThreshold)
proto native dJoint dJointCreateFixed(notnull IEntity ent1, notnull IEntity ent2, vector point1, vector point2, bool block, float breakThreshold)
proto native dJoint dJointCreateHinge(notnull IEntity ent1, notnull IEntity ent2, vector point1, vector axis1, vector point2, vector axis2, bool block, float breakThreshold)
proto native dJoint dJointCreateHinge2(notnull IEntity ent1, notnull IEntity ent2, vector matrix1[4], vector matrix2[4], bool block, float breakThreshold)
proto native dJoint dJointCreateSlider(notnull IEntity ent1, notnull IEntity ent2, vector matrix1[4], vector matrix2[4], bool block, float breakThreshold)
proto native void dJointDestroy(dJoint joint)
proto native void dJointHingeSetAxis(dJoint joint, vector axis)
proto native void dJointHingeSetLimits(dJoint joint, float low, float high, float softness, float biasFactor, float relaxationFactor)
proto native void dJointHingeSetMotorTargetAngle(dJoint joint, float angle, float dt, float maxImpulse)
proto native float dJointSliderGetAngularPos(dJoint joint)
proto native float dJointSliderGetLinearPos(dJoint joint)
proto native void dJointSliderSetAngularLimits(dJoint joint, float lowerLimit, float upperLimit)
proto native void dJointSliderSetAngularMotor(dJoint joint, float velocity, float force)
proto native void dJointSliderSetDirAngular(dJoint joint, float softness, float restitution, float damping)
proto native void dJointSliderSetDirLinear(dJoint joint, float softness, float restitution, float damping)
proto native void dJointSliderSetLimAngular(dJoint joint, float softness, float restitution, float damping)
proto native void dJointSliderSetLimLinear(dJoint joint, float softness, float restitution, float damping)
proto native void dJointSliderSetLinearLimits(dJoint joint, float lowerLimit, float upperLimit)
proto native void dJointSliderSetLinearMotor(dJoint joint, float velocity, float force)
proto native void dJointSliderSetOrthoAngular(dJoint joint, float softness, float restitution, float damping)
proto native void dJointSliderSetOrthoLinear(dJoint joint, float softness, float restitution, float damping)
proto void DPrint(string var)

Prints content of variable to console/log. Should be used for critical messages so it will appear in debug log

proto native void dSetGravity(notnull IEntity worldEntity, vector g)

Changes global gravity

proto native void dSetInteractionLayer(notnull IEntity worldEntity, int mask1, int mask2, bool enable)
proto native void dSetTimeSlice(notnull IEntity worldEntity, float timeSlice)

Changes fixed time-slice. Default is 1/40, thus simulation runs on 40fps. With smaller values, there is more precise simulation

proto void DumpStack()

Prints current call stack (stack trace)

\verbatim Output: -- Stack trace -- SaveFile() Scripts\Entities\Modules\ModuleBase\ModuleFileHandler.c : 51 SaveConfigToFile() Scripts\Entities\Modules\ModuleBase\ModuleFileHandler\ModuleLocalProfile.c : 114 SaveParameterArray() Scripts\Entities\Modules\ModuleBase\ModuleFileHandler\ModuleLocalProfile.c : 133 SetParameterArray() Scripts\Entities\Modules\ModuleBase\ModuleFileHandler\ModuleLocalProfile.c : 231 PresetAdd() Scripts\Entities\Modules\ModuleBase\ModuleFileHandler\ModuleLocalProfile\ModuleLocalProfileUI.h : 46 OnKeyPress() Scripts/mission/missionGameplay.c : 215 OnKeyPress() Scripts/DayZGame.c : 334 ----------------- \endverbatim

Returns: void

DumpStack();
proto void DumpStackString(out string stack)

Prints current call stack (stack trace) to given output

\verbatim Output: SaveFile() Scripts\Entities\Modules\ModuleBase\ModuleFileHandler.c : 51 SaveConfigToFile() Scripts\Entities\Modules\ModuleBase\ModuleFileHandler\ModuleLocalProfile.c : 114 SaveParameterArray() Scripts\Entities\Modules\ModuleBase\ModuleFileHandler\ModuleLocalProfile.c : 133 SetParameterArray() Scripts\Entities\Modules\ModuleBase\ModuleFileHandler\ModuleLocalProfile.c : 231 PresetAdd() Scripts\Entities\Modules\ModuleBase\ModuleFileHandler\ModuleLocalProfile\ModuleLocalProfileUI.h : 46 OnKeyPress() Scripts/mission/missionGameplay.c : 215 OnKeyPress() Scripts/DayZGame.c : 334 \endverbatim

Returns: void

  string tmp;
DumpStackString(tmp);
  Print(tmp);
proto native void EndParse(ParseHandle file)
proto volatile native void EndSound(HSOUND snd)ENF_DONE

Don't test hearability. Valid only together with SFX_3D!

void Error(string err)

Messagebox with error message

References Error2()
proto native void Error2(string title, string err)

Messagebox with error message

Referenced by Error()
proto void ErrorEx(string err, ErrorExSeverity severity = ErrorExSeverity.ERROR)
proto void ErrorExString(string err, out string str, ErrorExSeverity severity = ErrorExSeverity.ERROR)
proto int FGets(FileHandle file, string var)

Get line from file, every next call of this function returns next line

file
File handle ID of a opened file
var
Value to write

Returns: int Count of chars or -1 if is not any for read (end of file is EMPTY line)
usage :

FileHandle file_handle = OpenFile("$profile:testiik.txt", FileMode.READ);
string line_content;

while ( FGets( file_handle,  line_content ) > 0 )
{
	Print(line_content);
}

CloseFile(file_handle);
proto native void FinalizeLandMarkDecal(hDecal lmDecal, bool addAlpha, float alphaDist)

finalize landmark adding, e.g. when entity lose contact with ground -> the pointer to decal should have only world and entity if it has something to render, otherwise it's destroyed here

lmDecal
entity to add new landmark point
addAlpha
if to add last point with transition to zero alpha
alphaDist
distance to add last point
proto native IEntity FindEntityByID(IEntity worldEnt, int ID)
proto native IEntity FindEntityByName(IEntity worldEnt, string name)
proto bool FindNextFile(FindFileHandle handle, out string fileName, out FileAttr fileAttributes)
float fixAngle_PI_PI(float pAngle)
References Math.PI, and Math.PI2
proto void FPrint(FileHandle file, void var)

Write to file

file
File handle ID of a opened file
var
Value to write

Returns: void
usage :

FileHandle file = OpenFile("$profile:testiik.txt", FileMode.WRITE);
if (file != 0)
{
	FPrint(file, "A");
	FPrint(file, "B");
	FPrint(file, "C");
	CloseFile(file);
}
proto void FPrintln(FileHandle file, void var)

Write to file and add new line

file
File handle ID of a opened file
var
Value to write

Returns: void
usage :

FileHandle file = OpenFile("$profile:testiik.txt", FileMode.WRITE);
if (file != 0)
{
	FPrintln(file, "line1");
	FPrintln(file, "line2");
	FPrintln(file, "line3");
	CloseFile(file);
}
void fsmbDebugPrint(string s)
References PrintToRPT()
void fsmbDebugSpam(string s)
References PrintToRPT()
void GameLibInit()GAME_TEMPLATE
proto native IEntity GetActiveEntity(IEntity worldEntity, int index)

returns active entity

proto native BackendApi GetBackendApi()
proto native bool GetBoneLocalMatrix(notnull IEntity ent, int bone, vector mat[4])
proto native bool GetBoneMatrix(notnull IEntity ent, int bone, vector mat[4])
proto native void GetCamera(int cam, out vector mat[4])

Returns current camera transformation

proto native CEApi GetCEApi()

Get the CE API

NoteThis means that this will work on anything which is running a mission with an initialized Hive
NoteClient does not have Hive when connected to a server, only the server does if it was set up in the init.c
WarningOnly exists when the game has CE enabled
proto bool GetCLIParam(string param, out string val)

Returns command line argument

name
of a command line argument
val
string value of the param or empty string if the param hasn't been found

Returns: True if param is present, False if hasn't been found

string param;
GetCLIParam("world", param); // return a value when program executed with param -world something
proto native int GetFPS()

Returns actual fps (average in last 10 frames)

proto native float GetGamepadAxis(GamepadAxis axis)

return value in gamepad axis <-1000; 1000>

proto native int GetGamepadButton(GamepadButton button)

return if the button is pressed or not

proto void GetHourMinuteSecond(out int hour, out int minute, out int second)

Returns system time

out hour
int Hour
out minute
int Minute
out second
int Second

Returns: void

int hour = 0;
int minute = 0;
int second = 0;

GetHourMinuteSecondUTC(hour, minute, second);

Print(hour);
Print(minute);
Print(second);

>> hour = 16
>> minute = 38
>> second = 7
proto void GetHourMinuteSecondUTC(out int hour, out int minute, out int second)

Returns UTC system time

out hour
int Hour
out minute
int Minute
out second
int Second

Returns: void

int hour = 0;
int minute = 0;
int second = 0;

GetHourMinuteSecondUTC(hour, minute, second);

Print(hour);
Print(minute);
Print(second);

>> hour = 15
>> minute = 38
>> second = 7
proto native JsonApi GetJsonApi()
proto native vector GetLastLandMarkPoint(hDecal lmDecal)

return last landmark point or -65535.0 in all components

lmDecal
decal to test
proto string GetMachineName()
proto native int GetMouseState(MouseState index)

Returns state of mouse button. It's combination of number of release/pressed edges and mask MB_PRESSED_MASK that is set when button is pressed. If you want just to check if button is pressed, use this: if(GetMouseState(MouseState.LEFT) & MB_PRESSED_MASK)) Print("left button pressed");

proto native int GetNumActiveEntities(IEntity worldEntity)

returns number of active (simulated) Entities in the world

proto native int GetNumAnimFrames(vobject anim)

Returns number of frames, if the object is animation

int GetNumberOfSetBits(int i)
proto native vobject GetObject(string name)

Loads object from data, or gets it from cache. Object must be released when not used

proto int GetObjectMaterials(vobject object, string materials[])
proto native float GetOceanHeight(float worldX, float worldZ)

Get water ocean height at given point

worldX
world x position
worldZ
world z position
proto native vector GetOceanHeightAndDisplace(float worldX, float worldZ)

Get water ocean height and displacement at given point, returns vector(displaceX, height, displaceZ)

worldX
world x position
worldZ
world z position
proto native int GetParticleCount(notnull IEntity ent)
Referenced by ParticleGetCount()
proto int GetParticleEmitors(notnull IEntity ent, out string emitors[], int max)
static proto native PBOAPI GetPBOAPI()
PluginManager GetPluginManager()

Returns registred plugin by class type, better is to use global funtion GetPlugin(typename plugin_type)

module_tpye
typename class type of plugin

Returns: PluginBase

PluginRepairing plugin = GetPluginManager().GetPluginByType(PluginRepairing);
proto string GetProfileName()
bool GetProfileValueBool(string name, bool def = false)

Return value from profile variable, if variable with given name is not present, default value is returned

string GetRandomLoadingBackground()

Returns random loading background texture path

Referenced by LoadingMenu.Init()
proto void GetRenderView(IEntity ent, out int cam_index, out int width, out int height)ENF_DONE
proto native RestApi GetRestApi()
proto native float GetSceneHDRMul(int camera)

scene light multiplier (based on measured scene light levels) - pre-exposure of light

proto native int GetSoundLength(HSOUND sound)ENF_DONE
proto native int GetSoundPosition(HSOUND sound)ENF_DONE
proto native vector GetVelocity(notnull IEntity ent)

Returns linear velocity

ent
IEntity entity which origin will be set
mat
vector[4] matrix to be set

Returns: vector linear velocity

Man player = g_Game.GetPlayer();
Print( GetVelocity(player) );

>> <0,0,0>
proto void GetYearMonthDay(out int year, out int month, out int day)

Returns system date

out year
int Year
out month
int Month
out day
int Day

Returns: void

int year = 0;
int month = 0;
int day = 0;

GetYearMonthDay(year, month, day);

Print(year);
Print(month);
Print(day);

>> year = 2015
>> month = 3
>> day = 24
proto void GetYearMonthDayUTC(out int year, out int month, out int day)

Returns UTC system date

out year
int Year
out month
int Month
out day
int Day

Returns: void

int year = 0;
int month = 0;
int day = 0;

GetYearMonthDayUTC(year, month, day);

Print(year);
Print(month);
Print(day);

>> year = 2015
>> month = 3
>> day = 24
HandEventBase HandAnimEventFactory(WeaponEvents type, Man p = null, InventoryLocation src = null)
proto bool HasActiveParticle(notnull IEntity ent)
Referenced by ParticleHasActive()
void hndDebugPrint(string s)
References PrintToRPT()
Referenced by SelectAnimationOfForceSwapInHands(), SelectAnimationOfMoveFromHands(), SelectAnimationOfTakeToHands()
Show 39 more, BotGuardHasItemInHands.GuardCondition(), ChainedDropAndKillPlayerLambda.Execute(), DayZPlayerInventory.HandleHandEvent(), DayZPlayerInventory.HandleInventory(), DayZPlayerInventory.Init(), DayZPlayerInventory.OnHandsEnteredStableState(), DayZPlayerInventory.OnHandsExitedStableState(), DayZPlayerInventory.OnHandsStateChanged(), DayZPlayerInventory.SyncHandEventToRemote(), HandSelectAnimationOfForceSwapInHandsEvent.GuardCondition(), HandSelectAnimationOfMoveFromHandsEvent.GuardCondition(), HandStartAction.OnEntry(), HandStartReplacingItemElsewhereWithNewInHands.OnEntry(), HandStartReplacingItemInHands.OnEntry(), HandStateBase.OnAbort(), HandStateBase.OnEntry(), HandStateBase.OnExit(), HumanInventory.DropEntity(), HumanInventory.ForceSwapEntities(), HumanInventory.LocalDestroyEntity(), HumanInventory.OnEntityInHandsCreated(), HumanInventory.OnEntityInHandsDestroyed(), HumanInventory.RedirectToHandEvent(), HumanInventory.ReplaceItemInElsewhereWithNewinHandsImpl(), HumanInventory.ReplaceItemInHandsWithNewImpl(), HumanInventory.SwapEntities(), HumanInventory.TakeEntityAsAttachmentEx(), HumanInventory.TakeEntityToCargoEx(), HumanInventory.TakeEntityToInventory(), HumanInventory.TakeToDst(), HumanInventory.ThrowEntity(), HumanInventoryWithFSM.Init(), ReplaceItemWithNewLambdaBase.CopyOldPropertiesToNew(), ReplaceItemWithNewLambdaBase.CreateNetworkObjectInfo(), ReplaceItemWithNewLambdaBase.CreateNewEntity(), ReplaceItemWithNewLambdaBase.DeleteOldEntity(), ReplaceItemWithNewLambdaBase.Execute(), ReplaceItemWithNewLambdaBase.OnSuccess(), and ReplaceItemWithNewLambdaBase.PrepareLocations()
void hndDebugSpamALot(string s)
References PrintToRPT()
proto volatile void Idle()

Yiels execution to other threads and then it continues. Obsolete...

proto native int InitSky(string presetName)

initialize sky with preset, must be called to set the global planets setting

presetName
name of preset to be set (one of presets from file loaded using LoadSkyPresets)
proto native int IsAnimSlotPlaying(notnull IEntity ent, int mask)
proto native bool IsBoxVisible(vector mins, vector maxs, int flags)

tests if bbox is visible according to view-frustum and PVS

flags
& 1 - test also PVS

Returns: true/false is/isn't visible

proto native bool IsCircleToCrossSwapped()PS3

circle and cross can be swapped when license area is japan/asia

proto native bool IsLandMarkFinalized(hDecal lmDecal)

return if landmark was finalized

lmDecal
decal to test
bool IsModuleExist(typename plugin_type)
proto native bool IsOcean()

Is ocean availabled

proto native int KillThread(Class owner, string name)

Kills thread.

owner
Can be NULL for global threads.
name
Name of the first function on stack

Returns: int ???

???
int LerpARGB(int c1, int c2)
proto native int LerpSkyPreset(string presetName1, string presetName2, float dayTime, float stormy1, float stormy2, float lerpVal)

lerp two sky presets and set the result using day time

presetName1
name of preset1 to be set (one of presets from file loaded using LoadSkyPresets)
presetName2
name of preset2 to be set (one of presets from file loaded using LoadSkyPresets)
dayTime
day of time <0, 1>
stormy1
stormy parameter for preset1 <0, 1>
stormy2
stormy parameter for preset2 <0, 1>
lerpVal
lerp value between two presets
proto native int LerpSkyPreset3(string presetName1, string presetName2, string presetName3, float dayTime, float stormy1, float stormy2, float stormy3, float w1, float w2, float w3)

lerp three sky presets using barycentric coordinates and set the result using day time

presetName1
name of preset1 to be set (one of presets from file loaded using LoadSkyPresets)
presetName2
name of preset2 to be set (one of presets from file loaded using LoadSkyPresets)
presetName2
name of preset3 to be set (one of presets from file loaded using LoadSkyPresets)
dayTime
day of time <0, 1>
stormy1
stormy parameter for preset1 <0, 1>
stormy2
stormy parameter for preset2 <0, 1>
stormy3
stormy parameter for preset3 <0, 1>
w1
weight for preset1
w2
weight for preset2
w3
weight for preset3
proto native int LoadSkyPresets(string presetsFile)

load all sky presets from xml file

presetFile
name of XML file with presets
proto native bool LoadWidgetImageSet(string filename)
proto native void LoadWidgetStyles(string filename)
void Log(string message, LogTemplateID template_id = 0)
void LogError(string message, LogTemplateID template_id = 0)

Creates error log (optional) from LogTemplate which are registred

template_id
LogTemplateID ID of LogTemplate which was registred in proto/Logtemplate.h -> "class LogTemplates"
message
string Error message for log

Returns: void

LogT(TEMPLATE_JINDRICH, "This is some error log message");

>> output to scriptExt.log (for GamutLogViewer)
void LogInfo(string message, LogTemplateID template_id = 0)

Creates info log (optional) from LogTemplate which are registred

template_id
LogTemplateID ID of LogTemplate which was registred in proto/Logtemplate.h -> "class LogTemplates"
message
string Info message for log

Returns: void

LogInfo("This is some info log message", TEMPLATE_JINDRICH);

>> output to scriptExt.log (for GamutLogViewer)
void LogWarning(string message, LogTemplateID template_id = 0)

Creates warning log (optional) from LogTemplate which are registred

template_id
LogTemplateID ID of LogTemplate which was registred in proto/Logtemplate.h -> "class LogTemplates"
message
string Warning message for log

Returns: void

LogT(TEMPLATE_JINDRICH, "This is some warning log message");

>> output to scriptExt.log (for GamutLogViewer)
bool magazinesHaveEqualSizes(notnull Magazine mag, notnull Magazine mag2)

no magazine configured in parent state, looking in inventory

proto native void MakeScreenshot(string name)

makes screenshot and stores it in to a DDS format file if the name begins with '$' the screenshot in stored in the fullpath according to the name parameter otherwise the screenshot is stored in "$profile:ScreenShotes/DATE TIME-NAME.dds" where DATE, TIME AND NAME are replaced by actual values

name
name of the screenshot
proto native void MemoryValidation(bool enable)

Switches memory validation (huge slowdown! Use with care only for certain section of code!)

enable
bool Enable

Returns: void

???
proto native void MuteAllSoundControllers()

Overrides all the environment controllers to be muted

proto FileHandle OpenFile(string name, FileMode mode)

Opens File

name
of a file to open, (you can use filesystem prefixes ('$profile','$saves','$mission'). For accessing profile dir use '$profile', e.g. '$profile:myfilename.txt')
mode
constants FileMode.WRITE, FileMode.READ or FileMode.APPEND flag can be used

Returns: file handle ID or 0 if fails
usage :

FileHandle file = OpenFile("$profile:testiik.txt", FileMode.WRITE);
//FileHandle file = OpenFile("$profile:testiik.txt", FileMode.APPEND);
if (file != 0)
{
	FPrintln(file, "line1");
	FPrintln(file, "line2");
	FPrintln(file, "line3");
	CloseFile(file);
}
proto native int P2PVisibilityEx(vector from, vector to, int flags)

tests visibility

from
to
flags
//TraceFlags.VISTEST - //TraceFlags.DETAIL - test agains detail brushes //TraceFlags.ENT - test against brush entities //TraceFlags.NOTRACE - doesn't test geometry (has meaning in conjuction with s TraceFlags.VISTEST)

Returns: true is visible/false not visibel

proto int ParseLine(ParseHandle tp, int num, string tokens[])
proto int ParseString(string input, out string tokens[])

Parses string into array of tokens returns number of tokens

input
string String for parse
out tokens
array[] Parsed string in array

Returns: int Number of tokens

string token[2];
int result = ParseString("Hello World", token);

for( int i = 0; i < 2; i++ )
{
	Print(token[i]);
}

>> 'Hello'
>> 'World'
proto int ParseStringEx(inout string input, string token)

Parses one token from input string. Result is put into token string, and type of token is returned. Input string is left-truncated by the resulting token length.

[in,out] input string String for parse\ Output is without founded token
out token
string Founded string token

Returns: int Type of token \verbatim Token types: 0 - error, no token 1 - defined token (special characters etc. . / * ) 2 - quoted string. Quotes are removed -> TODO 3 - alphabetic string 4 - number 5 - end of line -> TODO \endverbatim

string input = "Hello*World";
string token1;
string token2;

int result1 = ParseStringEx(input, token1);
int result2 = ParseStringEx(input, token2);

Print( String( "Token1 = '" + token1 + "' Type = " + result1.ToString() ) );
Print( String( "Token2 = '" + token2 + "' Type = " + result2.ToString() ) );
Print( input );

>> 'Toke1 = 'Hello' Type = 3'
>> 'Toke1 = '*' Type = 1'
int ParticleGetCount(IEntity ent)
bool ParticleHasActive(IEntity ent)
void PluginManagerDelete()
void PluginManagerInit()
proto void Print(void var)

Prints content of variable to console/log

proto void PrintFormat(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)

Prints formated text to console/log

string c = "Peter";
PrintFormat("Hello %1, how are you?", c); // prints "Hello 'Peter', how are you?"
proto vector ProjectVector(int cam, IEntity ent, vector vec)
proto int ReadFile(FileHandle file, void param_array, int length)

Reads raw data from file.

param_array
Receiving array for the data. Valid types are int[] or string
length
Length of data

Returns: number of read bytes

proto native void ReleaseObject(vobject object, int flag = 0)

Release object. When there are not any other references, object is stored into cache and ready to be victed if necessary.

object
Object handle
flag
If RF_RELEASE is used, the object is evicted immediatelly, if not used by anyone else
proto native bool ReloadTexture(string path)
proto native void RemoveDecal(hDecal decal)
proto native bool RemoveLight(HLIGHT light)

removes light

proto native void ReportMouse(int mousex, int mousey, Widget rootWidget)
proto native void ResetAllSoundControllers()

Removes all the previously set overrides of sound controllers

proto native void ResetParticlePosition(notnull IEntity ent)
proto native void RestartParticle(notnull IEntity ent)
proto void reversearray(void param_array)
proto native bool SetActiveWindow(Widget w, bool resetFocus)
proto native void SetAnimFrame(notnull IEntity ent, int slot, float frame)
proto native void SetAnimMask(notnull IEntity ent, int mask)
proto native void SetAnimSlot(notnull IEntity ent, int slot, vobject anim, float blendin, float blendout, BoneMask mask, int fps, AnimFlags flags)
proto native void SetBone(notnull IEntity ent, int bone, vector angles, vector trans, float scale)
proto native void SetBoneGlobal(notnull IEntity ent, int bone, vector mat[4])
proto native bool SetBoneMatrix(notnull IEntity ent, int bone, vector mat[4])
proto native void SetCamera(int cam, vector origin, vector angle)

Changes camera position

cam
Index of camera
origin
position
angle
orientation
proto native void SetCameraEx(int cam, const vector mat[4])

Changes camera matrix

proto native void SetCameraFarPlane(int cam, float farplane)

default 160000 units

proto native void SetCameraNearPlane(int cam, float nearplane)

default 5 units

proto native void SetCameraPostProcessEffect(int cam, int priority, PostProcessEffectType type, string materialPath)

set postprocess effect to camera To disable effect in some prioroty ppEffect, just set effectName or name to NULL

cam
number of camera
priority
priority of effect
type
type of effect
materialPath
material
proto native void SetCameraType(int cam, CameraType type)
proto native void SetCameraVerticalFOV(int cam, float fovy)
proto native WorldHandle SetCurrentWorld(WorldHandle world)

Sets current world. It allows to work with entities outside world processing // return previous world

proto native void SetCursorWidget(Widget cursor)
void SetDispatcher(Dispatcher dispatcher)
proto native void SetFixedLOD(IEntity ent, int lod)ENF_DONE
proto native void SetGlobalLandMarkParams(float minSegmentLength, float maxSegmentLength, float degAngle)

set global parameters for landmark generation

minSegmentLength
minimum length segment, when new point is added (4 default), when is less, just the end position is on the fly updated
maxSegmentLength
maximum segment length, when length is bigger, the path is finished
degAngle
angle in degrees, when is more, the path is finished
proto native void SetGUIWidget(IEntity ent, int index, RTTextureWidget w)

sets Widget typu RTTextureWidgetTypeID, to which it is possible to reference in shader as $rendertarget it is posible to use only after object selection. When selecting another object, it is necessary to set GUI widget again

proto native bool SetLightCone(HLIGHT light, float cone)

Sets light cone in degrees (for LightType.SPOT).

proto native bool SetLightEx(HLIGHT light, float radius, vector color)
proto native int SetLightFlags(HLIGHT light, LightFlags flags)
proto native bool SetLightTexture(HLIGHT light, string cubemap)

sets lookup texture for projection lights

proto native void SetListenerCamera(int camera)

sets which camera will be a listener (for sound engine)

proto native void SetModal(Widget w)
proto native bool SetMorphState(notnull IEntity ent, string morph, float value)
proto native void SetNightLayerRotMatrix(vector mat[3])

night sky layer rotation matrix

mat
rotation matrix
void SetProfileValueBool(string name, bool value)

Writes bool variable to profile, after write don't forget to call CGame::SaveProfile() to save profile to storage!

proto native void SetRealStarAutoUpdate(bool update)

update of stars

update
true = automatic stars update, false = update is on user by SetStarsRotMatrix
proto native void SetRenderView(IEntity ent, int cam_index, int width, int height)ENF_DONE
proto native bool SetSkyPlanet(int index, float azimuthDeg, float zenithDeg)

set planet position

index
index of planet, 0 = sun usually
azimuthDeg
azimuth position in degrees
zenithDeg
zenith position in degrees
proto native bool SetSkyPlanetSize(int index, float angleDeg)

set planet size in degrees

index
index of planet, 0 = sun usually
angleDeg
angle size in degrees
proto native int SetSkyPreset(string presetName, float stormy, float dayTime)

set sky preset to day time and stormy parameter

presetName
name of preset to be set (one of presets from file loaded using LoadSkyPresets)
stormy
stormy parameter <0, 1>
dayTime
day of time <0, 1>
proto native void SetSkyUserPlanets(bool enabled)

user can set planets to its own positions on skydome using SetSkyPresetPlanet function, if disabled, the planets are positioned automatically using sky preset setting

enabled
enable/disable
proto native int SetSoundFrequency(HSOUND sound, int freq)ENF_DONE
proto native int SetSoundVolume(HSOUND sound, float volume)ENF_DONE
proto native void SetStarsObserverPosition(float latitudeDeg, float longitudeDeg)

set observer position

latitudeDeg
latitude in degrees
longitudeDeg
longitude in degrees
proto native void SetStarsObserverTime(int year, int month, int day, int hour, int minute, float sec, int offsetSec)

set UTC time for real time stars

year
month
day
hour
minute
sec
offsetSec
to take into account time difference between Greenwich and local time (position dependency, summer/winter time)
proto native void SetStarsRotMatrix(vector mat[3])

stars rotation matrix, is different from night rotation matrix because we don't know the time when night layers was captured

mat
rotation matrix
proto native void SetVelocity(notnull IEntity ent, vector vel)

Sets linear velocity (for Rigid bodies)

ent
entity which velocity will be set
vel
velocity vector to be set
proto native void SetWidgetWorld(RenderTargetWidget w, IEntity wrldEntity, int camera)
Referenced by RenderTarget.Init()
proto native void ShowCursorWidget(bool show)

direct mouse cursor visibility control

proto void Sort(void param_array[], int num)

Sorts static array of integers(ascendically) / floats(ascendically) / strings(alphabetically)

param_array
array Array to sort
num
int How many items will be sorted in array

Returns: void

string	arrStr[3] = {"Dog", "Car", "Apple"};
Sort(arrStr, 2)
for ( int x = 0; x < 3; x++ )
{
	Print( arrStr[x] );
}

>> 'Car'
>> 'Dog'
>> 'Apple'
EntityAI SpawnEntity(string object_name, notnull InventoryLocation inv_loc, int iSetupFlags, int iRotation)

Spawns entity in known inventory location

in object_name
string Name of item class
in inv_loc
Inventory Location of the spawned item

Returns: created entity in case of success, null otherwise

EntityAI SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
proto int SphereQuery(vector origin, float radius, out IEntity visents[], int ents, int fmask)

finds all entities in a radius

void SQFLog(string sqf_msg)
References Log()
void SQFPrint(string sqf_msg)
References Print()
proto native void StartVideo(string name)ENF_DONE

developer tool - start video grabber

proto native void StopVideo()ENF_DONE

developer tool - stop video grabber

proto owned string ThreadFunction(Class owner, string name, int backtrace, out int linenumber)

Debug function. Returns current function on stack of the thread

owner
Can be NULL for global threads
name
Name of the first function on stack
backtrace
???
linenumber
???

Returns: string ???

???
proto native int TickCount(int prev)

performance counter. Returns number of CPU ticks between 'prev' and 'now'

proto native bool TraceLineToEntity(IEntity ent, vector start, vector end, out TraceContact contact)
proto volatile float TraceMove(TraceParam param, out IEntity cent, out float plane[4], out int surfparm, func filtercallback)

traces line start->end, return 0..1 if trace was sucessfull. // It take bboux from ent // flag like in P2PVisibilityEx will be added //OUTPUT:

cent
[out] traced entity
plane
[out] traced polygon plane (X,Y,Z,D)
surfparm
[out] traced surface parameters

Returns: value 0...1, percentage of a path traveled

proto native bool TryFireWeapon(EntityAI weapon, int muzzleIndex)
proto vector UnprojectVector(int cam, float x, float y, vector dir)
proto void UpdateIndices(vobject obj, int surf, int indices[])
proto void UpdateVertsEx(notnull IEntity ent, int surf, vector verts[], float uv[])
proto native vector Vector(float x, float y, float z)

Vector constructor from components

x
float x component
y
float y component
z
float z component

Returns: vector resulting vector

Print( Vector(1, 2, 3) );

>> <1,2,3>
int VectortoRGBA(vector vec, float h)
proto int VisEntities(vector origin, vector look, float angle, float radius, out IEntity ents[2], int maxents, int fmask)

finds all visible entities (rought, according to a visibility. It is convinient for entitie selection where we want to do more precise visibility test)

origin
- position it is looked from
look
- look direction
angle
- view angle (usuably 90). -1 if we do not care about the view angle
ents
- array to which entities will be stored
maxents
- length of the array (prevents overflowing the array)
fmask
- flag mask (SetFlags()). Entity must have all flags set. it is possible to use reserved flags like EntityFlags.USER1, EntityFlags.USER2, EntityFlags.USER6 for fast finding of entities in custom categories
proto string vtoa(vobject vobj)

Returns name of visual object

void wpnDebugSpamALot(string s)
References PrintToRPT()