<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.frictionalgames.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=BoxFigs</id>
	<title>Frictional Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.frictionalgames.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=BoxFigs"/>
	<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page/Special:Contributions/BoxFigs"/>
	<updated>2026-04-07T12:25:28Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/TDD/Entity_Types&amp;diff=7032</id>
		<title>HPL2/TDD/Entity Types</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/TDD/Entity_Types&amp;diff=7032"/>
		<updated>2026-02-07T20:19:24Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Push */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TocRight}}&lt;br /&gt;
&lt;br /&gt;
This page lists the different types of entities found within the HPL2 engine. The type determines how the entity will be set up, what kind it is, what it does under different circumstances etc. Using the Model Editor you can identify and specify which type an entity has and its type vars, in Settings &amp;gt; User defined variables. In the Level Editor, the different types have different settings applicable for them, known as instance vars. For example, a MoveObject type will have the OffsetArea box available in the Level Editor, and an Item (Note) type will have a NoteText box available.&lt;br /&gt;
&lt;br /&gt;
A list of all the types and subtypes can be found in the table of contents to the right.&lt;br /&gt;
&lt;br /&gt;
== StaticProp ==&lt;br /&gt;
&lt;br /&gt;
A StaticProp entity resembles a static object. They have no available type properties, but they can still use physics bodies (collision boxes) and have mass/gravity. Note that they cannot be interacted with in the game, and cannot be disabled. If you need this feature, use Object (Static) instead.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CastShadows || Bool || true || If entity casts shadows.&lt;br /&gt;
|-&lt;br /&gt;
| IsAffectedByDecal || Bool || true || If decals can be created on entity.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CommentaryIcon ==&lt;br /&gt;
&lt;br /&gt;
A CommentaryIcon entity is simply an object that can execute commentary sound files, as it was done in the main game. These only appear if the player has &amp;quot;Commentary&amp;quot; enabled in their settings.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| RotateSubMesh || String || || The name of the submesh that is to be rotated&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| File || File (.comment) || || The .comment file for the commentary.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Object ==&lt;br /&gt;
&lt;br /&gt;
Objects are entities that can be activated/deactivated, broken, and interact with physics.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| BreakActive || Bool || false || If entity is broken when hit hard enough or health is 0.&lt;br /&gt;
|-&lt;br /&gt;
| BreakDestroyJoints || Bool || false || If all physics joints should be destroyed when broken.&lt;br /&gt;
|-&lt;br /&gt;
| BreakMinEnergy || Float || 100 || The minimum energy needed for breakage. Energy = Object1Speed * Object1Mass + Object2Speed * Object2Mass. Speed = m/s. If Object 2 is floor or something static, its speed is always 0 and does not contribute to total energy!&lt;br /&gt;
|-&lt;br /&gt;
| BreakEntity || File (.ent) || || The entity this entity turns into when broken.&lt;br /&gt;
|-&lt;br /&gt;
| BreakEntityAlignBody || String || || The body BreakEntity uses to align itself when created. No entity is created if left empty.&lt;br /&gt;
|-&lt;br /&gt;
| BreakSound || File (.snt) || || The sound made when broken.&lt;br /&gt;
|-&lt;br /&gt;
| BreakParticleSystem || File (.ps) || || Particle system shown when broken.&lt;br /&gt;
|-&lt;br /&gt;
| BreakImpulse || Float || 4 || Impulse (speed in m/s really) added to all bodies in BreakEntity when created. The direction of impulse is outwards from center of entity.&lt;br /&gt;
|-&lt;br /&gt;
| HitDamageAmount || Float || 5 || The amount of damage made when hitting an enemy or player.&lt;br /&gt;
|-&lt;br /&gt;
| HitDamageStrength || Int || 1 || The strength of the damage.&lt;br /&gt;
|-&lt;br /&gt;
| MinHitDamageSpeed || Float || 3 || The minimum speed (m/s) needed for damage to be made.&lt;br /&gt;
|-&lt;br /&gt;
| LifeLength || Float || 0 || A time after which the entity automatically breaks. 0=lasts forever.&lt;br /&gt;
|-&lt;br /&gt;
| IsFood || Bool || false || If this is food for some enemies and can be used to lure them. Needs to have break active and health determines how long the food lasts.&amp;lt;br&amp;gt;Waterlurkers are the only enemy type that is lured by and eats food objects.&lt;br /&gt;
|-&lt;br /&gt;
| ShowHints || Bool || true || If a hint can be triggered by interacting with the prop.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| ContainedItem || String || None || An item that is created when entity breaks.&amp;lt;br&amp;gt;Must match an entity file name (extension .ent optional) in the &amp;quot;items&amp;quot; folder.&lt;br /&gt;
|-&lt;br /&gt;
| DisableBreakable || Bool || false || If the entity is breakable then having this true will make it unbreakable.&lt;br /&gt;
|-&lt;br /&gt;
| IsInsanityVision || Bool || false || If the prop is only shown when insanity is low enough.&lt;br /&gt;
|-&lt;br /&gt;
| VisionMaxSanity || Float || 30 || The max sanity the player can have for prop to show if it is an insanity vision.&amp;lt;br&amp;gt;The object will only be visible if the player's sanity is less than this value.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Static ===&lt;br /&gt;
&lt;br /&gt;
Not to be confused with an actual static object. This Object subtype is a generic object with common properties. The static subtype simply disables any additional properties from the other subtypes. An Object (Static) is similar in concept to a StaticProp type entity, however the Object (Static) can be deactivated, can break, has physics, and can have an interact callback set.&lt;br /&gt;
&lt;br /&gt;
=== Grab ===&lt;br /&gt;
&lt;br /&gt;
A Grab subtype is a normal Object entity with the ability to be grabbed by the player in the game. In order for this to work, the object must have a mass above 0.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| GrabUseDepth || Bool || false || If GrabDepth is used. If not the interaction distance is used.&lt;br /&gt;
|-&lt;br /&gt;
| GrabDepth || Float || 1.5 || The distance which a grabbed object is automatically placed at.&lt;br /&gt;
|-&lt;br /&gt;
| GrabDepthInc || Float || 0.15 || Steps that the entity will move in when moving the mouse scroll.&lt;br /&gt;
|-&lt;br /&gt;
| GrabMinDepth || Float || 1.0 || Minimum distance the entity can be from player when grabbed.&lt;br /&gt;
|-&lt;br /&gt;
| GrabMaxDepth || Float || 2.2 || Maximum distance the entity can be from player when grabbed.&lt;br /&gt;
|-&lt;br /&gt;
| GrabUseOffset || Bool || false || If rotation and position offset is used. If not offset will be relative to the interact position.&lt;br /&gt;
|-&lt;br /&gt;
| GrabPositionOffset || Vector3f || 0 || Positional offset of entity.&lt;br /&gt;
|-&lt;br /&gt;
| GrabRotationOffset || Vector3f || 0 || Rotational offset of entity. It will automatically rotate to this when grabbed.&lt;br /&gt;
|-&lt;br /&gt;
| GrabThrowImpulse || Float || 10 || The speed (m/s) at which the entity is thrown.&lt;br /&gt;
|-&lt;br /&gt;
| GrabMassMul || Float || 0.1 || How much the object will weight when grabbed. Useful for heavier objects since they can wreck mayhem otherwise. 0.5% means half (50%) of the original weight.&lt;br /&gt;
|-&lt;br /&gt;
| GrabForceMul || Float || 1 || Change how much force is added to grabbed object.&lt;br /&gt;
|-&lt;br /&gt;
| GrabTorqueMul || Float || 1 || Change how much torque is added to grabbed object.&lt;br /&gt;
|-&lt;br /&gt;
| GrabUseRotation || Bool || true || If rotation should be used on grabbed object&lt;br /&gt;
|-&lt;br /&gt;
| GrabSkipNonOuterBodies || Bool || false || If true, then bodies that are inside a chain (has two or more joints attached to it) will not be grabbed.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Push ===&lt;br /&gt;
&lt;br /&gt;
Similar to the Grab subtype, the Push subtype allows the player to push or drag the object by taking hold of it and walking or right clicking. Examples include large rocks and the bed covering the hole in the floor in the Prison - Southern Block.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| PushAtPoint || Bool || false || If the push force should be applied to the point at the object where interaction took place.&lt;br /&gt;
|-&lt;br /&gt;
| PushForceMul || Float || 1 || Multiplier for force applied. Used to fine tune interaction.&lt;br /&gt;
|-&lt;br /&gt;
| PushImpulse || Float || 2 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Slide ===&lt;br /&gt;
&lt;br /&gt;
A Slide Object is similar to the Grab subtype, except it can only be slid in a single direction for a certain amount. An existing (but unused) entity that uses this is the secret floor carpet you can slide to the side.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| SlideMaxSpeed || Float || 10 || The maximum speed it can be moved.&lt;br /&gt;
|-&lt;br /&gt;
| SlideSlowDownFactor || Float || 1 || Amount of slowdown applied to object when not moved.&lt;br /&gt;
|-&lt;br /&gt;
| SlideSpeedFactor || Float || 1 || The higher value the more speed gain a mouse movement makes.&lt;br /&gt;
|-&lt;br /&gt;
| SlideThrowImpulse || Float || 3 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SwingDoor ==&lt;br /&gt;
&lt;br /&gt;
A SwingDoor entity is standard hinged door. Any door you can grab and swing open is considered a SwingDoor. To use a SwingDoor, you need to attach joints to where you want the door to swing around. These are usually placed by the hinges of the door. On the joint you can set the min and max values to limit how much the door can be opened. These are usually approximately 90 degrees apart in either positive or negative directions.&lt;br /&gt;
&lt;br /&gt;
If the FullGameSave instance var is not enabled, SwingDoors will reset to their initial open amount when leaving a level and returning to it.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MoveMaxSpeed || Float || 13.5 || The maximum speed it can be moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSlowDownFactor || Float || 3.0 || Amount of slowdown applied to object when not moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSpeedFactor || Float || 1.0 || The higher value the more speed gain a mouse movement makes.&lt;br /&gt;
|-&lt;br /&gt;
| MoveThrowImpulse || Float || 6.0 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
| CanInteractWithStaticBody || Bool || false || If by interacting with a static body in the entity, the door is interacted with. Meaning that interacting with any part of the entity will work.&lt;br /&gt;
|-&lt;br /&gt;
| CloseOnSound || File (.snt) || || Sound played when the door is closed.&lt;br /&gt;
|-&lt;br /&gt;
| CloseOffSound || File (.snt) || || Sound played when the door is opened.&lt;br /&gt;
|-&lt;br /&gt;
| LockOnSound || File (.snt) || || Sound played when the door is locked.&lt;br /&gt;
|-&lt;br /&gt;
| LockOffSound || File (.snt) || || Sound played when the door is unlocked.&lt;br /&gt;
|-&lt;br /&gt;
| InteractLockedSound || File (.snt) || || Sound made when player interacts with a locked door.&lt;br /&gt;
|-&lt;br /&gt;
| Breakable || Bool || false || Can the door be broken.&lt;br /&gt;
|-&lt;br /&gt;
| DamageMesh1 || File (.dae/.msh/.mesh) || || Mesh used when health is below HealthDamage1&lt;br /&gt;
|-&lt;br /&gt;
| DamageMesh2 || File (.dae/.msh/.mesh) || || Mesh used when health is below HealthDamage2&lt;br /&gt;
|-&lt;br /&gt;
| BrokenEntity || File (.ent) || || The entity this entity turns into when broken.&lt;br /&gt;
|-&lt;br /&gt;
| DamageSound || File (.snt) || || Sound made when a new damage mesh is used.&lt;br /&gt;
|-&lt;br /&gt;
| DamagePS || File (.ps) || || Particles created when a new damage mesh is used.&lt;br /&gt;
|-&lt;br /&gt;
| BreakSound || File (.snt) || || Sound made when broken.&lt;br /&gt;
|-&lt;br /&gt;
| BreakPS || File (.ps) || || Particles created when broken.&lt;br /&gt;
|-&lt;br /&gt;
| BreakImpulse || Float || 3 || Impulse set to objects in broken mesh.&amp;lt;br&amp;gt;Incorrectly defined as a sound file in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| HealthDamage1 || Float || 66 || Health when damage mesh 1 is used.&lt;br /&gt;
|-&lt;br /&gt;
| HealthDamage2 || Float || 33 || Health when damage mesh 2 is used.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| Locked || Bool || false || If the door is locked&lt;br /&gt;
|-&lt;br /&gt;
| OpenAmount || Float || 0 || The amount the door is open. 0 - 1.&lt;br /&gt;
|-&lt;br /&gt;
| DisableBreakable || Bool || false || If the entity is breakable then having this true will make it unbreakable.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Lever ==&lt;br /&gt;
&lt;br /&gt;
A Lever entity is an entity that can be swung between states to trigger callbacks. A lever requires a joint to swing around.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MoveMaxSpeed || Float || 13.5 || The maximum speed it can be moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSlowDownFactor || Float || 3.0 || Amount of slowdown applied to object when not moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSpeedFactor || Float || 1.0 || The higher value the more speed gain a mouse movement makes.&lt;br /&gt;
|-&lt;br /&gt;
| MoveThrowImpulse || Float || 6.0 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
| CanInteractWithStaticBody || Bool || false || If by interacting with a static body in the entity, the lever is interacted with. Meaning that interacting with any part of the entity will work.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitRange || Float || 5.0 || The distance from min the joint can be to be considered at min limit.&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitRange || Float || 5.0 || The distance from max the joint can be to be considered at max limit.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitSound || File (.snt) || || Sound played when at min limit&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitSound || File (.snt) || || Sound played when at max limit&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitStuck || Bool || false || If the lever becomes stuck when reaching min.&amp;lt;br&amp;gt;Missing from EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitStuck || Bool || false || If the lever becomes stuck when reaching max.&amp;lt;br&amp;gt;Missing from EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| StuckSound || File (.snt) || || Sound played when stuck&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| MiddleAngleAmount || Float || 0 || The amount between min and max that is considered middle. -1 to 1. -1=at min, 0=exactly between min and max, 1=at max&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveToAngle || Bool || True || If the lever should move to position when not interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveSpeedFactor || Float || 2 || Multiplier applied to speed to determine the speed it moves towards wanted position. The higher the faster it gets to the position.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveMaxSpeed || Float || 8 || Max speed it can move at to the wanted position&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveGoal || String || Middle || Where it should go when auto moving.&amp;lt;br&amp;gt;Can be &amp;quot;Middle&amp;quot;, &amp;quot;Min&amp;quot;, or &amp;quot;Max&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| StuckState || String || None || The initial stuck state for the lever.&amp;lt;br&amp;gt;Can be &amp;quot;None&amp;quot;, &amp;quot;Min&amp;quot;, or &amp;quot;Max&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| InteractionDisablesStuck || Bool || false || If stuck is disabled when player interacts.&lt;br /&gt;
|-&lt;br /&gt;
| OverrideDefaults || Bool || false || If normal settings, set in ent file, should be overridden by settings below.&lt;br /&gt;
|-&lt;br /&gt;
| MiddleAngleAmount || Float || 0 || The amount between min and max that is considered middle. -1 to 1. -1=at min, 0=exactly between min and max, 1=at max&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveToAngle || Bool || True || If the lever should move to position when not interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveGoal || String || Middle || Where it should go when auto moving.&amp;lt;br&amp;gt;Can be &amp;quot;Middle&amp;quot;, &amp;quot;Min&amp;quot;, or &amp;quot;Max&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Wheel ==&lt;br /&gt;
&lt;br /&gt;
A Wheel entity is a wheel that can be turned. They use states similar to the levers. Some wheels can be turned indefinitely and some (mostly valves) can be turned for a fixed amount in order to trigger an event. Wheels require a joint.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MoveMaxSpeed || Float || 13.5 || The maximum speed it can be moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSlowDownFactor || Float || 3.0 || Amount of slowdown applied to object when not moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSpeedFactor || Float || 1.0 || The higher value the more speed gain a mouse movement makes.&lt;br /&gt;
|-&lt;br /&gt;
| MoveThrowImpulse || Float || 6.0 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
| CanInteractWithStaticBody || Bool || false || If by interacting with a static body in the entity, the wheel is interacted with. Meaning that interacting with any part of the entity will work.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimit || Float || -180 || Min limit of the wheel, should be equal or below 0 but can be as low as wanted. Several revolutions are supported!&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimit || Float || 180 || Max limit of the wheel, should be equal or above 0 but can be as high as wanted. Several revolutions are supported!&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitRange || Float || 5.0 || The distance from min the joint can be to be considered at min limit.&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitRange || Float || 5.0 || The distance from max the joint can be to be considered at max limit.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitStuck || Bool || false || If the wheel becomes stuck when reaching min limit.&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitStuck || Bool || false || If the wheel becomes stuck when reaching max limit.&lt;br /&gt;
|-&lt;br /&gt;
| SpinDir || String || BothWays || The direction the wheel can be spun&amp;lt;br&amp;gt;Can be &amp;quot;BothWays&amp;quot;, &amp;quot;ToMin&amp;quot;, or &amp;quot;ToMax&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitSound || File (.snt) || || Sound played at min limit&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitSound || File (.snt) || || Sound played at max limit&lt;br /&gt;
|-&lt;br /&gt;
| StuckSound || File (.snt) || || Sound played when stuck.&lt;br /&gt;
|-&lt;br /&gt;
| SlowDownRotation || Bool || true || If rotation should be slowed to 0 when not interacting.&lt;br /&gt;
|-&lt;br /&gt;
| SkipMiddleState || Bool || true || If the middle state (when not in max or min) should be skipped by script and connections.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| StuckState || String || None || The stuck state for the wheel.&amp;lt;br&amp;gt;Can be &amp;quot;None&amp;quot;, &amp;quot;Min&amp;quot;, or &amp;quot;Max&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| InteractionDisablesStuck || Bool || false || If stuck is disabled when player interacts.&lt;br /&gt;
|-&lt;br /&gt;
| OverrideDefaults || Bool || false || If normal settings, set in ent file, should be overridden by settings below.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimit || Float || -180 || Min limit of the wheel, should be equal or below 0 but can be as low as wanted. Several revolutions are supported!&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimit || Float || 180 || Max limit of the wheel, should be equal or above 0 but can be as high as wanted. Several revolutions are supported!&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitStuck || Bool || false || If the wheel becomes stuck when reaching min limit.&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitStuck || Bool || false || If the wheel becomes stuck when reaching max limit.&lt;br /&gt;
|-&lt;br /&gt;
| SpinDir || String || BothWays || The direction the wheel can be spun&amp;lt;br&amp;gt;Can be &amp;quot;BothWays&amp;quot;, &amp;quot;ToMin&amp;quot;, or &amp;quot;ToMax&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MultiSlider ==&lt;br /&gt;
&lt;br /&gt;
A sliding-type lever that can be set to multiple states. Used for the gear levers in the Sewer.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| SlideMaxSpeed || Float || 10 || The maximum speed it can be moved.&lt;br /&gt;
|-&lt;br /&gt;
| SlideSlowDownFactor || Float || 1 || Amount of slowdown applied to object when not moved.&lt;br /&gt;
|-&lt;br /&gt;
| SlideSpeedFactor || Float || 1 || The higher value the more speed gain a mouse movement makes.&lt;br /&gt;
|-&lt;br /&gt;
| SlideThrowImpulse || Float || 3 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
| NumOfStates || Int || 3 || The number of states used.&lt;br /&gt;
|-&lt;br /&gt;
| StickToStateMaxDist || Float || 0.1 || The distance from a state that the slider sticks.&lt;br /&gt;
|-&lt;br /&gt;
| CanInteractWithStaticBody || Bool || false || If by interacting with a static body in the entity, the lever is interacted with. Meaning that interacting with any part of the entity will work.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveToCurrentState || Bool || true || If body should automove to current state when not interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveSpeedFactor || Float || 2 || Multiplier applied to speed to determine the speed it moves towards wanted position. The higher the faster it gets to the postion.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveMaxSpeed || Float || 8 || Max speed it can move at to the wanted position&lt;br /&gt;
|-&lt;br /&gt;
| ChangeStateSound || File (.snt) || || Sound played when state is changed&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| StuckSound || File (.snt) || || Sound played when stuck&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| StuckState || String || None || The stuck state for the wheel.&amp;lt;br&amp;gt;Can be &amp;quot;None&amp;quot;, &amp;quot;Min&amp;quot;, or &amp;quot;Max&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| InteractionDisablesStuck || Bool || false || If stuck is disabled when player interacts.&lt;br /&gt;
|-&lt;br /&gt;
| ChangeStateCallback || String || || Called when state changes Syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;Used instead of ConnectionStateChangeCallback, as this entity type can have more than two possible states.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Lamp ==&lt;br /&gt;
&lt;br /&gt;
A Lamp entity is a light source. If they are unlit, they can be lit by the player, consuming a tinderbox. Examples are torches and candles.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CanBeLitByPlayer || Bool || true || If the player can use a tinderbox on it to light it.&lt;br /&gt;
|-&lt;br /&gt;
| CanBeGrabbed || Bool || false || If it can be grabbed by the player.&amp;lt;br&amp;gt;No effect. Presumably intended to make the entity behave like a Grab Object, yet this is unimplemented.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| Lit || Bool || true || If the lamp is lit or not.&lt;br /&gt;
|-&lt;br /&gt;
| ConnectedLight || String || || Name of a light (that is not in an entity!) that will be connected to the this light and will increase/decrease in color as the lamp is turned on/off.&lt;br /&gt;
|-&lt;br /&gt;
| ConnectionLightAmount || Float || 1 || The amount to multiply the lamp's color by before adding it to the connected light's color.&lt;br /&gt;
|-&lt;br /&gt;
| ConnectionLightUseOnColor || Bool || true || If the on color should always be used. If false the light color (which might be flickering) is used.&lt;br /&gt;
|-&lt;br /&gt;
| ConnectionLightUseSpec || Bool || false || If the specular of the lamp color should be used.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Button ==&lt;br /&gt;
&lt;br /&gt;
A Button entity acts like a Lever, except it does not use a joint. It simply changes its connection state and toggles effects when interacted with.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| SwitchedOn || Bool || false || If the button starts as on or off&lt;br /&gt;
|-&lt;br /&gt;
| CanBeSwitchedOn || Bool || true || If player can switch it on.&lt;br /&gt;
|-&lt;br /&gt;
| CanBeSwitchedOff || Bool || false || If player can switch it off.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Photocell ==&lt;br /&gt;
&lt;br /&gt;
A prop that changes its texture illumination and connection state based on the light level around it. Presumably a leftover from Lux Tenebris, which featured light-based puzzles.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| LightLevelOnLimit || Float || 0.9 || Light level above this value turns the photocell on.&lt;br /&gt;
|-&lt;br /&gt;
| LightLevelOffLimit || Float || 0.1 || Light level below this value turns the photocell off.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MoveObject ==&lt;br /&gt;
&lt;br /&gt;
A MoveObject entity is an entity that can be specifically moved on a single axis through the use of scripting. It can be set to either Angular or Linear. Angular rotates the object around its own center point, unless otherwise specified by the use of an OffsetArea. Linear moves the object in a direction for a specified amount. Note that a linear move object can only move on one axis. You can pick X, Y, or Z in the entity and this cannot be changed mid-game. If you want the same object to move on more than 1 axis (for example left then forward) you can switch out the entity with an identical one that uses another axis. The script to move a MoveObject is &amp;lt;code&amp;gt;SetMoveObjectState&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;SetMoveObjectStateExt&amp;lt;/code&amp;gt; (see [[HPL2/Engine Scripts|Engine Scripts]]).&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MoveObjectType || String || Linear || The way the object moves. Linear means position changes and Angular means rotation changes.&amp;lt;br&amp;gt;Can be &amp;quot;Linear&amp;quot; or &amp;quot;Angular&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| OpenAmount || Float || 1.0 || Linear: How much of the MoveAxis size that will mean that it is open. Angular: 1=90 degrees. 0.5=45deg and 2=180deg (any numbers inbetween are okay of course)&lt;br /&gt;
|-&lt;br /&gt;
| MoveAxis || String || X || he axis that the movement is about. For angular it is rotation axis and for linear it is the position axis that is changed.&amp;lt;br&amp;gt;Can be &amp;quot;X&amp;quot;, &amp;quot;Y&amp;quot;, or &amp;quot;Z&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| OpenAcc || Float || 5.0 || The acceleration for reaching OpenSpeed&lt;br /&gt;
|-&lt;br /&gt;
| OpenSpeed || Float || 1.0 || The goal speed when opening.&lt;br /&gt;
|-&lt;br /&gt;
| CloseAcc || Float || 5.0 || The acceleration for reaching CloseSpeed&lt;br /&gt;
|-&lt;br /&gt;
| CloseSpeed || Float || 1.0 || The goal speed when closing.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMove || Bool || false || If the door should move towards some goal automatically.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveStateGoal || Float || 0.0 || The amount (relative to the what is considered open) that it shall move towards.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveAcc || Float || 9.0 || The acceleration when automoving&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveSpeed || Float || 5.0 || The goal speed when automoving&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveSlowdownDist || Float || 0.1 || The distance from state goal where it begins to slow down (in meters for linear and degrees for angular).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| AngularOffsetArea || String || || When mode is angular, this the point it rotates around. If empty, it rotates around its center.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Item ==&lt;br /&gt;
&lt;br /&gt;
Item entities become inventory items when interacted with. They glow when in pickup range.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| SubItemTypeName || String || || Determines its name and description by putting 'ItemDesc_' or 'ItemName_' as prefix for the lang file entry. Category is always Inventory&lt;br /&gt;
|-&lt;br /&gt;
| ImageFile || File (.tga/.dds/.jpg/.jpeg/.png) || || The icon shown in the inventory when picked up.&lt;br /&gt;
|-&lt;br /&gt;
| PickSound || String || Generic || The sound played when picked up.&amp;lt;br&amp;gt;Must match a sound file name in the &amp;quot;ui&amp;quot; folder, starting with &amp;quot;pick_&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CustomSubItemTypeName || String || || If not emtpy it overrides SubItemTypeName in entity file. Determines its name and description by putting 'ItemDesc_' or 'ItemName_' as prefix for the lang file entry. Category is always Inventory&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Puzzle ===&lt;br /&gt;
&lt;br /&gt;
A Puzzle subtype item is a general item with no extra properties. Use this if you only need an inventory item to be used to trigger a scripted action. Other subtypes have special properties, but Puzzle only has the ability to be collected and used from the inventory. When used, it's loaded onto the crosshair so the player can use it on objects.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| TempVar || Float || 0 || User specfic usage.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Coins ===&lt;br /&gt;
&lt;br /&gt;
Unused item type for the cut Thaler items. Thalers were once used to unlock Chests and use OilBarrels, with only the former functionality remaining.&lt;br /&gt;
&lt;br /&gt;
{{warning|You can create custom coin items, but there is a single language entry which is hardcoded into the engine and can't be changed. This means that even if all the others are changed, looking at Chests will always say &amp;quot;Locked. Costs X Thalers to open.&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CoinAmount || Int || 10 || The amount of coins it contains.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Note ===&lt;br /&gt;
&lt;br /&gt;
A Note item is an item that adds text to the player's journal. It displays itself when picked up. The note can be narrated, in which case it will automatically close once it's finished. If it isn't voiced, the player must close it. Use this if you want to make a Note item using a custom model or custom properties that differ from the main notes.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| NoteText || String || || The text and name of entry for note. Entry names for these are calculated: 'Note_'+NoteText+'_Name' and 'Note_'+NoteText+'_Text'&lt;br /&gt;
|-&lt;br /&gt;
| OpenNoteInJournal || Bool || true || If the journal should be opened when the note is picked up.&lt;br /&gt;
|-&lt;br /&gt;
| UseNarration || Bool || false || If the note has narration.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Diary ===&lt;br /&gt;
&lt;br /&gt;
A Diary item is nearly identical to the Note item. Instead, it adds itself to the Diary section of the player's journal, whereas the Note adds itself to the Notes section. Additionally, diary entries are grouped together, so that when one is split into multiple parts, the player will always read them in order, regardless of the specific Diary items that were picked up.&lt;br /&gt;
&lt;br /&gt;
Diaries are also always voice enabled, while Notes have the option for it. As such, a Diary without any voice files defined in its text will instantly close the journal on pickup.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| DiaryText || String || || The text and name of entry for diary. Entry name for these calculated: 'Diary_'+DiaryText+'_Name'+Idx and 'Diary_'+DiaryText+'_Text'+Idx. Idx starts at 1.&lt;br /&gt;
|-&lt;br /&gt;
| DiaryCallback || String || || A special callback for diary pickup. Syntax: &amp;lt;code&amp;gt;void Func(string &amp;amp;in asItem, int lDiaryIdx)&amp;lt;/code&amp;gt;. Call &amp;lt;code&amp;gt;ReturnOpenJournal(false)&amp;lt;/code&amp;gt; to not open diary in journal after callback.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Lantern ===&lt;br /&gt;
&lt;br /&gt;
A Lantern item can be picked up like a normal item, but is added as a lantern to the inventory. While having this item, the player can press F to toggle it, or click it in the inventory. Note: This is NOT the lantern model in the player's hands, only the item that gives it to the player. If you want a custom lantern model, you can follow [https://www.frictionalgames.com/forum/thread-12391.html this guide].&lt;br /&gt;
&lt;br /&gt;
=== Health ===&lt;br /&gt;
&lt;br /&gt;
A Health item acts like a health potion (Laudanum). When used, it increases the player's health by a specified amount.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| HealAmount || Float || 25 || How much health is regained when used.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sanity ===&lt;br /&gt;
&lt;br /&gt;
A Sanity item acts like a sanity potion. When used, it increases the player's sanity by a specified amount.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| HealAmount || Float || 25 || How much sanity is regained when used.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== LampOil ===&lt;br /&gt;
&lt;br /&gt;
A LampOil item acts like an oil potion. When used, it increases the player's lantern oil by a specified amount.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| OilAmount || Float || 25 || How much oil is regained when used.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Tinderbox ===&lt;br /&gt;
&lt;br /&gt;
A Tinderbox item adds itself to the player's tinderbox counter in the inventory. Tinderboxes can be used once to light a light source.&lt;br /&gt;
&lt;br /&gt;
=== HandObject ===&lt;br /&gt;
&lt;br /&gt;
Unused. Would have equipped the corresponding hand object on use.&lt;br /&gt;
&lt;br /&gt;
== Chest ==&lt;br /&gt;
&lt;br /&gt;
This is an unused feature, but it was kept in the engine and can be restored by making a custom entity. It is a object which can be opened using coins (or their replacements, if a custom Coin-type entity is made). Interacting with it brings up a text GUI. The text GUI can be changed in the base language file.&lt;br /&gt;
To make an entity of this type, just copy an existing entity file and change its entity type.&lt;br /&gt;
'''The chests that ended up in the game are actually just Levers.'''&lt;br /&gt;
&lt;br /&gt;
{{warning|In versions before 1.5, Chests did not write their CoinsNeeded instance var to save data, which caused the coin requirement of all Chests to default to 0 when loading a save.}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MoveMaxSpeed || Float || 13.5 || The maximum speed it can be moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSlowDownFactor || Float || 3.0 || Amount of slowdown applied to object when not moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSpeedFactor || Float || 1.0 || The higher value the more speed gain a mouse movement makes.&lt;br /&gt;
|-&lt;br /&gt;
| MoveThrowImpulse || Float || 6.0 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CoinsNeeded || Int || 200 || Coins required to open the chest.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== OilBarrel ==&lt;br /&gt;
&lt;br /&gt;
An OilBarrel entity simply adds some oil to the player's lantern upon interaction. The oil amount depends on the player's combined total oil stored in their lantern and as LampOil type items (the sum of the oil that the items would refill on use), determined when the player first looks at the OilBarrel. If the total oil is less than 100, the OilBarrel will contain exactly enough oil to bring it to 100. Otherwise (or if Hard Mode is enabled), it provides only 10 oil.&lt;br /&gt;
&lt;br /&gt;
If the FullGameSave instance var is not enabled, OilBarrels can be used again when leaving a level and returning to it.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| FillSound || File (.snt) || || Sound played when lantern is filled.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| EmptySound || File (.snt) || || Sound played when barrel is empty.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
== EmotionStone ==&lt;br /&gt;
&lt;br /&gt;
The memory capsule entities found in the game. Interacting with an EmotionStone causes an emotion flash effect to display, fading the screen to white and displaying a message.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| DescCat || String || || Category of text shown when in focus.&lt;br /&gt;
|-&lt;br /&gt;
| DescEntry || String || || Entry of text shown when in focus.&lt;br /&gt;
|-&lt;br /&gt;
| TextCat || String || || Category of text shown when interacted with.&amp;lt;br&amp;gt;Typically &amp;quot;EmotionStone&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry || String || || Entry of text shown when interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| Sound || File (.snt) || || Sound played when interacted with.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== NPC ==&lt;br /&gt;
&lt;br /&gt;
Non-Player Characters are non-enemy characters. Agrippa and Alexander as they appear in-game are NPCs. Their only purpose is to stand in place and look at the player (if you enable the option).&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MoveHeadBones || String || || List of bones that is rotated when the NPC rotates its head.&lt;br /&gt;
|-&lt;br /&gt;
| MoveHeadBoneMuls || String || || List of floats specifying how much each bone shall be rotated (-1 to 1).&lt;br /&gt;
|-&lt;br /&gt;
| HeadMoveSpeedMul || Float || 1 || Speed multiplier that that determines move speed based on distance to wanted angle.&lt;br /&gt;
|-&lt;br /&gt;
| HeadMoveMaxSpeed || Float || 1 || The max speed that the head moves in.&lt;br /&gt;
|-&lt;br /&gt;
| MaxHeadAngle || Float || 30 || The max angle that the head can turn when looking at the player.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| FollowPlayerArea || String || || When player is in this area, the NPC will look at him.&lt;br /&gt;
|-&lt;br /&gt;
| Awake || Bool || true || If the NPC is awake and looks at the player when in area.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== LevelDoor ==&lt;br /&gt;
&lt;br /&gt;
A LevelDoor transports the player to the specified level when interacted with. The locked sounds, text, and destination can be entered in the Level Editor itself.&lt;br /&gt;
&lt;br /&gt;
LevelDoors can also teleport the player (without a loading screen) if the same map is picked.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| EnterSound || File (.snt) || || Sound played when entering door.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| ExitSound || File (.snt) || || Sound played when entering new map after having interacted with door.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry || String || || The text shown when door is in focus. Category is always Levels&lt;br /&gt;
|-&lt;br /&gt;
| StartPos || String || || The start position of the next map that the player is transported to.&lt;br /&gt;
|-&lt;br /&gt;
| MapFile || File (.map) || || The file of the next map.&lt;br /&gt;
|-&lt;br /&gt;
| Locked || Bool || false || If the door is locked.&lt;br /&gt;
|-&lt;br /&gt;
| LockedSound || File (.snt) || || Sound heard if locked and interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| LockedTextCat || String || || Category of message shown if locked and interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| LockedTextEntry || String || || Entry of message shown if locked and interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| ShowStats || Bool || true || If stats of map it leads to should be shown (NOT IN USE)&amp;lt;br&amp;gt;Non-functional. Formerly used to display a completion percentage.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CritterBug ==&lt;br /&gt;
&lt;br /&gt;
Critters like rats, roaches, or fish on the ground (or in the case of fish, water). They move around the room they are placed in and run away from the player.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MeshOffsetRot || Vector3 || 0 0 0 || The mesh offset rotation.&lt;br /&gt;
|-&lt;br /&gt;
| MeshOffsetPos || Vector3 || 0 0 0 || The mesh offset position.&lt;br /&gt;
|-&lt;br /&gt;
| MaxSpeedNormal || Float || 0.5 || Max speed when in normal state&lt;br /&gt;
|-&lt;br /&gt;
| MaxSpeedAfraid || Float || 1.3 || Max speed when in the scared state&lt;br /&gt;
|-&lt;br /&gt;
| Gravity || Float || 9.8 || Amount of gravity applied.&lt;br /&gt;
|-&lt;br /&gt;
| HasRandomPauses || Bool || false || If the critter shall have random pauses&lt;br /&gt;
|-&lt;br /&gt;
| RandomPauseTimeMinMax || Vector2 || 1 3 || Random time length of pause&lt;br /&gt;
|-&lt;br /&gt;
| RandomMoveTimeMinMax || Vector2 || 2 6 || Random time length of movement (between pauses)&lt;br /&gt;
|-&lt;br /&gt;
| PlayerFleeDistance || Float || 3 || The distance from player which it begins to flee&lt;br /&gt;
|-&lt;br /&gt;
| FleeMul || Float || 2.1 || Factor for moving away from player (if fleeing)&lt;br /&gt;
|-&lt;br /&gt;
| BackToSpawnPointMul || Float || 0.1 || Factor for moving back to spawn point&lt;br /&gt;
|-&lt;br /&gt;
| WanderCircleRadius || Float || 4 || Picture a circle in front critter at a certain distance. A point inside the circle is randomly selected and then the vector from the critter to this point is the speed added. The larger the circle, the more random the walk.&lt;br /&gt;
|-&lt;br /&gt;
| WanderCircleDist || Float || 2 || The distance at which the wander circle is placed. The higher the distance, the more likely the critter is to move forward.&lt;br /&gt;
|-&lt;br /&gt;
| NormalSound || File (.snt) || || Sound made when in normal state&lt;br /&gt;
|-&lt;br /&gt;
| NormalSoundRandMinMax || Vector2 || 1 3 || Random time length between normal sounds. x=min, y=max&lt;br /&gt;
|-&lt;br /&gt;
| ScaredSound || File (.snt) || || Sound made when in afraid state&lt;br /&gt;
|-&lt;br /&gt;
| ScaredSoundRandMinMax || Vector2 || 1 3 || Random time length between afraid sounds. x=min, y=max&lt;br /&gt;
|-&lt;br /&gt;
| DeathEntity || File (.ent) || || Entity created when dead.&lt;br /&gt;
|-&lt;br /&gt;
| DeathPS || File (.ps) || || Particle created when dead.&lt;br /&gt;
|-&lt;br /&gt;
| DeathSound || File (.snt) || || Sound played when dead.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
== CritterSpider ==&lt;br /&gt;
&lt;br /&gt;
A unused critter similar to the spider enemies from [[wikipedia:Penumbra: Overture|Penumbra: Overture]]. Capable of climbing walls and ceilings, as well as attacking the player.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MaxIdleSpeed || Float || 0.5 ||&lt;br /&gt;
|-&lt;br /&gt;
| MaxHuntSpeed || Float || 0.75 ||&lt;br /&gt;
|-&lt;br /&gt;
| HitSound || File (.snt) || || Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| IdleSound || File (.snt) || || Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| IdleSoundRandMinMax || Vector2 || 1 3 ||&lt;br /&gt;
|-&lt;br /&gt;
| AttackSound || File (.snt) || || Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| AttackPlayerDistMinMax || Vector2 || 1 3 ||&lt;br /&gt;
|-&lt;br /&gt;
| HuntPlayerDist || Float || 8 ||&lt;br /&gt;
|-&lt;br /&gt;
| HuntTimeMinMax || Vector2 || 10 30 ||&lt;br /&gt;
|-&lt;br /&gt;
| MoveTimeMinMax || Vector2 || 4 8 ||&lt;br /&gt;
|-&lt;br /&gt;
| IdleTimeMinMax || Vector2 || 0.4 2 ||&lt;br /&gt;
|-&lt;br /&gt;
| DeathEntity || File (.ent) || || Entity created when dead.&lt;br /&gt;
|-&lt;br /&gt;
| DeathPS || File (.ps) || || Particle created when dead.&lt;br /&gt;
|-&lt;br /&gt;
| DeathSound || File (.snt) || || Sound played when dead.&lt;br /&gt;
|-&lt;br /&gt;
| AttackSizeRadius || Float || 0.3 ||&lt;br /&gt;
|-&lt;br /&gt;
| AttackOffset || Vector3 || 0 0 1 ||&lt;br /&gt;
|-&lt;br /&gt;
| AttackDamageMinMax || Vector2 || 5 15 ||&lt;br /&gt;
|-&lt;br /&gt;
| AttackForce || Vector2 || 5 1 ||&lt;br /&gt;
|-&lt;br /&gt;
| AttackStrength || Int || 1 ||&lt;br /&gt;
|-&lt;br /&gt;
| AttackHitSound || File (.snt) || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
== Enemy_Grunt ==&lt;br /&gt;
&lt;br /&gt;
An Enemy_Grunt entity is a standard enemy entity, used for the Grunt, Brute, and Suitor. Enemy entities require advanced setup, and should include animations added through Settings &amp;gt; Animations. Enemy properties can be modified in the entity type window, like certain sounds and music tracks playing, the enemy's awareness levels and damage, speed and other similar settings. An enemy does not use a collision box, but instead a skeleton and the aforementioned properties to determine how to collide/hit something.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Enemy}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| NoticeSound || File (.snt) || || Sound played when enemy notices that player is nearby&lt;br /&gt;
|-&lt;br /&gt;
| GiveUpNoticeSound || File (.snt) || || Sound played when enemy gives up investigation (after a notice)&lt;br /&gt;
|-&lt;br /&gt;
| EnabledSound || File (.snt) || || Sound played when enemy is enabled&lt;br /&gt;
|-&lt;br /&gt;
| GroggyDamageCount || Float || 15 || The accumulated amount of damage the enemy can take before getting groggy by the hit.&amp;lt;br&amp;gt;The enemy will flinch after taking this amount of damage.&lt;br /&gt;
|-&lt;br /&gt;
| AlertToHuntDistance || Float || 10 || If range is above this then enemy can go from alert to hunt&lt;br /&gt;
|-&lt;br /&gt;
| AlertToInstantHuntDistance || Float || 3.5 || If range is below this, enemy geos instantly to hunt.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMinTime || Float || 2.0 || Min time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMaxTime || Float || 4.5 || Max time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| IncreaseAlertSpeedDistance || Float || 6 || Distance at which the alert move speed increases.&lt;br /&gt;
|-&lt;br /&gt;
| IncreasedAlertSpeedMul || Float || 1.5 || The amount that move speed is multiplied by when alert.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsToHuntLimit || Float || 30 || The accumulated limit value when alert goes to hunt because of player running towards enemy.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsCheckDistance || Float || 5 || The distance where the move toward enemy check starts&lt;br /&gt;
|-&lt;br /&gt;
| IdleExtraTimeMin || Float || 2 || Min time between extra idle animations&lt;br /&gt;
|-&lt;br /&gt;
| IdleExtraTimeMax || Float || 6 || Max time between extra idle animations&lt;br /&gt;
|-&lt;br /&gt;
| IdleExtraNum || Int || 3 || Number of extra idle animations&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Enemy}}&lt;br /&gt;
&lt;br /&gt;
== Enemy_ManPig ==&lt;br /&gt;
{{clr}}&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
An enemy type ported from A Machine For Pigs. Compare to the [[HPL2/AMFP/NewEntities#Enemy_ManPig|AMFP version]] of the enemy.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Enemy}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Walk_ForwardSpeed || Float || 1.0 || Forward speed when walking on all fours, in meters per second.&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Walk_BackwardSpeed || Float || 1.0 || Backward speed when walking on all fours, in meters per second.&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Walk_ForwardAcc || Float || 2.0 || &lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Walk_ForwardDeacc || Float || 8.0 || &lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Run_ForwardSpeed || Float || 3.0 || Forward speed when running on all fours, in meters per second.&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Run_BackwardSpeed || Float || 2.0 || Backward speed when running on all fours, in meters per second.&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Run_ForwardAcc || Float || 4.0 || &lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Run_ForwardDeacc || Float || 8.0 || &lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_StoppedToWalkSpeed || Float || 0.05 || Speed at which the walk animation is played when on all fours&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_WalkToStoppedSpeed || Float || 0.02 || Speed at which walk goes to stopped when on all fours&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_WalkToRunSpeed || Float || 2.0 || Speed at which walk turns to run animation when on all fours&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_RunToWalkSpeed || Float || 0.9 || Speed at which run turns to walk when on all fours&lt;br /&gt;
|-&lt;br /&gt;
| NoticeSound || File (.snt) || || Sound played when enemy notices that player is nearby&lt;br /&gt;
|-&lt;br /&gt;
| GiveUpNoticeSound || File (.snt) || || Sound played when enemy gives up investigation (after a notice)&lt;br /&gt;
|-&lt;br /&gt;
| EnabledSound || File (.snt) || || Sound played when enemy is enabled&lt;br /&gt;
|-&lt;br /&gt;
| GroggyDamageCount || Float || 1 || The accumulated amount of damage the enemy can take before getting groggy by the hit.&amp;lt;br&amp;gt;The enemy will flinch after taking this amount of damage.&lt;br /&gt;
|-&lt;br /&gt;
| AlertToHuntDistance || Float || 6 || If range is above this then enemy can go from alert to hunt&lt;br /&gt;
|-&lt;br /&gt;
| AlertToInstantHuntDistance || Float || 2.5 || If range is below this, enemy geos instantly to hunt.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMinTime || Float || 0.5 || Min time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMaxTime || Float || 1.0 || Max time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| IncreaseAlertSpeedDistance || Float || 6 || Distance at which the alert move speed increases.&lt;br /&gt;
|-&lt;br /&gt;
| IncreasedAlertSpeedMul || Float || 1.25 || The amount that move speed is multiplied by when alert.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsToHuntLimit || Float || 30 || The accumulated limit value when alert goes to hunt because of player running towards enemy.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsCheckDistance || Float || 6 || The distance where the move toward enemy check starts&lt;br /&gt;
|-&lt;br /&gt;
| IsTelsa || Bool || false || If this is the tesla pig&lt;br /&gt;
|-&lt;br /&gt;
| TeslaSoundLoop || File (.snt) || || Sound file played when the tesla's proximity effects are active.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| ChaseSound || File (.snt) || || Played when the pig is chasing.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Enemy}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| Pose || String || Biped || The pose of the enemy to start with&amp;lt;br&amp;gt;Can be &amp;quot;Biped&amp;quot; or &amp;quot;Quadruped&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| ThreatenOnAlert || Bool || false || If the pig should stand still and threaten instead of walking towards player when in alert mode.&lt;br /&gt;
|-&lt;br /&gt;
| FleeFromPlayer || Bool || false || The pig will flee instead of hunting (threaten if ThreatenOnAlert). Disabled if far enough away. Will attack if cornered.&lt;br /&gt;
|-&lt;br /&gt;
| AutoDisableAfterFlee || Bool || false || If pig should be disabled after having fled (if possible)&lt;br /&gt;
|-&lt;br /&gt;
| LanternSensitivity || Float || 1 || A modifier for how quickly the pig reacts to being shined on by the lantern.&amp;lt;br&amp;gt;Not defined in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| IdleBehavior || String || None || The behavior used when there are no patrol nodes left to walk.&amp;lt;br&amp;gt;Can be &amp;quot;None&amp;quot;, &amp;quot;Stalk&amp;quot;, or &amp;quot;Track&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| PlayActivateSound || Bool || true || If the enemy can play its EnabledSound.&lt;br /&gt;
|-&lt;br /&gt;
| AllowZeroNodeWaitTimes || Bool || false || If set to true, path node wait times with value 0 actually mean no waiting&amp;lt;br&amp;gt;Normally, specifying a wait time of 0 in &amp;lt;code&amp;gt;AddEnemyPatrolNode&amp;lt;/code&amp;gt; results in a wait time of 1-3 seconds.&lt;br /&gt;
|-&lt;br /&gt;
| PatrolMoveSpeed || String || Walk || Whether this pig walks or runs along its patrol&amp;lt;br&amp;gt;Can be &amp;quot;Walk&amp;quot; or &amp;quot;Run&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| DamageMul || Float || 1 || Multiplier for the enemy's attack damage.&amp;lt;br&amp;gt;Not defined in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| RunSpeedMul || Float || 1 || Multiplier for the enemy's run speed.&amp;lt;br&amp;gt;Not defined in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseTimeMul || Float || 1 || Multiplier for wait time between attacks.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Enemy_Waterlurker ==&lt;br /&gt;
&lt;br /&gt;
Enemy type of the &amp;quot;water monster&amp;quot;. Since you can't assign animations to it, you might as well just use the normal waterlurker of the base game unless you want to change its properties (such as damage, movement speed, or music played).&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Enemy}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| PlayerDetectionHeight || Float || 0.6 || The y-distance from the enemy that the player is detected.&lt;br /&gt;
|-&lt;br /&gt;
| EatDamage || Float || 20 || The damage dealt to food being eaten&lt;br /&gt;
|-&lt;br /&gt;
| AfterAttackPauseTime || Float || 0 || The amount of timer lurker waits after an attack&lt;br /&gt;
|-&lt;br /&gt;
| SplashPS_Walk || File (.ps) || || Particle system created at surface when walking.&lt;br /&gt;
|-&lt;br /&gt;
| SplashPS_Run || File (.ps) || || Particle system created at surface when running.&lt;br /&gt;
|-&lt;br /&gt;
| SplashPS_Eat || File (.ps) || || Particle system created at surface when eating.&lt;br /&gt;
|-&lt;br /&gt;
| SplashPS_Attack || File (.ps) || || Particle system created at surface when attacking.&lt;br /&gt;
|-&lt;br /&gt;
| SplashSound_Walk || File (.snt) || || Sound played when walking.&lt;br /&gt;
|-&lt;br /&gt;
| SplashSound_Run || File (.snt) || || Sound played when running.&lt;br /&gt;
|-&lt;br /&gt;
| SplashSound_Eat || File (.snt) || || Sound played when eating.&lt;br /&gt;
|-&lt;br /&gt;
| SplashSound_Attack || File (.snt) || || Sound played when attacking.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Enemy}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| PlayerDetectionHeight || Float || 0 || If equal or below 0 the default in data file is used! The y-distance from the enemy that the player is detected.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== PlayerHands ==&lt;br /&gt;
&lt;br /&gt;
Player's hands. Unless you want to make a different looking hand for a full conversion mod, you don't have to worry about this.&lt;br /&gt;
&lt;br /&gt;
== HandObject ==&lt;br /&gt;
&lt;br /&gt;
The only available HandObject is the lantern. It is used in conjunction with a &amp;lt;code&amp;gt;.ho&amp;lt;/code&amp;gt; config file to place it properly in PlayerHands.&lt;br /&gt;
&lt;br /&gt;
Mostly a remnant of cut items that functioned as weapons, like in [[wikipedia:Penumbra: Overture|Penumbra: Overture]], including the pickaxe from that game.&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/AMFP/Infection&amp;diff=7031</id>
		<title>HPL2/AMFP/Infection</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/AMFP/Infection&amp;diff=7031"/>
		<updated>2026-02-07T20:14:59Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Missing parts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Infection =&lt;br /&gt;
&lt;br /&gt;
Infection is a mechanic which was cut from the final game, but it wasn't fully removed from it.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The mechanic is quite similar to sanity from TDD. It is a meter which fills up in certain circumstances and plays visual and sound effects, which depend on the meter's value.&lt;br /&gt;
&lt;br /&gt;
The infection meter is primarily changed by Infection areas. There are multiple of them placed in the game, but they all have been deactivated (which means that they can be restored). Infection areas can either increase or decrease infection. The only other functional method of changing infection (outside of scripting) is by standing in a Liquid area with the InfectionLevel variable set.&lt;br /&gt;
&lt;br /&gt;
There are 4 levels of infection, all of which play increasingly noticeable screen effects (sepia, image trails, and radial blur).&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Level !! Value Range (Check) !! Value (Set) !! Effects&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0 || 0 || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || 1-25 || 30 || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || 26-50 || 50 || &lt;br /&gt;
|-&lt;br /&gt;
| 3 || 51-75 || 70 || Running disabled&lt;br /&gt;
|-&lt;br /&gt;
| 4 || 76-100 || 90 || Running disabled, -50% speed&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Infection levels are calculated differently when going from level to value when checking infection level compared to setting infection level. Because of this quirk, setting infection to level 1 actually puts it in the level 2 range.&lt;br /&gt;
&lt;br /&gt;
The meter goes down automatically after the player leaves the infected area. It will gradually fall to zero, unless the player has gathered above 80 infection; in that case, they will die after 2 seconds (unless &amp;quot;faux mode&amp;quot; is enabled). Interestingly, infection no longer decreases over time above 75, which leaves a tight margin of 5 infection points which won't kill the player but will not decrease.&lt;br /&gt;
&lt;br /&gt;
Currently the only way to view the meter (aside from the audiovisual effects) is to press F1 in debug mode and turn on player info.&lt;br /&gt;
&lt;br /&gt;
== Other evidence ==&lt;br /&gt;
&lt;br /&gt;
According to these sections of '''game.cfg''', the infection system was a slightly modified version of the sanity mechanic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;Infection&lt;br /&gt;
    EventsFile = &amp;quot;misc/main_sanity_events.cfg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    MinTimeBetweenEvents = &amp;quot;300&amp;quot;&lt;br /&gt;
    MaxEventSanity = &amp;quot;65&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    MaxSanity_LongWait = &amp;quot;65&amp;quot;&lt;br /&gt;
    MaxSanity_MedWait = &amp;quot;45&amp;quot;&lt;br /&gt;
    MaxSanity_ShortWait = &amp;quot;25&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    TimeBetween_LongWait = &amp;quot;270&amp;quot;&lt;br /&gt;
    TimeBetween_MedWait = &amp;quot;180&amp;quot;&lt;br /&gt;
    TimeBetween_ShortWait = &amp;quot;80&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    MinExamineInfection = &amp;quot;50&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    InfectionArea_CheckTimeMin = &amp;quot;1&amp;quot;&lt;br /&gt;
    InfectionArea_CheckTimeMax = &amp;quot;2&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Player_Infection&lt;br /&gt;
	&lt;br /&gt;
	HitZoomInSpeed = &amp;quot;3.5&amp;quot;&lt;br /&gt;
	HitZoomOutSpeed = &amp;quot;0.6&amp;quot;&lt;br /&gt;
	HitZoomInFOVMul = &amp;quot;0.06&amp;quot;&lt;br /&gt;
	HitZoomInAspectMul = &amp;quot;0.15&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	InfectionDecreaseSpeed = &amp;quot;0.75&amp;quot;&lt;br /&gt;
	InfectionDecreaseLimitLevel = &amp;quot;3&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	InfectionVeryHighLimit = &amp;quot;80&amp;quot;&lt;br /&gt;
	InfectionEffectsStart = &amp;quot;35&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	InfectionWaveAlphaMul = &amp;quot;1&amp;quot;&lt;br /&gt;
	InfectionWaveSpeedMul = &amp;quot;1&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	CheckEnemyNearOrSeenInterval = &amp;quot;0.3&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	NearEnemyDecrease = &amp;quot;0.3&amp;quot;&lt;br /&gt;
	NearCritterDecrease = &amp;quot;0.1&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	StartSwayMinInfection = &amp;quot;15&amp;quot;&lt;br /&gt;
	SwayMaxSavedPositions = &amp;quot;30&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
  HighInfectionLimitForDeathTimer = &amp;quot;80&amp;quot;&lt;br /&gt;
	TimeUntilDeathAtHighInfection = &amp;quot;2&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	LightLampMinInfectionIncrease = &amp;quot;0.1&amp;quot;&lt;br /&gt;
	LightLampMaxInfectionIncrease = &amp;quot;5&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  NumberOfInfectionLevels = &amp;quot;4&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  InfectionLevelOneSpeedMultiplier = &amp;quot;1.0&amp;quot;&lt;br /&gt;
  InfectionLevelTwoSpeedMultiplier = &amp;quot;1.0&amp;quot;&lt;br /&gt;
  InfectionLevelThreeSpeedMultiplier = &amp;quot;1.0&amp;quot;&lt;br /&gt;
  InfectionLevelFourSpeedMultiplier = &amp;quot;0.5&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  MaxInfectionLevelAtWhichPlayerCanRun = &amp;quot;2&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  GradientThresholdOffset = &amp;quot;1.1&amp;quot;&lt;br /&gt;
  GradientFallofExponent = &amp;quot;8.0&amp;quot;&lt;br /&gt;
  InfectionMapZoom = &amp;quot;0.95&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  VomitEffectDuration =&amp;quot;3.0&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  InfectionEffectGrowSpeed = &amp;quot;1&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, in the game it uses a separate meter (which is visible via the aforementioned debug menu method).&lt;br /&gt;
&lt;br /&gt;
The mentioned sanity events config file contains exactly the same data as TDD, which means that it wasn't used in the end.&lt;br /&gt;
&lt;br /&gt;
Infection was supposed to increase near creatures, yet the config still has the old sanity property names:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    NearEnemyDecrease = &amp;quot;0.3&amp;quot;&lt;br /&gt;
    NearCritterDecrease = &amp;quot;0.1&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The proper names for these are &amp;lt;code&amp;gt;NearEnemyIncrease&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;NearCritterIncrease&amp;lt;/code&amp;gt;, although only CritterSpider increases infection, as a result of repurposed TDD code.&lt;br /&gt;
&lt;br /&gt;
These property names were changed to replace &amp;quot;Sanity&amp;quot; with &amp;quot;Infection&amp;quot;, but are entirely unused:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
   LightLampMinInfectionIncrease = &amp;quot;0.1&amp;quot;&lt;br /&gt;
   LightLampMaxInfectionIncrease = &amp;quot;5&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ManPig enemies have unused vomit animations and unused entity parameters, such as:&lt;br /&gt;
&lt;br /&gt;
* DistanceAtWhichFleeingPigVomitAttacks&lt;br /&gt;
* MinimumTimeBetweenVomitAttacks&lt;br /&gt;
* MinTimeBeforeIgnoringPlayerAfterVomit&lt;br /&gt;
&lt;br /&gt;
These seem to indicate that ManPigs would have attacked the player by vomiting, increasing the infection meter. The C++ source code shows that being vomited on would instantly set infection to the maximum level:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void cLuxPlayer::VomitDamage()&lt;br /&gt;
{&lt;br /&gt;
	mfTimeSinceLastVomit = 0.0f;&lt;br /&gt;
&lt;br /&gt;
	/*if ( GetInfectionLevel() &amp;lt; 3 )&lt;br /&gt;
	{&lt;br /&gt;
		SetInfectionLevel( 3 );&lt;br /&gt;
	}&lt;br /&gt;
	else*/ if ( GetInfectionLevel() &amp;lt; 4 )&lt;br /&gt;
	{&lt;br /&gt;
		SetInfectionLevel( 4 );&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A particle effect called &amp;quot;''ps_pig_attack_vomit''&amp;quot; was also left in the game.&lt;br /&gt;
&lt;br /&gt;
== Missing parts ==&lt;br /&gt;
&lt;br /&gt;
When the infection is used in-game by enabling the infection areas, some errors get printed to the log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ERROR: Could not load sound 'infection_loop_1'&lt;br /&gt;
ERROR: Can't find sound 'infection_loop_1'!&lt;br /&gt;
ERROR: Couldn't create SoundEntity 'infection_drain_high.snt'&lt;br /&gt;
ERROR: Couldn't create SoundEntity 'infection_heartbeat.snt'&lt;br /&gt;
WARNING: Could not find language file entry 'InfectionHigh'&lt;br /&gt;
ERROR: Couldn't create SoundEntity 'infection_pant.snt'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This indicates that some of the sound entity (.snt) files are missing. They don't have the raw sound files (.ogg) either. However, they use the same naming scheme as TDD's sanity sounds, so it's likely that the TDD sounds were simply renamed.&lt;br /&gt;
&lt;br /&gt;
Furthermore, the game displays an empty hint when player reaches level 4 of infection. Its lang file name is &amp;quot;InfectionHigh&amp;quot;, which means that it can be remade and will display automatically. It is unknown if hints for other infection levels exist.&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=7028</id>
		<title>HPL2/Engine Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=7028"/>
		<updated>2025-10-17T01:54:56Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Sounds &amp;amp; Music */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TocRight}}&lt;br /&gt;
&lt;br /&gt;
This page documents all scripts available in Amnesia: The Dark Descent.&lt;br /&gt;
&lt;br /&gt;
{{note|'''Note''': Some of the functions require the Amnesia 1.3 or 1.5 update. Steam and other online store copies should be automatically updated. Other copies can get 1.3 [http://www.frictionalgames.com/forum/thread-24334.html here].}}&lt;br /&gt;
&lt;br /&gt;
== Directives ==&lt;br /&gt;
&lt;br /&gt;
First off, &amp;lt;code&amp;gt;#include &amp;quot;file.hps&amp;quot;&amp;lt;/code&amp;gt; can be used to programmatically merge together multiple separate files to make organizing scripts easier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
==Engine scripts==&lt;br /&gt;
===Main===&lt;br /&gt;
&lt;br /&gt;
The following functions are the main hps functions that the HPL2 engine looks to run on certain events - similar to the C++ int main() function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void OnStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the map is loaded for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnEnter();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs whenever the player enters a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnLeave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the player leaves a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnGameStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is found in the global.hps file and the inventory.hps file, and is run when the game is first started by the player (ie via &amp;quot;Start New Game&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnUpdate(float afStep);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
This function is executed for every game update or &amp;quot;tick&amp;quot;. Can be used for rapid-firing updates instead of looping timers. Keep in mind that this can affect game performance if not used with care.&lt;br /&gt;
&lt;br /&gt;
#''afStep''- Time elapsed in seconds since the last frame. Multiply speeds, distances etc. by this argument to avoid framerate dependence issues (for example: if you move something in this function with constant speed, it will move faster on computers which run the game with high FPS and slower on computers with low FPS).&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float RandFloat(float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random float.&lt;br /&gt;
&lt;br /&gt;
#''afMin ''- minimum value&lt;br /&gt;
#''afMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int RandInt(int alMin, int alMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random int. Note: the maximum value is ''inclusive''  - the RandInt() function may return this value.&lt;br /&gt;
&lt;br /&gt;
#''alMin ''- minimum value&lt;br /&gt;
#''alMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringContains(string &amp;amp;in asString, string &amp;amp;in asSubString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a string contains the specified string. &amp;lt;br /&amp;gt;Example: searching for &amp;quot;hello&amp;quot; in &amp;quot;hello world&amp;quot; would return '''true'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to check&lt;br /&gt;
#''asSubString ''- the string to search for&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; StringSub(string &amp;amp;in asString, int alStart, int alCount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the substring in a string. &amp;lt;br /&amp;gt;Example: in the string &amp;quot;frictional games rocks&amp;quot;, using 4 as ''alStart''  and 6 as ''alCount''  would return '''&amp;quot;tional&amp;quot;'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string&lt;br /&gt;
#''alStart ''- starting character of the string, with 0 being the first character&lt;br /&gt;
#''alCount ''- amount of characters&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int StringToInt(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns an integer converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float StringToFloat(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a float converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringToBool(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a boolean converted from a string, else returns false.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&lt;br /&gt;
===Mathematical Operations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathCos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathTan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAsin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAcos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan2(float afX, float afY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Calculates and returns the arc tangent of the specified values.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - First value to operate.&lt;br /&gt;
#''afY''  - Second value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSqrt(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the square root of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathPow(float afBase, float afExp);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the value of afBase raised to the power of afExp.&lt;br /&gt;
&lt;br /&gt;
#''afBase''  - The base value.&lt;br /&gt;
#''afExp''  - Value to calculate the base with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMin(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the lowest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMax(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the highest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathClamp(float afX, float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns afX clamped between afMin and afMax. If afX &amp;lt; afMin, returns afMin, and if afX &amp;gt; afMax, returns afMax.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - The value to clamp.&lt;br /&gt;
#''afMin''  - The minimum value to clamp afX with.&lt;br /&gt;
#''afMax''  - The maximum value to clamp afX with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAbs(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the absolute value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&lt;br /&gt;
===Debugging===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void Print(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a string to the log file (''hpl.log'').&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDebugMessage(string &amp;amp;in asString, bool abCheckForDuplicates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a line of text to the debug console at the bottom left of the screen. Debug mode must be enabled for the console messages to be visible.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to print&lt;br /&gt;
#''abCheckForDuplicates ''- if true, the string won't be printed more than once on screen until it disappears&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ProgLog(string &amp;amp;in asLevel, string &amp;amp;in asMessage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints an entry to the ProgLog (progression log). &amp;lt;br /&amp;gt;ProgLog is a file created in Documents/Amnesia/main (or an FC folder if one is being used). It logs certain events, such us opening the menu or picking up the lantern, as well as the player's state (Health, Sanity, Oil, Tinderboxes, Coins), for the purpose of documenting a tester's playstyle. &amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt;This function allows to log custom messages.The messages in the ProgLog file are sorted by time elapsed since a map was loaded.&lt;br /&gt;
&lt;br /&gt;
ProgLog has to be enabled for a player profile in ''user_settings.cfg''  before it starts working.&lt;br /&gt;
&lt;br /&gt;
#''asLevel ''- can be &amp;quot;Low&amp;quot;, &amp;quot;Medium&amp;quot; or &amp;quot;High&amp;quot;. It's a tag which appears in each log entry, for event prioritising.&lt;br /&gt;
#''asMessage ''- The custom message to be printed to the log.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool ScriptDebugOn();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the debug mode is enabled. &amp;lt;br /&amp;gt;See [[HPL2/Development_Environment|&amp;quot;Setting up Development Environment&amp;quot;]] to setup debug mode on your own computer.&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
{{warning|Regular variables (int, float, etc.) are '''not''' saved by the game. Using them in important parts of yor script will break it upon loading a game save. In HPL, those variables should only be used for disposable counters, like spawning objects in a &amp;quot;for&amp;quot; loop. For variables which need to be saved, use the wrappers as described below.}}&lt;br /&gt;
&lt;br /&gt;
====Local====&lt;br /&gt;
&lt;br /&gt;
Local variables can be used throughout the same script file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetLocalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetLocalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddLocalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetLocalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Global====&lt;br /&gt;
&lt;br /&gt;
Global variables can be used throughout several maps and can be accessed by several script files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetGlobalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetGlobalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddGlobalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetGlobalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Particle Systems===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadParticleSystem(string &amp;amp;in asPSFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asPSFile''  - The particle system file to load. Extension: .ps&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntity(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntityExt(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS,&lt;br /&gt;
float afR, float afG, float afB, float afA, bool abFadeAtDistance, float afFadeMinEnd, float afFadeMinStart,&lt;br /&gt;
float afFadeMaxStart, float afFadeMaxEnd);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity, extended method with more options.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''abFadeAtDistance ''- determines whether a particle system fades from a certain distance on&lt;br /&gt;
#''afFadeMinEnd ''- minimum distance at which the particle system stops fading&lt;br /&gt;
#''afFadeMinStart ''- minimum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxStart ''- maximum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxEnd ''- maximum distance at which the particle system stops fading&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DestroyParticleSystem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Destroys a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - The internal name of the particle system&lt;br /&gt;
&lt;br /&gt;
===Sounds &amp;amp; Music===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadSound(string &amp;amp;in asSoundFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile''  - The sound file to load (extension .snt optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayGuiSound(string &amp;amp;in asSoundFile, float afVolume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays a sound, not using 3D.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile ''- the sound to play (extension .snt/.ogg optional)&lt;br /&gt;
#''afVolume ''- the volume of the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaySoundAtEntity(string &amp;amp;in asSoundName, string &amp;amp;in asSoundFile, string &amp;amp;in asEntity, float afFadeTime, bool abSaveSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a sound at an entity.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''asSoundFile ''- the sound to use (extension .snt optional)&lt;br /&gt;
#''asEntity ''- the entity to create the sound at. Using &amp;quot;Player&amp;quot; is effectively the same as &amp;lt;code&amp;gt;PlayGuiSound&amp;lt;/code&amp;gt;, yet this function allows a looping sound to be saved&lt;br /&gt;
#''afFadeTime ''- time in seconds the sound needs to fade. Avoids enemies hearing the sound if afFadeTime is at least 0.1f&lt;br /&gt;
#''abSaveSound ''- if ''true'', a looping sound will &amp;quot;remember&amp;quot; its playback state (currently playing/stopped), and that state will be restored the next time the level is entered. If ''true'', the sound is never attached to the entity! Note that saving should only be used on ''looping sounds''!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeInSound(string &amp;amp;in asSoundName, float afFadeTime, bool abPlayStart);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades in a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds&lt;br /&gt;
#''abPlayStart ''- Play the sound defined in the &amp;lt;code&amp;gt;&amp;lt;Start&amp;gt;&amp;lt;/code&amp;gt; section of the .snt before playing the main sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopSound(string &amp;amp;in asSoundName, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades out a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds, use 0 to immediately stop the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayMusic(string &amp;amp;in asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays music.&lt;br /&gt;
&lt;br /&gt;
#''asMusicFile ''- the music file to play (extension .ogg optional)&lt;br /&gt;
#''abLoop ''- determines whether a music track should loop&lt;br /&gt;
#''afVolume ''- volume of the music&lt;br /&gt;
#''afFadeTime ''- time in seconds until music reaches full volume&lt;br /&gt;
#''alPrio ''- priority of the music. Note that only the music with the highest priority can be heard! 0 - lowest, 1 - higher, etc.&lt;br /&gt;
#''abResume''  - if ''true'', playback will be continued from where the track stopped after the call to &amp;lt;code&amp;gt;StopMusic()&amp;lt;/code&amp;gt;. If ''false'', the track will be restarted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopMusic(float afFadeTime, int alPrio);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops music.&lt;br /&gt;
&lt;br /&gt;
#''afFadeTime ''- time in seconds until music stops&lt;br /&gt;
#''alPrio ''- the priority of the music that should stop&lt;br /&gt;
&lt;br /&gt;
{{bug|When loading a map from the debug menu, music from the previously loaded map cannot be stopped! It can only be overridden by playing another instance of music at the same priority level.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;To work around this, call &amp;lt;code&amp;gt;PlayMusic&amp;lt;/code&amp;gt; first, where the volume is greater than 0 and the priority matches the previous map's music, then call &amp;lt;code&amp;gt;StopMusic&amp;lt;/code&amp;gt; immediately afterward.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice(string &amp;amp;in asVoiceFile, string &amp;amp;in asEffectFile, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry,&lt;br /&gt;
bool abUsePosition, string &amp;amp;in asPosEntity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This adds a voice and an additional sound effect to be played. It is okay to call this many times in order to play many voices in a row. The EffectVoiceOverCallback is not called until ALL voices have finished.&lt;br /&gt;
&lt;br /&gt;
#''asVoiceFile ''- the voice to play&lt;br /&gt;
#''asEffectFile ''- the sound effect to play&lt;br /&gt;
#''asTextCat ''- the category in the .lang file, usually &amp;quot;Voice&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''abUsePosition ''- plays using 3D from the entity, or without 3D&lt;br /&gt;
#''asPosEntity ''- the entity at which the voice and sound are played from&lt;br /&gt;
#''afMinDistance ''- minimum distance the voice and sound are heard&lt;br /&gt;
#''afMaxDistance ''- maximum distance the voice and sound are heard&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopAllEffectVoices(float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all voices and calls the EffectVoiceOverCallback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEffectVoiceActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether EffectVoices are still active.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetEffectVoiceOverCallback(string &amp;amp;in asFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to be called when the EffectVoices are finished. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundVolume(float afDestVolume, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound volume, that means everything you can hear '''from the world'''. This does not affect music of GUI sounds.&lt;br /&gt;
&lt;br /&gt;
#''afDestVolume ''- desired volume&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired volume&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundSpeed(float afDestSpeed, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound speed.&lt;br /&gt;
&lt;br /&gt;
#''afDestSpeed ''- desired speed&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired speed&lt;br /&gt;
&lt;br /&gt;
===Lights===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightVisible(string &amp;amp;in asLightName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables lights.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''abVisible ''- determines the state of the light&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeLightTo(string &amp;amp;in asLightName, float afR, float afG, float afB, float afA, float afRadius, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the properties of a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''afRadius ''- radius of the light. -1 means keeping the radius&lt;br /&gt;
#''afTime ''- time in seconds until change is done&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightFlickerActive(string &amp;amp;in asLightName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates flickering on a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName'' - The internal light name&lt;br /&gt;
#''abActive'' - true = active, false = inactive&lt;br /&gt;
&lt;br /&gt;
==Game scripts==&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartCredits(string &amp;amp;in asMusic, bool abLoopMusic, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alEndNum);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts the end credits screen.&lt;br /&gt;
&lt;br /&gt;
#''asMusic ''- the music to play (including .ogg)&lt;br /&gt;
#''abLoopMusic ''- determines whether the music should loop&lt;br /&gt;
#''asTextCat ''- the category to be used in the .lang file, usually &amp;quot;Ending&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alEndNum ''- Amnesia has 3 different endings and displays a code at the bottom. Determines which code is displayed. 0-2 will display codes, any other integer will not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartDemoEnd();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shows the demo end screen. The background and UI elements are defined in demo.cfg, with the text using the entries in the &amp;quot;Demo&amp;quot; category of the .lang file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AutoSave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an auto save file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CheckPoint(string &amp;amp;in asName, string &amp;amp;in asStartPos, string &amp;amp;in asCallback, string &amp;amp;in asDeathHintCat, string &amp;amp;in asDeathHintEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a checkpoint at which the player will respawn in case he dies. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asName, int alCount)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;Count is 0 on the first checkpoint load!&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the editor&lt;br /&gt;
#''asCallback ''- the function to call when the player dies/respawns&lt;br /&gt;
#''asDeathHintCat ''- the category of the death hint message to be used in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asDeathHintEntry ''- the entry in the .lang file&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeMap(string &amp;amp;in asMapName, string &amp;amp;in asStartPos, string &amp;amp;in asStartSound, string &amp;amp;in asEndSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Loads another map after a 1.5 second fade out.&lt;br /&gt;
&lt;br /&gt;
#''asMapName ''- the file to load&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the next map&lt;br /&gt;
#''asStartSound ''- the sound that is played when the change starts&lt;br /&gt;
#''asEndSound ''- the sound that is played when the new map is loaded&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ClearSavedMaps();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the &amp;quot;history&amp;quot; of the save, useful to do when you know the player will not be able to go back anymore. Makes the next save much smaller in size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateDataCache();&lt;br /&gt;
void DestroyDataCache();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This caches all current textures and models and they are not released until destroy is called. If there is already cached data it is destroyed.&lt;br /&gt;
Create caches to enable faster loading when going back to a map. Destroy the cache if you know the player won't go back to that map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMapDisplayNameEntry(string &amp;amp;in asNameEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the map name shown in save file names. If none is set NULL is assumed.&lt;br /&gt;
&lt;br /&gt;
#''asNameEntry ''- the entry to display, category must be &amp;quot;Levels&amp;quot;!&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the skybox.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxTexture(string &amp;amp;in asTexture);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the texture of the skybox.&lt;br /&gt;
&lt;br /&gt;
#''asTexture''  - The texture file to set. Extension: .dds&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the solid color of the skybox rather than a texture.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the global fog.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the color to use for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogProperties(float afStart, float afEnd, float afFalloffExp, bool abCulling);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the properties for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afStart ''- how many meters from the camera should the fog begin&lt;br /&gt;
#''afEnd ''- how many meters from the camera should the fog reach full thickness&lt;br /&gt;
#''afFalloffExp ''- the amount by which the thinkness increases&lt;br /&gt;
#''abCulling ''- whether occlusion culling is active for the fog; this prevents objects behind the fog from being loaded&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetupLoadScreen(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alRandomNum, string &amp;amp;in asImageFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which loading screen will be shown when changing maps.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category of the loading text in the .lang file to be shown on the loading screen, usually &amp;quot;LoadingText&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alRandomNum ''- if greater 1, then it will randomize between 1 and alRandom for each LoadScreen giving entry the suffix XX (eg 01). If &amp;lt; =1 then no suffix is added&lt;br /&gt;
#''asImageFile ''- the image to be shown (optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void UnlockAchievement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlocks the specified achievement. Only able to be used for the ending achievements.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the achievement. Only the following strings are valid:&lt;br /&gt;
::* Benefactor&lt;br /&gt;
::* Survivor&lt;br /&gt;
::* Sacrifice&lt;br /&gt;
::* Quitter&lt;br /&gt;
::* Egotist&lt;br /&gt;
::* Altruist&lt;br /&gt;
::* Vacillator&lt;br /&gt;
&lt;br /&gt;
===Game Timer===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddTimer(string &amp;amp;in asName, float afTime, string &amp;amp;in asFunction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a timer which calls a function when it expires. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asTimer)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the name of the timer&lt;br /&gt;
#''afTime ''- time in seconds&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveTimer(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a timer, no matter how much time is left.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the timer.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetTimerTimeLeft(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the time left on a timer.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - the internal name of the timer.&lt;br /&gt;
&lt;br /&gt;
===Screen Effects===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeOut(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to black.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen is completly black&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeIn(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen back to normal.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeImageTrailTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies the image trail effect to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeSepiaColorTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the screen go dark red.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0) &lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeRadialBlurTo(float afSize, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies radial blur effects to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afSize ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetRadialBlurStartDist(float afStartDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines at which distance the radial blur effects appear.&lt;br /&gt;
&lt;br /&gt;
#''afStartDist ''- the distance at which the effect starts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectFlash(float afFadeIn, float afWhite, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white.&lt;br /&gt;
&lt;br /&gt;
#''afFadeIn ''- time in seconds until screen is white&lt;br /&gt;
#''afWhite ''- determines to which percentage the screen fades to white (1.0 = completly white)&lt;br /&gt;
#''afFadeOut ''- time in seconds until screen is back to normal again&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectEmotionFlash(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white and shows a text message.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''asSound ''- the sound to play while fading&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetFlashbackIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a flashback is still in effect.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerSpawnPS(string &amp;amp;in asSPSFile);&lt;br /&gt;
void StopPlayerSpawnPS();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Continuously spawn regular particle systems (''.ps'') around the player. Particles created by this script carry over from map to map.&lt;br /&gt;
&lt;br /&gt;
#''asSPSFile''  - the ''.sps''  file to use. Example ''.sps''  files are located in the ''/misc''  folder in the main game directory.&amp;lt;br&amp;gt;Custom ''.sps''  files can be created by hand in a text editor (see existing ones and mimic how those are written). &amp;lt;br /&amp;gt;Since ''StopPlayerSpawnPS()''  doesn't seem to work, to stop an SPS you must create an ''.sps''  file with an empty particle field field and override the old SPS by calling ''StartPlayerSpawnPS''  again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shakes the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity of the shake&lt;br /&gt;
#''afTime ''- duration of the shake&lt;br /&gt;
#''afFadeInTime ''- time in seconds until full intensity is reached&lt;br /&gt;
#''afFadeOutTime ''- time until screen is back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInDarknessEffectsActive(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the sanity drain and night vision effects while in the darkness.&lt;br /&gt;
&lt;br /&gt;
''bool abX''  - Enable/disable effects.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowScreenImage(string &amp;amp;in asImageName, float afX, float afY, float afScale, bool abUseRelativeCoordinates, float afDuration, float afFadeIn, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
Displays an image file directly onto the screen. See [[HPL2/Tutorials/ShowScreenImage()|ShowScreenImage()]] in the tutorials section for more information.&lt;br /&gt;
&lt;br /&gt;
# ''asImageName'' - The image file to render (.jpg, .png, .tga, .dds)&lt;br /&gt;
# ''afX'' - The X position of the image&lt;br /&gt;
# ''afY'' - The Y position of the image&lt;br /&gt;
# ''afScale'' - The size of the image in pixels (not scale), or original image size if negative&lt;br /&gt;
# ''abUseRelativeCoordinates'' - Whether X and Y are relative to the screen resoltion, or pixel co-ordinates if not&lt;br /&gt;
# ''afDuration'' - The duration that the image is displayed for&lt;br /&gt;
# ''afFadeIn'' - The time, in seconds, to fade in the image&lt;br /&gt;
# ''afFadeOut'' - The time, in seconds, to fade out the image&lt;br /&gt;
&lt;br /&gt;
===Insanity===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInsanitySetEnabled(string &amp;amp;in asSet, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which InsanitySets are enabled.&lt;br /&gt;
&lt;br /&gt;
#''asSet ''- the set&lt;br /&gt;
#''abX ''- enabled or not&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartInsanityEvent(string &amp;amp;in asEventName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Starts a specified insanity event.&lt;br /&gt;
&lt;br /&gt;
#''asEventName ''- Insanity event to play.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartRandomInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts a random insanity event from the available sets.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopCurrentInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Stops the currently playing insanity event.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void InsanityEventIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an insanity event is currently in effect.&amp;lt;br&amp;gt;Not useful at all due to having a return type of &amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; when it should be &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Player===&lt;br /&gt;
&lt;br /&gt;
Note that the player's maximum health and sanity is 100.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enabled/Disable player controlled movement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangePlayerStateToNormal();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets the player's state, forcing them to stop interacting with objects. It also clears the inventory item to be used (as if it was double-clicked on in the inventory again) and dismounts the player from ladders.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerCrouching(bool abCrouch);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddPlayerBodyForce(float afX, float afY, float afZ, bool abUseLocalCoords);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pushes the player into a certain direction. Note that you need values above ~2000 to see any effects.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - amount along the X-axis&lt;br /&gt;
#''afY'' - amount along the Y-axis&lt;br /&gt;
#''afZ'' - amount along the Z-axis&lt;br /&gt;
#''abUseLocalCoords'' - If true, axes are based on where the player is facing, not the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowPlayerCrossHairIcons(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the icons when a player has something in focus.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerSanity(float afSanity);&lt;br /&gt;
void AddPlayerSanity(float afSanity);&lt;br /&gt;
float GetPlayerSanity();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerHealth(float afHealth);&lt;br /&gt;
void AddPlayerHealth(float afHealth);&lt;br /&gt;
float GetPlayerHealth();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerLampOil(float afOil);&lt;br /&gt;
void AddPlayerLampOil(float afOil);&lt;br /&gt;
float GetPlayerLampOil();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the lamp oil of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerSpeed();&lt;br /&gt;
float GetPlayerYSpeed();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current speed of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSanityDrainDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables sanity drain from darkness.&lt;br /&gt;
{{bug|Sanity drain is reenabled on loading a save, as the game is unable to load the value properly from the save data.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoost();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a large amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! New Sanity&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || 100&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || 90&lt;br /&gt;
|-&lt;br /&gt;
| 50-74 || 80&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoostSmall();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a small amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! Sanity Bonus&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || +20&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || +15&lt;br /&gt;
|-&lt;br /&gt;
| 50-75 || +10&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityDamage(float afAmount, bool abUseEffect);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount'' - amount of sanity damage done&lt;br /&gt;
#''abUseEffect'' - if a sound is played and screen effects are shown when the sanity damage is dealt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GivePlayerDamage(float afAmount, string &amp;amp;in asType, bool abSpinHead, bool abLethal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the health of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount'' - amount of damage done to health&lt;br /&gt;
#''asType'' - plays a certain effect on the screen when the damage is dealt (BloodSplat, Claws, or Slash) &lt;br /&gt;
#''abSpinHead'' - changes the camera view when damage is dealt&lt;br /&gt;
#''abLethal'' - set to true if player can die from given damage. If ''false'' and the damage would have left the player with less than 10 health, health is set to 10.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerFOVMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the field of view of the player. A shorter FOV will create a zoom effect.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - multiplier of default FOV (1 is default)&lt;br /&gt;
#''afSpeed'' - the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerAspectMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the aspect ratio of the player. Basically stretches or narrows the screen horizontally.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - multiplier of default aspect (default is 1)&lt;br /&gt;
#''afSpeed'' - the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - angle of rotation of head, positive being counter-clockwise&lt;br /&gt;
#''afSpeedMul'' - speed (possibly acceleration) multiplier of the rotation (default 1, which is really slow)&lt;br /&gt;
#''afMaxSpeed'' - maximum speed of rotation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerForward(float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Moves the player forward. It needs to be called in a timer that updates 60 times / second.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- amount along the X-axis&lt;br /&gt;
#''afY ''- amount along the Y-axis&lt;br /&gt;
#''afZ ''- amount along the Z-axis&lt;br /&gt;
#''afSpeed ''- speed at which the change happens&lt;br /&gt;
#''afSlowDownDist ''- distance at which to start slowing down (prevents the head from abruptly stopping)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerLookAt(string &amp;amp;in asEntityName, float afSpeedMul, float afMaxSpeed, string &amp;amp;in asAtTargetCallback);&lt;br /&gt;
void StopPlayerLookAt();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to look at a certain entity until StopPlayerLookAt is used.&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- the entity to look at &lt;br /&gt;
#''afSpeedMul ''- how fast should the player look at the entity&lt;br /&gt;
#''afMaxSpeed ''- maximum speed allowed&lt;br /&gt;
#''asAtTargetCallback ''- function to call when player looks at target&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerMoveSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerRunSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerLookSpeedMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the player's move/run/look speed. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpForceMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the player's jump multiplier. Higher values = higher jumps. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpDisabled(bool abX);&lt;br /&gt;
void SetPlayerCrouchDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to jump/crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportPlayer(string &amp;amp;in asStartPosName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly teleports the player to the target StartPos.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternActive(bool abX, bool abUseEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the player use his lantern.&lt;br /&gt;
&lt;br /&gt;
# ''abX'' - Set lantern to be active (true) or inactive (false)&lt;br /&gt;
# ''abUseEffects'' - Play on/off sounds&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetLanternActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player is currently using the lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to use the lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternLitCallback(string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to call when the player uses the lantern. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;MyFunc(bool abLit)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message on the screen.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory'' - the category in the .lang file&lt;br /&gt;
#''asTextEntry'' - the entry in the .lang file&lt;br /&gt;
#''afTime'' - determines how long the message is displayed. If time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetDeathHint(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the message that appears when the player dies.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory'' - the category in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asTextEntry'' - the entry in the .lang file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DisableDeathStartSound();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the death sound when the player dies. This must be called directly before player is killed! The variable as soon as player dies too.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPermaDeathSound(string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Sets the sound played after the player dies when permadeath is active. Permadeath is only active when the game is launched with the &amp;lt;code&amp;gt;ptest&amp;lt;/code&amp;gt; command line parameter. Only used for the post-death Suitor lines in ''Justine''.&lt;br /&gt;
&lt;br /&gt;
#''asSound'' - The sound to be played after death. Expects a voice-type sound.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerFallDamageDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the player's ability to take fall damage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPos(float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the player's position within the level.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - X co-ordinate position.&lt;br /&gt;
#''afY'' - Y co-ordinate position.&lt;br /&gt;
#''afZ'' - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerPosX();&lt;br /&gt;
float GetPlayerPosY();&lt;br /&gt;
float GetPlayerPosZ();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the player's position within the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
===Journal===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddNote(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a note to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _Name and _Text and be in category &amp;quot;Journal&amp;quot;!&lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDiary(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a diary to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _NameX and _TextY whereas X and Y are numbers of the parts (_Name1: first diary, _Text1: first page) and be in category &amp;quot;Journal&amp;quot;! &lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ReturnOpenJournal(bool abOpenJournal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Only called in the pickup diary callback! If true the journal displays the entry else not.&lt;br /&gt;
&lt;br /&gt;
===Quests===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a quest to the player's journal under mementos. Completed quests cannot be readded.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name to be used&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot;Quest_&amp;lt;texthere&amp;gt;_Text”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CompleteQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Completes a quest. If the quest has not been added, it's marked as complete anyway, preventing it from being added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot; Quest_&amp;lt;texthere&amp;gt;_Text ”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool QuestIsCompleted(string &amp;amp;in asName);&lt;br /&gt;
bool QuestIsAdded(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a quest is completed/added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetNumberOfQuestsInMap(int alNumberOfQuests);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the number of quests in the map. Obsolete; formerly used to calculate a completion percentage when looking at a level door.&lt;br /&gt;
&lt;br /&gt;
#''alNumberOfQuests ''- Amount of quests&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveHint(string &amp;amp;in asName, string &amp;amp;in asMessageCat, string &amp;amp;in asMessageEntry, float afTimeShown);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a hint on the player's screen.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asMessageCat ''- the category in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asMessageEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTimeShown ''- time in seconds until the message disappears. If time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void BlockHint(string &amp;amp;in asName);&lt;br /&gt;
void UnBlockHint(string &amp;amp;in asName);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Blocking a hint prevents it from being shown. Blocked hints are included in savefiles, so they should persist between levels. Unblocking a hint allows it to be shown.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; blocks the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveHint(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes the hint from the list of already shown hints, allowing it to appear again.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; reenables the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
===Inventory===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ExitInventory();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Exits the inventory by force.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the player's ability to open his inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a message on the inventory screen. Used for feedback messages when failing to combine items.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory ''- the category in the .lang file, usually &amp;quot;Inventory&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTime ''- time in seconds until the message disappears. If life time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItem(string &amp;amp;in asName, string &amp;amp;in asType, string &amp;amp;in asSubTypeName, string &amp;amp;in asImageName, float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds an item to the inventory of the player. Note that the item does not have to exist as entity in the world to be able to do this.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asType ''- item type to give, Available types are:&lt;br /&gt;
::*Puzzle&lt;br /&gt;
::*Lantern&lt;br /&gt;
::*Health&lt;br /&gt;
::*Sanity&lt;br /&gt;
::*LampOil&lt;br /&gt;
::*Tinderbox&lt;br /&gt;
#''asSubTypeName ''- item name for .lang file&lt;br /&gt;
#''asImageName ''- the image which will appear in inventory. For example: &amp;lt;code&amp;gt;void GiveItem(&amp;quot;chemical_container_full_1&amp;quot;, &amp;quot;Puzzle&amp;quot;, &amp;quot;chemical_container_full&amp;quot;, &amp;quot;chemical_container_full.tga&amp;quot;, 1);&amp;lt;/code&amp;gt; will use the image from &amp;lt;code&amp;gt;graphics/item/chemical_container_full.tga&amp;lt;/code&amp;gt; &lt;br /&gt;
#''afAmount ''- amount the item gives, - For example: Oil potions will fill the oil meter by this amount, Health potions will heal by this amount, etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item from the player's inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool HasItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player has an item in his inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItemFromFile(string &amp;amp;in asName, string &amp;amp;in asFileName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a single item to the player's inventory. This is meant to be used for debug mostly as it creates the actual item and then destroys it.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asFileName ''- item to give + extension (.ent)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddCombineCallback(string &amp;amp;in asName, string &amp;amp;in asItemA, string &amp;amp;in asItemB, string &amp;amp;in asFunction, bool abAutoRemove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to combine items in his inventory. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItemA, string &amp;amp;in asItemB)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name for the callback&lt;br /&gt;
#''asItemA ''- internal name of first item&lt;br /&gt;
#''asItemB ''- internal name of second item&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
#''abAutoRemove ''- determines whether the callback should be removed when the items are combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveCombineCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a combine callback.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the callback to be removed (as specified in AddCombineCallback)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddUseItemCallback(string &amp;amp;in asName, string &amp;amp;in asItem, string &amp;amp;in asEntity, string &amp;amp;in asFunction, bool abAutoDestroy);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to use items on the world. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItem, string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
#''asItem ''- internal name of the item&lt;br /&gt;
#''asEntity ''- entity to be able to use the item on&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abAutoDestroy ''- determines whether the callback should be removed when the item is used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveUseItemCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item callback.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
&lt;br /&gt;
===Entities===&lt;br /&gt;
&lt;br /&gt;
====General====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityActive(string &amp;amp;in asName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityVisible(string &amp;amp;in asName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity's visual mesh. The collision body remains.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the entity.&lt;br /&gt;
#''abActive''  - Activate/deactivate mesh.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntityExists(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an entity exists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCustomFocusCrossHair(string &amp;amp;in asName, string&amp;amp; asCrossHair);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the crosshair that is used when focusing an entity.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCrossHair ''- desired crosshair, can be: &lt;br /&gt;
::*Default (no crosshair)&lt;br /&gt;
::*Grab&lt;br /&gt;
::*Push&lt;br /&gt;
::*Ignite&lt;br /&gt;
::*Pick&lt;br /&gt;
::*LevelDoor&lt;br /&gt;
::*Ladder&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void CreateEntityAtArea(string &amp;amp;in asEntityName, string &amp;amp;in asEntityFile, string &amp;amp;in asAreaName, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an entity at an area. When creating an enemy though, it cannot chase properly along PathNodes (using for example &amp;lt;code&amp;gt;ShowEnemyPlayerPosition&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- internal name&lt;br /&gt;
#''asEntityFile ''- entity to be used extension .ent&lt;br /&gt;
#''asAreaName ''- the area to create the entity at&lt;br /&gt;
#''abFullGameSave ''- determines whether an entity &amp;quot;remembers&amp;quot; its state&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ReplaceEntity(string &amp;amp;in asName, string &amp;amp;in asBodyName, string &amp;amp;in asNewEntityName, string &amp;amp;in asNewEntityFile, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Removes an entity and places a new one in its place.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to replace.&lt;br /&gt;
#''asBodyName'' - Name of the body of the entity to place the new entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''asNewEntityName'' - Name of the new entity.&lt;br /&gt;
#''asNewEntityFile'' - Name of the new entity file. Extension .ent. &lt;br /&gt;
#''abFullGameSave'' - Whether ALL properties of this entity should be saved throughout levels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaceEntityAtEntity(string &amp;amp;in asName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBodyName, bool abUseRotation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Places an entity at the position of another entity. Does not work for enemies, use TeleportEnemyToEntity instead.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to place.&lt;br /&gt;
#''asTargetEntity'' - Name of the other entity to place the first entity at.&lt;br /&gt;
#''asTargetBodyName'' - Name of the body of the entity to place the first entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''abUseRotation'' - Whether the entity should be rotated like the target entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPos(string &amp;amp;in asName, float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Moves an entity to a position in the level.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to move.&lt;br /&gt;
#''afX'' - X co-ordinate position.&lt;br /&gt;
#''afY'' - Y co-ordinate position.&lt;br /&gt;
#''afZ'' - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetEntityPosX(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosY(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosZ(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns an entity's position in the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerLookAtCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveWhenLookedAt);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player looks at a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = looking, -1 = not looking&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveWhenLookedAt ''- determines whether the callback should be removed when the player looked at the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerInteractCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveOnInteraction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player interacts with a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveOnInteraction ''- determines whether the callback should be removed when the player interacts with the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCallbackFunc(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when certain events occur with an entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, string &amp;amp;in asType)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;asType&amp;lt;/code&amp;gt; values depend on entity type:&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! asType Value&lt;br /&gt;
|-&lt;br /&gt;
| Object || Break&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || OnIgnite&lt;br /&gt;
|-&lt;br /&gt;
| Item || OnPickup&lt;br /&gt;
|-&lt;br /&gt;
| Enemy || OnDeath&lt;br /&gt;
|-&lt;br /&gt;
| Enemy_Grunt&amp;lt;br&amp;gt;Enemy_Manpig || OnAutoDisabled&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityConnectionStateChangeCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A callback called when ever the connection state changes (button being switched on, lever switched, etc). &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void Func(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: -1 = off, 0 = between, 1 = on&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityInteractionDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disallows interaction with an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void BreakJoint (string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Breaks a joint. Do not use this on joints in SwingDoors, Levers, Wheels, etc. where the joint is part of an interaction. That will make the game crash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void AddEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName, string &amp;amp;in asFunction, bool abDeleteOnCollide, int alStates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when two entities collide. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asParent, string &amp;amp;in asChild, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = enter, -1 = leave&lt;br /&gt;
&lt;br /&gt;
#''asParentName ''- internal name of main object&lt;br /&gt;
#''asChildName ''- internal name of object that collides with main object (asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) NOT supported!)&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abDeleteOnCollide ''- determines whether the callback after it was called&lt;br /&gt;
#''alStates ''- 1 = only enter, -1 = only leave, 0 = both&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an EntityCollideCallback. Asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) not supported in ''asChildName''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntitiesCollide(string &amp;amp;in asEntityA, string &amp;amp;in asEntityB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether two entities collide. This function does NOT support asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) or &amp;quot;Player&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetBodyMass(string &amp;amp;in asName, float afMass);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName.&lt;br /&gt;
#''afMass''  - The mass to set.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetBodyMass(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName. &lt;br /&gt;
#''afMass''  - The mass to get.&lt;br /&gt;
&lt;br /&gt;
====Props====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropEffectActive(string &amp;amp;in asName, bool abActive, bool abFadeAndPlaySounds);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Turns the texture illumination, billboards, particles, light flicker, and sounds of a prop on or off.&lt;br /&gt;
&lt;br /&gt;
Can be used on coal to give it the black color it should have.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name &lt;br /&gt;
#''abActive'' - active state&lt;br /&gt;
#''abFadeAndPlaySounds'' - if all effects should fade in/out or not&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropActiveAndFade(string &amp;amp;in asName, bool abActive, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates a prop.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''abActive ''- nothing to add&lt;br /&gt;
#''afFadeTime ''- time in seconds until prop fully fades&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropStaticPhysics(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates the physics of a prop, setting the mass to 0. Setting as true will make entities static in midair.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetPropIsInteractedWith(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a prop is interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RotatePropToSpeed(string &amp;amp;in asName, float afAcc, float afGoalSpeed, float afAxisX, float afAxisY, float afAxisZ, bool abResetSpeed, string &amp;amp;in asOffsetArea);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the prop up to a set speed.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afGoalSpeed ''- desired speed &lt;br /&gt;
#''afAxisX ''- rotation around X axis&lt;br /&gt;
#''afAxisY ''- rotation around Y axis&lt;br /&gt;
#''afAxisZ ''- rotation around Z axis&lt;br /&gt;
#''abResetSpeed ''- determines whether the speed is resetted after goal speed is reached&lt;br /&gt;
#''asOffsetArea ''- the area to rotate around, if empty, then the center of the body is used Note: The entity you want to rotate MUST be a &amp;quot;StaticObject&amp;quot; entity!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void StopPropMovement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all movement of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddAttachedPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop.&lt;br /&gt;
&lt;br /&gt;
#''asPropName''- the prop to attach another prop at &lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop&lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach&lt;br /&gt;
&lt;br /&gt;
Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
{{bug|''afRotZ '' is used for both the ZX rotation and the Z position of the attached prop. Unwanted rotation can be avoided by using: &amp;lt;br /&amp;gt;''AddAttachedPropToProp(asPropName, asAttachName, asAttachFile, afPosX, afPosY, '''0''', afPosZ, '''90.0f''', afPosZ)''}}&lt;br /&gt;
&lt;br /&gt;
{{bug|Attaching a breakable prop to a physically active prop, and then breaking the attached prop, will cause the game to crash, should the parent object be moved or reset.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop. Fixed version of &amp;lt;code&amp;gt;AddAttachedPropToProp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
#''asPropName ''- the prop to attach another prop at&lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop &lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach&lt;br /&gt;
&lt;br /&gt;
Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveAttachedPropFromProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches a prop from a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
void AddPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
float GetPropHealth(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ResetProp(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets a prop's state to the original one when the map was loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void PlayPropAnimation(string &amp;amp;in asProp, string &amp;amp;in asAnimation, float afFadeTime, bool abLoop, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the prop play an animation and calls a function when it stops. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asProp)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asProp ''- internal name of the prop&lt;br /&gt;
#''asAnimation ''- animation to play&lt;br /&gt;
#''afFadeTime ''- Fade time between current and new animations&lt;br /&gt;
#''abLoop ''- determines whether the animation loops &lt;br /&gt;
#''asCallback ''- function to call when the animation ends&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddPropForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddPropImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These functions push objects. Note that rather high values are needed when applying ''forces''  (on the order of ~100 (weak) to ~10000 (strong)), but not impulses (values less than 10 can be appropriate). Forces are external influences, and will have different effect depending on the mass of the object they are being applied to; impulses disregard mass, and can cause objects to break, as if hit. A &amp;quot;Body&amp;quot; is a physics-related helper object, to which a force or an impulse can be applied. Entities can consist of several bodies, interconnected in various ways (you can create/examine bodies in the model editor).&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the object to push; for bodies, use this format: &amp;quot;''entityName''_''bodyName''&amp;quot;&lt;br /&gt;
#''afX ''- magnitude along the X-axis&lt;br /&gt;
#''afY ''- magnitude along the Y-axis&lt;br /&gt;
#''afZ ''- magnitude along the Z-axis&lt;br /&gt;
#''asCoordSystem ''- determines which coordinate system is used, &amp;quot;local&amp;quot; or &amp;quot;world&amp;quot;&lt;br /&gt;
&lt;br /&gt;
All of these functions are ''additive''  - when called consecutively, for each call, the vectors defined by (afX, afY, afZ) will be added together, and a resultant force/impulse will be calculated ''before''  any physics simulation is applied to the target object.&lt;br /&gt;
&lt;br /&gt;
====Connections====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithRope(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asRopeName, bool abInteractOnly, float afSpeedMul, float afToMinSpeed, float afToMaxSpeed, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects a prop with the movement of a rope (i.e. turn a wheel to move a rope). For Levers, the rope only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName''- The name of the connection&lt;br /&gt;
#''asPropName'' - The name of the prop; can be a Lever or Wheel&lt;br /&gt;
#''asRopeName'' - The name of the rope&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''afSpeedMul'' - Speed multiplier of how quickly the rope moves&lt;br /&gt;
#''afToMinSpeed'' - The slowest the rope can move&lt;br /&gt;
#''afToMaxSpeed'' - The fastest the rope can move&lt;br /&gt;
#''abInvert'' - Whether to invert the direction the rope moves&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithMoveObject(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asMoveObjectName, bool abInteractOnly, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This one should only be used if there must be an exact correspondence to prop &amp;quot;amount&amp;quot; and the MoveObject open amount. It is best used for Wheel-door connections, where the MoveObject moves continuously along with the Wheel. For Levers, the MoveObject only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asPropName'' - The entity that controls the movement; can be a Lever or Wheel&lt;br /&gt;
#''asMoveObject'' - The MoveObject to move&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''abInvert'' - If the state is inverted, making the MoveObject move in the opposite direction&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ConnectEntities(string &amp;amp;in asName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, bool abInvertStateSent, int alStatesUsed, string &amp;amp;in asCallbackFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects two entities together so that changing the state of the main entity changes the state of the connected entity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! Max State (1) !! Min State (-1)&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || Lit || Unlit&lt;br /&gt;
|-&lt;br /&gt;
| MoveObject || Open || Close&lt;br /&gt;
|-&lt;br /&gt;
| SwingDoor&lt;br /&gt;
|rowspan=2| Locked&lt;br /&gt;
|rowspan=2| Unlocked&lt;br /&gt;
|-&lt;br /&gt;
| Chest&lt;br /&gt;
|-&lt;br /&gt;
| Button || Switched on || Switched off&lt;br /&gt;
|-&lt;br /&gt;
| Lever&lt;br /&gt;
|rowspan=2| Unstuck&lt;br /&gt;
|rowspan=2| Stuck (at min)&lt;br /&gt;
|-&lt;br /&gt;
| Wheel&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asMainEntity'' - The entity that causes the change; can be a Lever, Wheel, Button, or Photocell&lt;br /&gt;
#''asConnectEntity'' - The entity that is affected by the change&lt;br /&gt;
#''abInvertStateSent'' - If the state is inverted, making the connected entity change to the opposite state&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
#''asCallbackFunc'' - The name of the connection callback&lt;br /&gt;
&lt;br /&gt;
Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asConnectionName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, int alState)&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;alState is what is sent to connection entity and will be inverted if abInvertStateSent = true!&lt;br /&gt;
&lt;br /&gt;
====Lamps====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLampLit(string &amp;amp;in asName, bool abLit, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Turns a lamp on or off.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the lamp&lt;br /&gt;
#''abLit ''- Set true if you want the lamp to be lit, set to false if you want the lamp to be unlit&lt;br /&gt;
#''abEffects ''- If you want to have the lamp fade in/out when it gets lit/unlit&lt;br /&gt;
&lt;br /&gt;
====Doors====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorLocked(string &amp;amp;in asName, bool abLocked, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abLocked'' - Locked/unlocked&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is locked/unlocked&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorClosed(string &amp;amp;in asName, bool abClosed, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abClosed'' - Closed/open&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is closed/opened&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
bool GetSwingDoorLocked(string &amp;amp;in asName);&lt;br /&gt;
bool GetSwingDoorClosed(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a swing door is locked/closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorDisableAutoClose(string &amp;amp;in asName, bool abDisableAutoClose);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deactivates the &amp;quot;auto-close&amp;quot; when a door is nearly closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetSwingDoorState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns an integer depending on how far the door is opened. &amp;lt;br /&amp;gt;-1 = angle is close to 0°, 1 = angle is 70% or higher of max, 0 = inbetween -1 and 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLocked(string &amp;amp;in asName, bool abLocked);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a level door. Note that level doors are NOT swing doors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedSound(string &amp;amp;in asName, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which sound is played when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedText(string &amp;amp;in asName, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectState(string &amp;amp;in asName, float afState);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween (and above, for example, the bridge_metal_vert) are valid too!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectStateExt(string &amp;amp;in asName, float afState, float afAcc, float afMaxSpeed, float afSlowdownDist, bool abResetSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state, extended method.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween are valid too!&lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afMaxSpeed ''- maximum speed&lt;br /&gt;
#''afSlowdownDist ''- Distance to the target state before deceleration occurs.&lt;br /&gt;
#''abResetSpeed ''- Set to ''true'' if the prop's speed should be reset before performing the movement, else the prop will accelerate from its current speed to afMaxSpeed.&lt;br /&gt;
&lt;br /&gt;
====Levers, wheels and buttons====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropObjectStuckState(string &amp;amp;in asName, int alState);&lt;br /&gt;
void SetWheelStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
void SetLeverStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes an object/wheel/lever stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name&lt;br /&gt;
#''alState'' - 0 = not stuck, 1 = at max, -1 = at min &lt;br /&gt;
#''abEffects'' - play sound effects&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelAngle(string &amp;amp;in asName, float afAngle, bool abAutoMove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves a wheel to a certain angle.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name&lt;br /&gt;
#''afAngle'' - angle&lt;br /&gt;
#''abAutoMove'' - true = wheel physically moves to the new angle; false = angle is changed without moving the wheel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
void SetLeverInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to make a wheel/lever unstuck when interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetLeverState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the state of the lever. &amp;lt;br /&amp;gt;0 = not stuck, 1 = at max, -1 = at min&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderStuckState(string &amp;amp;in asName, int alStuckState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes a MultiSlider stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when state changes. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetButtonSwitchedOn(string &amp;amp;in asName, bool abSwitchedOn, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Sticky areas====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetAllowStickyAreaAttachment(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows entities to stick to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asProp);&lt;br /&gt;
void AttachBodyToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asBody);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop/body to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void DetachFromStickyArea(string &amp;amp;in asAreaName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches everything from a StickyArea.&lt;br /&gt;
&lt;br /&gt;
====NPCs====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCAwake(string &amp;amp;in asName, bool abAwake, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wakes/sleeps a NPC.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the NPC&lt;br /&gt;
#''abAwake'' - ''true'' to awaken, ''false'' to sleep&lt;br /&gt;
#''abEffects'' - Play the &amp;quot;Awake&amp;quot; or &amp;quot;Sleep&amp;quot; animations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCFollowPlayer(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a NPC's head to follow the player's movements.&lt;br /&gt;
&lt;br /&gt;
====Enemies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables an enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyIsHallucination(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes an enemy a hallucination. Hallucinations fade to smoke when they get near the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void FadeEnemyToSmoke(string &amp;amp;in asName, bool abPlaySound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly fades an enemy to smoke.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ShowEnemyPlayerPosition(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the enemy run to the player, no matter where he is.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AlertEnemyOfPlayerPresence(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gives the specified enemy the player's current position and makes it search the area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisableTriggers(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables or disables enemy triggers. If disabled, enemy will not react to player or attack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddEnemyPatrolNode(string &amp;amp;in asName, string &amp;amp;in asNodeName, float afWaitTime, string &amp;amp;in asAnimation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a patrol node to the enemy's path.&lt;br /&gt;
&lt;br /&gt;
#''asName''- Internal name of the enemy &lt;br /&gt;
#''asNodeName'' - Path node &lt;br /&gt;
#''afWaitTime'' - Time in seconds that the enemy waits at the path node before continuing. If 0, randomized between 1-3.&lt;br /&gt;
#''asAnimation'' - The animation the enemy uses when reaching the path node&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ClearEnemyPatrolNodes(string &amp;amp;in asEnemyName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the current path of patrol nodes of the enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemySanityDecreaseActive(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether an enemy activates the player's sanity drain when stared at.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy &lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToNode(string &amp;amp;in asEnemyName, string &amp;amp;in asNodeName, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific PathNode.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asNodeName'' - Internal name of the node to teleport to &lt;br /&gt;
#''abChangeY'' - Whether the Y position of the node will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToEntity(string &amp;amp;in asEnemyName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBody, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific entity.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asTargetEntity'' - Internal name of the entity to teleport to&lt;br /&gt;
#''asTargetBody'' - Internal name of the entity's body name to teleport to. If empty, the first body will be used (might be unstable, recommended to input a body anyway)&lt;br /&gt;
#''abChangeY'' - Whether the Y position of the entity will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeManPigPose(string &amp;amp;in asName, string &amp;amp;in asPoseType);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the pose a specified ManPig.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''asPoseType'' - Name of the ManPig pose to use. Can be &amp;quot;Biped&amp;quot; or &amp;quot;Quadruped&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigFadeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should fade the player's view in and out.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigSoundDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should play the proximity sounds.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigEasyEscapeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should be easier to escape from when hunted. If not disabled, easy escape is activated if the player is more than 12.35 meters away, the enemy can't see the player, and the player has less than 75 health. When this occurs, the enemy is forced to stop hunting and wait for half a second.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ForceTeslaPigSighting(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Forces a Tesla ManPig to be visible for a short time.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; GetEnemyStateName(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the name of the state a specified enemy is current in.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
Possible states for all enemies:&lt;br /&gt;
*Idle&lt;br /&gt;
*Wait&lt;br /&gt;
*Patrol&lt;br /&gt;
*Investigate&lt;br /&gt;
*Alert&lt;br /&gt;
*Search&lt;br /&gt;
*Hurt&lt;br /&gt;
*Hunt&lt;br /&gt;
*HuntPause&lt;br /&gt;
*HuntWander&lt;br /&gt;
*AttackMeleeShort&lt;br /&gt;
*AttackMeleeLong&lt;br /&gt;
*BreakDoor&lt;br /&gt;
*Dead&lt;br /&gt;
&lt;br /&gt;
Waterlurker-only states:&lt;br /&gt;
*GoHome&lt;br /&gt;
*Eat&lt;br /&gt;
&lt;br /&gt;
ManPig-only states: &lt;br /&gt;
*Flee&lt;br /&gt;
*Stalk&lt;br /&gt;
*Track&lt;br /&gt;
&lt;br /&gt;
Unused states:&lt;br /&gt;
*AttackRange&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=7027</id>
		<title>HPL2/Engine Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=7027"/>
		<updated>2025-10-16T18:47:30Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Levers, wheels and buttons */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TocRight}}&lt;br /&gt;
&lt;br /&gt;
This page documents all scripts available in Amnesia: The Dark Descent.&lt;br /&gt;
&lt;br /&gt;
{{note|'''Note''': Some of the functions require the Amnesia 1.3 or 1.5 update. Steam and other online store copies should be automatically updated. Other copies can get 1.3 [http://www.frictionalgames.com/forum/thread-24334.html here].}}&lt;br /&gt;
&lt;br /&gt;
== Directives ==&lt;br /&gt;
&lt;br /&gt;
First off, &amp;lt;code&amp;gt;#include &amp;quot;file.hps&amp;quot;&amp;lt;/code&amp;gt; can be used to programmatically merge together multiple separate files to make organizing scripts easier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
==Engine scripts==&lt;br /&gt;
===Main===&lt;br /&gt;
&lt;br /&gt;
The following functions are the main hps functions that the HPL2 engine looks to run on certain events - similar to the C++ int main() function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void OnStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the map is loaded for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnEnter();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs whenever the player enters a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnLeave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the player leaves a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnGameStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is found in the global.hps file and the inventory.hps file, and is run when the game is first started by the player (ie via &amp;quot;Start New Game&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnUpdate(float afStep);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
This function is executed for every game update or &amp;quot;tick&amp;quot;. Can be used for rapid-firing updates instead of looping timers. Keep in mind that this can affect game performance if not used with care.&lt;br /&gt;
&lt;br /&gt;
#''afStep''- Time elapsed in seconds since the last frame. Multiply speeds, distances etc. by this argument to avoid framerate dependence issues (for example: if you move something in this function with constant speed, it will move faster on computers which run the game with high FPS and slower on computers with low FPS).&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float RandFloat(float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random float.&lt;br /&gt;
&lt;br /&gt;
#''afMin ''- minimum value&lt;br /&gt;
#''afMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int RandInt(int alMin, int alMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random int. Note: the maximum value is ''inclusive''  - the RandInt() function may return this value.&lt;br /&gt;
&lt;br /&gt;
#''alMin ''- minimum value&lt;br /&gt;
#''alMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringContains(string &amp;amp;in asString, string &amp;amp;in asSubString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a string contains the specified string. &amp;lt;br /&amp;gt;Example: searching for &amp;quot;hello&amp;quot; in &amp;quot;hello world&amp;quot; would return '''true'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to check&lt;br /&gt;
#''asSubString ''- the string to search for&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; StringSub(string &amp;amp;in asString, int alStart, int alCount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the substring in a string. &amp;lt;br /&amp;gt;Example: in the string &amp;quot;frictional games rocks&amp;quot;, using 4 as ''alStart''  and 6 as ''alCount''  would return '''&amp;quot;tional&amp;quot;'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string&lt;br /&gt;
#''alStart ''- starting character of the string, with 0 being the first character&lt;br /&gt;
#''alCount ''- amount of characters&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int StringToInt(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns an integer converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float StringToFloat(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a float converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringToBool(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a boolean converted from a string, else returns false.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&lt;br /&gt;
===Mathematical Operations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathCos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathTan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAsin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAcos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan2(float afX, float afY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Calculates and returns the arc tangent of the specified values.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - First value to operate.&lt;br /&gt;
#''afY''  - Second value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSqrt(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the square root of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathPow(float afBase, float afExp);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the value of afBase raised to the power of afExp.&lt;br /&gt;
&lt;br /&gt;
#''afBase''  - The base value.&lt;br /&gt;
#''afExp''  - Value to calculate the base with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMin(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the lowest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMax(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the highest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathClamp(float afX, float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns afX clamped between afMin and afMax. If afX &amp;lt; afMin, returns afMin, and if afX &amp;gt; afMax, returns afMax.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - The value to clamp.&lt;br /&gt;
#''afMin''  - The minimum value to clamp afX with.&lt;br /&gt;
#''afMax''  - The maximum value to clamp afX with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAbs(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the absolute value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&lt;br /&gt;
===Debugging===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void Print(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a string to the log file (''hpl.log'').&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDebugMessage(string &amp;amp;in asString, bool abCheckForDuplicates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a line of text to the debug console at the bottom left of the screen. Debug mode must be enabled for the console messages to be visible.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to print&lt;br /&gt;
#''abCheckForDuplicates ''- if true, the string won't be printed more than once on screen until it disappears&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ProgLog(string &amp;amp;in asLevel, string &amp;amp;in asMessage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints an entry to the ProgLog (progression log). &amp;lt;br /&amp;gt;ProgLog is a file created in Documents/Amnesia/main (or an FC folder if one is being used). It logs certain events, such us opening the menu or picking up the lantern, as well as the player's state (Health, Sanity, Oil, Tinderboxes, Coins), for the purpose of documenting a tester's playstyle. &amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt;This function allows to log custom messages.The messages in the ProgLog file are sorted by time elapsed since a map was loaded.&lt;br /&gt;
&lt;br /&gt;
ProgLog has to be enabled for a player profile in ''user_settings.cfg''  before it starts working.&lt;br /&gt;
&lt;br /&gt;
#''asLevel ''- can be &amp;quot;Low&amp;quot;, &amp;quot;Medium&amp;quot; or &amp;quot;High&amp;quot;. It's a tag which appears in each log entry, for event prioritising.&lt;br /&gt;
#''asMessage ''- The custom message to be printed to the log.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool ScriptDebugOn();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the debug mode is enabled. &amp;lt;br /&amp;gt;See [[HPL2/Development_Environment|&amp;quot;Setting up Development Environment&amp;quot;]] to setup debug mode on your own computer.&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
{{warning|Regular variables (int, float, etc.) are '''not''' saved by the game. Using them in important parts of yor script will break it upon loading a game save. In HPL, those variables should only be used for disposable counters, like spawning objects in a &amp;quot;for&amp;quot; loop. For variables which need to be saved, use the wrappers as described below.}}&lt;br /&gt;
&lt;br /&gt;
====Local====&lt;br /&gt;
&lt;br /&gt;
Local variables can be used throughout the same script file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetLocalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetLocalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddLocalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetLocalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Global====&lt;br /&gt;
&lt;br /&gt;
Global variables can be used throughout several maps and can be accessed by several script files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetGlobalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetGlobalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddGlobalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetGlobalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Particle Systems===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadParticleSystem(string &amp;amp;in asPSFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asPSFile''  - The particle system file to load. Extension: .ps&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntity(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntityExt(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS,&lt;br /&gt;
float afR, float afG, float afB, float afA, bool abFadeAtDistance, float afFadeMinEnd, float afFadeMinStart,&lt;br /&gt;
float afFadeMaxStart, float afFadeMaxEnd);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity, extended method with more options.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''abFadeAtDistance ''- determines whether a particle system fades from a certain distance on&lt;br /&gt;
#''afFadeMinEnd ''- minimum distance at which the particle system stops fading&lt;br /&gt;
#''afFadeMinStart ''- minimum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxStart ''- maximum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxEnd ''- maximum distance at which the particle system stops fading&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DestroyParticleSystem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Destroys a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - The internal name of the particle system&lt;br /&gt;
&lt;br /&gt;
===Sounds &amp;amp; Music===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadSound(string &amp;amp;in asSoundFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile''  - The sound file to load (extension .snt optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayGuiSound(string &amp;amp;in asSoundFile, float afVolume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays a sound, not using 3D.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile ''- the sound to play (extension .snt/.ogg optional)&lt;br /&gt;
#''afVolume ''- the volume of the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaySoundAtEntity(string &amp;amp;in asSoundName, string &amp;amp;in asSoundFile, string &amp;amp;in asEntity, float afFadeTime, bool abSaveSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a sound at an entity.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''asSoundFile ''- the sound to use (extension .snt optional)&lt;br /&gt;
#''asEntity ''- the entity to create the sound at. Using &amp;quot;Player&amp;quot; is effectively the same as &amp;lt;code&amp;gt;PlayGuiSound&amp;lt;/code&amp;gt;, yet this function allows a looping sound to be saved&lt;br /&gt;
#''afFadeTime ''- time in seconds the sound needs to fade. Avoids enemies hearing the sound if afFadeTime is at least 0.1f&lt;br /&gt;
#''abSaveSound ''- if ''true'', a looping sound will &amp;quot;remember&amp;quot; its playback state (currently playing/stopped), and that state will be restored the next time the level is entered. If ''true'', the sound is never attached to the entity! Note that saving should only be used on ''looping sounds''!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeInSound(string &amp;amp;in asSoundName, float afFadeTime, bool abPlayStart);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades in a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds&lt;br /&gt;
#''abPlayStart ''- Play the sound defined in the &amp;lt;code&amp;gt;&amp;lt;Start&amp;gt;&amp;lt;/code&amp;gt; section of the .snt before playing the main sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopSound(string &amp;amp;in asSoundName, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades out a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds, use 0 to immediately stop the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayMusic(string &amp;amp;in asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays music.&lt;br /&gt;
&lt;br /&gt;
#''asMusicFile ''- the music file to play (extension .ogg optional)&lt;br /&gt;
#''abLoop ''- determines whether a music track should loop&lt;br /&gt;
#''afVolume ''- volume of the music&lt;br /&gt;
#''afFadeTime ''- time in seconds until music reaches full volume&lt;br /&gt;
#''alPrio ''- priority of the music. Note that only the music with the highest priority can be heard! 0 - lowest, 1 - higher, etc.&lt;br /&gt;
#''abResume''  - if ''true'', playback will be continued from where the track stopped after the call to &amp;lt;code&amp;gt;StopMusic()&amp;lt;/code&amp;gt;. If ''false'', the track will be restarted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopMusic(float afFadeTime, int alPrio);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops music.&lt;br /&gt;
&lt;br /&gt;
#''afFadeTime ''- time in seconds until music stops&lt;br /&gt;
#''alPrio ''- the priority of the music that should stop&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice(string &amp;amp;in asVoiceFile, string &amp;amp;in asEffectFile, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry,&lt;br /&gt;
bool abUsePosition, string &amp;amp;in asPosEntity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This adds a voice and an additional sound effect to be played. It is okay to call this many times in order to play many voices in a row. The EffectVoiceOverCallback is not called until ALL voices have finished.&lt;br /&gt;
&lt;br /&gt;
#''asVoiceFile ''- the voice to play&lt;br /&gt;
#''asEffectFile ''- the sound effect to play&lt;br /&gt;
#''asTextCat ''- the category in the .lang file, usually &amp;quot;Voice&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''abUsePosition ''- plays using 3D from the entity, or without 3D&lt;br /&gt;
#''asPosEntity ''- the entity at which the voice and sound are played from&lt;br /&gt;
#''afMinDistance ''- minimum distance the voice and sound are heard&lt;br /&gt;
#''afMaxDistance ''- maximum distance the voice and sound are heard&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopAllEffectVoices(float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all voices and calls the EffectVoiceOverCallback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEffectVoiceActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether EffectVoices are still active.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetEffectVoiceOverCallback(string &amp;amp;in asFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to be called when the EffectVoices are finished. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundVolume(float afDestVolume, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound volume, that means everything you can hear '''from the world'''. This does not affect music of GUI sounds.&lt;br /&gt;
&lt;br /&gt;
#''afDestVolume ''- desired volume&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired volume&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundSpeed(float afDestSpeed, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound speed.&lt;br /&gt;
&lt;br /&gt;
#''afDestSpeed ''- desired speed&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired speed&lt;br /&gt;
&lt;br /&gt;
===Lights===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightVisible(string &amp;amp;in asLightName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables lights.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''abVisible ''- determines the state of the light&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeLightTo(string &amp;amp;in asLightName, float afR, float afG, float afB, float afA, float afRadius, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the properties of a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''afRadius ''- radius of the light. -1 means keeping the radius&lt;br /&gt;
#''afTime ''- time in seconds until change is done&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightFlickerActive(string &amp;amp;in asLightName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates flickering on a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName'' - The internal light name&lt;br /&gt;
#''abActive'' - true = active, false = inactive&lt;br /&gt;
&lt;br /&gt;
==Game scripts==&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartCredits(string &amp;amp;in asMusic, bool abLoopMusic, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alEndNum);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts the end credits screen.&lt;br /&gt;
&lt;br /&gt;
#''asMusic ''- the music to play (including .ogg)&lt;br /&gt;
#''abLoopMusic ''- determines whether the music should loop&lt;br /&gt;
#''asTextCat ''- the category to be used in the .lang file, usually &amp;quot;Ending&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alEndNum ''- Amnesia has 3 different endings and displays a code at the bottom. Determines which code is displayed. 0-2 will display codes, any other integer will not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartDemoEnd();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shows the demo end screen. The background and UI elements are defined in demo.cfg, with the text using the entries in the &amp;quot;Demo&amp;quot; category of the .lang file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AutoSave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an auto save file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CheckPoint(string &amp;amp;in asName, string &amp;amp;in asStartPos, string &amp;amp;in asCallback, string &amp;amp;in asDeathHintCat, string &amp;amp;in asDeathHintEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a checkpoint at which the player will respawn in case he dies. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asName, int alCount)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;Count is 0 on the first checkpoint load!&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the editor&lt;br /&gt;
#''asCallback ''- the function to call when the player dies/respawns&lt;br /&gt;
#''asDeathHintCat ''- the category of the death hint message to be used in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asDeathHintEntry ''- the entry in the .lang file&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeMap(string &amp;amp;in asMapName, string &amp;amp;in asStartPos, string &amp;amp;in asStartSound, string &amp;amp;in asEndSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Loads another map after a 1.5 second fade out.&lt;br /&gt;
&lt;br /&gt;
#''asMapName ''- the file to load&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the next map&lt;br /&gt;
#''asStartSound ''- the sound that is played when the change starts&lt;br /&gt;
#''asEndSound ''- the sound that is played when the new map is loaded&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ClearSavedMaps();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the &amp;quot;history&amp;quot; of the save, useful to do when you know the player will not be able to go back anymore. Makes the next save much smaller in size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateDataCache();&lt;br /&gt;
void DestroyDataCache();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This caches all current textures and models and they are not released until destroy is called. If there is already cached data it is destroyed.&lt;br /&gt;
Create caches to enable faster loading when going back to a map. Destroy the cache if you know the player won't go back to that map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMapDisplayNameEntry(string &amp;amp;in asNameEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the map name shown in save file names. If none is set NULL is assumed.&lt;br /&gt;
&lt;br /&gt;
#''asNameEntry ''- the entry to display, category must be &amp;quot;Levels&amp;quot;!&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the skybox.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxTexture(string &amp;amp;in asTexture);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the texture of the skybox.&lt;br /&gt;
&lt;br /&gt;
#''asTexture''  - The texture file to set. Extension: .dds&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the solid color of the skybox rather than a texture.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the global fog.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the color to use for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogProperties(float afStart, float afEnd, float afFalloffExp, bool abCulling);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the properties for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afStart ''- how many meters from the camera should the fog begin&lt;br /&gt;
#''afEnd ''- how many meters from the camera should the fog reach full thickness&lt;br /&gt;
#''afFalloffExp ''- the amount by which the thinkness increases&lt;br /&gt;
#''abCulling ''- whether occlusion culling is active for the fog; this prevents objects behind the fog from being loaded&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetupLoadScreen(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alRandomNum, string &amp;amp;in asImageFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which loading screen will be shown when changing maps.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category of the loading text in the .lang file to be shown on the loading screen, usually &amp;quot;LoadingText&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alRandomNum ''- if greater 1, then it will randomize between 1 and alRandom for each LoadScreen giving entry the suffix XX (eg 01). If &amp;lt; =1 then no suffix is added&lt;br /&gt;
#''asImageFile ''- the image to be shown (optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void UnlockAchievement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlocks the specified achievement. Only able to be used for the ending achievements.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the achievement. Only the following strings are valid:&lt;br /&gt;
::* Benefactor&lt;br /&gt;
::* Survivor&lt;br /&gt;
::* Sacrifice&lt;br /&gt;
::* Quitter&lt;br /&gt;
::* Egotist&lt;br /&gt;
::* Altruist&lt;br /&gt;
::* Vacillator&lt;br /&gt;
&lt;br /&gt;
===Game Timer===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddTimer(string &amp;amp;in asName, float afTime, string &amp;amp;in asFunction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a timer which calls a function when it expires. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asTimer)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the name of the timer&lt;br /&gt;
#''afTime ''- time in seconds&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveTimer(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a timer, no matter how much time is left.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the timer.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetTimerTimeLeft(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the time left on a timer.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - the internal name of the timer.&lt;br /&gt;
&lt;br /&gt;
===Screen Effects===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeOut(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to black.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen is completly black&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeIn(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen back to normal.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeImageTrailTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies the image trail effect to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeSepiaColorTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the screen go dark red.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0) &lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeRadialBlurTo(float afSize, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies radial blur effects to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afSize ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetRadialBlurStartDist(float afStartDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines at which distance the radial blur effects appear.&lt;br /&gt;
&lt;br /&gt;
#''afStartDist ''- the distance at which the effect starts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectFlash(float afFadeIn, float afWhite, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white.&lt;br /&gt;
&lt;br /&gt;
#''afFadeIn ''- time in seconds until screen is white&lt;br /&gt;
#''afWhite ''- determines to which percentage the screen fades to white (1.0 = completly white)&lt;br /&gt;
#''afFadeOut ''- time in seconds until screen is back to normal again&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectEmotionFlash(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white and shows a text message.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''asSound ''- the sound to play while fading&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetFlashbackIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a flashback is still in effect.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerSpawnPS(string &amp;amp;in asSPSFile);&lt;br /&gt;
void StopPlayerSpawnPS();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Continuously spawn regular particle systems (''.ps'') around the player. Particles created by this script carry over from map to map.&lt;br /&gt;
&lt;br /&gt;
#''asSPSFile''  - the ''.sps''  file to use. Example ''.sps''  files are located in the ''/misc''  folder in the main game directory.&amp;lt;br&amp;gt;Custom ''.sps''  files can be created by hand in a text editor (see existing ones and mimic how those are written). &amp;lt;br /&amp;gt;Since ''StopPlayerSpawnPS()''  doesn't seem to work, to stop an SPS you must create an ''.sps''  file with an empty particle field field and override the old SPS by calling ''StartPlayerSpawnPS''  again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shakes the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity of the shake&lt;br /&gt;
#''afTime ''- duration of the shake&lt;br /&gt;
#''afFadeInTime ''- time in seconds until full intensity is reached&lt;br /&gt;
#''afFadeOutTime ''- time until screen is back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInDarknessEffectsActive(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the sanity drain and night vision effects while in the darkness.&lt;br /&gt;
&lt;br /&gt;
''bool abX''  - Enable/disable effects.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowScreenImage(string &amp;amp;in asImageName, float afX, float afY, float afScale, bool abUseRelativeCoordinates, float afDuration, float afFadeIn, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
Displays an image file directly onto the screen. See [[HPL2/Tutorials/ShowScreenImage()|ShowScreenImage()]] in the tutorials section for more information.&lt;br /&gt;
&lt;br /&gt;
# ''asImageName'' - The image file to render (.jpg, .png, .tga, .dds)&lt;br /&gt;
# ''afX'' - The X position of the image&lt;br /&gt;
# ''afY'' - The Y position of the image&lt;br /&gt;
# ''afScale'' - The size of the image in pixels (not scale), or original image size if negative&lt;br /&gt;
# ''abUseRelativeCoordinates'' - Whether X and Y are relative to the screen resoltion, or pixel co-ordinates if not&lt;br /&gt;
# ''afDuration'' - The duration that the image is displayed for&lt;br /&gt;
# ''afFadeIn'' - The time, in seconds, to fade in the image&lt;br /&gt;
# ''afFadeOut'' - The time, in seconds, to fade out the image&lt;br /&gt;
&lt;br /&gt;
===Insanity===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInsanitySetEnabled(string &amp;amp;in asSet, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which InsanitySets are enabled.&lt;br /&gt;
&lt;br /&gt;
#''asSet ''- the set&lt;br /&gt;
#''abX ''- enabled or not&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartInsanityEvent(string &amp;amp;in asEventName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Starts a specified insanity event.&lt;br /&gt;
&lt;br /&gt;
#''asEventName ''- Insanity event to play.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartRandomInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts a random insanity event from the available sets.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopCurrentInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Stops the currently playing insanity event.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void InsanityEventIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an insanity event is currently in effect.&amp;lt;br&amp;gt;Not useful at all due to having a return type of &amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; when it should be &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Player===&lt;br /&gt;
&lt;br /&gt;
Note that the player's maximum health and sanity is 100.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enabled/Disable player controlled movement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangePlayerStateToNormal();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets the player's state, forcing them to stop interacting with objects. It also clears the inventory item to be used (as if it was double-clicked on in the inventory again) and dismounts the player from ladders.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerCrouching(bool abCrouch);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddPlayerBodyForce(float afX, float afY, float afZ, bool abUseLocalCoords);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pushes the player into a certain direction. Note that you need values above ~2000 to see any effects.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - amount along the X-axis&lt;br /&gt;
#''afY'' - amount along the Y-axis&lt;br /&gt;
#''afZ'' - amount along the Z-axis&lt;br /&gt;
#''abUseLocalCoords'' - If true, axes are based on where the player is facing, not the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowPlayerCrossHairIcons(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the icons when a player has something in focus.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerSanity(float afSanity);&lt;br /&gt;
void AddPlayerSanity(float afSanity);&lt;br /&gt;
float GetPlayerSanity();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerHealth(float afHealth);&lt;br /&gt;
void AddPlayerHealth(float afHealth);&lt;br /&gt;
float GetPlayerHealth();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerLampOil(float afOil);&lt;br /&gt;
void AddPlayerLampOil(float afOil);&lt;br /&gt;
float GetPlayerLampOil();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the lamp oil of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerSpeed();&lt;br /&gt;
float GetPlayerYSpeed();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current speed of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSanityDrainDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables sanity drain from darkness.&lt;br /&gt;
{{bug|Sanity drain is reenabled on loading a save, as the game is unable to load the value properly from the save data.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoost();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a large amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! New Sanity&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || 100&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || 90&lt;br /&gt;
|-&lt;br /&gt;
| 50-74 || 80&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoostSmall();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a small amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! Sanity Bonus&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || +20&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || +15&lt;br /&gt;
|-&lt;br /&gt;
| 50-75 || +10&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityDamage(float afAmount, bool abUseEffect);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount'' - amount of sanity damage done&lt;br /&gt;
#''abUseEffect'' - if a sound is played and screen effects are shown when the sanity damage is dealt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GivePlayerDamage(float afAmount, string &amp;amp;in asType, bool abSpinHead, bool abLethal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the health of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount'' - amount of damage done to health&lt;br /&gt;
#''asType'' - plays a certain effect on the screen when the damage is dealt (BloodSplat, Claws, or Slash) &lt;br /&gt;
#''abSpinHead'' - changes the camera view when damage is dealt&lt;br /&gt;
#''abLethal'' - set to true if player can die from given damage. If ''false'' and the damage would have left the player with less than 10 health, health is set to 10.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerFOVMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the field of view of the player. A shorter FOV will create a zoom effect.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - multiplier of default FOV (1 is default)&lt;br /&gt;
#''afSpeed'' - the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerAspectMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the aspect ratio of the player. Basically stretches or narrows the screen horizontally.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - multiplier of default aspect (default is 1)&lt;br /&gt;
#''afSpeed'' - the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - angle of rotation of head, positive being counter-clockwise&lt;br /&gt;
#''afSpeedMul'' - speed (possibly acceleration) multiplier of the rotation (default 1, which is really slow)&lt;br /&gt;
#''afMaxSpeed'' - maximum speed of rotation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerForward(float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Moves the player forward. It needs to be called in a timer that updates 60 times / second.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- amount along the X-axis&lt;br /&gt;
#''afY ''- amount along the Y-axis&lt;br /&gt;
#''afZ ''- amount along the Z-axis&lt;br /&gt;
#''afSpeed ''- speed at which the change happens&lt;br /&gt;
#''afSlowDownDist ''- distance at which to start slowing down (prevents the head from abruptly stopping)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerLookAt(string &amp;amp;in asEntityName, float afSpeedMul, float afMaxSpeed, string &amp;amp;in asAtTargetCallback);&lt;br /&gt;
void StopPlayerLookAt();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to look at a certain entity until StopPlayerLookAt is used.&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- the entity to look at &lt;br /&gt;
#''afSpeedMul ''- how fast should the player look at the entity&lt;br /&gt;
#''afMaxSpeed ''- maximum speed allowed&lt;br /&gt;
#''asAtTargetCallback ''- function to call when player looks at target&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerMoveSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerRunSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerLookSpeedMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the player's move/run/look speed. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpForceMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the player's jump multiplier. Higher values = higher jumps. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpDisabled(bool abX);&lt;br /&gt;
void SetPlayerCrouchDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to jump/crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportPlayer(string &amp;amp;in asStartPosName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly teleports the player to the target StartPos.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternActive(bool abX, bool abUseEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the player use his lantern.&lt;br /&gt;
&lt;br /&gt;
# ''abX'' - Set lantern to be active (true) or inactive (false)&lt;br /&gt;
# ''abUseEffects'' - Play on/off sounds&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetLanternActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player is currently using the lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to use the lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternLitCallback(string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to call when the player uses the lantern. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;MyFunc(bool abLit)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message on the screen.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory'' - the category in the .lang file&lt;br /&gt;
#''asTextEntry'' - the entry in the .lang file&lt;br /&gt;
#''afTime'' - determines how long the message is displayed. If time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetDeathHint(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the message that appears when the player dies.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory'' - the category in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asTextEntry'' - the entry in the .lang file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DisableDeathStartSound();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the death sound when the player dies. This must be called directly before player is killed! The variable as soon as player dies too.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPermaDeathSound(string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Sets the sound played after the player dies when permadeath is active. Permadeath is only active when the game is launched with the &amp;lt;code&amp;gt;ptest&amp;lt;/code&amp;gt; command line parameter. Only used for the post-death Suitor lines in ''Justine''.&lt;br /&gt;
&lt;br /&gt;
#''asSound'' - The sound to be played after death. Expects a voice-type sound.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerFallDamageDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the player's ability to take fall damage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPos(float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the player's position within the level.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - X co-ordinate position.&lt;br /&gt;
#''afY'' - Y co-ordinate position.&lt;br /&gt;
#''afZ'' - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerPosX();&lt;br /&gt;
float GetPlayerPosY();&lt;br /&gt;
float GetPlayerPosZ();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the player's position within the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
===Journal===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddNote(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a note to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _Name and _Text and be in category &amp;quot;Journal&amp;quot;!&lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDiary(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a diary to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _NameX and _TextY whereas X and Y are numbers of the parts (_Name1: first diary, _Text1: first page) and be in category &amp;quot;Journal&amp;quot;! &lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ReturnOpenJournal(bool abOpenJournal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Only called in the pickup diary callback! If true the journal displays the entry else not.&lt;br /&gt;
&lt;br /&gt;
===Quests===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a quest to the player's journal under mementos. Completed quests cannot be readded.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name to be used&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot;Quest_&amp;lt;texthere&amp;gt;_Text”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CompleteQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Completes a quest. If the quest has not been added, it's marked as complete anyway, preventing it from being added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot; Quest_&amp;lt;texthere&amp;gt;_Text ”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool QuestIsCompleted(string &amp;amp;in asName);&lt;br /&gt;
bool QuestIsAdded(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a quest is completed/added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetNumberOfQuestsInMap(int alNumberOfQuests);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the number of quests in the map. Obsolete; formerly used to calculate a completion percentage when looking at a level door.&lt;br /&gt;
&lt;br /&gt;
#''alNumberOfQuests ''- Amount of quests&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveHint(string &amp;amp;in asName, string &amp;amp;in asMessageCat, string &amp;amp;in asMessageEntry, float afTimeShown);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a hint on the player's screen.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asMessageCat ''- the category in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asMessageEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTimeShown ''- time in seconds until the message disappears. If time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void BlockHint(string &amp;amp;in asName);&lt;br /&gt;
void UnBlockHint(string &amp;amp;in asName);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Blocking a hint prevents it from being shown. Blocked hints are included in savefiles, so they should persist between levels. Unblocking a hint allows it to be shown.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; blocks the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveHint(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes the hint from the list of already shown hints, allowing it to appear again.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; reenables the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
===Inventory===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ExitInventory();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Exits the inventory by force.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the player's ability to open his inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a message on the inventory screen. Used for feedback messages when failing to combine items.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory ''- the category in the .lang file, usually &amp;quot;Inventory&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTime ''- time in seconds until the message disappears. If life time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItem(string &amp;amp;in asName, string &amp;amp;in asType, string &amp;amp;in asSubTypeName, string &amp;amp;in asImageName, float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds an item to the inventory of the player. Note that the item does not have to exist as entity in the world to be able to do this.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asType ''- item type to give, Available types are:&lt;br /&gt;
::*Puzzle&lt;br /&gt;
::*Lantern&lt;br /&gt;
::*Health&lt;br /&gt;
::*Sanity&lt;br /&gt;
::*LampOil&lt;br /&gt;
::*Tinderbox&lt;br /&gt;
#''asSubTypeName ''- item name for .lang file&lt;br /&gt;
#''asImageName ''- the image which will appear in inventory. For example: &amp;lt;code&amp;gt;void GiveItem(&amp;quot;chemical_container_full_1&amp;quot;, &amp;quot;Puzzle&amp;quot;, &amp;quot;chemical_container_full&amp;quot;, &amp;quot;chemical_container_full.tga&amp;quot;, 1);&amp;lt;/code&amp;gt; will use the image from &amp;lt;code&amp;gt;graphics/item/chemical_container_full.tga&amp;lt;/code&amp;gt; &lt;br /&gt;
#''afAmount ''- amount the item gives, - For example: Oil potions will fill the oil meter by this amount, Health potions will heal by this amount, etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item from the player's inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool HasItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player has an item in his inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItemFromFile(string &amp;amp;in asName, string &amp;amp;in asFileName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a single item to the player's inventory. This is meant to be used for debug mostly as it creates the actual item and then destroys it.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asFileName ''- item to give + extension (.ent)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddCombineCallback(string &amp;amp;in asName, string &amp;amp;in asItemA, string &amp;amp;in asItemB, string &amp;amp;in asFunction, bool abAutoRemove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to combine items in his inventory. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItemA, string &amp;amp;in asItemB)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name for the callback&lt;br /&gt;
#''asItemA ''- internal name of first item&lt;br /&gt;
#''asItemB ''- internal name of second item&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
#''abAutoRemove ''- determines whether the callback should be removed when the items are combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveCombineCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a combine callback.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the callback to be removed (as specified in AddCombineCallback)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddUseItemCallback(string &amp;amp;in asName, string &amp;amp;in asItem, string &amp;amp;in asEntity, string &amp;amp;in asFunction, bool abAutoDestroy);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to use items on the world. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItem, string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
#''asItem ''- internal name of the item&lt;br /&gt;
#''asEntity ''- entity to be able to use the item on&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abAutoDestroy ''- determines whether the callback should be removed when the item is used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveUseItemCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item callback.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
&lt;br /&gt;
===Entities===&lt;br /&gt;
&lt;br /&gt;
====General====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityActive(string &amp;amp;in asName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityVisible(string &amp;amp;in asName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity's visual mesh. The collision body remains.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the entity.&lt;br /&gt;
#''abActive''  - Activate/deactivate mesh.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntityExists(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an entity exists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCustomFocusCrossHair(string &amp;amp;in asName, string&amp;amp; asCrossHair);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the crosshair that is used when focusing an entity.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCrossHair ''- desired crosshair, can be: &lt;br /&gt;
::*Default (no crosshair)&lt;br /&gt;
::*Grab&lt;br /&gt;
::*Push&lt;br /&gt;
::*Ignite&lt;br /&gt;
::*Pick&lt;br /&gt;
::*LevelDoor&lt;br /&gt;
::*Ladder&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void CreateEntityAtArea(string &amp;amp;in asEntityName, string &amp;amp;in asEntityFile, string &amp;amp;in asAreaName, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an entity at an area. When creating an enemy though, it cannot chase properly along PathNodes (using for example &amp;lt;code&amp;gt;ShowEnemyPlayerPosition&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- internal name&lt;br /&gt;
#''asEntityFile ''- entity to be used extension .ent&lt;br /&gt;
#''asAreaName ''- the area to create the entity at&lt;br /&gt;
#''abFullGameSave ''- determines whether an entity &amp;quot;remembers&amp;quot; its state&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ReplaceEntity(string &amp;amp;in asName, string &amp;amp;in asBodyName, string &amp;amp;in asNewEntityName, string &amp;amp;in asNewEntityFile, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Removes an entity and places a new one in its place.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to replace.&lt;br /&gt;
#''asBodyName'' - Name of the body of the entity to place the new entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''asNewEntityName'' - Name of the new entity.&lt;br /&gt;
#''asNewEntityFile'' - Name of the new entity file. Extension .ent. &lt;br /&gt;
#''abFullGameSave'' - Whether ALL properties of this entity should be saved throughout levels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaceEntityAtEntity(string &amp;amp;in asName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBodyName, bool abUseRotation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Places an entity at the position of another entity. Does not work for enemies, use TeleportEnemyToEntity instead.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to place.&lt;br /&gt;
#''asTargetEntity'' - Name of the other entity to place the first entity at.&lt;br /&gt;
#''asTargetBodyName'' - Name of the body of the entity to place the first entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''abUseRotation'' - Whether the entity should be rotated like the target entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPos(string &amp;amp;in asName, float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Moves an entity to a position in the level.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to move.&lt;br /&gt;
#''afX'' - X co-ordinate position.&lt;br /&gt;
#''afY'' - Y co-ordinate position.&lt;br /&gt;
#''afZ'' - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetEntityPosX(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosY(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosZ(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns an entity's position in the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerLookAtCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveWhenLookedAt);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player looks at a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = looking, -1 = not looking&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveWhenLookedAt ''- determines whether the callback should be removed when the player looked at the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerInteractCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveOnInteraction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player interacts with a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveOnInteraction ''- determines whether the callback should be removed when the player interacts with the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCallbackFunc(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when certain events occur with an entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, string &amp;amp;in asType)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;asType&amp;lt;/code&amp;gt; values depend on entity type:&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! asType Value&lt;br /&gt;
|-&lt;br /&gt;
| Object || Break&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || OnIgnite&lt;br /&gt;
|-&lt;br /&gt;
| Item || OnPickup&lt;br /&gt;
|-&lt;br /&gt;
| Enemy || OnDeath&lt;br /&gt;
|-&lt;br /&gt;
| Enemy_Grunt&amp;lt;br&amp;gt;Enemy_Manpig || OnAutoDisabled&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityConnectionStateChangeCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A callback called when ever the connection state changes (button being switched on, lever switched, etc). &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void Func(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: -1 = off, 0 = between, 1 = on&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityInteractionDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disallows interaction with an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void BreakJoint (string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Breaks a joint. Do not use this on joints in SwingDoors, Levers, Wheels, etc. where the joint is part of an interaction. That will make the game crash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void AddEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName, string &amp;amp;in asFunction, bool abDeleteOnCollide, int alStates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when two entities collide. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asParent, string &amp;amp;in asChild, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = enter, -1 = leave&lt;br /&gt;
&lt;br /&gt;
#''asParentName ''- internal name of main object&lt;br /&gt;
#''asChildName ''- internal name of object that collides with main object (asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) NOT supported!)&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abDeleteOnCollide ''- determines whether the callback after it was called&lt;br /&gt;
#''alStates ''- 1 = only enter, -1 = only leave, 0 = both&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an EntityCollideCallback. Asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) not supported in ''asChildName''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntitiesCollide(string &amp;amp;in asEntityA, string &amp;amp;in asEntityB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether two entities collide. This function does NOT support asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) or &amp;quot;Player&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetBodyMass(string &amp;amp;in asName, float afMass);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName.&lt;br /&gt;
#''afMass''  - The mass to set.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetBodyMass(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName. &lt;br /&gt;
#''afMass''  - The mass to get.&lt;br /&gt;
&lt;br /&gt;
====Props====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropEffectActive(string &amp;amp;in asName, bool abActive, bool abFadeAndPlaySounds);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Turns the texture illumination, billboards, particles, light flicker, and sounds of a prop on or off.&lt;br /&gt;
&lt;br /&gt;
Can be used on coal to give it the black color it should have.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name &lt;br /&gt;
#''abActive'' - active state&lt;br /&gt;
#''abFadeAndPlaySounds'' - if all effects should fade in/out or not&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropActiveAndFade(string &amp;amp;in asName, bool abActive, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates a prop.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''abActive ''- nothing to add&lt;br /&gt;
#''afFadeTime ''- time in seconds until prop fully fades&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropStaticPhysics(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates the physics of a prop, setting the mass to 0. Setting as true will make entities static in midair.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetPropIsInteractedWith(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a prop is interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RotatePropToSpeed(string &amp;amp;in asName, float afAcc, float afGoalSpeed, float afAxisX, float afAxisY, float afAxisZ, bool abResetSpeed, string &amp;amp;in asOffsetArea);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the prop up to a set speed.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afGoalSpeed ''- desired speed &lt;br /&gt;
#''afAxisX ''- rotation around X axis&lt;br /&gt;
#''afAxisY ''- rotation around Y axis&lt;br /&gt;
#''afAxisZ ''- rotation around Z axis&lt;br /&gt;
#''abResetSpeed ''- determines whether the speed is resetted after goal speed is reached&lt;br /&gt;
#''asOffsetArea ''- the area to rotate around, if empty, then the center of the body is used Note: The entity you want to rotate MUST be a &amp;quot;StaticObject&amp;quot; entity!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void StopPropMovement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all movement of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddAttachedPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop.&lt;br /&gt;
&lt;br /&gt;
#''asPropName''- the prop to attach another prop at &lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop&lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach&lt;br /&gt;
&lt;br /&gt;
Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
{{bug|''afRotZ '' is used for both the ZX rotation and the Z position of the attached prop. Unwanted rotation can be avoided by using: &amp;lt;br /&amp;gt;''AddAttachedPropToProp(asPropName, asAttachName, asAttachFile, afPosX, afPosY, '''0''', afPosZ, '''90.0f''', afPosZ)''}}&lt;br /&gt;
&lt;br /&gt;
{{bug|Attaching a breakable prop to a physically active prop, and then breaking the attached prop, will cause the game to crash, should the parent object be moved or reset.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop. Fixed version of &amp;lt;code&amp;gt;AddAttachedPropToProp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
#''asPropName ''- the prop to attach another prop at&lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop &lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach&lt;br /&gt;
&lt;br /&gt;
Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveAttachedPropFromProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches a prop from a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
void AddPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
float GetPropHealth(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ResetProp(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets a prop's state to the original one when the map was loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void PlayPropAnimation(string &amp;amp;in asProp, string &amp;amp;in asAnimation, float afFadeTime, bool abLoop, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the prop play an animation and calls a function when it stops. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asProp)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asProp ''- internal name of the prop&lt;br /&gt;
#''asAnimation ''- animation to play&lt;br /&gt;
#''afFadeTime ''- Fade time between current and new animations&lt;br /&gt;
#''abLoop ''- determines whether the animation loops &lt;br /&gt;
#''asCallback ''- function to call when the animation ends&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddPropForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddPropImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These functions push objects. Note that rather high values are needed when applying ''forces''  (on the order of ~100 (weak) to ~10000 (strong)), but not impulses (values less than 10 can be appropriate). Forces are external influences, and will have different effect depending on the mass of the object they are being applied to; impulses disregard mass, and can cause objects to break, as if hit. A &amp;quot;Body&amp;quot; is a physics-related helper object, to which a force or an impulse can be applied. Entities can consist of several bodies, interconnected in various ways (you can create/examine bodies in the model editor).&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the object to push; for bodies, use this format: &amp;quot;''entityName''_''bodyName''&amp;quot;&lt;br /&gt;
#''afX ''- magnitude along the X-axis&lt;br /&gt;
#''afY ''- magnitude along the Y-axis&lt;br /&gt;
#''afZ ''- magnitude along the Z-axis&lt;br /&gt;
#''asCoordSystem ''- determines which coordinate system is used, &amp;quot;local&amp;quot; or &amp;quot;world&amp;quot;&lt;br /&gt;
&lt;br /&gt;
All of these functions are ''additive''  - when called consecutively, for each call, the vectors defined by (afX, afY, afZ) will be added together, and a resultant force/impulse will be calculated ''before''  any physics simulation is applied to the target object.&lt;br /&gt;
&lt;br /&gt;
====Connections====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithRope(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asRopeName, bool abInteractOnly, float afSpeedMul, float afToMinSpeed, float afToMaxSpeed, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects a prop with the movement of a rope (i.e. turn a wheel to move a rope). For Levers, the rope only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName''- The name of the connection&lt;br /&gt;
#''asPropName'' - The name of the prop; can be a Lever or Wheel&lt;br /&gt;
#''asRopeName'' - The name of the rope&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''afSpeedMul'' - Speed multiplier of how quickly the rope moves&lt;br /&gt;
#''afToMinSpeed'' - The slowest the rope can move&lt;br /&gt;
#''afToMaxSpeed'' - The fastest the rope can move&lt;br /&gt;
#''abInvert'' - Whether to invert the direction the rope moves&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithMoveObject(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asMoveObjectName, bool abInteractOnly, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This one should only be used if there must be an exact correspondence to prop &amp;quot;amount&amp;quot; and the MoveObject open amount. It is best used for Wheel-door connections, where the MoveObject moves continuously along with the Wheel. For Levers, the MoveObject only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asPropName'' - The entity that controls the movement; can be a Lever or Wheel&lt;br /&gt;
#''asMoveObject'' - The MoveObject to move&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''abInvert'' - If the state is inverted, making the MoveObject move in the opposite direction&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ConnectEntities(string &amp;amp;in asName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, bool abInvertStateSent, int alStatesUsed, string &amp;amp;in asCallbackFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects two entities together so that changing the state of the main entity changes the state of the connected entity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! Max State (1) !! Min State (-1)&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || Lit || Unlit&lt;br /&gt;
|-&lt;br /&gt;
| MoveObject || Open || Close&lt;br /&gt;
|-&lt;br /&gt;
| SwingDoor&lt;br /&gt;
|rowspan=2| Locked&lt;br /&gt;
|rowspan=2| Unlocked&lt;br /&gt;
|-&lt;br /&gt;
| Chest&lt;br /&gt;
|-&lt;br /&gt;
| Button || Switched on || Switched off&lt;br /&gt;
|-&lt;br /&gt;
| Lever&lt;br /&gt;
|rowspan=2| Unstuck&lt;br /&gt;
|rowspan=2| Stuck (at min)&lt;br /&gt;
|-&lt;br /&gt;
| Wheel&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asMainEntity'' - The entity that causes the change; can be a Lever, Wheel, Button, or Photocell&lt;br /&gt;
#''asConnectEntity'' - The entity that is affected by the change&lt;br /&gt;
#''abInvertStateSent'' - If the state is inverted, making the connected entity change to the opposite state&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
#''asCallbackFunc'' - The name of the connection callback&lt;br /&gt;
&lt;br /&gt;
Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asConnectionName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, int alState)&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;alState is what is sent to connection entity and will be inverted if abInvertStateSent = true!&lt;br /&gt;
&lt;br /&gt;
====Lamps====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLampLit(string &amp;amp;in asName, bool abLit, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Turns a lamp on or off.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the lamp&lt;br /&gt;
#''abLit ''- Set true if you want the lamp to be lit, set to false if you want the lamp to be unlit&lt;br /&gt;
#''abEffects ''- If you want to have the lamp fade in/out when it gets lit/unlit&lt;br /&gt;
&lt;br /&gt;
====Doors====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorLocked(string &amp;amp;in asName, bool abLocked, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abLocked'' - Locked/unlocked&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is locked/unlocked&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorClosed(string &amp;amp;in asName, bool abClosed, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abClosed'' - Closed/open&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is closed/opened&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
bool GetSwingDoorLocked(string &amp;amp;in asName);&lt;br /&gt;
bool GetSwingDoorClosed(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a swing door is locked/closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorDisableAutoClose(string &amp;amp;in asName, bool abDisableAutoClose);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deactivates the &amp;quot;auto-close&amp;quot; when a door is nearly closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetSwingDoorState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns an integer depending on how far the door is opened. &amp;lt;br /&amp;gt;-1 = angle is close to 0°, 1 = angle is 70% or higher of max, 0 = inbetween -1 and 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLocked(string &amp;amp;in asName, bool abLocked);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a level door. Note that level doors are NOT swing doors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedSound(string &amp;amp;in asName, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which sound is played when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedText(string &amp;amp;in asName, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectState(string &amp;amp;in asName, float afState);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween (and above, for example, the bridge_metal_vert) are valid too!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectStateExt(string &amp;amp;in asName, float afState, float afAcc, float afMaxSpeed, float afSlowdownDist, bool abResetSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state, extended method.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween are valid too!&lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afMaxSpeed ''- maximum speed&lt;br /&gt;
#''afSlowdownDist ''- Distance to the target state before deceleration occurs.&lt;br /&gt;
#''abResetSpeed ''- Set to ''true'' if the prop's speed should be reset before performing the movement, else the prop will accelerate from its current speed to afMaxSpeed.&lt;br /&gt;
&lt;br /&gt;
====Levers, wheels and buttons====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropObjectStuckState(string &amp;amp;in asName, int alState);&lt;br /&gt;
void SetWheelStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
void SetLeverStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes an object/wheel/lever stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name&lt;br /&gt;
#''alState'' - 0 = not stuck, 1 = at max, -1 = at min &lt;br /&gt;
#''abEffects'' - play sound effects&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelAngle(string &amp;amp;in asName, float afAngle, bool abAutoMove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves a wheel to a certain angle.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name&lt;br /&gt;
#''afAngle'' - angle&lt;br /&gt;
#''abAutoMove'' - true = wheel physically moves to the new angle; false = angle is changed without moving the wheel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
void SetLeverInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to make a wheel/lever unstuck when interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetLeverState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the state of the lever. &amp;lt;br /&amp;gt;0 = not stuck, 1 = at max, -1 = at min&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderStuckState(string &amp;amp;in asName, int alStuckState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes a MultiSlider stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when state changes. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetButtonSwitchedOn(string &amp;amp;in asName, bool abSwitchedOn, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Sticky areas====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetAllowStickyAreaAttachment(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows entities to stick to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asProp);&lt;br /&gt;
void AttachBodyToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asBody);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop/body to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void DetachFromStickyArea(string &amp;amp;in asAreaName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches everything from a StickyArea.&lt;br /&gt;
&lt;br /&gt;
====NPCs====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCAwake(string &amp;amp;in asName, bool abAwake, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wakes/sleeps a NPC.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the NPC&lt;br /&gt;
#''abAwake'' - ''true'' to awaken, ''false'' to sleep&lt;br /&gt;
#''abEffects'' - Play the &amp;quot;Awake&amp;quot; or &amp;quot;Sleep&amp;quot; animations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCFollowPlayer(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a NPC's head to follow the player's movements.&lt;br /&gt;
&lt;br /&gt;
====Enemies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables an enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyIsHallucination(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes an enemy a hallucination. Hallucinations fade to smoke when they get near the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void FadeEnemyToSmoke(string &amp;amp;in asName, bool abPlaySound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly fades an enemy to smoke.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ShowEnemyPlayerPosition(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the enemy run to the player, no matter where he is.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AlertEnemyOfPlayerPresence(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gives the specified enemy the player's current position and makes it search the area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisableTriggers(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables or disables enemy triggers. If disabled, enemy will not react to player or attack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddEnemyPatrolNode(string &amp;amp;in asName, string &amp;amp;in asNodeName, float afWaitTime, string &amp;amp;in asAnimation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a patrol node to the enemy's path.&lt;br /&gt;
&lt;br /&gt;
#''asName''- Internal name of the enemy &lt;br /&gt;
#''asNodeName'' - Path node &lt;br /&gt;
#''afWaitTime'' - Time in seconds that the enemy waits at the path node before continuing. If 0, randomized between 1-3.&lt;br /&gt;
#''asAnimation'' - The animation the enemy uses when reaching the path node&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ClearEnemyPatrolNodes(string &amp;amp;in asEnemyName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the current path of patrol nodes of the enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemySanityDecreaseActive(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether an enemy activates the player's sanity drain when stared at.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy &lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToNode(string &amp;amp;in asEnemyName, string &amp;amp;in asNodeName, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific PathNode.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asNodeName'' - Internal name of the node to teleport to &lt;br /&gt;
#''abChangeY'' - Whether the Y position of the node will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToEntity(string &amp;amp;in asEnemyName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBody, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific entity.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asTargetEntity'' - Internal name of the entity to teleport to&lt;br /&gt;
#''asTargetBody'' - Internal name of the entity's body name to teleport to. If empty, the first body will be used (might be unstable, recommended to input a body anyway)&lt;br /&gt;
#''abChangeY'' - Whether the Y position of the entity will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeManPigPose(string &amp;amp;in asName, string &amp;amp;in asPoseType);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the pose a specified ManPig.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''asPoseType'' - Name of the ManPig pose to use. Can be &amp;quot;Biped&amp;quot; or &amp;quot;Quadruped&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigFadeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should fade the player's view in and out.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigSoundDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should play the proximity sounds.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigEasyEscapeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should be easier to escape from when hunted. If not disabled, easy escape is activated if the player is more than 12.35 meters away, the enemy can't see the player, and the player has less than 75 health. When this occurs, the enemy is forced to stop hunting and wait for half a second.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ForceTeslaPigSighting(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Forces a Tesla ManPig to be visible for a short time.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; GetEnemyStateName(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the name of the state a specified enemy is current in.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
Possible states for all enemies:&lt;br /&gt;
*Idle&lt;br /&gt;
*Wait&lt;br /&gt;
*Patrol&lt;br /&gt;
*Investigate&lt;br /&gt;
*Alert&lt;br /&gt;
*Search&lt;br /&gt;
*Hurt&lt;br /&gt;
*Hunt&lt;br /&gt;
*HuntPause&lt;br /&gt;
*HuntWander&lt;br /&gt;
*AttackMeleeShort&lt;br /&gt;
*AttackMeleeLong&lt;br /&gt;
*BreakDoor&lt;br /&gt;
*Dead&lt;br /&gt;
&lt;br /&gt;
Waterlurker-only states:&lt;br /&gt;
*GoHome&lt;br /&gt;
*Eat&lt;br /&gt;
&lt;br /&gt;
ManPig-only states: &lt;br /&gt;
*Flee&lt;br /&gt;
*Stalk&lt;br /&gt;
*Track&lt;br /&gt;
&lt;br /&gt;
Unused states:&lt;br /&gt;
*AttackRange&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=7026</id>
		<title>HPL2/Engine Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=7026"/>
		<updated>2025-10-16T18:46:44Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Levers, wheels and buttons */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TocRight}}&lt;br /&gt;
&lt;br /&gt;
This page documents all scripts available in Amnesia: The Dark Descent.&lt;br /&gt;
&lt;br /&gt;
{{note|'''Note''': Some of the functions require the Amnesia 1.3 or 1.5 update. Steam and other online store copies should be automatically updated. Other copies can get 1.3 [http://www.frictionalgames.com/forum/thread-24334.html here].}}&lt;br /&gt;
&lt;br /&gt;
== Directives ==&lt;br /&gt;
&lt;br /&gt;
First off, &amp;lt;code&amp;gt;#include &amp;quot;file.hps&amp;quot;&amp;lt;/code&amp;gt; can be used to programmatically merge together multiple separate files to make organizing scripts easier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
==Engine scripts==&lt;br /&gt;
===Main===&lt;br /&gt;
&lt;br /&gt;
The following functions are the main hps functions that the HPL2 engine looks to run on certain events - similar to the C++ int main() function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void OnStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the map is loaded for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnEnter();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs whenever the player enters a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnLeave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the player leaves a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnGameStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is found in the global.hps file and the inventory.hps file, and is run when the game is first started by the player (ie via &amp;quot;Start New Game&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnUpdate(float afStep);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
This function is executed for every game update or &amp;quot;tick&amp;quot;. Can be used for rapid-firing updates instead of looping timers. Keep in mind that this can affect game performance if not used with care.&lt;br /&gt;
&lt;br /&gt;
#''afStep''- Time elapsed in seconds since the last frame. Multiply speeds, distances etc. by this argument to avoid framerate dependence issues (for example: if you move something in this function with constant speed, it will move faster on computers which run the game with high FPS and slower on computers with low FPS).&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float RandFloat(float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random float.&lt;br /&gt;
&lt;br /&gt;
#''afMin ''- minimum value&lt;br /&gt;
#''afMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int RandInt(int alMin, int alMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random int. Note: the maximum value is ''inclusive''  - the RandInt() function may return this value.&lt;br /&gt;
&lt;br /&gt;
#''alMin ''- minimum value&lt;br /&gt;
#''alMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringContains(string &amp;amp;in asString, string &amp;amp;in asSubString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a string contains the specified string. &amp;lt;br /&amp;gt;Example: searching for &amp;quot;hello&amp;quot; in &amp;quot;hello world&amp;quot; would return '''true'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to check&lt;br /&gt;
#''asSubString ''- the string to search for&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; StringSub(string &amp;amp;in asString, int alStart, int alCount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the substring in a string. &amp;lt;br /&amp;gt;Example: in the string &amp;quot;frictional games rocks&amp;quot;, using 4 as ''alStart''  and 6 as ''alCount''  would return '''&amp;quot;tional&amp;quot;'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string&lt;br /&gt;
#''alStart ''- starting character of the string, with 0 being the first character&lt;br /&gt;
#''alCount ''- amount of characters&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int StringToInt(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns an integer converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float StringToFloat(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a float converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringToBool(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a boolean converted from a string, else returns false.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&lt;br /&gt;
===Mathematical Operations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathCos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathTan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAsin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAcos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan2(float afX, float afY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Calculates and returns the arc tangent of the specified values.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - First value to operate.&lt;br /&gt;
#''afY''  - Second value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSqrt(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the square root of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathPow(float afBase, float afExp);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the value of afBase raised to the power of afExp.&lt;br /&gt;
&lt;br /&gt;
#''afBase''  - The base value.&lt;br /&gt;
#''afExp''  - Value to calculate the base with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMin(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the lowest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMax(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the highest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathClamp(float afX, float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns afX clamped between afMin and afMax. If afX &amp;lt; afMin, returns afMin, and if afX &amp;gt; afMax, returns afMax.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - The value to clamp.&lt;br /&gt;
#''afMin''  - The minimum value to clamp afX with.&lt;br /&gt;
#''afMax''  - The maximum value to clamp afX with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAbs(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the absolute value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&lt;br /&gt;
===Debugging===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void Print(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a string to the log file (''hpl.log'').&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDebugMessage(string &amp;amp;in asString, bool abCheckForDuplicates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a line of text to the debug console at the bottom left of the screen. Debug mode must be enabled for the console messages to be visible.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to print&lt;br /&gt;
#''abCheckForDuplicates ''- if true, the string won't be printed more than once on screen until it disappears&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ProgLog(string &amp;amp;in asLevel, string &amp;amp;in asMessage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints an entry to the ProgLog (progression log). &amp;lt;br /&amp;gt;ProgLog is a file created in Documents/Amnesia/main (or an FC folder if one is being used). It logs certain events, such us opening the menu or picking up the lantern, as well as the player's state (Health, Sanity, Oil, Tinderboxes, Coins), for the purpose of documenting a tester's playstyle. &amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt;This function allows to log custom messages.The messages in the ProgLog file are sorted by time elapsed since a map was loaded.&lt;br /&gt;
&lt;br /&gt;
ProgLog has to be enabled for a player profile in ''user_settings.cfg''  before it starts working.&lt;br /&gt;
&lt;br /&gt;
#''asLevel ''- can be &amp;quot;Low&amp;quot;, &amp;quot;Medium&amp;quot; or &amp;quot;High&amp;quot;. It's a tag which appears in each log entry, for event prioritising.&lt;br /&gt;
#''asMessage ''- The custom message to be printed to the log.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool ScriptDebugOn();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the debug mode is enabled. &amp;lt;br /&amp;gt;See [[HPL2/Development_Environment|&amp;quot;Setting up Development Environment&amp;quot;]] to setup debug mode on your own computer.&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
{{warning|Regular variables (int, float, etc.) are '''not''' saved by the game. Using them in important parts of yor script will break it upon loading a game save. In HPL, those variables should only be used for disposable counters, like spawning objects in a &amp;quot;for&amp;quot; loop. For variables which need to be saved, use the wrappers as described below.}}&lt;br /&gt;
&lt;br /&gt;
====Local====&lt;br /&gt;
&lt;br /&gt;
Local variables can be used throughout the same script file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetLocalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetLocalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddLocalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetLocalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Global====&lt;br /&gt;
&lt;br /&gt;
Global variables can be used throughout several maps and can be accessed by several script files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetGlobalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetGlobalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddGlobalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetGlobalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Particle Systems===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadParticleSystem(string &amp;amp;in asPSFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asPSFile''  - The particle system file to load. Extension: .ps&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntity(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntityExt(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS,&lt;br /&gt;
float afR, float afG, float afB, float afA, bool abFadeAtDistance, float afFadeMinEnd, float afFadeMinStart,&lt;br /&gt;
float afFadeMaxStart, float afFadeMaxEnd);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity, extended method with more options.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''abFadeAtDistance ''- determines whether a particle system fades from a certain distance on&lt;br /&gt;
#''afFadeMinEnd ''- minimum distance at which the particle system stops fading&lt;br /&gt;
#''afFadeMinStart ''- minimum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxStart ''- maximum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxEnd ''- maximum distance at which the particle system stops fading&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DestroyParticleSystem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Destroys a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - The internal name of the particle system&lt;br /&gt;
&lt;br /&gt;
===Sounds &amp;amp; Music===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadSound(string &amp;amp;in asSoundFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile''  - The sound file to load (extension .snt optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayGuiSound(string &amp;amp;in asSoundFile, float afVolume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays a sound, not using 3D.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile ''- the sound to play (extension .snt/.ogg optional)&lt;br /&gt;
#''afVolume ''- the volume of the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaySoundAtEntity(string &amp;amp;in asSoundName, string &amp;amp;in asSoundFile, string &amp;amp;in asEntity, float afFadeTime, bool abSaveSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a sound at an entity.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''asSoundFile ''- the sound to use (extension .snt optional)&lt;br /&gt;
#''asEntity ''- the entity to create the sound at. Using &amp;quot;Player&amp;quot; is effectively the same as &amp;lt;code&amp;gt;PlayGuiSound&amp;lt;/code&amp;gt;, yet this function allows a looping sound to be saved&lt;br /&gt;
#''afFadeTime ''- time in seconds the sound needs to fade. Avoids enemies hearing the sound if afFadeTime is at least 0.1f&lt;br /&gt;
#''abSaveSound ''- if ''true'', a looping sound will &amp;quot;remember&amp;quot; its playback state (currently playing/stopped), and that state will be restored the next time the level is entered. If ''true'', the sound is never attached to the entity! Note that saving should only be used on ''looping sounds''!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeInSound(string &amp;amp;in asSoundName, float afFadeTime, bool abPlayStart);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades in a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds&lt;br /&gt;
#''abPlayStart ''- Play the sound defined in the &amp;lt;code&amp;gt;&amp;lt;Start&amp;gt;&amp;lt;/code&amp;gt; section of the .snt before playing the main sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopSound(string &amp;amp;in asSoundName, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades out a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds, use 0 to immediately stop the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayMusic(string &amp;amp;in asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays music.&lt;br /&gt;
&lt;br /&gt;
#''asMusicFile ''- the music file to play (extension .ogg optional)&lt;br /&gt;
#''abLoop ''- determines whether a music track should loop&lt;br /&gt;
#''afVolume ''- volume of the music&lt;br /&gt;
#''afFadeTime ''- time in seconds until music reaches full volume&lt;br /&gt;
#''alPrio ''- priority of the music. Note that only the music with the highest priority can be heard! 0 - lowest, 1 - higher, etc.&lt;br /&gt;
#''abResume''  - if ''true'', playback will be continued from where the track stopped after the call to &amp;lt;code&amp;gt;StopMusic()&amp;lt;/code&amp;gt;. If ''false'', the track will be restarted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopMusic(float afFadeTime, int alPrio);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops music.&lt;br /&gt;
&lt;br /&gt;
#''afFadeTime ''- time in seconds until music stops&lt;br /&gt;
#''alPrio ''- the priority of the music that should stop&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice(string &amp;amp;in asVoiceFile, string &amp;amp;in asEffectFile, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry,&lt;br /&gt;
bool abUsePosition, string &amp;amp;in asPosEntity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This adds a voice and an additional sound effect to be played. It is okay to call this many times in order to play many voices in a row. The EffectVoiceOverCallback is not called until ALL voices have finished.&lt;br /&gt;
&lt;br /&gt;
#''asVoiceFile ''- the voice to play&lt;br /&gt;
#''asEffectFile ''- the sound effect to play&lt;br /&gt;
#''asTextCat ''- the category in the .lang file, usually &amp;quot;Voice&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''abUsePosition ''- plays using 3D from the entity, or without 3D&lt;br /&gt;
#''asPosEntity ''- the entity at which the voice and sound are played from&lt;br /&gt;
#''afMinDistance ''- minimum distance the voice and sound are heard&lt;br /&gt;
#''afMaxDistance ''- maximum distance the voice and sound are heard&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopAllEffectVoices(float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all voices and calls the EffectVoiceOverCallback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEffectVoiceActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether EffectVoices are still active.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetEffectVoiceOverCallback(string &amp;amp;in asFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to be called when the EffectVoices are finished. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundVolume(float afDestVolume, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound volume, that means everything you can hear '''from the world'''. This does not affect music of GUI sounds.&lt;br /&gt;
&lt;br /&gt;
#''afDestVolume ''- desired volume&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired volume&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundSpeed(float afDestSpeed, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound speed.&lt;br /&gt;
&lt;br /&gt;
#''afDestSpeed ''- desired speed&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired speed&lt;br /&gt;
&lt;br /&gt;
===Lights===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightVisible(string &amp;amp;in asLightName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables lights.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''abVisible ''- determines the state of the light&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeLightTo(string &amp;amp;in asLightName, float afR, float afG, float afB, float afA, float afRadius, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the properties of a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''afRadius ''- radius of the light. -1 means keeping the radius&lt;br /&gt;
#''afTime ''- time in seconds until change is done&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightFlickerActive(string &amp;amp;in asLightName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates flickering on a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName'' - The internal light name&lt;br /&gt;
#''abActive'' - true = active, false = inactive&lt;br /&gt;
&lt;br /&gt;
==Game scripts==&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartCredits(string &amp;amp;in asMusic, bool abLoopMusic, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alEndNum);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts the end credits screen.&lt;br /&gt;
&lt;br /&gt;
#''asMusic ''- the music to play (including .ogg)&lt;br /&gt;
#''abLoopMusic ''- determines whether the music should loop&lt;br /&gt;
#''asTextCat ''- the category to be used in the .lang file, usually &amp;quot;Ending&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alEndNum ''- Amnesia has 3 different endings and displays a code at the bottom. Determines which code is displayed. 0-2 will display codes, any other integer will not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartDemoEnd();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shows the demo end screen. The background and UI elements are defined in demo.cfg, with the text using the entries in the &amp;quot;Demo&amp;quot; category of the .lang file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AutoSave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an auto save file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CheckPoint(string &amp;amp;in asName, string &amp;amp;in asStartPos, string &amp;amp;in asCallback, string &amp;amp;in asDeathHintCat, string &amp;amp;in asDeathHintEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a checkpoint at which the player will respawn in case he dies. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asName, int alCount)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;Count is 0 on the first checkpoint load!&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the editor&lt;br /&gt;
#''asCallback ''- the function to call when the player dies/respawns&lt;br /&gt;
#''asDeathHintCat ''- the category of the death hint message to be used in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asDeathHintEntry ''- the entry in the .lang file&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeMap(string &amp;amp;in asMapName, string &amp;amp;in asStartPos, string &amp;amp;in asStartSound, string &amp;amp;in asEndSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Loads another map after a 1.5 second fade out.&lt;br /&gt;
&lt;br /&gt;
#''asMapName ''- the file to load&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the next map&lt;br /&gt;
#''asStartSound ''- the sound that is played when the change starts&lt;br /&gt;
#''asEndSound ''- the sound that is played when the new map is loaded&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ClearSavedMaps();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the &amp;quot;history&amp;quot; of the save, useful to do when you know the player will not be able to go back anymore. Makes the next save much smaller in size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateDataCache();&lt;br /&gt;
void DestroyDataCache();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This caches all current textures and models and they are not released until destroy is called. If there is already cached data it is destroyed.&lt;br /&gt;
Create caches to enable faster loading when going back to a map. Destroy the cache if you know the player won't go back to that map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMapDisplayNameEntry(string &amp;amp;in asNameEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the map name shown in save file names. If none is set NULL is assumed.&lt;br /&gt;
&lt;br /&gt;
#''asNameEntry ''- the entry to display, category must be &amp;quot;Levels&amp;quot;!&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the skybox.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxTexture(string &amp;amp;in asTexture);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the texture of the skybox.&lt;br /&gt;
&lt;br /&gt;
#''asTexture''  - The texture file to set. Extension: .dds&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the solid color of the skybox rather than a texture.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the global fog.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the color to use for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogProperties(float afStart, float afEnd, float afFalloffExp, bool abCulling);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the properties for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afStart ''- how many meters from the camera should the fog begin&lt;br /&gt;
#''afEnd ''- how many meters from the camera should the fog reach full thickness&lt;br /&gt;
#''afFalloffExp ''- the amount by which the thinkness increases&lt;br /&gt;
#''abCulling ''- whether occlusion culling is active for the fog; this prevents objects behind the fog from being loaded&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetupLoadScreen(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alRandomNum, string &amp;amp;in asImageFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which loading screen will be shown when changing maps.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category of the loading text in the .lang file to be shown on the loading screen, usually &amp;quot;LoadingText&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alRandomNum ''- if greater 1, then it will randomize between 1 and alRandom for each LoadScreen giving entry the suffix XX (eg 01). If &amp;lt; =1 then no suffix is added&lt;br /&gt;
#''asImageFile ''- the image to be shown (optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void UnlockAchievement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlocks the specified achievement. Only able to be used for the ending achievements.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the achievement. Only the following strings are valid:&lt;br /&gt;
::* Benefactor&lt;br /&gt;
::* Survivor&lt;br /&gt;
::* Sacrifice&lt;br /&gt;
::* Quitter&lt;br /&gt;
::* Egotist&lt;br /&gt;
::* Altruist&lt;br /&gt;
::* Vacillator&lt;br /&gt;
&lt;br /&gt;
===Game Timer===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddTimer(string &amp;amp;in asName, float afTime, string &amp;amp;in asFunction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a timer which calls a function when it expires. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asTimer)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the name of the timer&lt;br /&gt;
#''afTime ''- time in seconds&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveTimer(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a timer, no matter how much time is left.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the timer.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetTimerTimeLeft(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the time left on a timer.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - the internal name of the timer.&lt;br /&gt;
&lt;br /&gt;
===Screen Effects===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeOut(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to black.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen is completly black&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeIn(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen back to normal.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeImageTrailTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies the image trail effect to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeSepiaColorTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the screen go dark red.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0) &lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeRadialBlurTo(float afSize, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies radial blur effects to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afSize ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetRadialBlurStartDist(float afStartDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines at which distance the radial blur effects appear.&lt;br /&gt;
&lt;br /&gt;
#''afStartDist ''- the distance at which the effect starts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectFlash(float afFadeIn, float afWhite, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white.&lt;br /&gt;
&lt;br /&gt;
#''afFadeIn ''- time in seconds until screen is white&lt;br /&gt;
#''afWhite ''- determines to which percentage the screen fades to white (1.0 = completly white)&lt;br /&gt;
#''afFadeOut ''- time in seconds until screen is back to normal again&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectEmotionFlash(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white and shows a text message.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''asSound ''- the sound to play while fading&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetFlashbackIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a flashback is still in effect.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerSpawnPS(string &amp;amp;in asSPSFile);&lt;br /&gt;
void StopPlayerSpawnPS();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Continuously spawn regular particle systems (''.ps'') around the player. Particles created by this script carry over from map to map.&lt;br /&gt;
&lt;br /&gt;
#''asSPSFile''  - the ''.sps''  file to use. Example ''.sps''  files are located in the ''/misc''  folder in the main game directory.&amp;lt;br&amp;gt;Custom ''.sps''  files can be created by hand in a text editor (see existing ones and mimic how those are written). &amp;lt;br /&amp;gt;Since ''StopPlayerSpawnPS()''  doesn't seem to work, to stop an SPS you must create an ''.sps''  file with an empty particle field field and override the old SPS by calling ''StartPlayerSpawnPS''  again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shakes the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity of the shake&lt;br /&gt;
#''afTime ''- duration of the shake&lt;br /&gt;
#''afFadeInTime ''- time in seconds until full intensity is reached&lt;br /&gt;
#''afFadeOutTime ''- time until screen is back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInDarknessEffectsActive(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the sanity drain and night vision effects while in the darkness.&lt;br /&gt;
&lt;br /&gt;
''bool abX''  - Enable/disable effects.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowScreenImage(string &amp;amp;in asImageName, float afX, float afY, float afScale, bool abUseRelativeCoordinates, float afDuration, float afFadeIn, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
Displays an image file directly onto the screen. See [[HPL2/Tutorials/ShowScreenImage()|ShowScreenImage()]] in the tutorials section for more information.&lt;br /&gt;
&lt;br /&gt;
# ''asImageName'' - The image file to render (.jpg, .png, .tga, .dds)&lt;br /&gt;
# ''afX'' - The X position of the image&lt;br /&gt;
# ''afY'' - The Y position of the image&lt;br /&gt;
# ''afScale'' - The size of the image in pixels (not scale), or original image size if negative&lt;br /&gt;
# ''abUseRelativeCoordinates'' - Whether X and Y are relative to the screen resoltion, or pixel co-ordinates if not&lt;br /&gt;
# ''afDuration'' - The duration that the image is displayed for&lt;br /&gt;
# ''afFadeIn'' - The time, in seconds, to fade in the image&lt;br /&gt;
# ''afFadeOut'' - The time, in seconds, to fade out the image&lt;br /&gt;
&lt;br /&gt;
===Insanity===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInsanitySetEnabled(string &amp;amp;in asSet, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which InsanitySets are enabled.&lt;br /&gt;
&lt;br /&gt;
#''asSet ''- the set&lt;br /&gt;
#''abX ''- enabled or not&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartInsanityEvent(string &amp;amp;in asEventName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Starts a specified insanity event.&lt;br /&gt;
&lt;br /&gt;
#''asEventName ''- Insanity event to play.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartRandomInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts a random insanity event from the available sets.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopCurrentInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Stops the currently playing insanity event.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void InsanityEventIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an insanity event is currently in effect.&amp;lt;br&amp;gt;Not useful at all due to having a return type of &amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; when it should be &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Player===&lt;br /&gt;
&lt;br /&gt;
Note that the player's maximum health and sanity is 100.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enabled/Disable player controlled movement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangePlayerStateToNormal();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets the player's state, forcing them to stop interacting with objects. It also clears the inventory item to be used (as if it was double-clicked on in the inventory again) and dismounts the player from ladders.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerCrouching(bool abCrouch);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddPlayerBodyForce(float afX, float afY, float afZ, bool abUseLocalCoords);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pushes the player into a certain direction. Note that you need values above ~2000 to see any effects.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - amount along the X-axis&lt;br /&gt;
#''afY'' - amount along the Y-axis&lt;br /&gt;
#''afZ'' - amount along the Z-axis&lt;br /&gt;
#''abUseLocalCoords'' - If true, axes are based on where the player is facing, not the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowPlayerCrossHairIcons(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the icons when a player has something in focus.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerSanity(float afSanity);&lt;br /&gt;
void AddPlayerSanity(float afSanity);&lt;br /&gt;
float GetPlayerSanity();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerHealth(float afHealth);&lt;br /&gt;
void AddPlayerHealth(float afHealth);&lt;br /&gt;
float GetPlayerHealth();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerLampOil(float afOil);&lt;br /&gt;
void AddPlayerLampOil(float afOil);&lt;br /&gt;
float GetPlayerLampOil();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the lamp oil of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerSpeed();&lt;br /&gt;
float GetPlayerYSpeed();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current speed of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSanityDrainDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables sanity drain from darkness.&lt;br /&gt;
{{bug|Sanity drain is reenabled on loading a save, as the game is unable to load the value properly from the save data.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoost();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a large amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! New Sanity&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || 100&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || 90&lt;br /&gt;
|-&lt;br /&gt;
| 50-74 || 80&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoostSmall();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a small amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! Sanity Bonus&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || +20&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || +15&lt;br /&gt;
|-&lt;br /&gt;
| 50-75 || +10&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityDamage(float afAmount, bool abUseEffect);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount'' - amount of sanity damage done&lt;br /&gt;
#''abUseEffect'' - if a sound is played and screen effects are shown when the sanity damage is dealt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GivePlayerDamage(float afAmount, string &amp;amp;in asType, bool abSpinHead, bool abLethal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the health of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount'' - amount of damage done to health&lt;br /&gt;
#''asType'' - plays a certain effect on the screen when the damage is dealt (BloodSplat, Claws, or Slash) &lt;br /&gt;
#''abSpinHead'' - changes the camera view when damage is dealt&lt;br /&gt;
#''abLethal'' - set to true if player can die from given damage. If ''false'' and the damage would have left the player with less than 10 health, health is set to 10.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerFOVMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the field of view of the player. A shorter FOV will create a zoom effect.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - multiplier of default FOV (1 is default)&lt;br /&gt;
#''afSpeed'' - the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerAspectMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the aspect ratio of the player. Basically stretches or narrows the screen horizontally.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - multiplier of default aspect (default is 1)&lt;br /&gt;
#''afSpeed'' - the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - angle of rotation of head, positive being counter-clockwise&lt;br /&gt;
#''afSpeedMul'' - speed (possibly acceleration) multiplier of the rotation (default 1, which is really slow)&lt;br /&gt;
#''afMaxSpeed'' - maximum speed of rotation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerForward(float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Moves the player forward. It needs to be called in a timer that updates 60 times / second.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- amount along the X-axis&lt;br /&gt;
#''afY ''- amount along the Y-axis&lt;br /&gt;
#''afZ ''- amount along the Z-axis&lt;br /&gt;
#''afSpeed ''- speed at which the change happens&lt;br /&gt;
#''afSlowDownDist ''- distance at which to start slowing down (prevents the head from abruptly stopping)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerLookAt(string &amp;amp;in asEntityName, float afSpeedMul, float afMaxSpeed, string &amp;amp;in asAtTargetCallback);&lt;br /&gt;
void StopPlayerLookAt();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to look at a certain entity until StopPlayerLookAt is used.&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- the entity to look at &lt;br /&gt;
#''afSpeedMul ''- how fast should the player look at the entity&lt;br /&gt;
#''afMaxSpeed ''- maximum speed allowed&lt;br /&gt;
#''asAtTargetCallback ''- function to call when player looks at target&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerMoveSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerRunSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerLookSpeedMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the player's move/run/look speed. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpForceMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the player's jump multiplier. Higher values = higher jumps. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpDisabled(bool abX);&lt;br /&gt;
void SetPlayerCrouchDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to jump/crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportPlayer(string &amp;amp;in asStartPosName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly teleports the player to the target StartPos.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternActive(bool abX, bool abUseEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the player use his lantern.&lt;br /&gt;
&lt;br /&gt;
# ''abX'' - Set lantern to be active (true) or inactive (false)&lt;br /&gt;
# ''abUseEffects'' - Play on/off sounds&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetLanternActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player is currently using the lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to use the lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternLitCallback(string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to call when the player uses the lantern. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;MyFunc(bool abLit)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message on the screen.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory'' - the category in the .lang file&lt;br /&gt;
#''asTextEntry'' - the entry in the .lang file&lt;br /&gt;
#''afTime'' - determines how long the message is displayed. If time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetDeathHint(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the message that appears when the player dies.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory'' - the category in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asTextEntry'' - the entry in the .lang file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DisableDeathStartSound();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the death sound when the player dies. This must be called directly before player is killed! The variable as soon as player dies too.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPermaDeathSound(string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Sets the sound played after the player dies when permadeath is active. Permadeath is only active when the game is launched with the &amp;lt;code&amp;gt;ptest&amp;lt;/code&amp;gt; command line parameter. Only used for the post-death Suitor lines in ''Justine''.&lt;br /&gt;
&lt;br /&gt;
#''asSound'' - The sound to be played after death. Expects a voice-type sound.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerFallDamageDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the player's ability to take fall damage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPos(float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the player's position within the level.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - X co-ordinate position.&lt;br /&gt;
#''afY'' - Y co-ordinate position.&lt;br /&gt;
#''afZ'' - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerPosX();&lt;br /&gt;
float GetPlayerPosY();&lt;br /&gt;
float GetPlayerPosZ();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the player's position within the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
===Journal===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddNote(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a note to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _Name and _Text and be in category &amp;quot;Journal&amp;quot;!&lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDiary(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a diary to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _NameX and _TextY whereas X and Y are numbers of the parts (_Name1: first diary, _Text1: first page) and be in category &amp;quot;Journal&amp;quot;! &lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ReturnOpenJournal(bool abOpenJournal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Only called in the pickup diary callback! If true the journal displays the entry else not.&lt;br /&gt;
&lt;br /&gt;
===Quests===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a quest to the player's journal under mementos. Completed quests cannot be readded.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name to be used&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot;Quest_&amp;lt;texthere&amp;gt;_Text”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CompleteQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Completes a quest. If the quest has not been added, it's marked as complete anyway, preventing it from being added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot; Quest_&amp;lt;texthere&amp;gt;_Text ”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool QuestIsCompleted(string &amp;amp;in asName);&lt;br /&gt;
bool QuestIsAdded(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a quest is completed/added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetNumberOfQuestsInMap(int alNumberOfQuests);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the number of quests in the map. Obsolete; formerly used to calculate a completion percentage when looking at a level door.&lt;br /&gt;
&lt;br /&gt;
#''alNumberOfQuests ''- Amount of quests&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveHint(string &amp;amp;in asName, string &amp;amp;in asMessageCat, string &amp;amp;in asMessageEntry, float afTimeShown);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a hint on the player's screen.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asMessageCat ''- the category in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asMessageEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTimeShown ''- time in seconds until the message disappears. If time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void BlockHint(string &amp;amp;in asName);&lt;br /&gt;
void UnBlockHint(string &amp;amp;in asName);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Blocking a hint prevents it from being shown. Blocked hints are included in savefiles, so they should persist between levels. Unblocking a hint allows it to be shown.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; blocks the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveHint(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes the hint from the list of already shown hints, allowing it to appear again.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; reenables the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
===Inventory===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ExitInventory();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Exits the inventory by force.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the player's ability to open his inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a message on the inventory screen. Used for feedback messages when failing to combine items.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory ''- the category in the .lang file, usually &amp;quot;Inventory&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTime ''- time in seconds until the message disappears. If life time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItem(string &amp;amp;in asName, string &amp;amp;in asType, string &amp;amp;in asSubTypeName, string &amp;amp;in asImageName, float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds an item to the inventory of the player. Note that the item does not have to exist as entity in the world to be able to do this.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asType ''- item type to give, Available types are:&lt;br /&gt;
::*Puzzle&lt;br /&gt;
::*Lantern&lt;br /&gt;
::*Health&lt;br /&gt;
::*Sanity&lt;br /&gt;
::*LampOil&lt;br /&gt;
::*Tinderbox&lt;br /&gt;
#''asSubTypeName ''- item name for .lang file&lt;br /&gt;
#''asImageName ''- the image which will appear in inventory. For example: &amp;lt;code&amp;gt;void GiveItem(&amp;quot;chemical_container_full_1&amp;quot;, &amp;quot;Puzzle&amp;quot;, &amp;quot;chemical_container_full&amp;quot;, &amp;quot;chemical_container_full.tga&amp;quot;, 1);&amp;lt;/code&amp;gt; will use the image from &amp;lt;code&amp;gt;graphics/item/chemical_container_full.tga&amp;lt;/code&amp;gt; &lt;br /&gt;
#''afAmount ''- amount the item gives, - For example: Oil potions will fill the oil meter by this amount, Health potions will heal by this amount, etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item from the player's inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool HasItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player has an item in his inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItemFromFile(string &amp;amp;in asName, string &amp;amp;in asFileName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a single item to the player's inventory. This is meant to be used for debug mostly as it creates the actual item and then destroys it.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asFileName ''- item to give + extension (.ent)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddCombineCallback(string &amp;amp;in asName, string &amp;amp;in asItemA, string &amp;amp;in asItemB, string &amp;amp;in asFunction, bool abAutoRemove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to combine items in his inventory. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItemA, string &amp;amp;in asItemB)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name for the callback&lt;br /&gt;
#''asItemA ''- internal name of first item&lt;br /&gt;
#''asItemB ''- internal name of second item&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
#''abAutoRemove ''- determines whether the callback should be removed when the items are combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveCombineCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a combine callback.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the callback to be removed (as specified in AddCombineCallback)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddUseItemCallback(string &amp;amp;in asName, string &amp;amp;in asItem, string &amp;amp;in asEntity, string &amp;amp;in asFunction, bool abAutoDestroy);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to use items on the world. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItem, string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
#''asItem ''- internal name of the item&lt;br /&gt;
#''asEntity ''- entity to be able to use the item on&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abAutoDestroy ''- determines whether the callback should be removed when the item is used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveUseItemCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item callback.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
&lt;br /&gt;
===Entities===&lt;br /&gt;
&lt;br /&gt;
====General====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityActive(string &amp;amp;in asName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityVisible(string &amp;amp;in asName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity's visual mesh. The collision body remains.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the entity.&lt;br /&gt;
#''abActive''  - Activate/deactivate mesh.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntityExists(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an entity exists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCustomFocusCrossHair(string &amp;amp;in asName, string&amp;amp; asCrossHair);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the crosshair that is used when focusing an entity.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCrossHair ''- desired crosshair, can be: &lt;br /&gt;
::*Default (no crosshair)&lt;br /&gt;
::*Grab&lt;br /&gt;
::*Push&lt;br /&gt;
::*Ignite&lt;br /&gt;
::*Pick&lt;br /&gt;
::*LevelDoor&lt;br /&gt;
::*Ladder&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void CreateEntityAtArea(string &amp;amp;in asEntityName, string &amp;amp;in asEntityFile, string &amp;amp;in asAreaName, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an entity at an area. When creating an enemy though, it cannot chase properly along PathNodes (using for example &amp;lt;code&amp;gt;ShowEnemyPlayerPosition&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- internal name&lt;br /&gt;
#''asEntityFile ''- entity to be used extension .ent&lt;br /&gt;
#''asAreaName ''- the area to create the entity at&lt;br /&gt;
#''abFullGameSave ''- determines whether an entity &amp;quot;remembers&amp;quot; its state&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ReplaceEntity(string &amp;amp;in asName, string &amp;amp;in asBodyName, string &amp;amp;in asNewEntityName, string &amp;amp;in asNewEntityFile, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Removes an entity and places a new one in its place.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to replace.&lt;br /&gt;
#''asBodyName'' - Name of the body of the entity to place the new entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''asNewEntityName'' - Name of the new entity.&lt;br /&gt;
#''asNewEntityFile'' - Name of the new entity file. Extension .ent. &lt;br /&gt;
#''abFullGameSave'' - Whether ALL properties of this entity should be saved throughout levels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaceEntityAtEntity(string &amp;amp;in asName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBodyName, bool abUseRotation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Places an entity at the position of another entity. Does not work for enemies, use TeleportEnemyToEntity instead.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to place.&lt;br /&gt;
#''asTargetEntity'' - Name of the other entity to place the first entity at.&lt;br /&gt;
#''asTargetBodyName'' - Name of the body of the entity to place the first entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''abUseRotation'' - Whether the entity should be rotated like the target entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPos(string &amp;amp;in asName, float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Moves an entity to a position in the level.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to move.&lt;br /&gt;
#''afX'' - X co-ordinate position.&lt;br /&gt;
#''afY'' - Y co-ordinate position.&lt;br /&gt;
#''afZ'' - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetEntityPosX(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosY(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosZ(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns an entity's position in the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerLookAtCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveWhenLookedAt);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player looks at a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = looking, -1 = not looking&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveWhenLookedAt ''- determines whether the callback should be removed when the player looked at the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerInteractCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveOnInteraction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player interacts with a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveOnInteraction ''- determines whether the callback should be removed when the player interacts with the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCallbackFunc(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when certain events occur with an entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, string &amp;amp;in asType)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;asType&amp;lt;/code&amp;gt; values depend on entity type:&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! asType Value&lt;br /&gt;
|-&lt;br /&gt;
| Object || Break&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || OnIgnite&lt;br /&gt;
|-&lt;br /&gt;
| Item || OnPickup&lt;br /&gt;
|-&lt;br /&gt;
| Enemy || OnDeath&lt;br /&gt;
|-&lt;br /&gt;
| Enemy_Grunt&amp;lt;br&amp;gt;Enemy_Manpig || OnAutoDisabled&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityConnectionStateChangeCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A callback called when ever the connection state changes (button being switched on, lever switched, etc). &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void Func(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: -1 = off, 0 = between, 1 = on&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityInteractionDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disallows interaction with an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void BreakJoint (string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Breaks a joint. Do not use this on joints in SwingDoors, Levers, Wheels, etc. where the joint is part of an interaction. That will make the game crash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void AddEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName, string &amp;amp;in asFunction, bool abDeleteOnCollide, int alStates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when two entities collide. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asParent, string &amp;amp;in asChild, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = enter, -1 = leave&lt;br /&gt;
&lt;br /&gt;
#''asParentName ''- internal name of main object&lt;br /&gt;
#''asChildName ''- internal name of object that collides with main object (asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) NOT supported!)&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abDeleteOnCollide ''- determines whether the callback after it was called&lt;br /&gt;
#''alStates ''- 1 = only enter, -1 = only leave, 0 = both&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an EntityCollideCallback. Asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) not supported in ''asChildName''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntitiesCollide(string &amp;amp;in asEntityA, string &amp;amp;in asEntityB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether two entities collide. This function does NOT support asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) or &amp;quot;Player&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetBodyMass(string &amp;amp;in asName, float afMass);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName.&lt;br /&gt;
#''afMass''  - The mass to set.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetBodyMass(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName. &lt;br /&gt;
#''afMass''  - The mass to get.&lt;br /&gt;
&lt;br /&gt;
====Props====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropEffectActive(string &amp;amp;in asName, bool abActive, bool abFadeAndPlaySounds);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Turns the texture illumination, billboards, particles, light flicker, and sounds of a prop on or off.&lt;br /&gt;
&lt;br /&gt;
Can be used on coal to give it the black color it should have.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name &lt;br /&gt;
#''abActive'' - active state&lt;br /&gt;
#''abFadeAndPlaySounds'' - if all effects should fade in/out or not&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropActiveAndFade(string &amp;amp;in asName, bool abActive, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates a prop.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''abActive ''- nothing to add&lt;br /&gt;
#''afFadeTime ''- time in seconds until prop fully fades&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropStaticPhysics(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates the physics of a prop, setting the mass to 0. Setting as true will make entities static in midair.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetPropIsInteractedWith(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a prop is interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RotatePropToSpeed(string &amp;amp;in asName, float afAcc, float afGoalSpeed, float afAxisX, float afAxisY, float afAxisZ, bool abResetSpeed, string &amp;amp;in asOffsetArea);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the prop up to a set speed.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afGoalSpeed ''- desired speed &lt;br /&gt;
#''afAxisX ''- rotation around X axis&lt;br /&gt;
#''afAxisY ''- rotation around Y axis&lt;br /&gt;
#''afAxisZ ''- rotation around Z axis&lt;br /&gt;
#''abResetSpeed ''- determines whether the speed is resetted after goal speed is reached&lt;br /&gt;
#''asOffsetArea ''- the area to rotate around, if empty, then the center of the body is used Note: The entity you want to rotate MUST be a &amp;quot;StaticObject&amp;quot; entity!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void StopPropMovement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all movement of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddAttachedPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop.&lt;br /&gt;
&lt;br /&gt;
#''asPropName''- the prop to attach another prop at &lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop&lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach&lt;br /&gt;
&lt;br /&gt;
Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
{{bug|''afRotZ '' is used for both the ZX rotation and the Z position of the attached prop. Unwanted rotation can be avoided by using: &amp;lt;br /&amp;gt;''AddAttachedPropToProp(asPropName, asAttachName, asAttachFile, afPosX, afPosY, '''0''', afPosZ, '''90.0f''', afPosZ)''}}&lt;br /&gt;
&lt;br /&gt;
{{bug|Attaching a breakable prop to a physically active prop, and then breaking the attached prop, will cause the game to crash, should the parent object be moved or reset.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop. Fixed version of &amp;lt;code&amp;gt;AddAttachedPropToProp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
#''asPropName ''- the prop to attach another prop at&lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop &lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach&lt;br /&gt;
&lt;br /&gt;
Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveAttachedPropFromProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches a prop from a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
void AddPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
float GetPropHealth(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ResetProp(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets a prop's state to the original one when the map was loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void PlayPropAnimation(string &amp;amp;in asProp, string &amp;amp;in asAnimation, float afFadeTime, bool abLoop, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the prop play an animation and calls a function when it stops. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asProp)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asProp ''- internal name of the prop&lt;br /&gt;
#''asAnimation ''- animation to play&lt;br /&gt;
#''afFadeTime ''- Fade time between current and new animations&lt;br /&gt;
#''abLoop ''- determines whether the animation loops &lt;br /&gt;
#''asCallback ''- function to call when the animation ends&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddPropForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddPropImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These functions push objects. Note that rather high values are needed when applying ''forces''  (on the order of ~100 (weak) to ~10000 (strong)), but not impulses (values less than 10 can be appropriate). Forces are external influences, and will have different effect depending on the mass of the object they are being applied to; impulses disregard mass, and can cause objects to break, as if hit. A &amp;quot;Body&amp;quot; is a physics-related helper object, to which a force or an impulse can be applied. Entities can consist of several bodies, interconnected in various ways (you can create/examine bodies in the model editor).&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the object to push; for bodies, use this format: &amp;quot;''entityName''_''bodyName''&amp;quot;&lt;br /&gt;
#''afX ''- magnitude along the X-axis&lt;br /&gt;
#''afY ''- magnitude along the Y-axis&lt;br /&gt;
#''afZ ''- magnitude along the Z-axis&lt;br /&gt;
#''asCoordSystem ''- determines which coordinate system is used, &amp;quot;local&amp;quot; or &amp;quot;world&amp;quot;&lt;br /&gt;
&lt;br /&gt;
All of these functions are ''additive''  - when called consecutively, for each call, the vectors defined by (afX, afY, afZ) will be added together, and a resultant force/impulse will be calculated ''before''  any physics simulation is applied to the target object.&lt;br /&gt;
&lt;br /&gt;
====Connections====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithRope(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asRopeName, bool abInteractOnly, float afSpeedMul, float afToMinSpeed, float afToMaxSpeed, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects a prop with the movement of a rope (i.e. turn a wheel to move a rope). For Levers, the rope only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName''- The name of the connection&lt;br /&gt;
#''asPropName'' - The name of the prop; can be a Lever or Wheel&lt;br /&gt;
#''asRopeName'' - The name of the rope&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''afSpeedMul'' - Speed multiplier of how quickly the rope moves&lt;br /&gt;
#''afToMinSpeed'' - The slowest the rope can move&lt;br /&gt;
#''afToMaxSpeed'' - The fastest the rope can move&lt;br /&gt;
#''abInvert'' - Whether to invert the direction the rope moves&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithMoveObject(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asMoveObjectName, bool abInteractOnly, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This one should only be used if there must be an exact correspondence to prop &amp;quot;amount&amp;quot; and the MoveObject open amount. It is best used for Wheel-door connections, where the MoveObject moves continuously along with the Wheel. For Levers, the MoveObject only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asPropName'' - The entity that controls the movement; can be a Lever or Wheel&lt;br /&gt;
#''asMoveObject'' - The MoveObject to move&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''abInvert'' - If the state is inverted, making the MoveObject move in the opposite direction&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ConnectEntities(string &amp;amp;in asName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, bool abInvertStateSent, int alStatesUsed, string &amp;amp;in asCallbackFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects two entities together so that changing the state of the main entity changes the state of the connected entity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! Max State (1) !! Min State (-1)&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || Lit || Unlit&lt;br /&gt;
|-&lt;br /&gt;
| MoveObject || Open || Close&lt;br /&gt;
|-&lt;br /&gt;
| SwingDoor&lt;br /&gt;
|rowspan=2| Locked&lt;br /&gt;
|rowspan=2| Unlocked&lt;br /&gt;
|-&lt;br /&gt;
| Chest&lt;br /&gt;
|-&lt;br /&gt;
| Button || Switched on || Switched off&lt;br /&gt;
|-&lt;br /&gt;
| Lever&lt;br /&gt;
|rowspan=2| Unstuck&lt;br /&gt;
|rowspan=2| Stuck (at min)&lt;br /&gt;
|-&lt;br /&gt;
| Wheel&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asMainEntity'' - The entity that causes the change; can be a Lever, Wheel, Button, or Photocell&lt;br /&gt;
#''asConnectEntity'' - The entity that is affected by the change&lt;br /&gt;
#''abInvertStateSent'' - If the state is inverted, making the connected entity change to the opposite state&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
#''asCallbackFunc'' - The name of the connection callback&lt;br /&gt;
&lt;br /&gt;
Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asConnectionName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, int alState)&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;alState is what is sent to connection entity and will be inverted if abInvertStateSent = true!&lt;br /&gt;
&lt;br /&gt;
====Lamps====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLampLit(string &amp;amp;in asName, bool abLit, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Turns a lamp on or off.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the lamp&lt;br /&gt;
#''abLit ''- Set true if you want the lamp to be lit, set to false if you want the lamp to be unlit&lt;br /&gt;
#''abEffects ''- If you want to have the lamp fade in/out when it gets lit/unlit&lt;br /&gt;
&lt;br /&gt;
====Doors====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorLocked(string &amp;amp;in asName, bool abLocked, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abLocked'' - Locked/unlocked&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is locked/unlocked&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorClosed(string &amp;amp;in asName, bool abClosed, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abClosed'' - Closed/open&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is closed/opened&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
bool GetSwingDoorLocked(string &amp;amp;in asName);&lt;br /&gt;
bool GetSwingDoorClosed(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a swing door is locked/closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorDisableAutoClose(string &amp;amp;in asName, bool abDisableAutoClose);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deactivates the &amp;quot;auto-close&amp;quot; when a door is nearly closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetSwingDoorState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns an integer depending on how far the door is opened. &amp;lt;br /&amp;gt;-1 = angle is close to 0°, 1 = angle is 70% or higher of max, 0 = inbetween -1 and 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLocked(string &amp;amp;in asName, bool abLocked);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a level door. Note that level doors are NOT swing doors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedSound(string &amp;amp;in asName, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which sound is played when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedText(string &amp;amp;in asName, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectState(string &amp;amp;in asName, float afState);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween (and above, for example, the bridge_metal_vert) are valid too!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectStateExt(string &amp;amp;in asName, float afState, float afAcc, float afMaxSpeed, float afSlowdownDist, bool abResetSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state, extended method.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween are valid too!&lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afMaxSpeed ''- maximum speed&lt;br /&gt;
#''afSlowdownDist ''- Distance to the target state before deceleration occurs.&lt;br /&gt;
#''abResetSpeed ''- Set to ''true'' if the prop's speed should be reset before performing the movement, else the prop will accelerate from its current speed to afMaxSpeed.&lt;br /&gt;
&lt;br /&gt;
====Levers, wheels and buttons====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropObjectStuckState(string &amp;amp;in asName, int alState);&lt;br /&gt;
void SetWheelStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
void SetLeverStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes an object/wheel/lever stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name&lt;br /&gt;
#''alState'' - 0 = not stuck, 1 = at max, -1 = at min &lt;br /&gt;
#''abEffects'' - play sound effects&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelAngle(string &amp;amp;in asName, float afAngle, bool abAutoMove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves a wheel to a certain angle.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name&lt;br /&gt;
#''afAngle'' - angle&lt;br /&gt;
#''abAutoMove'' - true: wheel physically moves to the new angle; false: angle is changed without moving the wheel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
void SetLeverInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to make a wheel/lever unstuck when interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetLeverState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the state of the lever. &amp;lt;br /&amp;gt;0 = not stuck, 1 = at max, -1 = at min&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderStuckState(string &amp;amp;in asName, int alStuckState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes a MultiSlider stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when state changes. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetButtonSwitchedOn(string &amp;amp;in asName, bool abSwitchedOn, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Sticky areas====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetAllowStickyAreaAttachment(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows entities to stick to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asProp);&lt;br /&gt;
void AttachBodyToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asBody);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop/body to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void DetachFromStickyArea(string &amp;amp;in asAreaName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches everything from a StickyArea.&lt;br /&gt;
&lt;br /&gt;
====NPCs====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCAwake(string &amp;amp;in asName, bool abAwake, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wakes/sleeps a NPC.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the NPC&lt;br /&gt;
#''abAwake'' - ''true'' to awaken, ''false'' to sleep&lt;br /&gt;
#''abEffects'' - Play the &amp;quot;Awake&amp;quot; or &amp;quot;Sleep&amp;quot; animations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCFollowPlayer(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a NPC's head to follow the player's movements.&lt;br /&gt;
&lt;br /&gt;
====Enemies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables an enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyIsHallucination(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes an enemy a hallucination. Hallucinations fade to smoke when they get near the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void FadeEnemyToSmoke(string &amp;amp;in asName, bool abPlaySound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly fades an enemy to smoke.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ShowEnemyPlayerPosition(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the enemy run to the player, no matter where he is.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AlertEnemyOfPlayerPresence(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gives the specified enemy the player's current position and makes it search the area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisableTriggers(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables or disables enemy triggers. If disabled, enemy will not react to player or attack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddEnemyPatrolNode(string &amp;amp;in asName, string &amp;amp;in asNodeName, float afWaitTime, string &amp;amp;in asAnimation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a patrol node to the enemy's path.&lt;br /&gt;
&lt;br /&gt;
#''asName''- Internal name of the enemy &lt;br /&gt;
#''asNodeName'' - Path node &lt;br /&gt;
#''afWaitTime'' - Time in seconds that the enemy waits at the path node before continuing. If 0, randomized between 1-3.&lt;br /&gt;
#''asAnimation'' - The animation the enemy uses when reaching the path node&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ClearEnemyPatrolNodes(string &amp;amp;in asEnemyName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the current path of patrol nodes of the enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemySanityDecreaseActive(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether an enemy activates the player's sanity drain when stared at.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy &lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToNode(string &amp;amp;in asEnemyName, string &amp;amp;in asNodeName, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific PathNode.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asNodeName'' - Internal name of the node to teleport to &lt;br /&gt;
#''abChangeY'' - Whether the Y position of the node will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToEntity(string &amp;amp;in asEnemyName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBody, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific entity.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asTargetEntity'' - Internal name of the entity to teleport to&lt;br /&gt;
#''asTargetBody'' - Internal name of the entity's body name to teleport to. If empty, the first body will be used (might be unstable, recommended to input a body anyway)&lt;br /&gt;
#''abChangeY'' - Whether the Y position of the entity will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeManPigPose(string &amp;amp;in asName, string &amp;amp;in asPoseType);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the pose a specified ManPig.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''asPoseType'' - Name of the ManPig pose to use. Can be &amp;quot;Biped&amp;quot; or &amp;quot;Quadruped&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigFadeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should fade the player's view in and out.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigSoundDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should play the proximity sounds.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigEasyEscapeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should be easier to escape from when hunted. If not disabled, easy escape is activated if the player is more than 12.35 meters away, the enemy can't see the player, and the player has less than 75 health. When this occurs, the enemy is forced to stop hunting and wait for half a second.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ForceTeslaPigSighting(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Forces a Tesla ManPig to be visible for a short time.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; GetEnemyStateName(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the name of the state a specified enemy is current in.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
Possible states for all enemies:&lt;br /&gt;
*Idle&lt;br /&gt;
*Wait&lt;br /&gt;
*Patrol&lt;br /&gt;
*Investigate&lt;br /&gt;
*Alert&lt;br /&gt;
*Search&lt;br /&gt;
*Hurt&lt;br /&gt;
*Hunt&lt;br /&gt;
*HuntPause&lt;br /&gt;
*HuntWander&lt;br /&gt;
*AttackMeleeShort&lt;br /&gt;
*AttackMeleeLong&lt;br /&gt;
*BreakDoor&lt;br /&gt;
*Dead&lt;br /&gt;
&lt;br /&gt;
Waterlurker-only states:&lt;br /&gt;
*GoHome&lt;br /&gt;
*Eat&lt;br /&gt;
&lt;br /&gt;
ManPig-only states: &lt;br /&gt;
*Flee&lt;br /&gt;
*Stalk&lt;br /&gt;
*Track&lt;br /&gt;
&lt;br /&gt;
Unused states:&lt;br /&gt;
*AttackRange&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=7025</id>
		<title>HPL2/Engine Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=7025"/>
		<updated>2025-10-16T18:41:48Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Props */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TocRight}}&lt;br /&gt;
&lt;br /&gt;
This page documents all scripts available in Amnesia: The Dark Descent.&lt;br /&gt;
&lt;br /&gt;
{{note|'''Note''': Some of the functions require the Amnesia 1.3 or 1.5 update. Steam and other online store copies should be automatically updated. Other copies can get 1.3 [http://www.frictionalgames.com/forum/thread-24334.html here].}}&lt;br /&gt;
&lt;br /&gt;
== Directives ==&lt;br /&gt;
&lt;br /&gt;
First off, &amp;lt;code&amp;gt;#include &amp;quot;file.hps&amp;quot;&amp;lt;/code&amp;gt; can be used to programmatically merge together multiple separate files to make organizing scripts easier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
==Engine scripts==&lt;br /&gt;
===Main===&lt;br /&gt;
&lt;br /&gt;
The following functions are the main hps functions that the HPL2 engine looks to run on certain events - similar to the C++ int main() function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void OnStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the map is loaded for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnEnter();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs whenever the player enters a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnLeave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the player leaves a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnGameStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is found in the global.hps file and the inventory.hps file, and is run when the game is first started by the player (ie via &amp;quot;Start New Game&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnUpdate(float afStep);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
This function is executed for every game update or &amp;quot;tick&amp;quot;. Can be used for rapid-firing updates instead of looping timers. Keep in mind that this can affect game performance if not used with care.&lt;br /&gt;
&lt;br /&gt;
#''afStep''- Time elapsed in seconds since the last frame. Multiply speeds, distances etc. by this argument to avoid framerate dependence issues (for example: if you move something in this function with constant speed, it will move faster on computers which run the game with high FPS and slower on computers with low FPS).&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float RandFloat(float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random float.&lt;br /&gt;
&lt;br /&gt;
#''afMin ''- minimum value&lt;br /&gt;
#''afMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int RandInt(int alMin, int alMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random int. Note: the maximum value is ''inclusive''  - the RandInt() function may return this value.&lt;br /&gt;
&lt;br /&gt;
#''alMin ''- minimum value&lt;br /&gt;
#''alMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringContains(string &amp;amp;in asString, string &amp;amp;in asSubString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a string contains the specified string. &amp;lt;br /&amp;gt;Example: searching for &amp;quot;hello&amp;quot; in &amp;quot;hello world&amp;quot; would return '''true'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to check&lt;br /&gt;
#''asSubString ''- the string to search for&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; StringSub(string &amp;amp;in asString, int alStart, int alCount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the substring in a string. &amp;lt;br /&amp;gt;Example: in the string &amp;quot;frictional games rocks&amp;quot;, using 4 as ''alStart''  and 6 as ''alCount''  would return '''&amp;quot;tional&amp;quot;'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string&lt;br /&gt;
#''alStart ''- starting character of the string, with 0 being the first character&lt;br /&gt;
#''alCount ''- amount of characters&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int StringToInt(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns an integer converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float StringToFloat(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a float converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringToBool(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a boolean converted from a string, else returns false.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&lt;br /&gt;
===Mathematical Operations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathCos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathTan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAsin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAcos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan2(float afX, float afY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Calculates and returns the arc tangent of the specified values.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - First value to operate.&lt;br /&gt;
#''afY''  - Second value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSqrt(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the square root of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathPow(float afBase, float afExp);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the value of afBase raised to the power of afExp.&lt;br /&gt;
&lt;br /&gt;
#''afBase''  - The base value.&lt;br /&gt;
#''afExp''  - Value to calculate the base with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMin(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the lowest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMax(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the highest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathClamp(float afX, float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns afX clamped between afMin and afMax. If afX &amp;lt; afMin, returns afMin, and if afX &amp;gt; afMax, returns afMax.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - The value to clamp.&lt;br /&gt;
#''afMin''  - The minimum value to clamp afX with.&lt;br /&gt;
#''afMax''  - The maximum value to clamp afX with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAbs(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the absolute value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&lt;br /&gt;
===Debugging===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void Print(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a string to the log file (''hpl.log'').&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDebugMessage(string &amp;amp;in asString, bool abCheckForDuplicates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a line of text to the debug console at the bottom left of the screen. Debug mode must be enabled for the console messages to be visible.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to print&lt;br /&gt;
#''abCheckForDuplicates ''- if true, the string won't be printed more than once on screen until it disappears&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ProgLog(string &amp;amp;in asLevel, string &amp;amp;in asMessage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints an entry to the ProgLog (progression log). &amp;lt;br /&amp;gt;ProgLog is a file created in Documents/Amnesia/main (or an FC folder if one is being used). It logs certain events, such us opening the menu or picking up the lantern, as well as the player's state (Health, Sanity, Oil, Tinderboxes, Coins), for the purpose of documenting a tester's playstyle. &amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt;This function allows to log custom messages.The messages in the ProgLog file are sorted by time elapsed since a map was loaded.&lt;br /&gt;
&lt;br /&gt;
ProgLog has to be enabled for a player profile in ''user_settings.cfg''  before it starts working.&lt;br /&gt;
&lt;br /&gt;
#''asLevel ''- can be &amp;quot;Low&amp;quot;, &amp;quot;Medium&amp;quot; or &amp;quot;High&amp;quot;. It's a tag which appears in each log entry, for event prioritising.&lt;br /&gt;
#''asMessage ''- The custom message to be printed to the log.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool ScriptDebugOn();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the debug mode is enabled. &amp;lt;br /&amp;gt;See [[HPL2/Development_Environment|&amp;quot;Setting up Development Environment&amp;quot;]] to setup debug mode on your own computer.&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
{{warning|Regular variables (int, float, etc.) are '''not''' saved by the game. Using them in important parts of yor script will break it upon loading a game save. In HPL, those variables should only be used for disposable counters, like spawning objects in a &amp;quot;for&amp;quot; loop. For variables which need to be saved, use the wrappers as described below.}}&lt;br /&gt;
&lt;br /&gt;
====Local====&lt;br /&gt;
&lt;br /&gt;
Local variables can be used throughout the same script file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetLocalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetLocalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddLocalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetLocalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Global====&lt;br /&gt;
&lt;br /&gt;
Global variables can be used throughout several maps and can be accessed by several script files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetGlobalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetGlobalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddGlobalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetGlobalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Particle Systems===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadParticleSystem(string &amp;amp;in asPSFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asPSFile''  - The particle system file to load. Extension: .ps&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntity(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntityExt(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS,&lt;br /&gt;
float afR, float afG, float afB, float afA, bool abFadeAtDistance, float afFadeMinEnd, float afFadeMinStart,&lt;br /&gt;
float afFadeMaxStart, float afFadeMaxEnd);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity, extended method with more options.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''abFadeAtDistance ''- determines whether a particle system fades from a certain distance on&lt;br /&gt;
#''afFadeMinEnd ''- minimum distance at which the particle system stops fading&lt;br /&gt;
#''afFadeMinStart ''- minimum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxStart ''- maximum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxEnd ''- maximum distance at which the particle system stops fading&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DestroyParticleSystem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Destroys a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - The internal name of the particle system&lt;br /&gt;
&lt;br /&gt;
===Sounds &amp;amp; Music===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadSound(string &amp;amp;in asSoundFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile''  - The sound file to load (extension .snt optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayGuiSound(string &amp;amp;in asSoundFile, float afVolume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays a sound, not using 3D.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile ''- the sound to play (extension .snt/.ogg optional)&lt;br /&gt;
#''afVolume ''- the volume of the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaySoundAtEntity(string &amp;amp;in asSoundName, string &amp;amp;in asSoundFile, string &amp;amp;in asEntity, float afFadeTime, bool abSaveSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a sound at an entity.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''asSoundFile ''- the sound to use (extension .snt optional)&lt;br /&gt;
#''asEntity ''- the entity to create the sound at. Using &amp;quot;Player&amp;quot; is effectively the same as &amp;lt;code&amp;gt;PlayGuiSound&amp;lt;/code&amp;gt;, yet this function allows a looping sound to be saved&lt;br /&gt;
#''afFadeTime ''- time in seconds the sound needs to fade. Avoids enemies hearing the sound if afFadeTime is at least 0.1f&lt;br /&gt;
#''abSaveSound ''- if ''true'', a looping sound will &amp;quot;remember&amp;quot; its playback state (currently playing/stopped), and that state will be restored the next time the level is entered. If ''true'', the sound is never attached to the entity! Note that saving should only be used on ''looping sounds''!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeInSound(string &amp;amp;in asSoundName, float afFadeTime, bool abPlayStart);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades in a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds&lt;br /&gt;
#''abPlayStart ''- Play the sound defined in the &amp;lt;code&amp;gt;&amp;lt;Start&amp;gt;&amp;lt;/code&amp;gt; section of the .snt before playing the main sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopSound(string &amp;amp;in asSoundName, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades out a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds, use 0 to immediately stop the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayMusic(string &amp;amp;in asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays music.&lt;br /&gt;
&lt;br /&gt;
#''asMusicFile ''- the music file to play (extension .ogg optional)&lt;br /&gt;
#''abLoop ''- determines whether a music track should loop&lt;br /&gt;
#''afVolume ''- volume of the music&lt;br /&gt;
#''afFadeTime ''- time in seconds until music reaches full volume&lt;br /&gt;
#''alPrio ''- priority of the music. Note that only the music with the highest priority can be heard! 0 - lowest, 1 - higher, etc.&lt;br /&gt;
#''abResume''  - if ''true'', playback will be continued from where the track stopped after the call to &amp;lt;code&amp;gt;StopMusic()&amp;lt;/code&amp;gt;. If ''false'', the track will be restarted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopMusic(float afFadeTime, int alPrio);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops music.&lt;br /&gt;
&lt;br /&gt;
#''afFadeTime ''- time in seconds until music stops&lt;br /&gt;
#''alPrio ''- the priority of the music that should stop&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice(string &amp;amp;in asVoiceFile, string &amp;amp;in asEffectFile, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry,&lt;br /&gt;
bool abUsePosition, string &amp;amp;in asPosEntity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This adds a voice and an additional sound effect to be played. It is okay to call this many times in order to play many voices in a row. The EffectVoiceOverCallback is not called until ALL voices have finished.&lt;br /&gt;
&lt;br /&gt;
#''asVoiceFile ''- the voice to play&lt;br /&gt;
#''asEffectFile ''- the sound effect to play&lt;br /&gt;
#''asTextCat ''- the category in the .lang file, usually &amp;quot;Voice&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''abUsePosition ''- plays using 3D from the entity, or without 3D&lt;br /&gt;
#''asPosEntity ''- the entity at which the voice and sound are played from&lt;br /&gt;
#''afMinDistance ''- minimum distance the voice and sound are heard&lt;br /&gt;
#''afMaxDistance ''- maximum distance the voice and sound are heard&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopAllEffectVoices(float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all voices and calls the EffectVoiceOverCallback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEffectVoiceActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether EffectVoices are still active.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetEffectVoiceOverCallback(string &amp;amp;in asFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to be called when the EffectVoices are finished. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundVolume(float afDestVolume, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound volume, that means everything you can hear '''from the world'''. This does not affect music of GUI sounds.&lt;br /&gt;
&lt;br /&gt;
#''afDestVolume ''- desired volume&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired volume&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundSpeed(float afDestSpeed, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound speed.&lt;br /&gt;
&lt;br /&gt;
#''afDestSpeed ''- desired speed&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired speed&lt;br /&gt;
&lt;br /&gt;
===Lights===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightVisible(string &amp;amp;in asLightName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables lights.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''abVisible ''- determines the state of the light&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeLightTo(string &amp;amp;in asLightName, float afR, float afG, float afB, float afA, float afRadius, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the properties of a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''afRadius ''- radius of the light. -1 means keeping the radius&lt;br /&gt;
#''afTime ''- time in seconds until change is done&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightFlickerActive(string &amp;amp;in asLightName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates flickering on a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName'' - The internal light name&lt;br /&gt;
#''abActive'' - true = active, false = inactive&lt;br /&gt;
&lt;br /&gt;
==Game scripts==&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartCredits(string &amp;amp;in asMusic, bool abLoopMusic, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alEndNum);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts the end credits screen.&lt;br /&gt;
&lt;br /&gt;
#''asMusic ''- the music to play (including .ogg)&lt;br /&gt;
#''abLoopMusic ''- determines whether the music should loop&lt;br /&gt;
#''asTextCat ''- the category to be used in the .lang file, usually &amp;quot;Ending&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alEndNum ''- Amnesia has 3 different endings and displays a code at the bottom. Determines which code is displayed. 0-2 will display codes, any other integer will not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartDemoEnd();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shows the demo end screen. The background and UI elements are defined in demo.cfg, with the text using the entries in the &amp;quot;Demo&amp;quot; category of the .lang file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AutoSave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an auto save file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CheckPoint(string &amp;amp;in asName, string &amp;amp;in asStartPos, string &amp;amp;in asCallback, string &amp;amp;in asDeathHintCat, string &amp;amp;in asDeathHintEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a checkpoint at which the player will respawn in case he dies. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asName, int alCount)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;Count is 0 on the first checkpoint load!&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the editor&lt;br /&gt;
#''asCallback ''- the function to call when the player dies/respawns&lt;br /&gt;
#''asDeathHintCat ''- the category of the death hint message to be used in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asDeathHintEntry ''- the entry in the .lang file&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeMap(string &amp;amp;in asMapName, string &amp;amp;in asStartPos, string &amp;amp;in asStartSound, string &amp;amp;in asEndSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Loads another map after a 1.5 second fade out.&lt;br /&gt;
&lt;br /&gt;
#''asMapName ''- the file to load&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the next map&lt;br /&gt;
#''asStartSound ''- the sound that is played when the change starts&lt;br /&gt;
#''asEndSound ''- the sound that is played when the new map is loaded&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ClearSavedMaps();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the &amp;quot;history&amp;quot; of the save, useful to do when you know the player will not be able to go back anymore. Makes the next save much smaller in size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateDataCache();&lt;br /&gt;
void DestroyDataCache();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This caches all current textures and models and they are not released until destroy is called. If there is already cached data it is destroyed.&lt;br /&gt;
Create caches to enable faster loading when going back to a map. Destroy the cache if you know the player won't go back to that map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMapDisplayNameEntry(string &amp;amp;in asNameEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the map name shown in save file names. If none is set NULL is assumed.&lt;br /&gt;
&lt;br /&gt;
#''asNameEntry ''- the entry to display, category must be &amp;quot;Levels&amp;quot;!&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the skybox.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxTexture(string &amp;amp;in asTexture);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the texture of the skybox.&lt;br /&gt;
&lt;br /&gt;
#''asTexture''  - The texture file to set. Extension: .dds&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the solid color of the skybox rather than a texture.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the global fog.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the color to use for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogProperties(float afStart, float afEnd, float afFalloffExp, bool abCulling);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the properties for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afStart ''- how many meters from the camera should the fog begin&lt;br /&gt;
#''afEnd ''- how many meters from the camera should the fog reach full thickness&lt;br /&gt;
#''afFalloffExp ''- the amount by which the thinkness increases&lt;br /&gt;
#''abCulling ''- whether occlusion culling is active for the fog; this prevents objects behind the fog from being loaded&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetupLoadScreen(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alRandomNum, string &amp;amp;in asImageFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which loading screen will be shown when changing maps.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category of the loading text in the .lang file to be shown on the loading screen, usually &amp;quot;LoadingText&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alRandomNum ''- if greater 1, then it will randomize between 1 and alRandom for each LoadScreen giving entry the suffix XX (eg 01). If &amp;lt; =1 then no suffix is added&lt;br /&gt;
#''asImageFile ''- the image to be shown (optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void UnlockAchievement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlocks the specified achievement. Only able to be used for the ending achievements.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the achievement. Only the following strings are valid:&lt;br /&gt;
::* Benefactor&lt;br /&gt;
::* Survivor&lt;br /&gt;
::* Sacrifice&lt;br /&gt;
::* Quitter&lt;br /&gt;
::* Egotist&lt;br /&gt;
::* Altruist&lt;br /&gt;
::* Vacillator&lt;br /&gt;
&lt;br /&gt;
===Game Timer===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddTimer(string &amp;amp;in asName, float afTime, string &amp;amp;in asFunction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a timer which calls a function when it expires. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asTimer)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the name of the timer&lt;br /&gt;
#''afTime ''- time in seconds&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveTimer(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a timer, no matter how much time is left.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the timer.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetTimerTimeLeft(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the time left on a timer.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - the internal name of the timer.&lt;br /&gt;
&lt;br /&gt;
===Screen Effects===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeOut(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to black.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen is completly black&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeIn(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen back to normal.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeImageTrailTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies the image trail effect to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeSepiaColorTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the screen go dark red.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0) &lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeRadialBlurTo(float afSize, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies radial blur effects to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afSize ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetRadialBlurStartDist(float afStartDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines at which distance the radial blur effects appear.&lt;br /&gt;
&lt;br /&gt;
#''afStartDist ''- the distance at which the effect starts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectFlash(float afFadeIn, float afWhite, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white.&lt;br /&gt;
&lt;br /&gt;
#''afFadeIn ''- time in seconds until screen is white&lt;br /&gt;
#''afWhite ''- determines to which percentage the screen fades to white (1.0 = completly white)&lt;br /&gt;
#''afFadeOut ''- time in seconds until screen is back to normal again&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectEmotionFlash(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white and shows a text message.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''asSound ''- the sound to play while fading&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetFlashbackIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a flashback is still in effect.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerSpawnPS(string &amp;amp;in asSPSFile);&lt;br /&gt;
void StopPlayerSpawnPS();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Continuously spawn regular particle systems (''.ps'') around the player. Particles created by this script carry over from map to map.&lt;br /&gt;
&lt;br /&gt;
#''asSPSFile''  - the ''.sps''  file to use. Example ''.sps''  files are located in the ''/misc''  folder in the main game directory.&amp;lt;br&amp;gt;Custom ''.sps''  files can be created by hand in a text editor (see existing ones and mimic how those are written). &amp;lt;br /&amp;gt;Since ''StopPlayerSpawnPS()''  doesn't seem to work, to stop an SPS you must create an ''.sps''  file with an empty particle field field and override the old SPS by calling ''StartPlayerSpawnPS''  again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shakes the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity of the shake&lt;br /&gt;
#''afTime ''- duration of the shake&lt;br /&gt;
#''afFadeInTime ''- time in seconds until full intensity is reached&lt;br /&gt;
#''afFadeOutTime ''- time until screen is back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInDarknessEffectsActive(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the sanity drain and night vision effects while in the darkness.&lt;br /&gt;
&lt;br /&gt;
''bool abX''  - Enable/disable effects.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowScreenImage(string &amp;amp;in asImageName, float afX, float afY, float afScale, bool abUseRelativeCoordinates, float afDuration, float afFadeIn, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
Displays an image file directly onto the screen. See [[HPL2/Tutorials/ShowScreenImage()|ShowScreenImage()]] in the tutorials section for more information.&lt;br /&gt;
&lt;br /&gt;
# ''asImageName'' - The image file to render (.jpg, .png, .tga, .dds)&lt;br /&gt;
# ''afX'' - The X position of the image&lt;br /&gt;
# ''afY'' - The Y position of the image&lt;br /&gt;
# ''afScale'' - The size of the image in pixels (not scale), or original image size if negative&lt;br /&gt;
# ''abUseRelativeCoordinates'' - Whether X and Y are relative to the screen resoltion, or pixel co-ordinates if not&lt;br /&gt;
# ''afDuration'' - The duration that the image is displayed for&lt;br /&gt;
# ''afFadeIn'' - The time, in seconds, to fade in the image&lt;br /&gt;
# ''afFadeOut'' - The time, in seconds, to fade out the image&lt;br /&gt;
&lt;br /&gt;
===Insanity===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInsanitySetEnabled(string &amp;amp;in asSet, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which InsanitySets are enabled.&lt;br /&gt;
&lt;br /&gt;
#''asSet ''- the set&lt;br /&gt;
#''abX ''- enabled or not&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartInsanityEvent(string &amp;amp;in asEventName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Starts a specified insanity event.&lt;br /&gt;
&lt;br /&gt;
#''asEventName ''- Insanity event to play.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartRandomInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts a random insanity event from the available sets.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopCurrentInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Stops the currently playing insanity event.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void InsanityEventIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an insanity event is currently in effect.&amp;lt;br&amp;gt;Not useful at all due to having a return type of &amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; when it should be &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Player===&lt;br /&gt;
&lt;br /&gt;
Note that the player's maximum health and sanity is 100.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enabled/Disable player controlled movement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangePlayerStateToNormal();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets the player's state, forcing them to stop interacting with objects. It also clears the inventory item to be used (as if it was double-clicked on in the inventory again) and dismounts the player from ladders.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerCrouching(bool abCrouch);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddPlayerBodyForce(float afX, float afY, float afZ, bool abUseLocalCoords);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pushes the player into a certain direction. Note that you need values above ~2000 to see any effects.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - amount along the X-axis&lt;br /&gt;
#''afY'' - amount along the Y-axis&lt;br /&gt;
#''afZ'' - amount along the Z-axis&lt;br /&gt;
#''abUseLocalCoords'' - If true, axes are based on where the player is facing, not the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowPlayerCrossHairIcons(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the icons when a player has something in focus.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerSanity(float afSanity);&lt;br /&gt;
void AddPlayerSanity(float afSanity);&lt;br /&gt;
float GetPlayerSanity();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerHealth(float afHealth);&lt;br /&gt;
void AddPlayerHealth(float afHealth);&lt;br /&gt;
float GetPlayerHealth();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerLampOil(float afOil);&lt;br /&gt;
void AddPlayerLampOil(float afOil);&lt;br /&gt;
float GetPlayerLampOil();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the lamp oil of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerSpeed();&lt;br /&gt;
float GetPlayerYSpeed();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current speed of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSanityDrainDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables sanity drain from darkness.&lt;br /&gt;
{{bug|Sanity drain is reenabled on loading a save, as the game is unable to load the value properly from the save data.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoost();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a large amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! New Sanity&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || 100&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || 90&lt;br /&gt;
|-&lt;br /&gt;
| 50-74 || 80&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoostSmall();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a small amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! Sanity Bonus&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || +20&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || +15&lt;br /&gt;
|-&lt;br /&gt;
| 50-75 || +10&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityDamage(float afAmount, bool abUseEffect);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount'' - amount of sanity damage done&lt;br /&gt;
#''abUseEffect'' - if a sound is played and screen effects are shown when the sanity damage is dealt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GivePlayerDamage(float afAmount, string &amp;amp;in asType, bool abSpinHead, bool abLethal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the health of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount'' - amount of damage done to health&lt;br /&gt;
#''asType'' - plays a certain effect on the screen when the damage is dealt (BloodSplat, Claws, or Slash) &lt;br /&gt;
#''abSpinHead'' - changes the camera view when damage is dealt&lt;br /&gt;
#''abLethal'' - set to true if player can die from given damage. If ''false'' and the damage would have left the player with less than 10 health, health is set to 10.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerFOVMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the field of view of the player. A shorter FOV will create a zoom effect.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - multiplier of default FOV (1 is default)&lt;br /&gt;
#''afSpeed'' - the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerAspectMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the aspect ratio of the player. Basically stretches or narrows the screen horizontally.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - multiplier of default aspect (default is 1)&lt;br /&gt;
#''afSpeed'' - the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - angle of rotation of head, positive being counter-clockwise&lt;br /&gt;
#''afSpeedMul'' - speed (possibly acceleration) multiplier of the rotation (default 1, which is really slow)&lt;br /&gt;
#''afMaxSpeed'' - maximum speed of rotation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerForward(float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Moves the player forward. It needs to be called in a timer that updates 60 times / second.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- amount along the X-axis&lt;br /&gt;
#''afY ''- amount along the Y-axis&lt;br /&gt;
#''afZ ''- amount along the Z-axis&lt;br /&gt;
#''afSpeed ''- speed at which the change happens&lt;br /&gt;
#''afSlowDownDist ''- distance at which to start slowing down (prevents the head from abruptly stopping)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerLookAt(string &amp;amp;in asEntityName, float afSpeedMul, float afMaxSpeed, string &amp;amp;in asAtTargetCallback);&lt;br /&gt;
void StopPlayerLookAt();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to look at a certain entity until StopPlayerLookAt is used.&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- the entity to look at &lt;br /&gt;
#''afSpeedMul ''- how fast should the player look at the entity&lt;br /&gt;
#''afMaxSpeed ''- maximum speed allowed&lt;br /&gt;
#''asAtTargetCallback ''- function to call when player looks at target&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerMoveSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerRunSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerLookSpeedMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the player's move/run/look speed. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpForceMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the player's jump multiplier. Higher values = higher jumps. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpDisabled(bool abX);&lt;br /&gt;
void SetPlayerCrouchDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to jump/crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportPlayer(string &amp;amp;in asStartPosName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly teleports the player to the target StartPos.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternActive(bool abX, bool abUseEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the player use his lantern.&lt;br /&gt;
&lt;br /&gt;
# ''abX'' - Set lantern to be active (true) or inactive (false)&lt;br /&gt;
# ''abUseEffects'' - Play on/off sounds&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetLanternActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player is currently using the lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to use the lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternLitCallback(string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to call when the player uses the lantern. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;MyFunc(bool abLit)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message on the screen.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory'' - the category in the .lang file&lt;br /&gt;
#''asTextEntry'' - the entry in the .lang file&lt;br /&gt;
#''afTime'' - determines how long the message is displayed. If time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetDeathHint(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the message that appears when the player dies.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory'' - the category in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asTextEntry'' - the entry in the .lang file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DisableDeathStartSound();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the death sound when the player dies. This must be called directly before player is killed! The variable as soon as player dies too.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPermaDeathSound(string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Sets the sound played after the player dies when permadeath is active. Permadeath is only active when the game is launched with the &amp;lt;code&amp;gt;ptest&amp;lt;/code&amp;gt; command line parameter. Only used for the post-death Suitor lines in ''Justine''.&lt;br /&gt;
&lt;br /&gt;
#''asSound'' - The sound to be played after death. Expects a voice-type sound.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerFallDamageDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the player's ability to take fall damage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPos(float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the player's position within the level.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - X co-ordinate position.&lt;br /&gt;
#''afY'' - Y co-ordinate position.&lt;br /&gt;
#''afZ'' - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerPosX();&lt;br /&gt;
float GetPlayerPosY();&lt;br /&gt;
float GetPlayerPosZ();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the player's position within the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
===Journal===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddNote(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a note to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _Name and _Text and be in category &amp;quot;Journal&amp;quot;!&lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDiary(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a diary to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _NameX and _TextY whereas X and Y are numbers of the parts (_Name1: first diary, _Text1: first page) and be in category &amp;quot;Journal&amp;quot;! &lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ReturnOpenJournal(bool abOpenJournal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Only called in the pickup diary callback! If true the journal displays the entry else not.&lt;br /&gt;
&lt;br /&gt;
===Quests===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a quest to the player's journal under mementos. Completed quests cannot be readded.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name to be used&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot;Quest_&amp;lt;texthere&amp;gt;_Text”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CompleteQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Completes a quest. If the quest has not been added, it's marked as complete anyway, preventing it from being added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot; Quest_&amp;lt;texthere&amp;gt;_Text ”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool QuestIsCompleted(string &amp;amp;in asName);&lt;br /&gt;
bool QuestIsAdded(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a quest is completed/added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetNumberOfQuestsInMap(int alNumberOfQuests);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the number of quests in the map. Obsolete; formerly used to calculate a completion percentage when looking at a level door.&lt;br /&gt;
&lt;br /&gt;
#''alNumberOfQuests ''- Amount of quests&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveHint(string &amp;amp;in asName, string &amp;amp;in asMessageCat, string &amp;amp;in asMessageEntry, float afTimeShown);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a hint on the player's screen.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asMessageCat ''- the category in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asMessageEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTimeShown ''- time in seconds until the message disappears. If time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void BlockHint(string &amp;amp;in asName);&lt;br /&gt;
void UnBlockHint(string &amp;amp;in asName);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Blocking a hint prevents it from being shown. Blocked hints are included in savefiles, so they should persist between levels. Unblocking a hint allows it to be shown.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; blocks the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveHint(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes the hint from the list of already shown hints, allowing it to appear again.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; reenables the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
===Inventory===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ExitInventory();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Exits the inventory by force.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the player's ability to open his inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a message on the inventory screen. Used for feedback messages when failing to combine items.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory ''- the category in the .lang file, usually &amp;quot;Inventory&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTime ''- time in seconds until the message disappears. If life time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItem(string &amp;amp;in asName, string &amp;amp;in asType, string &amp;amp;in asSubTypeName, string &amp;amp;in asImageName, float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds an item to the inventory of the player. Note that the item does not have to exist as entity in the world to be able to do this.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asType ''- item type to give, Available types are:&lt;br /&gt;
::*Puzzle&lt;br /&gt;
::*Lantern&lt;br /&gt;
::*Health&lt;br /&gt;
::*Sanity&lt;br /&gt;
::*LampOil&lt;br /&gt;
::*Tinderbox&lt;br /&gt;
#''asSubTypeName ''- item name for .lang file&lt;br /&gt;
#''asImageName ''- the image which will appear in inventory. For example: &amp;lt;code&amp;gt;void GiveItem(&amp;quot;chemical_container_full_1&amp;quot;, &amp;quot;Puzzle&amp;quot;, &amp;quot;chemical_container_full&amp;quot;, &amp;quot;chemical_container_full.tga&amp;quot;, 1);&amp;lt;/code&amp;gt; will use the image from &amp;lt;code&amp;gt;graphics/item/chemical_container_full.tga&amp;lt;/code&amp;gt; &lt;br /&gt;
#''afAmount ''- amount the item gives, - For example: Oil potions will fill the oil meter by this amount, Health potions will heal by this amount, etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item from the player's inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool HasItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player has an item in his inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItemFromFile(string &amp;amp;in asName, string &amp;amp;in asFileName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a single item to the player's inventory. This is meant to be used for debug mostly as it creates the actual item and then destroys it.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asFileName ''- item to give + extension (.ent)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddCombineCallback(string &amp;amp;in asName, string &amp;amp;in asItemA, string &amp;amp;in asItemB, string &amp;amp;in asFunction, bool abAutoRemove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to combine items in his inventory. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItemA, string &amp;amp;in asItemB)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name for the callback&lt;br /&gt;
#''asItemA ''- internal name of first item&lt;br /&gt;
#''asItemB ''- internal name of second item&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
#''abAutoRemove ''- determines whether the callback should be removed when the items are combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveCombineCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a combine callback.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the callback to be removed (as specified in AddCombineCallback)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddUseItemCallback(string &amp;amp;in asName, string &amp;amp;in asItem, string &amp;amp;in asEntity, string &amp;amp;in asFunction, bool abAutoDestroy);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to use items on the world. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItem, string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
#''asItem ''- internal name of the item&lt;br /&gt;
#''asEntity ''- entity to be able to use the item on&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abAutoDestroy ''- determines whether the callback should be removed when the item is used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveUseItemCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item callback.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
&lt;br /&gt;
===Entities===&lt;br /&gt;
&lt;br /&gt;
====General====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityActive(string &amp;amp;in asName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityVisible(string &amp;amp;in asName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity's visual mesh. The collision body remains.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the entity.&lt;br /&gt;
#''abActive''  - Activate/deactivate mesh.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntityExists(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an entity exists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCustomFocusCrossHair(string &amp;amp;in asName, string&amp;amp; asCrossHair);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the crosshair that is used when focusing an entity.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCrossHair ''- desired crosshair, can be: &lt;br /&gt;
::*Default (no crosshair)&lt;br /&gt;
::*Grab&lt;br /&gt;
::*Push&lt;br /&gt;
::*Ignite&lt;br /&gt;
::*Pick&lt;br /&gt;
::*LevelDoor&lt;br /&gt;
::*Ladder&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void CreateEntityAtArea(string &amp;amp;in asEntityName, string &amp;amp;in asEntityFile, string &amp;amp;in asAreaName, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an entity at an area. When creating an enemy though, it cannot chase properly along PathNodes (using for example &amp;lt;code&amp;gt;ShowEnemyPlayerPosition&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- internal name&lt;br /&gt;
#''asEntityFile ''- entity to be used extension .ent&lt;br /&gt;
#''asAreaName ''- the area to create the entity at&lt;br /&gt;
#''abFullGameSave ''- determines whether an entity &amp;quot;remembers&amp;quot; its state&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ReplaceEntity(string &amp;amp;in asName, string &amp;amp;in asBodyName, string &amp;amp;in asNewEntityName, string &amp;amp;in asNewEntityFile, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Removes an entity and places a new one in its place.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to replace.&lt;br /&gt;
#''asBodyName'' - Name of the body of the entity to place the new entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''asNewEntityName'' - Name of the new entity.&lt;br /&gt;
#''asNewEntityFile'' - Name of the new entity file. Extension .ent. &lt;br /&gt;
#''abFullGameSave'' - Whether ALL properties of this entity should be saved throughout levels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaceEntityAtEntity(string &amp;amp;in asName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBodyName, bool abUseRotation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Places an entity at the position of another entity. Does not work for enemies, use TeleportEnemyToEntity instead.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to place.&lt;br /&gt;
#''asTargetEntity'' - Name of the other entity to place the first entity at.&lt;br /&gt;
#''asTargetBodyName'' - Name of the body of the entity to place the first entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''abUseRotation'' - Whether the entity should be rotated like the target entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPos(string &amp;amp;in asName, float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Moves an entity to a position in the level.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to move.&lt;br /&gt;
#''afX'' - X co-ordinate position.&lt;br /&gt;
#''afY'' - Y co-ordinate position.&lt;br /&gt;
#''afZ'' - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetEntityPosX(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosY(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosZ(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns an entity's position in the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerLookAtCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveWhenLookedAt);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player looks at a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = looking, -1 = not looking&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveWhenLookedAt ''- determines whether the callback should be removed when the player looked at the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerInteractCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveOnInteraction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player interacts with a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveOnInteraction ''- determines whether the callback should be removed when the player interacts with the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCallbackFunc(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when certain events occur with an entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, string &amp;amp;in asType)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;asType&amp;lt;/code&amp;gt; values depend on entity type:&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! asType Value&lt;br /&gt;
|-&lt;br /&gt;
| Object || Break&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || OnIgnite&lt;br /&gt;
|-&lt;br /&gt;
| Item || OnPickup&lt;br /&gt;
|-&lt;br /&gt;
| Enemy || OnDeath&lt;br /&gt;
|-&lt;br /&gt;
| Enemy_Grunt&amp;lt;br&amp;gt;Enemy_Manpig || OnAutoDisabled&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityConnectionStateChangeCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A callback called when ever the connection state changes (button being switched on, lever switched, etc). &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void Func(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: -1 = off, 0 = between, 1 = on&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityInteractionDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disallows interaction with an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void BreakJoint (string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Breaks a joint. Do not use this on joints in SwingDoors, Levers, Wheels, etc. where the joint is part of an interaction. That will make the game crash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void AddEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName, string &amp;amp;in asFunction, bool abDeleteOnCollide, int alStates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when two entities collide. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asParent, string &amp;amp;in asChild, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = enter, -1 = leave&lt;br /&gt;
&lt;br /&gt;
#''asParentName ''- internal name of main object&lt;br /&gt;
#''asChildName ''- internal name of object that collides with main object (asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) NOT supported!)&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abDeleteOnCollide ''- determines whether the callback after it was called&lt;br /&gt;
#''alStates ''- 1 = only enter, -1 = only leave, 0 = both&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an EntityCollideCallback. Asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) not supported in ''asChildName''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntitiesCollide(string &amp;amp;in asEntityA, string &amp;amp;in asEntityB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether two entities collide. This function does NOT support asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) or &amp;quot;Player&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetBodyMass(string &amp;amp;in asName, float afMass);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName.&lt;br /&gt;
#''afMass''  - The mass to set.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetBodyMass(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName. &lt;br /&gt;
#''afMass''  - The mass to get.&lt;br /&gt;
&lt;br /&gt;
====Props====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropEffectActive(string &amp;amp;in asName, bool abActive, bool abFadeAndPlaySounds);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Turns the texture illumination, billboards, particles, light flicker, and sounds of a prop on or off.&lt;br /&gt;
&lt;br /&gt;
Can be used on coal to give it the black color it should have.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name &lt;br /&gt;
#''abActive'' - active state&lt;br /&gt;
#''abFadeAndPlaySounds'' - if all effects should fade in/out or not&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropActiveAndFade(string &amp;amp;in asName, bool abActive, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates a prop.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''abActive ''- nothing to add&lt;br /&gt;
#''afFadeTime ''- time in seconds until prop fully fades&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropStaticPhysics(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates the physics of a prop, setting the mass to 0. Setting as true will make entities static in midair.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetPropIsInteractedWith(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a prop is interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RotatePropToSpeed(string &amp;amp;in asName, float afAcc, float afGoalSpeed, float afAxisX, float afAxisY, float afAxisZ, bool abResetSpeed, string &amp;amp;in asOffsetArea);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the prop up to a set speed.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afGoalSpeed ''- desired speed &lt;br /&gt;
#''afAxisX ''- rotation around X axis&lt;br /&gt;
#''afAxisY ''- rotation around Y axis&lt;br /&gt;
#''afAxisZ ''- rotation around Z axis&lt;br /&gt;
#''abResetSpeed ''- determines whether the speed is resetted after goal speed is reached&lt;br /&gt;
#''asOffsetArea ''- the area to rotate around, if empty, then the center of the body is used Note: The entity you want to rotate MUST be a &amp;quot;StaticObject&amp;quot; entity!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void StopPropMovement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all movement of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddAttachedPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop.&lt;br /&gt;
&lt;br /&gt;
#''asPropName''- the prop to attach another prop at &lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop&lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach&lt;br /&gt;
&lt;br /&gt;
Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
{{bug|''afRotZ '' is used for both the ZX rotation and the Z position of the attached prop. Unwanted rotation can be avoided by using: &amp;lt;br /&amp;gt;''AddAttachedPropToProp(asPropName, asAttachName, asAttachFile, afPosX, afPosY, '''0''', afPosZ, '''90.0f''', afPosZ)''}}&lt;br /&gt;
&lt;br /&gt;
{{bug|Attaching a breakable prop to a physically active prop, and then breaking the attached prop, will cause the game to crash, should the parent object be moved or reset.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop. Fixed version of &amp;lt;code&amp;gt;AddAttachedPropToProp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
#''asPropName ''- the prop to attach another prop at&lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop &lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach&lt;br /&gt;
&lt;br /&gt;
Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveAttachedPropFromProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches a prop from a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
void AddPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
float GetPropHealth(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ResetProp(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets a prop's state to the original one when the map was loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void PlayPropAnimation(string &amp;amp;in asProp, string &amp;amp;in asAnimation, float afFadeTime, bool abLoop, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the prop play an animation and calls a function when it stops. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asProp)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asProp ''- internal name of the prop&lt;br /&gt;
#''asAnimation ''- animation to play&lt;br /&gt;
#''afFadeTime ''- Fade time between current and new animations&lt;br /&gt;
#''abLoop ''- determines whether the animation loops &lt;br /&gt;
#''asCallback ''- function to call when the animation ends&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddPropForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddPropImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These functions push objects. Note that rather high values are needed when applying ''forces''  (on the order of ~100 (weak) to ~10000 (strong)), but not impulses (values less than 10 can be appropriate). Forces are external influences, and will have different effect depending on the mass of the object they are being applied to; impulses disregard mass, and can cause objects to break, as if hit. A &amp;quot;Body&amp;quot; is a physics-related helper object, to which a force or an impulse can be applied. Entities can consist of several bodies, interconnected in various ways (you can create/examine bodies in the model editor).&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the object to push; for bodies, use this format: &amp;quot;''entityName''_''bodyName''&amp;quot;&lt;br /&gt;
#''afX ''- magnitude along the X-axis&lt;br /&gt;
#''afY ''- magnitude along the Y-axis&lt;br /&gt;
#''afZ ''- magnitude along the Z-axis&lt;br /&gt;
#''asCoordSystem ''- determines which coordinate system is used, &amp;quot;local&amp;quot; or &amp;quot;world&amp;quot;&lt;br /&gt;
&lt;br /&gt;
All of these functions are ''additive''  - when called consecutively, for each call, the vectors defined by (afX, afY, afZ) will be added together, and a resultant force/impulse will be calculated ''before''  any physics simulation is applied to the target object.&lt;br /&gt;
&lt;br /&gt;
====Connections====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithRope(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asRopeName, bool abInteractOnly, float afSpeedMul, float afToMinSpeed, float afToMaxSpeed, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects a prop with the movement of a rope (i.e. turn a wheel to move a rope). For Levers, the rope only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName''- The name of the connection&lt;br /&gt;
#''asPropName'' - The name of the prop; can be a Lever or Wheel&lt;br /&gt;
#''asRopeName'' - The name of the rope&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''afSpeedMul'' - Speed multiplier of how quickly the rope moves&lt;br /&gt;
#''afToMinSpeed'' - The slowest the rope can move&lt;br /&gt;
#''afToMaxSpeed'' - The fastest the rope can move&lt;br /&gt;
#''abInvert'' - Whether to invert the direction the rope moves&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithMoveObject(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asMoveObjectName, bool abInteractOnly, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This one should only be used if there must be an exact correspondence to prop &amp;quot;amount&amp;quot; and the MoveObject open amount. It is best used for Wheel-door connections, where the MoveObject moves continuously along with the Wheel. For Levers, the MoveObject only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asPropName'' - The entity that controls the movement; can be a Lever or Wheel&lt;br /&gt;
#''asMoveObject'' - The MoveObject to move&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''abInvert'' - If the state is inverted, making the MoveObject move in the opposite direction&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ConnectEntities(string &amp;amp;in asName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, bool abInvertStateSent, int alStatesUsed, string &amp;amp;in asCallbackFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects two entities together so that changing the state of the main entity changes the state of the connected entity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! Max State (1) !! Min State (-1)&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || Lit || Unlit&lt;br /&gt;
|-&lt;br /&gt;
| MoveObject || Open || Close&lt;br /&gt;
|-&lt;br /&gt;
| SwingDoor&lt;br /&gt;
|rowspan=2| Locked&lt;br /&gt;
|rowspan=2| Unlocked&lt;br /&gt;
|-&lt;br /&gt;
| Chest&lt;br /&gt;
|-&lt;br /&gt;
| Button || Switched on || Switched off&lt;br /&gt;
|-&lt;br /&gt;
| Lever&lt;br /&gt;
|rowspan=2| Unstuck&lt;br /&gt;
|rowspan=2| Stuck (at min)&lt;br /&gt;
|-&lt;br /&gt;
| Wheel&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asMainEntity'' - The entity that causes the change; can be a Lever, Wheel, Button, or Photocell&lt;br /&gt;
#''asConnectEntity'' - The entity that is affected by the change&lt;br /&gt;
#''abInvertStateSent'' - If the state is inverted, making the connected entity change to the opposite state&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
#''asCallbackFunc'' - The name of the connection callback&lt;br /&gt;
&lt;br /&gt;
Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asConnectionName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, int alState)&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;alState is what is sent to connection entity and will be inverted if abInvertStateSent = true!&lt;br /&gt;
&lt;br /&gt;
====Lamps====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLampLit(string &amp;amp;in asName, bool abLit, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Turns a lamp on or off.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the lamp&lt;br /&gt;
#''abLit ''- Set true if you want the lamp to be lit, set to false if you want the lamp to be unlit&lt;br /&gt;
#''abEffects ''- If you want to have the lamp fade in/out when it gets lit/unlit&lt;br /&gt;
&lt;br /&gt;
====Doors====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorLocked(string &amp;amp;in asName, bool abLocked, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abLocked'' - Locked/unlocked&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is locked/unlocked&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorClosed(string &amp;amp;in asName, bool abClosed, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abClosed'' - Closed/open&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is closed/opened&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
bool GetSwingDoorLocked(string &amp;amp;in asName);&lt;br /&gt;
bool GetSwingDoorClosed(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a swing door is locked/closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorDisableAutoClose(string &amp;amp;in asName, bool abDisableAutoClose);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deactivates the &amp;quot;auto-close&amp;quot; when a door is nearly closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetSwingDoorState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns an integer depending on how far the door is opened. &amp;lt;br /&amp;gt;-1 = angle is close to 0°, 1 = angle is 70% or higher of max, 0 = inbetween -1 and 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLocked(string &amp;amp;in asName, bool abLocked);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a level door. Note that level doors are NOT swing doors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedSound(string &amp;amp;in asName, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which sound is played when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedText(string &amp;amp;in asName, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectState(string &amp;amp;in asName, float afState);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween (and above, for example, the bridge_metal_vert) are valid too!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectStateExt(string &amp;amp;in asName, float afState, float afAcc, float afMaxSpeed, float afSlowdownDist, bool abResetSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state, extended method.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween are valid too!&lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afMaxSpeed ''- maximum speed&lt;br /&gt;
#''afSlowdownDist ''- Distance to the target state before deceleration occurs.&lt;br /&gt;
#''abResetSpeed ''- Set to ''true'' if the prop's speed should be reset before performing the movement, else the prop will accelerate from its current speed to afMaxSpeed.&lt;br /&gt;
&lt;br /&gt;
====Levers, wheels and buttons====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropObjectStuckState(string &amp;amp;in asName, int alState);&lt;br /&gt;
void SetWheelStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
void SetLeverStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes an object/wheel/lever stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name&lt;br /&gt;
#''alState'' - 0 = not stuck, 1 = at max, -1 = at min &lt;br /&gt;
#''abEffects'' - play sound effects&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelAngle(string &amp;amp;in asName, float afAngle, bool abAutoMove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves a wheel to a certain angle.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name&lt;br /&gt;
#''afAngle'' - angle&lt;br /&gt;
#''abAutoMove'' - determines whether the wheel should move on its own&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
void SetLeverInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to make a wheel/lever unstuck when interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetLeverState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the state of the lever. &amp;lt;br /&amp;gt;0 = not stuck, 1 = at max, -1 = at min&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderStuckState(string &amp;amp;in asName, int alStuckState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes a MultiSlider stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when state changes. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetButtonSwitchedOn(string &amp;amp;in asName, bool abSwitchedOn, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Sticky areas====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetAllowStickyAreaAttachment(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows entities to stick to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asProp);&lt;br /&gt;
void AttachBodyToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asBody);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop/body to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void DetachFromStickyArea(string &amp;amp;in asAreaName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches everything from a StickyArea.&lt;br /&gt;
&lt;br /&gt;
====NPCs====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCAwake(string &amp;amp;in asName, bool abAwake, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wakes/sleeps a NPC.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the NPC&lt;br /&gt;
#''abAwake'' - ''true'' to awaken, ''false'' to sleep&lt;br /&gt;
#''abEffects'' - Play the &amp;quot;Awake&amp;quot; or &amp;quot;Sleep&amp;quot; animations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCFollowPlayer(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a NPC's head to follow the player's movements.&lt;br /&gt;
&lt;br /&gt;
====Enemies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables an enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyIsHallucination(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes an enemy a hallucination. Hallucinations fade to smoke when they get near the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void FadeEnemyToSmoke(string &amp;amp;in asName, bool abPlaySound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly fades an enemy to smoke.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ShowEnemyPlayerPosition(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the enemy run to the player, no matter where he is.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AlertEnemyOfPlayerPresence(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gives the specified enemy the player's current position and makes it search the area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisableTriggers(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables or disables enemy triggers. If disabled, enemy will not react to player or attack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddEnemyPatrolNode(string &amp;amp;in asName, string &amp;amp;in asNodeName, float afWaitTime, string &amp;amp;in asAnimation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a patrol node to the enemy's path.&lt;br /&gt;
&lt;br /&gt;
#''asName''- Internal name of the enemy &lt;br /&gt;
#''asNodeName'' - Path node &lt;br /&gt;
#''afWaitTime'' - Time in seconds that the enemy waits at the path node before continuing. If 0, randomized between 1-3.&lt;br /&gt;
#''asAnimation'' - The animation the enemy uses when reaching the path node&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ClearEnemyPatrolNodes(string &amp;amp;in asEnemyName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the current path of patrol nodes of the enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemySanityDecreaseActive(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether an enemy activates the player's sanity drain when stared at.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy &lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToNode(string &amp;amp;in asEnemyName, string &amp;amp;in asNodeName, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific PathNode.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asNodeName'' - Internal name of the node to teleport to &lt;br /&gt;
#''abChangeY'' - Whether the Y position of the node will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToEntity(string &amp;amp;in asEnemyName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBody, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific entity.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asTargetEntity'' - Internal name of the entity to teleport to&lt;br /&gt;
#''asTargetBody'' - Internal name of the entity's body name to teleport to. If empty, the first body will be used (might be unstable, recommended to input a body anyway)&lt;br /&gt;
#''abChangeY'' - Whether the Y position of the entity will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeManPigPose(string &amp;amp;in asName, string &amp;amp;in asPoseType);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the pose a specified ManPig.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''asPoseType'' - Name of the ManPig pose to use. Can be &amp;quot;Biped&amp;quot; or &amp;quot;Quadruped&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigFadeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should fade the player's view in and out.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigSoundDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should play the proximity sounds.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigEasyEscapeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should be easier to escape from when hunted. If not disabled, easy escape is activated if the player is more than 12.35 meters away, the enemy can't see the player, and the player has less than 75 health. When this occurs, the enemy is forced to stop hunting and wait for half a second.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ForceTeslaPigSighting(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Forces a Tesla ManPig to be visible for a short time.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; GetEnemyStateName(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the name of the state a specified enemy is current in.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
Possible states for all enemies:&lt;br /&gt;
*Idle&lt;br /&gt;
*Wait&lt;br /&gt;
*Patrol&lt;br /&gt;
*Investigate&lt;br /&gt;
*Alert&lt;br /&gt;
*Search&lt;br /&gt;
*Hurt&lt;br /&gt;
*Hunt&lt;br /&gt;
*HuntPause&lt;br /&gt;
*HuntWander&lt;br /&gt;
*AttackMeleeShort&lt;br /&gt;
*AttackMeleeLong&lt;br /&gt;
*BreakDoor&lt;br /&gt;
*Dead&lt;br /&gt;
&lt;br /&gt;
Waterlurker-only states:&lt;br /&gt;
*GoHome&lt;br /&gt;
*Eat&lt;br /&gt;
&lt;br /&gt;
ManPig-only states: &lt;br /&gt;
*Flee&lt;br /&gt;
*Stalk&lt;br /&gt;
*Track&lt;br /&gt;
&lt;br /&gt;
Unused states:&lt;br /&gt;
*AttackRange&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=7024</id>
		<title>HPL2/Engine Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=7024"/>
		<updated>2025-10-16T18:39:21Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Props */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TocRight}}&lt;br /&gt;
&lt;br /&gt;
This page documents all scripts available in Amnesia: The Dark Descent.&lt;br /&gt;
&lt;br /&gt;
{{note|'''Note''': Some of the functions require the Amnesia 1.3 or 1.5 update. Steam and other online store copies should be automatically updated. Other copies can get 1.3 [http://www.frictionalgames.com/forum/thread-24334.html here].}}&lt;br /&gt;
&lt;br /&gt;
== Directives ==&lt;br /&gt;
&lt;br /&gt;
First off, &amp;lt;code&amp;gt;#include &amp;quot;file.hps&amp;quot;&amp;lt;/code&amp;gt; can be used to programmatically merge together multiple separate files to make organizing scripts easier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
==Engine scripts==&lt;br /&gt;
===Main===&lt;br /&gt;
&lt;br /&gt;
The following functions are the main hps functions that the HPL2 engine looks to run on certain events - similar to the C++ int main() function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void OnStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the map is loaded for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnEnter();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs whenever the player enters a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnLeave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the player leaves a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnGameStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is found in the global.hps file and the inventory.hps file, and is run when the game is first started by the player (ie via &amp;quot;Start New Game&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnUpdate(float afStep);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
This function is executed for every game update or &amp;quot;tick&amp;quot;. Can be used for rapid-firing updates instead of looping timers. Keep in mind that this can affect game performance if not used with care.&lt;br /&gt;
&lt;br /&gt;
#''afStep''- Time elapsed in seconds since the last frame. Multiply speeds, distances etc. by this argument to avoid framerate dependence issues (for example: if you move something in this function with constant speed, it will move faster on computers which run the game with high FPS and slower on computers with low FPS).&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float RandFloat(float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random float.&lt;br /&gt;
&lt;br /&gt;
#''afMin ''- minimum value&lt;br /&gt;
#''afMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int RandInt(int alMin, int alMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random int. Note: the maximum value is ''inclusive''  - the RandInt() function may return this value.&lt;br /&gt;
&lt;br /&gt;
#''alMin ''- minimum value&lt;br /&gt;
#''alMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringContains(string &amp;amp;in asString, string &amp;amp;in asSubString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a string contains the specified string. &amp;lt;br /&amp;gt;Example: searching for &amp;quot;hello&amp;quot; in &amp;quot;hello world&amp;quot; would return '''true'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to check&lt;br /&gt;
#''asSubString ''- the string to search for&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; StringSub(string &amp;amp;in asString, int alStart, int alCount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the substring in a string. &amp;lt;br /&amp;gt;Example: in the string &amp;quot;frictional games rocks&amp;quot;, using 4 as ''alStart''  and 6 as ''alCount''  would return '''&amp;quot;tional&amp;quot;'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string&lt;br /&gt;
#''alStart ''- starting character of the string, with 0 being the first character&lt;br /&gt;
#''alCount ''- amount of characters&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int StringToInt(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns an integer converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float StringToFloat(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a float converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringToBool(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a boolean converted from a string, else returns false.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&lt;br /&gt;
===Mathematical Operations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathCos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathTan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAsin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAcos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan2(float afX, float afY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Calculates and returns the arc tangent of the specified values.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - First value to operate.&lt;br /&gt;
#''afY''  - Second value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSqrt(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the square root of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathPow(float afBase, float afExp);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the value of afBase raised to the power of afExp.&lt;br /&gt;
&lt;br /&gt;
#''afBase''  - The base value.&lt;br /&gt;
#''afExp''  - Value to calculate the base with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMin(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the lowest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMax(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the highest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathClamp(float afX, float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns afX clamped between afMin and afMax. If afX &amp;lt; afMin, returns afMin, and if afX &amp;gt; afMax, returns afMax.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - The value to clamp.&lt;br /&gt;
#''afMin''  - The minimum value to clamp afX with.&lt;br /&gt;
#''afMax''  - The maximum value to clamp afX with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAbs(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the absolute value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&lt;br /&gt;
===Debugging===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void Print(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a string to the log file (''hpl.log'').&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDebugMessage(string &amp;amp;in asString, bool abCheckForDuplicates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a line of text to the debug console at the bottom left of the screen. Debug mode must be enabled for the console messages to be visible.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to print&lt;br /&gt;
#''abCheckForDuplicates ''- if true, the string won't be printed more than once on screen until it disappears&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ProgLog(string &amp;amp;in asLevel, string &amp;amp;in asMessage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints an entry to the ProgLog (progression log). &amp;lt;br /&amp;gt;ProgLog is a file created in Documents/Amnesia/main (or an FC folder if one is being used). It logs certain events, such us opening the menu or picking up the lantern, as well as the player's state (Health, Sanity, Oil, Tinderboxes, Coins), for the purpose of documenting a tester's playstyle. &amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt;This function allows to log custom messages.The messages in the ProgLog file are sorted by time elapsed since a map was loaded.&lt;br /&gt;
&lt;br /&gt;
ProgLog has to be enabled for a player profile in ''user_settings.cfg''  before it starts working.&lt;br /&gt;
&lt;br /&gt;
#''asLevel ''- can be &amp;quot;Low&amp;quot;, &amp;quot;Medium&amp;quot; or &amp;quot;High&amp;quot;. It's a tag which appears in each log entry, for event prioritising.&lt;br /&gt;
#''asMessage ''- The custom message to be printed to the log.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool ScriptDebugOn();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the debug mode is enabled. &amp;lt;br /&amp;gt;See [[HPL2/Development_Environment|&amp;quot;Setting up Development Environment&amp;quot;]] to setup debug mode on your own computer.&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
{{warning|Regular variables (int, float, etc.) are '''not''' saved by the game. Using them in important parts of yor script will break it upon loading a game save. In HPL, those variables should only be used for disposable counters, like spawning objects in a &amp;quot;for&amp;quot; loop. For variables which need to be saved, use the wrappers as described below.}}&lt;br /&gt;
&lt;br /&gt;
====Local====&lt;br /&gt;
&lt;br /&gt;
Local variables can be used throughout the same script file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetLocalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetLocalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddLocalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetLocalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Global====&lt;br /&gt;
&lt;br /&gt;
Global variables can be used throughout several maps and can be accessed by several script files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetGlobalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetGlobalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddGlobalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetGlobalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Particle Systems===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadParticleSystem(string &amp;amp;in asPSFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asPSFile''  - The particle system file to load. Extension: .ps&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntity(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntityExt(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS,&lt;br /&gt;
float afR, float afG, float afB, float afA, bool abFadeAtDistance, float afFadeMinEnd, float afFadeMinStart,&lt;br /&gt;
float afFadeMaxStart, float afFadeMaxEnd);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity, extended method with more options.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''abFadeAtDistance ''- determines whether a particle system fades from a certain distance on&lt;br /&gt;
#''afFadeMinEnd ''- minimum distance at which the particle system stops fading&lt;br /&gt;
#''afFadeMinStart ''- minimum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxStart ''- maximum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxEnd ''- maximum distance at which the particle system stops fading&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DestroyParticleSystem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Destroys a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - The internal name of the particle system&lt;br /&gt;
&lt;br /&gt;
===Sounds &amp;amp; Music===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadSound(string &amp;amp;in asSoundFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile''  - The sound file to load (extension .snt optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayGuiSound(string &amp;amp;in asSoundFile, float afVolume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays a sound, not using 3D.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile ''- the sound to play (extension .snt/.ogg optional)&lt;br /&gt;
#''afVolume ''- the volume of the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaySoundAtEntity(string &amp;amp;in asSoundName, string &amp;amp;in asSoundFile, string &amp;amp;in asEntity, float afFadeTime, bool abSaveSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a sound at an entity.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''asSoundFile ''- the sound to use (extension .snt optional)&lt;br /&gt;
#''asEntity ''- the entity to create the sound at. Using &amp;quot;Player&amp;quot; is effectively the same as &amp;lt;code&amp;gt;PlayGuiSound&amp;lt;/code&amp;gt;, yet this function allows a looping sound to be saved&lt;br /&gt;
#''afFadeTime ''- time in seconds the sound needs to fade. Avoids enemies hearing the sound if afFadeTime is at least 0.1f&lt;br /&gt;
#''abSaveSound ''- if ''true'', a looping sound will &amp;quot;remember&amp;quot; its playback state (currently playing/stopped), and that state will be restored the next time the level is entered. If ''true'', the sound is never attached to the entity! Note that saving should only be used on ''looping sounds''!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeInSound(string &amp;amp;in asSoundName, float afFadeTime, bool abPlayStart);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades in a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds&lt;br /&gt;
#''abPlayStart ''- Play the sound defined in the &amp;lt;code&amp;gt;&amp;lt;Start&amp;gt;&amp;lt;/code&amp;gt; section of the .snt before playing the main sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopSound(string &amp;amp;in asSoundName, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades out a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds, use 0 to immediately stop the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayMusic(string &amp;amp;in asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays music.&lt;br /&gt;
&lt;br /&gt;
#''asMusicFile ''- the music file to play (extension .ogg optional)&lt;br /&gt;
#''abLoop ''- determines whether a music track should loop&lt;br /&gt;
#''afVolume ''- volume of the music&lt;br /&gt;
#''afFadeTime ''- time in seconds until music reaches full volume&lt;br /&gt;
#''alPrio ''- priority of the music. Note that only the music with the highest priority can be heard! 0 - lowest, 1 - higher, etc.&lt;br /&gt;
#''abResume''  - if ''true'', playback will be continued from where the track stopped after the call to &amp;lt;code&amp;gt;StopMusic()&amp;lt;/code&amp;gt;. If ''false'', the track will be restarted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopMusic(float afFadeTime, int alPrio);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops music.&lt;br /&gt;
&lt;br /&gt;
#''afFadeTime ''- time in seconds until music stops&lt;br /&gt;
#''alPrio ''- the priority of the music that should stop&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice(string &amp;amp;in asVoiceFile, string &amp;amp;in asEffectFile, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry,&lt;br /&gt;
bool abUsePosition, string &amp;amp;in asPosEntity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This adds a voice and an additional sound effect to be played. It is okay to call this many times in order to play many voices in a row. The EffectVoiceOverCallback is not called until ALL voices have finished.&lt;br /&gt;
&lt;br /&gt;
#''asVoiceFile ''- the voice to play&lt;br /&gt;
#''asEffectFile ''- the sound effect to play&lt;br /&gt;
#''asTextCat ''- the category in the .lang file, usually &amp;quot;Voice&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''abUsePosition ''- plays using 3D from the entity, or without 3D&lt;br /&gt;
#''asPosEntity ''- the entity at which the voice and sound are played from&lt;br /&gt;
#''afMinDistance ''- minimum distance the voice and sound are heard&lt;br /&gt;
#''afMaxDistance ''- maximum distance the voice and sound are heard&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopAllEffectVoices(float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all voices and calls the EffectVoiceOverCallback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEffectVoiceActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether EffectVoices are still active.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetEffectVoiceOverCallback(string &amp;amp;in asFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to be called when the EffectVoices are finished. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundVolume(float afDestVolume, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound volume, that means everything you can hear '''from the world'''. This does not affect music of GUI sounds.&lt;br /&gt;
&lt;br /&gt;
#''afDestVolume ''- desired volume&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired volume&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundSpeed(float afDestSpeed, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound speed.&lt;br /&gt;
&lt;br /&gt;
#''afDestSpeed ''- desired speed&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired speed&lt;br /&gt;
&lt;br /&gt;
===Lights===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightVisible(string &amp;amp;in asLightName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables lights.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''abVisible ''- determines the state of the light&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeLightTo(string &amp;amp;in asLightName, float afR, float afG, float afB, float afA, float afRadius, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the properties of a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''afRadius ''- radius of the light. -1 means keeping the radius&lt;br /&gt;
#''afTime ''- time in seconds until change is done&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightFlickerActive(string &amp;amp;in asLightName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates flickering on a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName'' - The internal light name&lt;br /&gt;
#''abActive'' - true = active, false = inactive&lt;br /&gt;
&lt;br /&gt;
==Game scripts==&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartCredits(string &amp;amp;in asMusic, bool abLoopMusic, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alEndNum);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts the end credits screen.&lt;br /&gt;
&lt;br /&gt;
#''asMusic ''- the music to play (including .ogg)&lt;br /&gt;
#''abLoopMusic ''- determines whether the music should loop&lt;br /&gt;
#''asTextCat ''- the category to be used in the .lang file, usually &amp;quot;Ending&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alEndNum ''- Amnesia has 3 different endings and displays a code at the bottom. Determines which code is displayed. 0-2 will display codes, any other integer will not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartDemoEnd();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shows the demo end screen. The background and UI elements are defined in demo.cfg, with the text using the entries in the &amp;quot;Demo&amp;quot; category of the .lang file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AutoSave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an auto save file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CheckPoint(string &amp;amp;in asName, string &amp;amp;in asStartPos, string &amp;amp;in asCallback, string &amp;amp;in asDeathHintCat, string &amp;amp;in asDeathHintEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a checkpoint at which the player will respawn in case he dies. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asName, int alCount)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;Count is 0 on the first checkpoint load!&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the editor&lt;br /&gt;
#''asCallback ''- the function to call when the player dies/respawns&lt;br /&gt;
#''asDeathHintCat ''- the category of the death hint message to be used in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asDeathHintEntry ''- the entry in the .lang file&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeMap(string &amp;amp;in asMapName, string &amp;amp;in asStartPos, string &amp;amp;in asStartSound, string &amp;amp;in asEndSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Loads another map after a 1.5 second fade out.&lt;br /&gt;
&lt;br /&gt;
#''asMapName ''- the file to load&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the next map&lt;br /&gt;
#''asStartSound ''- the sound that is played when the change starts&lt;br /&gt;
#''asEndSound ''- the sound that is played when the new map is loaded&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ClearSavedMaps();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the &amp;quot;history&amp;quot; of the save, useful to do when you know the player will not be able to go back anymore. Makes the next save much smaller in size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateDataCache();&lt;br /&gt;
void DestroyDataCache();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This caches all current textures and models and they are not released until destroy is called. If there is already cached data it is destroyed.&lt;br /&gt;
Create caches to enable faster loading when going back to a map. Destroy the cache if you know the player won't go back to that map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMapDisplayNameEntry(string &amp;amp;in asNameEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the map name shown in save file names. If none is set NULL is assumed.&lt;br /&gt;
&lt;br /&gt;
#''asNameEntry ''- the entry to display, category must be &amp;quot;Levels&amp;quot;!&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the skybox.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxTexture(string &amp;amp;in asTexture);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the texture of the skybox.&lt;br /&gt;
&lt;br /&gt;
#''asTexture''  - The texture file to set. Extension: .dds&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the solid color of the skybox rather than a texture.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the global fog.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the color to use for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogProperties(float afStart, float afEnd, float afFalloffExp, bool abCulling);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the properties for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afStart ''- how many meters from the camera should the fog begin&lt;br /&gt;
#''afEnd ''- how many meters from the camera should the fog reach full thickness&lt;br /&gt;
#''afFalloffExp ''- the amount by which the thinkness increases&lt;br /&gt;
#''abCulling ''- whether occlusion culling is active for the fog; this prevents objects behind the fog from being loaded&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetupLoadScreen(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alRandomNum, string &amp;amp;in asImageFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which loading screen will be shown when changing maps.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category of the loading text in the .lang file to be shown on the loading screen, usually &amp;quot;LoadingText&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alRandomNum ''- if greater 1, then it will randomize between 1 and alRandom for each LoadScreen giving entry the suffix XX (eg 01). If &amp;lt; =1 then no suffix is added&lt;br /&gt;
#''asImageFile ''- the image to be shown (optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void UnlockAchievement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlocks the specified achievement. Only able to be used for the ending achievements.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the achievement. Only the following strings are valid:&lt;br /&gt;
::* Benefactor&lt;br /&gt;
::* Survivor&lt;br /&gt;
::* Sacrifice&lt;br /&gt;
::* Quitter&lt;br /&gt;
::* Egotist&lt;br /&gt;
::* Altruist&lt;br /&gt;
::* Vacillator&lt;br /&gt;
&lt;br /&gt;
===Game Timer===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddTimer(string &amp;amp;in asName, float afTime, string &amp;amp;in asFunction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a timer which calls a function when it expires. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asTimer)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the name of the timer&lt;br /&gt;
#''afTime ''- time in seconds&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveTimer(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a timer, no matter how much time is left.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the timer.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetTimerTimeLeft(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the time left on a timer.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - the internal name of the timer.&lt;br /&gt;
&lt;br /&gt;
===Screen Effects===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeOut(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to black.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen is completly black&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeIn(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen back to normal.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeImageTrailTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies the image trail effect to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeSepiaColorTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the screen go dark red.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0) &lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeRadialBlurTo(float afSize, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies radial blur effects to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afSize ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetRadialBlurStartDist(float afStartDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines at which distance the radial blur effects appear.&lt;br /&gt;
&lt;br /&gt;
#''afStartDist ''- the distance at which the effect starts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectFlash(float afFadeIn, float afWhite, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white.&lt;br /&gt;
&lt;br /&gt;
#''afFadeIn ''- time in seconds until screen is white&lt;br /&gt;
#''afWhite ''- determines to which percentage the screen fades to white (1.0 = completly white)&lt;br /&gt;
#''afFadeOut ''- time in seconds until screen is back to normal again&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectEmotionFlash(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white and shows a text message.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''asSound ''- the sound to play while fading&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetFlashbackIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a flashback is still in effect.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerSpawnPS(string &amp;amp;in asSPSFile);&lt;br /&gt;
void StopPlayerSpawnPS();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Continuously spawn regular particle systems (''.ps'') around the player. Particles created by this script carry over from map to map.&lt;br /&gt;
&lt;br /&gt;
#''asSPSFile''  - the ''.sps''  file to use. Example ''.sps''  files are located in the ''/misc''  folder in the main game directory.&amp;lt;br&amp;gt;Custom ''.sps''  files can be created by hand in a text editor (see existing ones and mimic how those are written). &amp;lt;br /&amp;gt;Since ''StopPlayerSpawnPS()''  doesn't seem to work, to stop an SPS you must create an ''.sps''  file with an empty particle field field and override the old SPS by calling ''StartPlayerSpawnPS''  again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shakes the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity of the shake&lt;br /&gt;
#''afTime ''- duration of the shake&lt;br /&gt;
#''afFadeInTime ''- time in seconds until full intensity is reached&lt;br /&gt;
#''afFadeOutTime ''- time until screen is back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInDarknessEffectsActive(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the sanity drain and night vision effects while in the darkness.&lt;br /&gt;
&lt;br /&gt;
''bool abX''  - Enable/disable effects.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowScreenImage(string &amp;amp;in asImageName, float afX, float afY, float afScale, bool abUseRelativeCoordinates, float afDuration, float afFadeIn, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
Displays an image file directly onto the screen. See [[HPL2/Tutorials/ShowScreenImage()|ShowScreenImage()]] in the tutorials section for more information.&lt;br /&gt;
&lt;br /&gt;
# ''asImageName'' - The image file to render (.jpg, .png, .tga, .dds)&lt;br /&gt;
# ''afX'' - The X position of the image&lt;br /&gt;
# ''afY'' - The Y position of the image&lt;br /&gt;
# ''afScale'' - The size of the image in pixels (not scale), or original image size if negative&lt;br /&gt;
# ''abUseRelativeCoordinates'' - Whether X and Y are relative to the screen resoltion, or pixel co-ordinates if not&lt;br /&gt;
# ''afDuration'' - The duration that the image is displayed for&lt;br /&gt;
# ''afFadeIn'' - The time, in seconds, to fade in the image&lt;br /&gt;
# ''afFadeOut'' - The time, in seconds, to fade out the image&lt;br /&gt;
&lt;br /&gt;
===Insanity===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInsanitySetEnabled(string &amp;amp;in asSet, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which InsanitySets are enabled.&lt;br /&gt;
&lt;br /&gt;
#''asSet ''- the set&lt;br /&gt;
#''abX ''- enabled or not&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartInsanityEvent(string &amp;amp;in asEventName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Starts a specified insanity event.&lt;br /&gt;
&lt;br /&gt;
#''asEventName ''- Insanity event to play.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartRandomInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts a random insanity event from the available sets.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopCurrentInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Stops the currently playing insanity event.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void InsanityEventIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an insanity event is currently in effect.&amp;lt;br&amp;gt;Not useful at all due to having a return type of &amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; when it should be &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Player===&lt;br /&gt;
&lt;br /&gt;
Note that the player's maximum health and sanity is 100.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enabled/Disable player controlled movement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangePlayerStateToNormal();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets the player's state, forcing them to stop interacting with objects. It also clears the inventory item to be used (as if it was double-clicked on in the inventory again) and dismounts the player from ladders.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerCrouching(bool abCrouch);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddPlayerBodyForce(float afX, float afY, float afZ, bool abUseLocalCoords);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pushes the player into a certain direction. Note that you need values above ~2000 to see any effects.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - amount along the X-axis&lt;br /&gt;
#''afY'' - amount along the Y-axis&lt;br /&gt;
#''afZ'' - amount along the Z-axis&lt;br /&gt;
#''abUseLocalCoords'' - If true, axes are based on where the player is facing, not the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowPlayerCrossHairIcons(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the icons when a player has something in focus.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerSanity(float afSanity);&lt;br /&gt;
void AddPlayerSanity(float afSanity);&lt;br /&gt;
float GetPlayerSanity();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerHealth(float afHealth);&lt;br /&gt;
void AddPlayerHealth(float afHealth);&lt;br /&gt;
float GetPlayerHealth();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerLampOil(float afOil);&lt;br /&gt;
void AddPlayerLampOil(float afOil);&lt;br /&gt;
float GetPlayerLampOil();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the lamp oil of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerSpeed();&lt;br /&gt;
float GetPlayerYSpeed();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current speed of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSanityDrainDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables sanity drain from darkness.&lt;br /&gt;
{{bug|Sanity drain is reenabled on loading a save, as the game is unable to load the value properly from the save data.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoost();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a large amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! New Sanity&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || 100&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || 90&lt;br /&gt;
|-&lt;br /&gt;
| 50-74 || 80&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoostSmall();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a small amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! Sanity Bonus&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || +20&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || +15&lt;br /&gt;
|-&lt;br /&gt;
| 50-75 || +10&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityDamage(float afAmount, bool abUseEffect);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount'' - amount of sanity damage done&lt;br /&gt;
#''abUseEffect'' - if a sound is played and screen effects are shown when the sanity damage is dealt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GivePlayerDamage(float afAmount, string &amp;amp;in asType, bool abSpinHead, bool abLethal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the health of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount'' - amount of damage done to health&lt;br /&gt;
#''asType'' - plays a certain effect on the screen when the damage is dealt (BloodSplat, Claws, or Slash) &lt;br /&gt;
#''abSpinHead'' - changes the camera view when damage is dealt&lt;br /&gt;
#''abLethal'' - set to true if player can die from given damage. If ''false'' and the damage would have left the player with less than 10 health, health is set to 10.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerFOVMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the field of view of the player. A shorter FOV will create a zoom effect.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - multiplier of default FOV (1 is default)&lt;br /&gt;
#''afSpeed'' - the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerAspectMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the aspect ratio of the player. Basically stretches or narrows the screen horizontally.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - multiplier of default aspect (default is 1)&lt;br /&gt;
#''afSpeed'' - the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - angle of rotation of head, positive being counter-clockwise&lt;br /&gt;
#''afSpeedMul'' - speed (possibly acceleration) multiplier of the rotation (default 1, which is really slow)&lt;br /&gt;
#''afMaxSpeed'' - maximum speed of rotation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerForward(float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Moves the player forward. It needs to be called in a timer that updates 60 times / second.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- amount along the X-axis&lt;br /&gt;
#''afY ''- amount along the Y-axis&lt;br /&gt;
#''afZ ''- amount along the Z-axis&lt;br /&gt;
#''afSpeed ''- speed at which the change happens&lt;br /&gt;
#''afSlowDownDist ''- distance at which to start slowing down (prevents the head from abruptly stopping)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerLookAt(string &amp;amp;in asEntityName, float afSpeedMul, float afMaxSpeed, string &amp;amp;in asAtTargetCallback);&lt;br /&gt;
void StopPlayerLookAt();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to look at a certain entity until StopPlayerLookAt is used.&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- the entity to look at &lt;br /&gt;
#''afSpeedMul ''- how fast should the player look at the entity&lt;br /&gt;
#''afMaxSpeed ''- maximum speed allowed&lt;br /&gt;
#''asAtTargetCallback ''- function to call when player looks at target&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerMoveSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerRunSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerLookSpeedMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the player's move/run/look speed. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpForceMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the player's jump multiplier. Higher values = higher jumps. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpDisabled(bool abX);&lt;br /&gt;
void SetPlayerCrouchDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to jump/crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportPlayer(string &amp;amp;in asStartPosName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly teleports the player to the target StartPos.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternActive(bool abX, bool abUseEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the player use his lantern.&lt;br /&gt;
&lt;br /&gt;
# ''abX'' - Set lantern to be active (true) or inactive (false)&lt;br /&gt;
# ''abUseEffects'' - Play on/off sounds&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetLanternActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player is currently using the lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to use the lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternLitCallback(string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to call when the player uses the lantern. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;MyFunc(bool abLit)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message on the screen.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory'' - the category in the .lang file&lt;br /&gt;
#''asTextEntry'' - the entry in the .lang file&lt;br /&gt;
#''afTime'' - determines how long the message is displayed. If time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetDeathHint(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the message that appears when the player dies.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory'' - the category in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asTextEntry'' - the entry in the .lang file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DisableDeathStartSound();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the death sound when the player dies. This must be called directly before player is killed! The variable as soon as player dies too.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPermaDeathSound(string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Sets the sound played after the player dies when permadeath is active. Permadeath is only active when the game is launched with the &amp;lt;code&amp;gt;ptest&amp;lt;/code&amp;gt; command line parameter. Only used for the post-death Suitor lines in ''Justine''.&lt;br /&gt;
&lt;br /&gt;
#''asSound'' - The sound to be played after death. Expects a voice-type sound.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerFallDamageDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the player's ability to take fall damage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPos(float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the player's position within the level.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - X co-ordinate position.&lt;br /&gt;
#''afY'' - Y co-ordinate position.&lt;br /&gt;
#''afZ'' - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerPosX();&lt;br /&gt;
float GetPlayerPosY();&lt;br /&gt;
float GetPlayerPosZ();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the player's position within the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
===Journal===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddNote(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a note to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _Name and _Text and be in category &amp;quot;Journal&amp;quot;!&lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDiary(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a diary to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _NameX and _TextY whereas X and Y are numbers of the parts (_Name1: first diary, _Text1: first page) and be in category &amp;quot;Journal&amp;quot;! &lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ReturnOpenJournal(bool abOpenJournal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Only called in the pickup diary callback! If true the journal displays the entry else not.&lt;br /&gt;
&lt;br /&gt;
===Quests===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a quest to the player's journal under mementos. Completed quests cannot be readded.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name to be used&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot;Quest_&amp;lt;texthere&amp;gt;_Text”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CompleteQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Completes a quest. If the quest has not been added, it's marked as complete anyway, preventing it from being added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot; Quest_&amp;lt;texthere&amp;gt;_Text ”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool QuestIsCompleted(string &amp;amp;in asName);&lt;br /&gt;
bool QuestIsAdded(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a quest is completed/added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetNumberOfQuestsInMap(int alNumberOfQuests);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the number of quests in the map. Obsolete; formerly used to calculate a completion percentage when looking at a level door.&lt;br /&gt;
&lt;br /&gt;
#''alNumberOfQuests ''- Amount of quests&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveHint(string &amp;amp;in asName, string &amp;amp;in asMessageCat, string &amp;amp;in asMessageEntry, float afTimeShown);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a hint on the player's screen.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asMessageCat ''- the category in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asMessageEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTimeShown ''- time in seconds until the message disappears. If time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void BlockHint(string &amp;amp;in asName);&lt;br /&gt;
void UnBlockHint(string &amp;amp;in asName);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Blocking a hint prevents it from being shown. Blocked hints are included in savefiles, so they should persist between levels. Unblocking a hint allows it to be shown.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; blocks the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveHint(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes the hint from the list of already shown hints, allowing it to appear again.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; reenables the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
===Inventory===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ExitInventory();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Exits the inventory by force.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the player's ability to open his inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a message on the inventory screen. Used for feedback messages when failing to combine items.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory ''- the category in the .lang file, usually &amp;quot;Inventory&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTime ''- time in seconds until the message disappears. If life time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItem(string &amp;amp;in asName, string &amp;amp;in asType, string &amp;amp;in asSubTypeName, string &amp;amp;in asImageName, float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds an item to the inventory of the player. Note that the item does not have to exist as entity in the world to be able to do this.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asType ''- item type to give, Available types are:&lt;br /&gt;
::*Puzzle&lt;br /&gt;
::*Lantern&lt;br /&gt;
::*Health&lt;br /&gt;
::*Sanity&lt;br /&gt;
::*LampOil&lt;br /&gt;
::*Tinderbox&lt;br /&gt;
#''asSubTypeName ''- item name for .lang file&lt;br /&gt;
#''asImageName ''- the image which will appear in inventory. For example: &amp;lt;code&amp;gt;void GiveItem(&amp;quot;chemical_container_full_1&amp;quot;, &amp;quot;Puzzle&amp;quot;, &amp;quot;chemical_container_full&amp;quot;, &amp;quot;chemical_container_full.tga&amp;quot;, 1);&amp;lt;/code&amp;gt; will use the image from &amp;lt;code&amp;gt;graphics/item/chemical_container_full.tga&amp;lt;/code&amp;gt; &lt;br /&gt;
#''afAmount ''- amount the item gives, - For example: Oil potions will fill the oil meter by this amount, Health potions will heal by this amount, etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item from the player's inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool HasItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player has an item in his inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItemFromFile(string &amp;amp;in asName, string &amp;amp;in asFileName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a single item to the player's inventory. This is meant to be used for debug mostly as it creates the actual item and then destroys it.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asFileName ''- item to give + extension (.ent)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddCombineCallback(string &amp;amp;in asName, string &amp;amp;in asItemA, string &amp;amp;in asItemB, string &amp;amp;in asFunction, bool abAutoRemove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to combine items in his inventory. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItemA, string &amp;amp;in asItemB)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name for the callback&lt;br /&gt;
#''asItemA ''- internal name of first item&lt;br /&gt;
#''asItemB ''- internal name of second item&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
#''abAutoRemove ''- determines whether the callback should be removed when the items are combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveCombineCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a combine callback.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the callback to be removed (as specified in AddCombineCallback)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddUseItemCallback(string &amp;amp;in asName, string &amp;amp;in asItem, string &amp;amp;in asEntity, string &amp;amp;in asFunction, bool abAutoDestroy);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to use items on the world. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItem, string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
#''asItem ''- internal name of the item&lt;br /&gt;
#''asEntity ''- entity to be able to use the item on&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abAutoDestroy ''- determines whether the callback should be removed when the item is used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveUseItemCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item callback.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
&lt;br /&gt;
===Entities===&lt;br /&gt;
&lt;br /&gt;
====General====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityActive(string &amp;amp;in asName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityVisible(string &amp;amp;in asName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity's visual mesh. The collision body remains.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the entity.&lt;br /&gt;
#''abActive''  - Activate/deactivate mesh.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntityExists(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an entity exists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCustomFocusCrossHair(string &amp;amp;in asName, string&amp;amp; asCrossHair);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the crosshair that is used when focusing an entity.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCrossHair ''- desired crosshair, can be: &lt;br /&gt;
::*Default (no crosshair)&lt;br /&gt;
::*Grab&lt;br /&gt;
::*Push&lt;br /&gt;
::*Ignite&lt;br /&gt;
::*Pick&lt;br /&gt;
::*LevelDoor&lt;br /&gt;
::*Ladder&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void CreateEntityAtArea(string &amp;amp;in asEntityName, string &amp;amp;in asEntityFile, string &amp;amp;in asAreaName, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an entity at an area. When creating an enemy though, it cannot chase properly along PathNodes (using for example &amp;lt;code&amp;gt;ShowEnemyPlayerPosition&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- internal name&lt;br /&gt;
#''asEntityFile ''- entity to be used extension .ent&lt;br /&gt;
#''asAreaName ''- the area to create the entity at&lt;br /&gt;
#''abFullGameSave ''- determines whether an entity &amp;quot;remembers&amp;quot; its state&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ReplaceEntity(string &amp;amp;in asName, string &amp;amp;in asBodyName, string &amp;amp;in asNewEntityName, string &amp;amp;in asNewEntityFile, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Removes an entity and places a new one in its place.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to replace.&lt;br /&gt;
#''asBodyName'' - Name of the body of the entity to place the new entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''asNewEntityName'' - Name of the new entity.&lt;br /&gt;
#''asNewEntityFile'' - Name of the new entity file. Extension .ent. &lt;br /&gt;
#''abFullGameSave'' - Whether ALL properties of this entity should be saved throughout levels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaceEntityAtEntity(string &amp;amp;in asName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBodyName, bool abUseRotation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Places an entity at the position of another entity. Does not work for enemies, use TeleportEnemyToEntity instead.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to place.&lt;br /&gt;
#''asTargetEntity'' - Name of the other entity to place the first entity at.&lt;br /&gt;
#''asTargetBodyName'' - Name of the body of the entity to place the first entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''abUseRotation'' - Whether the entity should be rotated like the target entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPos(string &amp;amp;in asName, float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Moves an entity to a position in the level.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to move.&lt;br /&gt;
#''afX'' - X co-ordinate position.&lt;br /&gt;
#''afY'' - Y co-ordinate position.&lt;br /&gt;
#''afZ'' - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetEntityPosX(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosY(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosZ(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns an entity's position in the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerLookAtCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveWhenLookedAt);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player looks at a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = looking, -1 = not looking&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveWhenLookedAt ''- determines whether the callback should be removed when the player looked at the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerInteractCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveOnInteraction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player interacts with a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveOnInteraction ''- determines whether the callback should be removed when the player interacts with the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCallbackFunc(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when certain events occur with an entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, string &amp;amp;in asType)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;asType&amp;lt;/code&amp;gt; values depend on entity type:&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! asType Value&lt;br /&gt;
|-&lt;br /&gt;
| Object || Break&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || OnIgnite&lt;br /&gt;
|-&lt;br /&gt;
| Item || OnPickup&lt;br /&gt;
|-&lt;br /&gt;
| Enemy || OnDeath&lt;br /&gt;
|-&lt;br /&gt;
| Enemy_Grunt&amp;lt;br&amp;gt;Enemy_Manpig || OnAutoDisabled&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityConnectionStateChangeCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A callback called when ever the connection state changes (button being switched on, lever switched, etc). &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void Func(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: -1 = off, 0 = between, 1 = on&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityInteractionDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disallows interaction with an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void BreakJoint (string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Breaks a joint. Do not use this on joints in SwingDoors, Levers, Wheels, etc. where the joint is part of an interaction. That will make the game crash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void AddEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName, string &amp;amp;in asFunction, bool abDeleteOnCollide, int alStates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when two entities collide. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asParent, string &amp;amp;in asChild, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = enter, -1 = leave&lt;br /&gt;
&lt;br /&gt;
#''asParentName ''- internal name of main object&lt;br /&gt;
#''asChildName ''- internal name of object that collides with main object (asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) NOT supported!)&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abDeleteOnCollide ''- determines whether the callback after it was called&lt;br /&gt;
#''alStates ''- 1 = only enter, -1 = only leave, 0 = both&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an EntityCollideCallback. Asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) not supported in ''asChildName''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntitiesCollide(string &amp;amp;in asEntityA, string &amp;amp;in asEntityB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether two entities collide. This function does NOT support asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) or &amp;quot;Player&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetBodyMass(string &amp;amp;in asName, float afMass);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName.&lt;br /&gt;
#''afMass''  - The mass to set.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetBodyMass(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName. &lt;br /&gt;
#''afMass''  - The mass to get.&lt;br /&gt;
&lt;br /&gt;
====Props====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropEffectActive(string &amp;amp;in asName, bool abActive, bool abFadeAndPlaySounds);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Turns the texture illumination, billboards, particles, light flicker, and sounds of a prop on or off.&lt;br /&gt;
&lt;br /&gt;
Can be used on coal to give it the black color it should have.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name &lt;br /&gt;
#''abActive'' - active state&lt;br /&gt;
#''abFadeAndPlaySounds'' - if all effects should fade in/out or not&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropActiveAndFade(string &amp;amp;in asName, bool abActive, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates a prop.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''abActive ''- nothing to add&lt;br /&gt;
#''afFadeTime ''- time in seconds until prop fully fades&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropStaticPhysics(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates the physics of a prop, setting the mass to 0. Setting as true will make entities static in midair.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetPropIsInteractedWith(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a prop is interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RotatePropToSpeed(string &amp;amp;in asName, float afAcc, float afGoalSpeed, float afAxisX, float afAxisY, float afAxisZ, bool abResetSpeed, string &amp;amp;in asOffsetArea);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the prop up to a set speed.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afGoalSpeed ''- desired speed &lt;br /&gt;
#''afAxisX ''- rotation around X axis&lt;br /&gt;
#''afAxisY ''- rotation around Y axis&lt;br /&gt;
#''afAxisZ ''- rotation around Z axis&lt;br /&gt;
#''abResetSpeed ''- determines whether the speed is resetted after goal speed is reached&lt;br /&gt;
#''asOffsetArea ''- the area to rotate around, if empty, then the center of the body is used Note: The entity you want to rotate MUST be a &amp;quot;StaticObject&amp;quot; entity!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void StopPropMovement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all movement of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddAttachedPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop.&lt;br /&gt;
&lt;br /&gt;
#''asPropName''- the prop to attach another prop at &lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop&lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach&lt;br /&gt;
&lt;br /&gt;
Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
{{bug|''afRotZ '' is used for both the ZX rotation and the Z position of the attached prop. Unwanted rotation can be avoided by using: &amp;lt;br /&amp;gt;''AddAttachedPropToProp(asPropName, asAttachName, asAttachFile, afPosX, afPosY, '''0''', afPosZ, '''90.0f''', afPosZ)''}}&lt;br /&gt;
&lt;br /&gt;
{{bug|Attaching a breakable prop to a physically active prop, and then breaking the attached prop, will cause the game to crash, should the parent object be moved or reset.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop. Fixed version of &amp;lt;code&amp;gt;AddAttachedPropToProp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
#''asPropName ''- the prop to attach another prop at&lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop &lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach&lt;br /&gt;
&lt;br /&gt;
Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveAttachedPropFromProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches a prop from a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
void AddPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
float GetPropHealth(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ResetProp(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets a prop's state to the original one when the map was loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void PlayPropAnimation(string &amp;amp;in asProp, string &amp;amp;in asAnimation, float afFadeTime, bool abLoop, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the prop play an animation and calls a function. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asProp)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asProp ''- internal name of the prop&lt;br /&gt;
#''asAnimation ''- animation to play&lt;br /&gt;
#''afFadeTime ''- Fade time between current and new animations&lt;br /&gt;
#''abLoop ''- determines whether the animation loops &lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddPropForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddPropImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These functions push objects. Note that rather high values are needed when applying ''forces''  (on the order of ~100 (weak) to ~10000 (strong)), but not impulses (values less than 10 can be appropriate). Forces are external influences, and will have different effect depending on the mass of the object they are being applied to; impulses disregard mass, and can cause objects to break, as if hit. A &amp;quot;Body&amp;quot; is a physics-related helper object, to which a force or an impulse can be applied. Entities can consist of several bodies, interconnected in various ways (you can create/examine bodies in the model editor).&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the object to push; for bodies, use this format: &amp;quot;''entityName''_''bodyName''&amp;quot;&lt;br /&gt;
#''afX ''- magnitude along the X-axis&lt;br /&gt;
#''afY ''- magnitude along the Y-axis&lt;br /&gt;
#''afZ ''- magnitude along the Z-axis&lt;br /&gt;
#''asCoordSystem ''- determines which coordinate system is used, &amp;quot;local&amp;quot; or &amp;quot;world&amp;quot;&lt;br /&gt;
&lt;br /&gt;
All of these functions are ''additive''  - when called consecutively, for each call, the vectors defined by (afX, afY, afZ) will be added together, and a resultant force/impulse will be calculated ''before''  any physics simulation is applied to the target object.&lt;br /&gt;
&lt;br /&gt;
====Connections====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithRope(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asRopeName, bool abInteractOnly, float afSpeedMul, float afToMinSpeed, float afToMaxSpeed, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects a prop with the movement of a rope (i.e. turn a wheel to move a rope). For Levers, the rope only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName''- The name of the connection&lt;br /&gt;
#''asPropName'' - The name of the prop; can be a Lever or Wheel&lt;br /&gt;
#''asRopeName'' - The name of the rope&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''afSpeedMul'' - Speed multiplier of how quickly the rope moves&lt;br /&gt;
#''afToMinSpeed'' - The slowest the rope can move&lt;br /&gt;
#''afToMaxSpeed'' - The fastest the rope can move&lt;br /&gt;
#''abInvert'' - Whether to invert the direction the rope moves&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithMoveObject(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asMoveObjectName, bool abInteractOnly, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This one should only be used if there must be an exact correspondence to prop &amp;quot;amount&amp;quot; and the MoveObject open amount. It is best used for Wheel-door connections, where the MoveObject moves continuously along with the Wheel. For Levers, the MoveObject only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asPropName'' - The entity that controls the movement; can be a Lever or Wheel&lt;br /&gt;
#''asMoveObject'' - The MoveObject to move&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''abInvert'' - If the state is inverted, making the MoveObject move in the opposite direction&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ConnectEntities(string &amp;amp;in asName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, bool abInvertStateSent, int alStatesUsed, string &amp;amp;in asCallbackFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects two entities together so that changing the state of the main entity changes the state of the connected entity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! Max State (1) !! Min State (-1)&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || Lit || Unlit&lt;br /&gt;
|-&lt;br /&gt;
| MoveObject || Open || Close&lt;br /&gt;
|-&lt;br /&gt;
| SwingDoor&lt;br /&gt;
|rowspan=2| Locked&lt;br /&gt;
|rowspan=2| Unlocked&lt;br /&gt;
|-&lt;br /&gt;
| Chest&lt;br /&gt;
|-&lt;br /&gt;
| Button || Switched on || Switched off&lt;br /&gt;
|-&lt;br /&gt;
| Lever&lt;br /&gt;
|rowspan=2| Unstuck&lt;br /&gt;
|rowspan=2| Stuck (at min)&lt;br /&gt;
|-&lt;br /&gt;
| Wheel&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asMainEntity'' - The entity that causes the change; can be a Lever, Wheel, Button, or Photocell&lt;br /&gt;
#''asConnectEntity'' - The entity that is affected by the change&lt;br /&gt;
#''abInvertStateSent'' - If the state is inverted, making the connected entity change to the opposite state&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
#''asCallbackFunc'' - The name of the connection callback&lt;br /&gt;
&lt;br /&gt;
Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asConnectionName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, int alState)&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;alState is what is sent to connection entity and will be inverted if abInvertStateSent = true!&lt;br /&gt;
&lt;br /&gt;
====Lamps====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLampLit(string &amp;amp;in asName, bool abLit, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Turns a lamp on or off.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the lamp&lt;br /&gt;
#''abLit ''- Set true if you want the lamp to be lit, set to false if you want the lamp to be unlit&lt;br /&gt;
#''abEffects ''- If you want to have the lamp fade in/out when it gets lit/unlit&lt;br /&gt;
&lt;br /&gt;
====Doors====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorLocked(string &amp;amp;in asName, bool abLocked, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abLocked'' - Locked/unlocked&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is locked/unlocked&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorClosed(string &amp;amp;in asName, bool abClosed, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abClosed'' - Closed/open&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is closed/opened&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
bool GetSwingDoorLocked(string &amp;amp;in asName);&lt;br /&gt;
bool GetSwingDoorClosed(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a swing door is locked/closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorDisableAutoClose(string &amp;amp;in asName, bool abDisableAutoClose);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deactivates the &amp;quot;auto-close&amp;quot; when a door is nearly closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetSwingDoorState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns an integer depending on how far the door is opened. &amp;lt;br /&amp;gt;-1 = angle is close to 0°, 1 = angle is 70% or higher of max, 0 = inbetween -1 and 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLocked(string &amp;amp;in asName, bool abLocked);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a level door. Note that level doors are NOT swing doors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedSound(string &amp;amp;in asName, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which sound is played when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedText(string &amp;amp;in asName, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectState(string &amp;amp;in asName, float afState);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween (and above, for example, the bridge_metal_vert) are valid too!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectStateExt(string &amp;amp;in asName, float afState, float afAcc, float afMaxSpeed, float afSlowdownDist, bool abResetSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state, extended method.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween are valid too!&lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afMaxSpeed ''- maximum speed&lt;br /&gt;
#''afSlowdownDist ''- Distance to the target state before deceleration occurs.&lt;br /&gt;
#''abResetSpeed ''- Set to ''true'' if the prop's speed should be reset before performing the movement, else the prop will accelerate from its current speed to afMaxSpeed.&lt;br /&gt;
&lt;br /&gt;
====Levers, wheels and buttons====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropObjectStuckState(string &amp;amp;in asName, int alState);&lt;br /&gt;
void SetWheelStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
void SetLeverStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes an object/wheel/lever stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name&lt;br /&gt;
#''alState'' - 0 = not stuck, 1 = at max, -1 = at min &lt;br /&gt;
#''abEffects'' - play sound effects&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelAngle(string &amp;amp;in asName, float afAngle, bool abAutoMove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves a wheel to a certain angle.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name&lt;br /&gt;
#''afAngle'' - angle&lt;br /&gt;
#''abAutoMove'' - determines whether the wheel should move on its own&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
void SetLeverInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to make a wheel/lever unstuck when interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetLeverState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the state of the lever. &amp;lt;br /&amp;gt;0 = not stuck, 1 = at max, -1 = at min&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderStuckState(string &amp;amp;in asName, int alStuckState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes a MultiSlider stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when state changes. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetButtonSwitchedOn(string &amp;amp;in asName, bool abSwitchedOn, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Sticky areas====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetAllowStickyAreaAttachment(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows entities to stick to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asProp);&lt;br /&gt;
void AttachBodyToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asBody);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop/body to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void DetachFromStickyArea(string &amp;amp;in asAreaName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches everything from a StickyArea.&lt;br /&gt;
&lt;br /&gt;
====NPCs====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCAwake(string &amp;amp;in asName, bool abAwake, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wakes/sleeps a NPC.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the NPC&lt;br /&gt;
#''abAwake'' - ''true'' to awaken, ''false'' to sleep&lt;br /&gt;
#''abEffects'' - Play the &amp;quot;Awake&amp;quot; or &amp;quot;Sleep&amp;quot; animations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCFollowPlayer(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a NPC's head to follow the player's movements.&lt;br /&gt;
&lt;br /&gt;
====Enemies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables an enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyIsHallucination(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes an enemy a hallucination. Hallucinations fade to smoke when they get near the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void FadeEnemyToSmoke(string &amp;amp;in asName, bool abPlaySound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly fades an enemy to smoke.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ShowEnemyPlayerPosition(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the enemy run to the player, no matter where he is.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AlertEnemyOfPlayerPresence(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gives the specified enemy the player's current position and makes it search the area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisableTriggers(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables or disables enemy triggers. If disabled, enemy will not react to player or attack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddEnemyPatrolNode(string &amp;amp;in asName, string &amp;amp;in asNodeName, float afWaitTime, string &amp;amp;in asAnimation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a patrol node to the enemy's path.&lt;br /&gt;
&lt;br /&gt;
#''asName''- Internal name of the enemy &lt;br /&gt;
#''asNodeName'' - Path node &lt;br /&gt;
#''afWaitTime'' - Time in seconds that the enemy waits at the path node before continuing. If 0, randomized between 1-3.&lt;br /&gt;
#''asAnimation'' - The animation the enemy uses when reaching the path node&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ClearEnemyPatrolNodes(string &amp;amp;in asEnemyName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the current path of patrol nodes of the enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemySanityDecreaseActive(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether an enemy activates the player's sanity drain when stared at.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy &lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToNode(string &amp;amp;in asEnemyName, string &amp;amp;in asNodeName, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific PathNode.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asNodeName'' - Internal name of the node to teleport to &lt;br /&gt;
#''abChangeY'' - Whether the Y position of the node will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToEntity(string &amp;amp;in asEnemyName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBody, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific entity.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asTargetEntity'' - Internal name of the entity to teleport to&lt;br /&gt;
#''asTargetBody'' - Internal name of the entity's body name to teleport to. If empty, the first body will be used (might be unstable, recommended to input a body anyway)&lt;br /&gt;
#''abChangeY'' - Whether the Y position of the entity will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeManPigPose(string &amp;amp;in asName, string &amp;amp;in asPoseType);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the pose a specified ManPig.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''asPoseType'' - Name of the ManPig pose to use. Can be &amp;quot;Biped&amp;quot; or &amp;quot;Quadruped&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigFadeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should fade the player's view in and out.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigSoundDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should play the proximity sounds.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigEasyEscapeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should be easier to escape from when hunted. If not disabled, easy escape is activated if the player is more than 12.35 meters away, the enemy can't see the player, and the player has less than 75 health. When this occurs, the enemy is forced to stop hunting and wait for half a second.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ForceTeslaPigSighting(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Forces a Tesla ManPig to be visible for a short time.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; GetEnemyStateName(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the name of the state a specified enemy is current in.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
Possible states for all enemies:&lt;br /&gt;
*Idle&lt;br /&gt;
*Wait&lt;br /&gt;
*Patrol&lt;br /&gt;
*Investigate&lt;br /&gt;
*Alert&lt;br /&gt;
*Search&lt;br /&gt;
*Hurt&lt;br /&gt;
*Hunt&lt;br /&gt;
*HuntPause&lt;br /&gt;
*HuntWander&lt;br /&gt;
*AttackMeleeShort&lt;br /&gt;
*AttackMeleeLong&lt;br /&gt;
*BreakDoor&lt;br /&gt;
*Dead&lt;br /&gt;
&lt;br /&gt;
Waterlurker-only states:&lt;br /&gt;
*GoHome&lt;br /&gt;
*Eat&lt;br /&gt;
&lt;br /&gt;
ManPig-only states: &lt;br /&gt;
*Flee&lt;br /&gt;
*Stalk&lt;br /&gt;
*Track&lt;br /&gt;
&lt;br /&gt;
Unused states:&lt;br /&gt;
*AttackRange&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=7023</id>
		<title>HPL2/Engine Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=7023"/>
		<updated>2025-10-16T18:38:44Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Props */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TocRight}}&lt;br /&gt;
&lt;br /&gt;
This page documents all scripts available in Amnesia: The Dark Descent.&lt;br /&gt;
&lt;br /&gt;
{{note|'''Note''': Some of the functions require the Amnesia 1.3 or 1.5 update. Steam and other online store copies should be automatically updated. Other copies can get 1.3 [http://www.frictionalgames.com/forum/thread-24334.html here].}}&lt;br /&gt;
&lt;br /&gt;
== Directives ==&lt;br /&gt;
&lt;br /&gt;
First off, &amp;lt;code&amp;gt;#include &amp;quot;file.hps&amp;quot;&amp;lt;/code&amp;gt; can be used to programmatically merge together multiple separate files to make organizing scripts easier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
==Engine scripts==&lt;br /&gt;
===Main===&lt;br /&gt;
&lt;br /&gt;
The following functions are the main hps functions that the HPL2 engine looks to run on certain events - similar to the C++ int main() function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void OnStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the map is loaded for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnEnter();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs whenever the player enters a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnLeave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the player leaves a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnGameStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is found in the global.hps file and the inventory.hps file, and is run when the game is first started by the player (ie via &amp;quot;Start New Game&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnUpdate(float afStep);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
This function is executed for every game update or &amp;quot;tick&amp;quot;. Can be used for rapid-firing updates instead of looping timers. Keep in mind that this can affect game performance if not used with care.&lt;br /&gt;
&lt;br /&gt;
#''afStep''- Time elapsed in seconds since the last frame. Multiply speeds, distances etc. by this argument to avoid framerate dependence issues (for example: if you move something in this function with constant speed, it will move faster on computers which run the game with high FPS and slower on computers with low FPS).&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float RandFloat(float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random float.&lt;br /&gt;
&lt;br /&gt;
#''afMin ''- minimum value&lt;br /&gt;
#''afMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int RandInt(int alMin, int alMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random int. Note: the maximum value is ''inclusive''  - the RandInt() function may return this value.&lt;br /&gt;
&lt;br /&gt;
#''alMin ''- minimum value&lt;br /&gt;
#''alMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringContains(string &amp;amp;in asString, string &amp;amp;in asSubString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a string contains the specified string. &amp;lt;br /&amp;gt;Example: searching for &amp;quot;hello&amp;quot; in &amp;quot;hello world&amp;quot; would return '''true'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to check&lt;br /&gt;
#''asSubString ''- the string to search for&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; StringSub(string &amp;amp;in asString, int alStart, int alCount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the substring in a string. &amp;lt;br /&amp;gt;Example: in the string &amp;quot;frictional games rocks&amp;quot;, using 4 as ''alStart''  and 6 as ''alCount''  would return '''&amp;quot;tional&amp;quot;'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string&lt;br /&gt;
#''alStart ''- starting character of the string, with 0 being the first character&lt;br /&gt;
#''alCount ''- amount of characters&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int StringToInt(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns an integer converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float StringToFloat(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a float converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringToBool(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a boolean converted from a string, else returns false.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&lt;br /&gt;
===Mathematical Operations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathCos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathTan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAsin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAcos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan2(float afX, float afY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Calculates and returns the arc tangent of the specified values.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - First value to operate.&lt;br /&gt;
#''afY''  - Second value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSqrt(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the square root of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathPow(float afBase, float afExp);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the value of afBase raised to the power of afExp.&lt;br /&gt;
&lt;br /&gt;
#''afBase''  - The base value.&lt;br /&gt;
#''afExp''  - Value to calculate the base with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMin(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the lowest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMax(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the highest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathClamp(float afX, float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns afX clamped between afMin and afMax. If afX &amp;lt; afMin, returns afMin, and if afX &amp;gt; afMax, returns afMax.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - The value to clamp.&lt;br /&gt;
#''afMin''  - The minimum value to clamp afX with.&lt;br /&gt;
#''afMax''  - The maximum value to clamp afX with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAbs(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the absolute value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&lt;br /&gt;
===Debugging===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void Print(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a string to the log file (''hpl.log'').&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDebugMessage(string &amp;amp;in asString, bool abCheckForDuplicates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a line of text to the debug console at the bottom left of the screen. Debug mode must be enabled for the console messages to be visible.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to print&lt;br /&gt;
#''abCheckForDuplicates ''- if true, the string won't be printed more than once on screen until it disappears&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ProgLog(string &amp;amp;in asLevel, string &amp;amp;in asMessage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints an entry to the ProgLog (progression log). &amp;lt;br /&amp;gt;ProgLog is a file created in Documents/Amnesia/main (or an FC folder if one is being used). It logs certain events, such us opening the menu or picking up the lantern, as well as the player's state (Health, Sanity, Oil, Tinderboxes, Coins), for the purpose of documenting a tester's playstyle. &amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt;This function allows to log custom messages.The messages in the ProgLog file are sorted by time elapsed since a map was loaded.&lt;br /&gt;
&lt;br /&gt;
ProgLog has to be enabled for a player profile in ''user_settings.cfg''  before it starts working.&lt;br /&gt;
&lt;br /&gt;
#''asLevel ''- can be &amp;quot;Low&amp;quot;, &amp;quot;Medium&amp;quot; or &amp;quot;High&amp;quot;. It's a tag which appears in each log entry, for event prioritising.&lt;br /&gt;
#''asMessage ''- The custom message to be printed to the log.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool ScriptDebugOn();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the debug mode is enabled. &amp;lt;br /&amp;gt;See [[HPL2/Development_Environment|&amp;quot;Setting up Development Environment&amp;quot;]] to setup debug mode on your own computer.&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
{{warning|Regular variables (int, float, etc.) are '''not''' saved by the game. Using them in important parts of yor script will break it upon loading a game save. In HPL, those variables should only be used for disposable counters, like spawning objects in a &amp;quot;for&amp;quot; loop. For variables which need to be saved, use the wrappers as described below.}}&lt;br /&gt;
&lt;br /&gt;
====Local====&lt;br /&gt;
&lt;br /&gt;
Local variables can be used throughout the same script file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetLocalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetLocalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddLocalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetLocalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Global====&lt;br /&gt;
&lt;br /&gt;
Global variables can be used throughout several maps and can be accessed by several script files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetGlobalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetGlobalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddGlobalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetGlobalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Particle Systems===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadParticleSystem(string &amp;amp;in asPSFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asPSFile''  - The particle system file to load. Extension: .ps&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntity(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntityExt(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS,&lt;br /&gt;
float afR, float afG, float afB, float afA, bool abFadeAtDistance, float afFadeMinEnd, float afFadeMinStart,&lt;br /&gt;
float afFadeMaxStart, float afFadeMaxEnd);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity, extended method with more options.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''abFadeAtDistance ''- determines whether a particle system fades from a certain distance on&lt;br /&gt;
#''afFadeMinEnd ''- minimum distance at which the particle system stops fading&lt;br /&gt;
#''afFadeMinStart ''- minimum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxStart ''- maximum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxEnd ''- maximum distance at which the particle system stops fading&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DestroyParticleSystem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Destroys a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - The internal name of the particle system&lt;br /&gt;
&lt;br /&gt;
===Sounds &amp;amp; Music===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadSound(string &amp;amp;in asSoundFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile''  - The sound file to load (extension .snt optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayGuiSound(string &amp;amp;in asSoundFile, float afVolume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays a sound, not using 3D.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile ''- the sound to play (extension .snt/.ogg optional)&lt;br /&gt;
#''afVolume ''- the volume of the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaySoundAtEntity(string &amp;amp;in asSoundName, string &amp;amp;in asSoundFile, string &amp;amp;in asEntity, float afFadeTime, bool abSaveSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a sound at an entity.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''asSoundFile ''- the sound to use (extension .snt optional)&lt;br /&gt;
#''asEntity ''- the entity to create the sound at. Using &amp;quot;Player&amp;quot; is effectively the same as &amp;lt;code&amp;gt;PlayGuiSound&amp;lt;/code&amp;gt;, yet this function allows a looping sound to be saved&lt;br /&gt;
#''afFadeTime ''- time in seconds the sound needs to fade. Avoids enemies hearing the sound if afFadeTime is at least 0.1f&lt;br /&gt;
#''abSaveSound ''- if ''true'', a looping sound will &amp;quot;remember&amp;quot; its playback state (currently playing/stopped), and that state will be restored the next time the level is entered. If ''true'', the sound is never attached to the entity! Note that saving should only be used on ''looping sounds''!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeInSound(string &amp;amp;in asSoundName, float afFadeTime, bool abPlayStart);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades in a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds&lt;br /&gt;
#''abPlayStart ''- Play the sound defined in the &amp;lt;code&amp;gt;&amp;lt;Start&amp;gt;&amp;lt;/code&amp;gt; section of the .snt before playing the main sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopSound(string &amp;amp;in asSoundName, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades out a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds, use 0 to immediately stop the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayMusic(string &amp;amp;in asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays music.&lt;br /&gt;
&lt;br /&gt;
#''asMusicFile ''- the music file to play (extension .ogg optional)&lt;br /&gt;
#''abLoop ''- determines whether a music track should loop&lt;br /&gt;
#''afVolume ''- volume of the music&lt;br /&gt;
#''afFadeTime ''- time in seconds until music reaches full volume&lt;br /&gt;
#''alPrio ''- priority of the music. Note that only the music with the highest priority can be heard! 0 - lowest, 1 - higher, etc.&lt;br /&gt;
#''abResume''  - if ''true'', playback will be continued from where the track stopped after the call to &amp;lt;code&amp;gt;StopMusic()&amp;lt;/code&amp;gt;. If ''false'', the track will be restarted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopMusic(float afFadeTime, int alPrio);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops music.&lt;br /&gt;
&lt;br /&gt;
#''afFadeTime ''- time in seconds until music stops&lt;br /&gt;
#''alPrio ''- the priority of the music that should stop&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice(string &amp;amp;in asVoiceFile, string &amp;amp;in asEffectFile, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry,&lt;br /&gt;
bool abUsePosition, string &amp;amp;in asPosEntity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This adds a voice and an additional sound effect to be played. It is okay to call this many times in order to play many voices in a row. The EffectVoiceOverCallback is not called until ALL voices have finished.&lt;br /&gt;
&lt;br /&gt;
#''asVoiceFile ''- the voice to play&lt;br /&gt;
#''asEffectFile ''- the sound effect to play&lt;br /&gt;
#''asTextCat ''- the category in the .lang file, usually &amp;quot;Voice&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''abUsePosition ''- plays using 3D from the entity, or without 3D&lt;br /&gt;
#''asPosEntity ''- the entity at which the voice and sound are played from&lt;br /&gt;
#''afMinDistance ''- minimum distance the voice and sound are heard&lt;br /&gt;
#''afMaxDistance ''- maximum distance the voice and sound are heard&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopAllEffectVoices(float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all voices and calls the EffectVoiceOverCallback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEffectVoiceActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether EffectVoices are still active.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetEffectVoiceOverCallback(string &amp;amp;in asFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to be called when the EffectVoices are finished. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundVolume(float afDestVolume, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound volume, that means everything you can hear '''from the world'''. This does not affect music of GUI sounds.&lt;br /&gt;
&lt;br /&gt;
#''afDestVolume ''- desired volume&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired volume&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundSpeed(float afDestSpeed, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound speed.&lt;br /&gt;
&lt;br /&gt;
#''afDestSpeed ''- desired speed&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired speed&lt;br /&gt;
&lt;br /&gt;
===Lights===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightVisible(string &amp;amp;in asLightName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables lights.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''abVisible ''- determines the state of the light&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeLightTo(string &amp;amp;in asLightName, float afR, float afG, float afB, float afA, float afRadius, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the properties of a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''afRadius ''- radius of the light. -1 means keeping the radius&lt;br /&gt;
#''afTime ''- time in seconds until change is done&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightFlickerActive(string &amp;amp;in asLightName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates flickering on a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName'' - The internal light name&lt;br /&gt;
#''abActive'' - true = active, false = inactive&lt;br /&gt;
&lt;br /&gt;
==Game scripts==&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartCredits(string &amp;amp;in asMusic, bool abLoopMusic, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alEndNum);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts the end credits screen.&lt;br /&gt;
&lt;br /&gt;
#''asMusic ''- the music to play (including .ogg)&lt;br /&gt;
#''abLoopMusic ''- determines whether the music should loop&lt;br /&gt;
#''asTextCat ''- the category to be used in the .lang file, usually &amp;quot;Ending&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alEndNum ''- Amnesia has 3 different endings and displays a code at the bottom. Determines which code is displayed. 0-2 will display codes, any other integer will not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartDemoEnd();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shows the demo end screen. The background and UI elements are defined in demo.cfg, with the text using the entries in the &amp;quot;Demo&amp;quot; category of the .lang file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AutoSave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an auto save file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CheckPoint(string &amp;amp;in asName, string &amp;amp;in asStartPos, string &amp;amp;in asCallback, string &amp;amp;in asDeathHintCat, string &amp;amp;in asDeathHintEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a checkpoint at which the player will respawn in case he dies. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asName, int alCount)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;Count is 0 on the first checkpoint load!&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the editor&lt;br /&gt;
#''asCallback ''- the function to call when the player dies/respawns&lt;br /&gt;
#''asDeathHintCat ''- the category of the death hint message to be used in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asDeathHintEntry ''- the entry in the .lang file&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeMap(string &amp;amp;in asMapName, string &amp;amp;in asStartPos, string &amp;amp;in asStartSound, string &amp;amp;in asEndSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Loads another map after a 1.5 second fade out.&lt;br /&gt;
&lt;br /&gt;
#''asMapName ''- the file to load&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the next map&lt;br /&gt;
#''asStartSound ''- the sound that is played when the change starts&lt;br /&gt;
#''asEndSound ''- the sound that is played when the new map is loaded&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ClearSavedMaps();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the &amp;quot;history&amp;quot; of the save, useful to do when you know the player will not be able to go back anymore. Makes the next save much smaller in size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateDataCache();&lt;br /&gt;
void DestroyDataCache();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This caches all current textures and models and they are not released until destroy is called. If there is already cached data it is destroyed.&lt;br /&gt;
Create caches to enable faster loading when going back to a map. Destroy the cache if you know the player won't go back to that map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMapDisplayNameEntry(string &amp;amp;in asNameEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the map name shown in save file names. If none is set NULL is assumed.&lt;br /&gt;
&lt;br /&gt;
#''asNameEntry ''- the entry to display, category must be &amp;quot;Levels&amp;quot;!&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the skybox.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxTexture(string &amp;amp;in asTexture);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the texture of the skybox.&lt;br /&gt;
&lt;br /&gt;
#''asTexture''  - The texture file to set. Extension: .dds&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the solid color of the skybox rather than a texture.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the global fog.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the color to use for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogProperties(float afStart, float afEnd, float afFalloffExp, bool abCulling);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the properties for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afStart ''- how many meters from the camera should the fog begin&lt;br /&gt;
#''afEnd ''- how many meters from the camera should the fog reach full thickness&lt;br /&gt;
#''afFalloffExp ''- the amount by which the thinkness increases&lt;br /&gt;
#''abCulling ''- whether occlusion culling is active for the fog; this prevents objects behind the fog from being loaded&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetupLoadScreen(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alRandomNum, string &amp;amp;in asImageFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which loading screen will be shown when changing maps.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category of the loading text in the .lang file to be shown on the loading screen, usually &amp;quot;LoadingText&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alRandomNum ''- if greater 1, then it will randomize between 1 and alRandom for each LoadScreen giving entry the suffix XX (eg 01). If &amp;lt; =1 then no suffix is added&lt;br /&gt;
#''asImageFile ''- the image to be shown (optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void UnlockAchievement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlocks the specified achievement. Only able to be used for the ending achievements.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the achievement. Only the following strings are valid:&lt;br /&gt;
::* Benefactor&lt;br /&gt;
::* Survivor&lt;br /&gt;
::* Sacrifice&lt;br /&gt;
::* Quitter&lt;br /&gt;
::* Egotist&lt;br /&gt;
::* Altruist&lt;br /&gt;
::* Vacillator&lt;br /&gt;
&lt;br /&gt;
===Game Timer===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddTimer(string &amp;amp;in asName, float afTime, string &amp;amp;in asFunction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a timer which calls a function when it expires. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asTimer)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the name of the timer&lt;br /&gt;
#''afTime ''- time in seconds&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveTimer(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a timer, no matter how much time is left.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the timer.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetTimerTimeLeft(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the time left on a timer.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - the internal name of the timer.&lt;br /&gt;
&lt;br /&gt;
===Screen Effects===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeOut(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to black.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen is completly black&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeIn(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen back to normal.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeImageTrailTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies the image trail effect to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeSepiaColorTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the screen go dark red.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0) &lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeRadialBlurTo(float afSize, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies radial blur effects to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afSize ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetRadialBlurStartDist(float afStartDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines at which distance the radial blur effects appear.&lt;br /&gt;
&lt;br /&gt;
#''afStartDist ''- the distance at which the effect starts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectFlash(float afFadeIn, float afWhite, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white.&lt;br /&gt;
&lt;br /&gt;
#''afFadeIn ''- time in seconds until screen is white&lt;br /&gt;
#''afWhite ''- determines to which percentage the screen fades to white (1.0 = completly white)&lt;br /&gt;
#''afFadeOut ''- time in seconds until screen is back to normal again&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectEmotionFlash(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white and shows a text message.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''asSound ''- the sound to play while fading&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetFlashbackIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a flashback is still in effect.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerSpawnPS(string &amp;amp;in asSPSFile);&lt;br /&gt;
void StopPlayerSpawnPS();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Continuously spawn regular particle systems (''.ps'') around the player. Particles created by this script carry over from map to map.&lt;br /&gt;
&lt;br /&gt;
#''asSPSFile''  - the ''.sps''  file to use. Example ''.sps''  files are located in the ''/misc''  folder in the main game directory.&amp;lt;br&amp;gt;Custom ''.sps''  files can be created by hand in a text editor (see existing ones and mimic how those are written). &amp;lt;br /&amp;gt;Since ''StopPlayerSpawnPS()''  doesn't seem to work, to stop an SPS you must create an ''.sps''  file with an empty particle field field and override the old SPS by calling ''StartPlayerSpawnPS''  again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shakes the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity of the shake&lt;br /&gt;
#''afTime ''- duration of the shake&lt;br /&gt;
#''afFadeInTime ''- time in seconds until full intensity is reached&lt;br /&gt;
#''afFadeOutTime ''- time until screen is back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInDarknessEffectsActive(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the sanity drain and night vision effects while in the darkness.&lt;br /&gt;
&lt;br /&gt;
''bool abX''  - Enable/disable effects.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowScreenImage(string &amp;amp;in asImageName, float afX, float afY, float afScale, bool abUseRelativeCoordinates, float afDuration, float afFadeIn, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
Displays an image file directly onto the screen. See [[HPL2/Tutorials/ShowScreenImage()|ShowScreenImage()]] in the tutorials section for more information.&lt;br /&gt;
&lt;br /&gt;
# ''asImageName'' - The image file to render (.jpg, .png, .tga, .dds)&lt;br /&gt;
# ''afX'' - The X position of the image&lt;br /&gt;
# ''afY'' - The Y position of the image&lt;br /&gt;
# ''afScale'' - The size of the image in pixels (not scale), or original image size if negative&lt;br /&gt;
# ''abUseRelativeCoordinates'' - Whether X and Y are relative to the screen resoltion, or pixel co-ordinates if not&lt;br /&gt;
# ''afDuration'' - The duration that the image is displayed for&lt;br /&gt;
# ''afFadeIn'' - The time, in seconds, to fade in the image&lt;br /&gt;
# ''afFadeOut'' - The time, in seconds, to fade out the image&lt;br /&gt;
&lt;br /&gt;
===Insanity===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInsanitySetEnabled(string &amp;amp;in asSet, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which InsanitySets are enabled.&lt;br /&gt;
&lt;br /&gt;
#''asSet ''- the set&lt;br /&gt;
#''abX ''- enabled or not&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartInsanityEvent(string &amp;amp;in asEventName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Starts a specified insanity event.&lt;br /&gt;
&lt;br /&gt;
#''asEventName ''- Insanity event to play.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartRandomInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts a random insanity event from the available sets.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopCurrentInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Stops the currently playing insanity event.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void InsanityEventIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an insanity event is currently in effect.&amp;lt;br&amp;gt;Not useful at all due to having a return type of &amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; when it should be &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Player===&lt;br /&gt;
&lt;br /&gt;
Note that the player's maximum health and sanity is 100.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enabled/Disable player controlled movement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangePlayerStateToNormal();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets the player's state, forcing them to stop interacting with objects. It also clears the inventory item to be used (as if it was double-clicked on in the inventory again) and dismounts the player from ladders.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerCrouching(bool abCrouch);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddPlayerBodyForce(float afX, float afY, float afZ, bool abUseLocalCoords);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pushes the player into a certain direction. Note that you need values above ~2000 to see any effects.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - amount along the X-axis&lt;br /&gt;
#''afY'' - amount along the Y-axis&lt;br /&gt;
#''afZ'' - amount along the Z-axis&lt;br /&gt;
#''abUseLocalCoords'' - If true, axes are based on where the player is facing, not the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowPlayerCrossHairIcons(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the icons when a player has something in focus.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerSanity(float afSanity);&lt;br /&gt;
void AddPlayerSanity(float afSanity);&lt;br /&gt;
float GetPlayerSanity();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerHealth(float afHealth);&lt;br /&gt;
void AddPlayerHealth(float afHealth);&lt;br /&gt;
float GetPlayerHealth();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerLampOil(float afOil);&lt;br /&gt;
void AddPlayerLampOil(float afOil);&lt;br /&gt;
float GetPlayerLampOil();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the lamp oil of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerSpeed();&lt;br /&gt;
float GetPlayerYSpeed();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current speed of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSanityDrainDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables sanity drain from darkness.&lt;br /&gt;
{{bug|Sanity drain is reenabled on loading a save, as the game is unable to load the value properly from the save data.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoost();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a large amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! New Sanity&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || 100&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || 90&lt;br /&gt;
|-&lt;br /&gt;
| 50-74 || 80&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoostSmall();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a small amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! Sanity Bonus&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || +20&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || +15&lt;br /&gt;
|-&lt;br /&gt;
| 50-75 || +10&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityDamage(float afAmount, bool abUseEffect);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount'' - amount of sanity damage done&lt;br /&gt;
#''abUseEffect'' - if a sound is played and screen effects are shown when the sanity damage is dealt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GivePlayerDamage(float afAmount, string &amp;amp;in asType, bool abSpinHead, bool abLethal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the health of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount'' - amount of damage done to health&lt;br /&gt;
#''asType'' - plays a certain effect on the screen when the damage is dealt (BloodSplat, Claws, or Slash) &lt;br /&gt;
#''abSpinHead'' - changes the camera view when damage is dealt&lt;br /&gt;
#''abLethal'' - set to true if player can die from given damage. If ''false'' and the damage would have left the player with less than 10 health, health is set to 10.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerFOVMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the field of view of the player. A shorter FOV will create a zoom effect.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - multiplier of default FOV (1 is default)&lt;br /&gt;
#''afSpeed'' - the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerAspectMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the aspect ratio of the player. Basically stretches or narrows the screen horizontally.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - multiplier of default aspect (default is 1)&lt;br /&gt;
#''afSpeed'' - the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - angle of rotation of head, positive being counter-clockwise&lt;br /&gt;
#''afSpeedMul'' - speed (possibly acceleration) multiplier of the rotation (default 1, which is really slow)&lt;br /&gt;
#''afMaxSpeed'' - maximum speed of rotation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerForward(float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Moves the player forward. It needs to be called in a timer that updates 60 times / second.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- amount along the X-axis&lt;br /&gt;
#''afY ''- amount along the Y-axis&lt;br /&gt;
#''afZ ''- amount along the Z-axis&lt;br /&gt;
#''afSpeed ''- speed at which the change happens&lt;br /&gt;
#''afSlowDownDist ''- distance at which to start slowing down (prevents the head from abruptly stopping)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerLookAt(string &amp;amp;in asEntityName, float afSpeedMul, float afMaxSpeed, string &amp;amp;in asAtTargetCallback);&lt;br /&gt;
void StopPlayerLookAt();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to look at a certain entity until StopPlayerLookAt is used.&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- the entity to look at &lt;br /&gt;
#''afSpeedMul ''- how fast should the player look at the entity&lt;br /&gt;
#''afMaxSpeed ''- maximum speed allowed&lt;br /&gt;
#''asAtTargetCallback ''- function to call when player looks at target&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerMoveSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerRunSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerLookSpeedMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the player's move/run/look speed. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpForceMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the player's jump multiplier. Higher values = higher jumps. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpDisabled(bool abX);&lt;br /&gt;
void SetPlayerCrouchDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to jump/crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportPlayer(string &amp;amp;in asStartPosName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly teleports the player to the target StartPos.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternActive(bool abX, bool abUseEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the player use his lantern.&lt;br /&gt;
&lt;br /&gt;
# ''abX'' - Set lantern to be active (true) or inactive (false)&lt;br /&gt;
# ''abUseEffects'' - Play on/off sounds&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetLanternActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player is currently using the lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to use the lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternLitCallback(string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to call when the player uses the lantern. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;MyFunc(bool abLit)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message on the screen.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory'' - the category in the .lang file&lt;br /&gt;
#''asTextEntry'' - the entry in the .lang file&lt;br /&gt;
#''afTime'' - determines how long the message is displayed. If time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetDeathHint(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the message that appears when the player dies.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory'' - the category in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asTextEntry'' - the entry in the .lang file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DisableDeathStartSound();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the death sound when the player dies. This must be called directly before player is killed! The variable as soon as player dies too.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPermaDeathSound(string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Sets the sound played after the player dies when permadeath is active. Permadeath is only active when the game is launched with the &amp;lt;code&amp;gt;ptest&amp;lt;/code&amp;gt; command line parameter. Only used for the post-death Suitor lines in ''Justine''.&lt;br /&gt;
&lt;br /&gt;
#''asSound'' - The sound to be played after death. Expects a voice-type sound.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerFallDamageDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the player's ability to take fall damage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPos(float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the player's position within the level.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - X co-ordinate position.&lt;br /&gt;
#''afY'' - Y co-ordinate position.&lt;br /&gt;
#''afZ'' - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerPosX();&lt;br /&gt;
float GetPlayerPosY();&lt;br /&gt;
float GetPlayerPosZ();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the player's position within the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
===Journal===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddNote(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a note to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _Name and _Text and be in category &amp;quot;Journal&amp;quot;!&lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDiary(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a diary to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _NameX and _TextY whereas X and Y are numbers of the parts (_Name1: first diary, _Text1: first page) and be in category &amp;quot;Journal&amp;quot;! &lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ReturnOpenJournal(bool abOpenJournal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Only called in the pickup diary callback! If true the journal displays the entry else not.&lt;br /&gt;
&lt;br /&gt;
===Quests===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a quest to the player's journal under mementos. Completed quests cannot be readded.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name to be used&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot;Quest_&amp;lt;texthere&amp;gt;_Text”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CompleteQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Completes a quest. If the quest has not been added, it's marked as complete anyway, preventing it from being added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot; Quest_&amp;lt;texthere&amp;gt;_Text ”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool QuestIsCompleted(string &amp;amp;in asName);&lt;br /&gt;
bool QuestIsAdded(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a quest is completed/added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetNumberOfQuestsInMap(int alNumberOfQuests);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the number of quests in the map. Obsolete; formerly used to calculate a completion percentage when looking at a level door.&lt;br /&gt;
&lt;br /&gt;
#''alNumberOfQuests ''- Amount of quests&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveHint(string &amp;amp;in asName, string &amp;amp;in asMessageCat, string &amp;amp;in asMessageEntry, float afTimeShown);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a hint on the player's screen.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asMessageCat ''- the category in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asMessageEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTimeShown ''- time in seconds until the message disappears. If time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void BlockHint(string &amp;amp;in asName);&lt;br /&gt;
void UnBlockHint(string &amp;amp;in asName);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Blocking a hint prevents it from being shown. Blocked hints are included in savefiles, so they should persist between levels. Unblocking a hint allows it to be shown.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; blocks the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveHint(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes the hint from the list of already shown hints, allowing it to appear again.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; reenables the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
===Inventory===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ExitInventory();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Exits the inventory by force.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the player's ability to open his inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a message on the inventory screen. Used for feedback messages when failing to combine items.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory ''- the category in the .lang file, usually &amp;quot;Inventory&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTime ''- time in seconds until the message disappears. If life time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItem(string &amp;amp;in asName, string &amp;amp;in asType, string &amp;amp;in asSubTypeName, string &amp;amp;in asImageName, float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds an item to the inventory of the player. Note that the item does not have to exist as entity in the world to be able to do this.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asType ''- item type to give, Available types are:&lt;br /&gt;
::*Puzzle&lt;br /&gt;
::*Lantern&lt;br /&gt;
::*Health&lt;br /&gt;
::*Sanity&lt;br /&gt;
::*LampOil&lt;br /&gt;
::*Tinderbox&lt;br /&gt;
#''asSubTypeName ''- item name for .lang file&lt;br /&gt;
#''asImageName ''- the image which will appear in inventory. For example: &amp;lt;code&amp;gt;void GiveItem(&amp;quot;chemical_container_full_1&amp;quot;, &amp;quot;Puzzle&amp;quot;, &amp;quot;chemical_container_full&amp;quot;, &amp;quot;chemical_container_full.tga&amp;quot;, 1);&amp;lt;/code&amp;gt; will use the image from &amp;lt;code&amp;gt;graphics/item/chemical_container_full.tga&amp;lt;/code&amp;gt; &lt;br /&gt;
#''afAmount ''- amount the item gives, - For example: Oil potions will fill the oil meter by this amount, Health potions will heal by this amount, etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item from the player's inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool HasItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player has an item in his inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItemFromFile(string &amp;amp;in asName, string &amp;amp;in asFileName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a single item to the player's inventory. This is meant to be used for debug mostly as it creates the actual item and then destroys it.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asFileName ''- item to give + extension (.ent)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddCombineCallback(string &amp;amp;in asName, string &amp;amp;in asItemA, string &amp;amp;in asItemB, string &amp;amp;in asFunction, bool abAutoRemove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to combine items in his inventory. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItemA, string &amp;amp;in asItemB)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name for the callback&lt;br /&gt;
#''asItemA ''- internal name of first item&lt;br /&gt;
#''asItemB ''- internal name of second item&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
#''abAutoRemove ''- determines whether the callback should be removed when the items are combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveCombineCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a combine callback.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the callback to be removed (as specified in AddCombineCallback)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddUseItemCallback(string &amp;amp;in asName, string &amp;amp;in asItem, string &amp;amp;in asEntity, string &amp;amp;in asFunction, bool abAutoDestroy);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to use items on the world. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItem, string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
#''asItem ''- internal name of the item&lt;br /&gt;
#''asEntity ''- entity to be able to use the item on&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abAutoDestroy ''- determines whether the callback should be removed when the item is used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveUseItemCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item callback.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
&lt;br /&gt;
===Entities===&lt;br /&gt;
&lt;br /&gt;
====General====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityActive(string &amp;amp;in asName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityVisible(string &amp;amp;in asName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity's visual mesh. The collision body remains.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the entity.&lt;br /&gt;
#''abActive''  - Activate/deactivate mesh.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntityExists(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an entity exists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCustomFocusCrossHair(string &amp;amp;in asName, string&amp;amp; asCrossHair);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the crosshair that is used when focusing an entity.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCrossHair ''- desired crosshair, can be: &lt;br /&gt;
::*Default (no crosshair)&lt;br /&gt;
::*Grab&lt;br /&gt;
::*Push&lt;br /&gt;
::*Ignite&lt;br /&gt;
::*Pick&lt;br /&gt;
::*LevelDoor&lt;br /&gt;
::*Ladder&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void CreateEntityAtArea(string &amp;amp;in asEntityName, string &amp;amp;in asEntityFile, string &amp;amp;in asAreaName, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an entity at an area. When creating an enemy though, it cannot chase properly along PathNodes (using for example &amp;lt;code&amp;gt;ShowEnemyPlayerPosition&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- internal name&lt;br /&gt;
#''asEntityFile ''- entity to be used extension .ent&lt;br /&gt;
#''asAreaName ''- the area to create the entity at&lt;br /&gt;
#''abFullGameSave ''- determines whether an entity &amp;quot;remembers&amp;quot; its state&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ReplaceEntity(string &amp;amp;in asName, string &amp;amp;in asBodyName, string &amp;amp;in asNewEntityName, string &amp;amp;in asNewEntityFile, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Removes an entity and places a new one in its place.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to replace.&lt;br /&gt;
#''asBodyName'' - Name of the body of the entity to place the new entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''asNewEntityName'' - Name of the new entity.&lt;br /&gt;
#''asNewEntityFile'' - Name of the new entity file. Extension .ent. &lt;br /&gt;
#''abFullGameSave'' - Whether ALL properties of this entity should be saved throughout levels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaceEntityAtEntity(string &amp;amp;in asName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBodyName, bool abUseRotation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Places an entity at the position of another entity. Does not work for enemies, use TeleportEnemyToEntity instead.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to place.&lt;br /&gt;
#''asTargetEntity'' - Name of the other entity to place the first entity at.&lt;br /&gt;
#''asTargetBodyName'' - Name of the body of the entity to place the first entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''abUseRotation'' - Whether the entity should be rotated like the target entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPos(string &amp;amp;in asName, float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Moves an entity to a position in the level.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to move.&lt;br /&gt;
#''afX'' - X co-ordinate position.&lt;br /&gt;
#''afY'' - Y co-ordinate position.&lt;br /&gt;
#''afZ'' - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetEntityPosX(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosY(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosZ(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns an entity's position in the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerLookAtCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveWhenLookedAt);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player looks at a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = looking, -1 = not looking&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveWhenLookedAt ''- determines whether the callback should be removed when the player looked at the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerInteractCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveOnInteraction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player interacts with a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveOnInteraction ''- determines whether the callback should be removed when the player interacts with the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCallbackFunc(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when certain events occur with an entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, string &amp;amp;in asType)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;asType&amp;lt;/code&amp;gt; values depend on entity type:&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! asType Value&lt;br /&gt;
|-&lt;br /&gt;
| Object || Break&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || OnIgnite&lt;br /&gt;
|-&lt;br /&gt;
| Item || OnPickup&lt;br /&gt;
|-&lt;br /&gt;
| Enemy || OnDeath&lt;br /&gt;
|-&lt;br /&gt;
| Enemy_Grunt&amp;lt;br&amp;gt;Enemy_Manpig || OnAutoDisabled&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityConnectionStateChangeCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A callback called when ever the connection state changes (button being switched on, lever switched, etc). &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void Func(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: -1 = off, 0 = between, 1 = on&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityInteractionDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disallows interaction with an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void BreakJoint (string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Breaks a joint. Do not use this on joints in SwingDoors, Levers, Wheels, etc. where the joint is part of an interaction. That will make the game crash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void AddEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName, string &amp;amp;in asFunction, bool abDeleteOnCollide, int alStates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when two entities collide. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asParent, string &amp;amp;in asChild, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = enter, -1 = leave&lt;br /&gt;
&lt;br /&gt;
#''asParentName ''- internal name of main object&lt;br /&gt;
#''asChildName ''- internal name of object that collides with main object (asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) NOT supported!)&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abDeleteOnCollide ''- determines whether the callback after it was called&lt;br /&gt;
#''alStates ''- 1 = only enter, -1 = only leave, 0 = both&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an EntityCollideCallback. Asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) not supported in ''asChildName''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntitiesCollide(string &amp;amp;in asEntityA, string &amp;amp;in asEntityB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether two entities collide. This function does NOT support asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) or &amp;quot;Player&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetBodyMass(string &amp;amp;in asName, float afMass);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName.&lt;br /&gt;
#''afMass''  - The mass to set.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetBodyMass(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName. &lt;br /&gt;
#''afMass''  - The mass to get.&lt;br /&gt;
&lt;br /&gt;
====Props====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropEffectActive(string &amp;amp;in asName, bool abActive, bool abFadeAndPlaySounds);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Turns the texture illumination, billboards, particles, light flicker, and sounds of a prop on or off.&lt;br /&gt;
&lt;br /&gt;
Can be used on coal to give it the black color it should have.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name &lt;br /&gt;
#''abActive'' - active state&lt;br /&gt;
#''abFadeAndPlaySounds'' - if all effects should fade in/out or not&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropActiveAndFade(string &amp;amp;in asName, bool abActive, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates a prop.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''abActive ''- nothing to add&lt;br /&gt;
#''afFadeTime ''- time in seconds until prop fully fades&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropStaticPhysics(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates the physics of a prop, setting the mass to 0. Setting as true will make entities static in midair.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetPropIsInteractedWith(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a prop is interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RotatePropToSpeed(string &amp;amp;in asName, float afAcc, float afGoalSpeed, float afAxisX, float afAxisY, float afAxisZ, bool abResetSpeed, string &amp;amp;in asOffsetArea);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the prop up to a set speed.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afGoalSpeed ''- desired speed &lt;br /&gt;
#''afAxisX ''- rotation around X axis&lt;br /&gt;
#''afAxisY ''- rotation around Y axis&lt;br /&gt;
#''afAxisZ ''- rotation around Z axis&lt;br /&gt;
#''abResetSpeed ''- determines whether the speed is resetted after goal speed is reached&lt;br /&gt;
#''asOffsetArea ''- the area to rotate around, if empty, then the center of the body is used Note: The entity you want to rotate MUST be a &amp;quot;StaticObject&amp;quot; entity!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void StopPropMovement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all movement of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddAttachedPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop.&lt;br /&gt;
&lt;br /&gt;
#''asPropName''- the prop to attach another prop at &lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop&lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach&lt;br /&gt;
&lt;br /&gt;
Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
{{bug|''afRotZ '' is used for both the ZX rotation and the Z position of the attached prop. Unwanted rotation can be avoided by using: &amp;lt;br /&amp;gt;''AddAttachedPropToProp(asPropName, asAttachName, asAttachFile, afPosX, afPosY, '''0''', afPosZ, '''90.0f''', afPosZ)''}}&lt;br /&gt;
&lt;br /&gt;
{{bug|Attaching a breakable prop to a physically active prop, and then breaking the attached prop, will cause the game to crash, should the parent object be moved or reset.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop. Fixed version of &amp;lt;code&amp;gt;AddAttachedPropToProp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
#''asPropName ''- the prop to attach another prop at&lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop &lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveAttachedPropFromProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches a prop from a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
void AddPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
float GetPropHealth(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ResetProp(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets a prop's state to the original one when the map was loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void PlayPropAnimation(string &amp;amp;in asProp, string &amp;amp;in asAnimation, float afFadeTime, bool abLoop, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the prop play an animation and calls a function. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asProp)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asProp ''- internal name of the prop&lt;br /&gt;
#''asAnimation ''- animation to play&lt;br /&gt;
#''afFadeTime ''- Fade time between current and new animations&lt;br /&gt;
#''abLoop ''- determines whether the animation loops &lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddPropForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddPropImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These functions push objects. Note that rather high values are needed when applying ''forces''  (on the order of ~100 (weak) to ~10000 (strong)), but not impulses (values less than 10 can be appropriate). Forces are external influences, and will have different effect depending on the mass of the object they are being applied to; impulses disregard mass, and can cause objects to break, as if hit. A &amp;quot;Body&amp;quot; is a physics-related helper object, to which a force or an impulse can be applied. Entities can consist of several bodies, interconnected in various ways (you can create/examine bodies in the model editor).&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the object to push; for bodies, use this format: &amp;quot;''entityName''_''bodyName''&amp;quot;&lt;br /&gt;
#''afX ''- magnitude along the X-axis&lt;br /&gt;
#''afY ''- magnitude along the Y-axis&lt;br /&gt;
#''afZ ''- magnitude along the Z-axis&lt;br /&gt;
#''asCoordSystem ''- determines which coordinate system is used, &amp;quot;local&amp;quot; or &amp;quot;world&amp;quot;&lt;br /&gt;
&lt;br /&gt;
All of these functions are ''additive''  - when called consecutively, for each call, the vectors defined by (afX, afY, afZ) will be added together, and a resultant force/impulse will be calculated ''before''  any physics simulation is applied to the target object.&lt;br /&gt;
&lt;br /&gt;
====Connections====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithRope(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asRopeName, bool abInteractOnly, float afSpeedMul, float afToMinSpeed, float afToMaxSpeed, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects a prop with the movement of a rope (i.e. turn a wheel to move a rope). For Levers, the rope only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName''- The name of the connection&lt;br /&gt;
#''asPropName'' - The name of the prop; can be a Lever or Wheel&lt;br /&gt;
#''asRopeName'' - The name of the rope&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''afSpeedMul'' - Speed multiplier of how quickly the rope moves&lt;br /&gt;
#''afToMinSpeed'' - The slowest the rope can move&lt;br /&gt;
#''afToMaxSpeed'' - The fastest the rope can move&lt;br /&gt;
#''abInvert'' - Whether to invert the direction the rope moves&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithMoveObject(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asMoveObjectName, bool abInteractOnly, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This one should only be used if there must be an exact correspondence to prop &amp;quot;amount&amp;quot; and the MoveObject open amount. It is best used for Wheel-door connections, where the MoveObject moves continuously along with the Wheel. For Levers, the MoveObject only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asPropName'' - The entity that controls the movement; can be a Lever or Wheel&lt;br /&gt;
#''asMoveObject'' - The MoveObject to move&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''abInvert'' - If the state is inverted, making the MoveObject move in the opposite direction&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ConnectEntities(string &amp;amp;in asName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, bool abInvertStateSent, int alStatesUsed, string &amp;amp;in asCallbackFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects two entities together so that changing the state of the main entity changes the state of the connected entity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! Max State (1) !! Min State (-1)&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || Lit || Unlit&lt;br /&gt;
|-&lt;br /&gt;
| MoveObject || Open || Close&lt;br /&gt;
|-&lt;br /&gt;
| SwingDoor&lt;br /&gt;
|rowspan=2| Locked&lt;br /&gt;
|rowspan=2| Unlocked&lt;br /&gt;
|-&lt;br /&gt;
| Chest&lt;br /&gt;
|-&lt;br /&gt;
| Button || Switched on || Switched off&lt;br /&gt;
|-&lt;br /&gt;
| Lever&lt;br /&gt;
|rowspan=2| Unstuck&lt;br /&gt;
|rowspan=2| Stuck (at min)&lt;br /&gt;
|-&lt;br /&gt;
| Wheel&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asMainEntity'' - The entity that causes the change; can be a Lever, Wheel, Button, or Photocell&lt;br /&gt;
#''asConnectEntity'' - The entity that is affected by the change&lt;br /&gt;
#''abInvertStateSent'' - If the state is inverted, making the connected entity change to the opposite state&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
#''asCallbackFunc'' - The name of the connection callback&lt;br /&gt;
&lt;br /&gt;
Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asConnectionName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, int alState)&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;alState is what is sent to connection entity and will be inverted if abInvertStateSent = true!&lt;br /&gt;
&lt;br /&gt;
====Lamps====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLampLit(string &amp;amp;in asName, bool abLit, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Turns a lamp on or off.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the lamp&lt;br /&gt;
#''abLit ''- Set true if you want the lamp to be lit, set to false if you want the lamp to be unlit&lt;br /&gt;
#''abEffects ''- If you want to have the lamp fade in/out when it gets lit/unlit&lt;br /&gt;
&lt;br /&gt;
====Doors====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorLocked(string &amp;amp;in asName, bool abLocked, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abLocked'' - Locked/unlocked&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is locked/unlocked&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorClosed(string &amp;amp;in asName, bool abClosed, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abClosed'' - Closed/open&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is closed/opened&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
bool GetSwingDoorLocked(string &amp;amp;in asName);&lt;br /&gt;
bool GetSwingDoorClosed(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a swing door is locked/closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorDisableAutoClose(string &amp;amp;in asName, bool abDisableAutoClose);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deactivates the &amp;quot;auto-close&amp;quot; when a door is nearly closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetSwingDoorState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns an integer depending on how far the door is opened. &amp;lt;br /&amp;gt;-1 = angle is close to 0°, 1 = angle is 70% or higher of max, 0 = inbetween -1 and 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLocked(string &amp;amp;in asName, bool abLocked);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a level door. Note that level doors are NOT swing doors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedSound(string &amp;amp;in asName, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which sound is played when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedText(string &amp;amp;in asName, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectState(string &amp;amp;in asName, float afState);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween (and above, for example, the bridge_metal_vert) are valid too!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectStateExt(string &amp;amp;in asName, float afState, float afAcc, float afMaxSpeed, float afSlowdownDist, bool abResetSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state, extended method.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween are valid too!&lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afMaxSpeed ''- maximum speed&lt;br /&gt;
#''afSlowdownDist ''- Distance to the target state before deceleration occurs.&lt;br /&gt;
#''abResetSpeed ''- Set to ''true'' if the prop's speed should be reset before performing the movement, else the prop will accelerate from its current speed to afMaxSpeed.&lt;br /&gt;
&lt;br /&gt;
====Levers, wheels and buttons====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropObjectStuckState(string &amp;amp;in asName, int alState);&lt;br /&gt;
void SetWheelStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
void SetLeverStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes an object/wheel/lever stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name&lt;br /&gt;
#''alState'' - 0 = not stuck, 1 = at max, -1 = at min &lt;br /&gt;
#''abEffects'' - play sound effects&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelAngle(string &amp;amp;in asName, float afAngle, bool abAutoMove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves a wheel to a certain angle.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name&lt;br /&gt;
#''afAngle'' - angle&lt;br /&gt;
#''abAutoMove'' - determines whether the wheel should move on its own&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
void SetLeverInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to make a wheel/lever unstuck when interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetLeverState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the state of the lever. &amp;lt;br /&amp;gt;0 = not stuck, 1 = at max, -1 = at min&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderStuckState(string &amp;amp;in asName, int alStuckState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes a MultiSlider stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when state changes. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetButtonSwitchedOn(string &amp;amp;in asName, bool abSwitchedOn, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Sticky areas====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetAllowStickyAreaAttachment(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows entities to stick to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asProp);&lt;br /&gt;
void AttachBodyToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asBody);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop/body to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void DetachFromStickyArea(string &amp;amp;in asAreaName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches everything from a StickyArea.&lt;br /&gt;
&lt;br /&gt;
====NPCs====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCAwake(string &amp;amp;in asName, bool abAwake, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wakes/sleeps a NPC.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the NPC&lt;br /&gt;
#''abAwake'' - ''true'' to awaken, ''false'' to sleep&lt;br /&gt;
#''abEffects'' - Play the &amp;quot;Awake&amp;quot; or &amp;quot;Sleep&amp;quot; animations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCFollowPlayer(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a NPC's head to follow the player's movements.&lt;br /&gt;
&lt;br /&gt;
====Enemies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables an enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyIsHallucination(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes an enemy a hallucination. Hallucinations fade to smoke when they get near the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void FadeEnemyToSmoke(string &amp;amp;in asName, bool abPlaySound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly fades an enemy to smoke.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ShowEnemyPlayerPosition(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the enemy run to the player, no matter where he is.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AlertEnemyOfPlayerPresence(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gives the specified enemy the player's current position and makes it search the area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisableTriggers(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables or disables enemy triggers. If disabled, enemy will not react to player or attack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddEnemyPatrolNode(string &amp;amp;in asName, string &amp;amp;in asNodeName, float afWaitTime, string &amp;amp;in asAnimation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a patrol node to the enemy's path.&lt;br /&gt;
&lt;br /&gt;
#''asName''- Internal name of the enemy &lt;br /&gt;
#''asNodeName'' - Path node &lt;br /&gt;
#''afWaitTime'' - Time in seconds that the enemy waits at the path node before continuing. If 0, randomized between 1-3.&lt;br /&gt;
#''asAnimation'' - The animation the enemy uses when reaching the path node&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ClearEnemyPatrolNodes(string &amp;amp;in asEnemyName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the current path of patrol nodes of the enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemySanityDecreaseActive(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether an enemy activates the player's sanity drain when stared at.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy &lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToNode(string &amp;amp;in asEnemyName, string &amp;amp;in asNodeName, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific PathNode.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asNodeName'' - Internal name of the node to teleport to &lt;br /&gt;
#''abChangeY'' - Whether the Y position of the node will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToEntity(string &amp;amp;in asEnemyName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBody, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific entity.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asTargetEntity'' - Internal name of the entity to teleport to&lt;br /&gt;
#''asTargetBody'' - Internal name of the entity's body name to teleport to. If empty, the first body will be used (might be unstable, recommended to input a body anyway)&lt;br /&gt;
#''abChangeY'' - Whether the Y position of the entity will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeManPigPose(string &amp;amp;in asName, string &amp;amp;in asPoseType);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the pose a specified ManPig.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''asPoseType'' - Name of the ManPig pose to use. Can be &amp;quot;Biped&amp;quot; or &amp;quot;Quadruped&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigFadeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should fade the player's view in and out.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigSoundDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should play the proximity sounds.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigEasyEscapeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should be easier to escape from when hunted. If not disabled, easy escape is activated if the player is more than 12.35 meters away, the enemy can't see the player, and the player has less than 75 health. When this occurs, the enemy is forced to stop hunting and wait for half a second.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ForceTeslaPigSighting(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Forces a Tesla ManPig to be visible for a short time.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; GetEnemyStateName(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the name of the state a specified enemy is current in.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
Possible states for all enemies:&lt;br /&gt;
*Idle&lt;br /&gt;
*Wait&lt;br /&gt;
*Patrol&lt;br /&gt;
*Investigate&lt;br /&gt;
*Alert&lt;br /&gt;
*Search&lt;br /&gt;
*Hurt&lt;br /&gt;
*Hunt&lt;br /&gt;
*HuntPause&lt;br /&gt;
*HuntWander&lt;br /&gt;
*AttackMeleeShort&lt;br /&gt;
*AttackMeleeLong&lt;br /&gt;
*BreakDoor&lt;br /&gt;
*Dead&lt;br /&gt;
&lt;br /&gt;
Waterlurker-only states:&lt;br /&gt;
*GoHome&lt;br /&gt;
*Eat&lt;br /&gt;
&lt;br /&gt;
ManPig-only states: &lt;br /&gt;
*Flee&lt;br /&gt;
*Stalk&lt;br /&gt;
*Track&lt;br /&gt;
&lt;br /&gt;
Unused states:&lt;br /&gt;
*AttackRange&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=7022</id>
		<title>HPL2/Engine Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=7022"/>
		<updated>2025-10-16T18:32:16Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Player */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TocRight}}&lt;br /&gt;
&lt;br /&gt;
This page documents all scripts available in Amnesia: The Dark Descent.&lt;br /&gt;
&lt;br /&gt;
{{note|'''Note''': Some of the functions require the Amnesia 1.3 or 1.5 update. Steam and other online store copies should be automatically updated. Other copies can get 1.3 [http://www.frictionalgames.com/forum/thread-24334.html here].}}&lt;br /&gt;
&lt;br /&gt;
== Directives ==&lt;br /&gt;
&lt;br /&gt;
First off, &amp;lt;code&amp;gt;#include &amp;quot;file.hps&amp;quot;&amp;lt;/code&amp;gt; can be used to programmatically merge together multiple separate files to make organizing scripts easier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
==Engine scripts==&lt;br /&gt;
===Main===&lt;br /&gt;
&lt;br /&gt;
The following functions are the main hps functions that the HPL2 engine looks to run on certain events - similar to the C++ int main() function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void OnStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the map is loaded for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnEnter();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs whenever the player enters a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnLeave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the player leaves a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnGameStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is found in the global.hps file and the inventory.hps file, and is run when the game is first started by the player (ie via &amp;quot;Start New Game&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnUpdate(float afStep);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
This function is executed for every game update or &amp;quot;tick&amp;quot;. Can be used for rapid-firing updates instead of looping timers. Keep in mind that this can affect game performance if not used with care.&lt;br /&gt;
&lt;br /&gt;
#''afStep''- Time elapsed in seconds since the last frame. Multiply speeds, distances etc. by this argument to avoid framerate dependence issues (for example: if you move something in this function with constant speed, it will move faster on computers which run the game with high FPS and slower on computers with low FPS).&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float RandFloat(float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random float.&lt;br /&gt;
&lt;br /&gt;
#''afMin ''- minimum value&lt;br /&gt;
#''afMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int RandInt(int alMin, int alMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random int. Note: the maximum value is ''inclusive''  - the RandInt() function may return this value.&lt;br /&gt;
&lt;br /&gt;
#''alMin ''- minimum value&lt;br /&gt;
#''alMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringContains(string &amp;amp;in asString, string &amp;amp;in asSubString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a string contains the specified string. &amp;lt;br /&amp;gt;Example: searching for &amp;quot;hello&amp;quot; in &amp;quot;hello world&amp;quot; would return '''true'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to check&lt;br /&gt;
#''asSubString ''- the string to search for&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; StringSub(string &amp;amp;in asString, int alStart, int alCount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the substring in a string. &amp;lt;br /&amp;gt;Example: in the string &amp;quot;frictional games rocks&amp;quot;, using 4 as ''alStart''  and 6 as ''alCount''  would return '''&amp;quot;tional&amp;quot;'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string&lt;br /&gt;
#''alStart ''- starting character of the string, with 0 being the first character&lt;br /&gt;
#''alCount ''- amount of characters&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int StringToInt(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns an integer converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float StringToFloat(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a float converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringToBool(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a boolean converted from a string, else returns false.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&lt;br /&gt;
===Mathematical Operations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathCos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathTan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAsin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAcos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan2(float afX, float afY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Calculates and returns the arc tangent of the specified values.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - First value to operate.&lt;br /&gt;
#''afY''  - Second value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSqrt(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the square root of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathPow(float afBase, float afExp);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the value of afBase raised to the power of afExp.&lt;br /&gt;
&lt;br /&gt;
#''afBase''  - The base value.&lt;br /&gt;
#''afExp''  - Value to calculate the base with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMin(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the lowest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMax(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the highest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathClamp(float afX, float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns afX clamped between afMin and afMax. If afX &amp;lt; afMin, returns afMin, and if afX &amp;gt; afMax, returns afMax.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - The value to clamp.&lt;br /&gt;
#''afMin''  - The minimum value to clamp afX with.&lt;br /&gt;
#''afMax''  - The maximum value to clamp afX with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAbs(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the absolute value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&lt;br /&gt;
===Debugging===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void Print(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a string to the log file (''hpl.log'').&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDebugMessage(string &amp;amp;in asString, bool abCheckForDuplicates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a line of text to the debug console at the bottom left of the screen. Debug mode must be enabled for the console messages to be visible.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to print&lt;br /&gt;
#''abCheckForDuplicates ''- if true, the string won't be printed more than once on screen until it disappears&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ProgLog(string &amp;amp;in asLevel, string &amp;amp;in asMessage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints an entry to the ProgLog (progression log). &amp;lt;br /&amp;gt;ProgLog is a file created in Documents/Amnesia/main (or an FC folder if one is being used). It logs certain events, such us opening the menu or picking up the lantern, as well as the player's state (Health, Sanity, Oil, Tinderboxes, Coins), for the purpose of documenting a tester's playstyle. &amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt;This function allows to log custom messages.The messages in the ProgLog file are sorted by time elapsed since a map was loaded.&lt;br /&gt;
&lt;br /&gt;
ProgLog has to be enabled for a player profile in ''user_settings.cfg''  before it starts working.&lt;br /&gt;
&lt;br /&gt;
#''asLevel ''- can be &amp;quot;Low&amp;quot;, &amp;quot;Medium&amp;quot; or &amp;quot;High&amp;quot;. It's a tag which appears in each log entry, for event prioritising.&lt;br /&gt;
#''asMessage ''- The custom message to be printed to the log.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool ScriptDebugOn();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the debug mode is enabled. &amp;lt;br /&amp;gt;See [[HPL2/Development_Environment|&amp;quot;Setting up Development Environment&amp;quot;]] to setup debug mode on your own computer.&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
{{warning|Regular variables (int, float, etc.) are '''not''' saved by the game. Using them in important parts of yor script will break it upon loading a game save. In HPL, those variables should only be used for disposable counters, like spawning objects in a &amp;quot;for&amp;quot; loop. For variables which need to be saved, use the wrappers as described below.}}&lt;br /&gt;
&lt;br /&gt;
====Local====&lt;br /&gt;
&lt;br /&gt;
Local variables can be used throughout the same script file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetLocalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetLocalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddLocalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetLocalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Global====&lt;br /&gt;
&lt;br /&gt;
Global variables can be used throughout several maps and can be accessed by several script files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetGlobalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetGlobalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddGlobalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetGlobalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Particle Systems===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadParticleSystem(string &amp;amp;in asPSFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asPSFile''  - The particle system file to load. Extension: .ps&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntity(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntityExt(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS,&lt;br /&gt;
float afR, float afG, float afB, float afA, bool abFadeAtDistance, float afFadeMinEnd, float afFadeMinStart,&lt;br /&gt;
float afFadeMaxStart, float afFadeMaxEnd);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity, extended method with more options.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''abFadeAtDistance ''- determines whether a particle system fades from a certain distance on&lt;br /&gt;
#''afFadeMinEnd ''- minimum distance at which the particle system stops fading&lt;br /&gt;
#''afFadeMinStart ''- minimum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxStart ''- maximum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxEnd ''- maximum distance at which the particle system stops fading&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DestroyParticleSystem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Destroys a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - The internal name of the particle system&lt;br /&gt;
&lt;br /&gt;
===Sounds &amp;amp; Music===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadSound(string &amp;amp;in asSoundFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile''  - The sound file to load (extension .snt optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayGuiSound(string &amp;amp;in asSoundFile, float afVolume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays a sound, not using 3D.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile ''- the sound to play (extension .snt/.ogg optional)&lt;br /&gt;
#''afVolume ''- the volume of the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaySoundAtEntity(string &amp;amp;in asSoundName, string &amp;amp;in asSoundFile, string &amp;amp;in asEntity, float afFadeTime, bool abSaveSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a sound at an entity.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''asSoundFile ''- the sound to use (extension .snt optional)&lt;br /&gt;
#''asEntity ''- the entity to create the sound at. Using &amp;quot;Player&amp;quot; is effectively the same as &amp;lt;code&amp;gt;PlayGuiSound&amp;lt;/code&amp;gt;, yet this function allows a looping sound to be saved&lt;br /&gt;
#''afFadeTime ''- time in seconds the sound needs to fade. Avoids enemies hearing the sound if afFadeTime is at least 0.1f&lt;br /&gt;
#''abSaveSound ''- if ''true'', a looping sound will &amp;quot;remember&amp;quot; its playback state (currently playing/stopped), and that state will be restored the next time the level is entered. If ''true'', the sound is never attached to the entity! Note that saving should only be used on ''looping sounds''!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeInSound(string &amp;amp;in asSoundName, float afFadeTime, bool abPlayStart);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades in a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds&lt;br /&gt;
#''abPlayStart ''- Play the sound defined in the &amp;lt;code&amp;gt;&amp;lt;Start&amp;gt;&amp;lt;/code&amp;gt; section of the .snt before playing the main sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopSound(string &amp;amp;in asSoundName, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades out a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds, use 0 to immediately stop the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayMusic(string &amp;amp;in asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays music.&lt;br /&gt;
&lt;br /&gt;
#''asMusicFile ''- the music file to play (extension .ogg optional)&lt;br /&gt;
#''abLoop ''- determines whether a music track should loop&lt;br /&gt;
#''afVolume ''- volume of the music&lt;br /&gt;
#''afFadeTime ''- time in seconds until music reaches full volume&lt;br /&gt;
#''alPrio ''- priority of the music. Note that only the music with the highest priority can be heard! 0 - lowest, 1 - higher, etc.&lt;br /&gt;
#''abResume''  - if ''true'', playback will be continued from where the track stopped after the call to &amp;lt;code&amp;gt;StopMusic()&amp;lt;/code&amp;gt;. If ''false'', the track will be restarted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopMusic(float afFadeTime, int alPrio);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops music.&lt;br /&gt;
&lt;br /&gt;
#''afFadeTime ''- time in seconds until music stops&lt;br /&gt;
#''alPrio ''- the priority of the music that should stop&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice(string &amp;amp;in asVoiceFile, string &amp;amp;in asEffectFile, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry,&lt;br /&gt;
bool abUsePosition, string &amp;amp;in asPosEntity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This adds a voice and an additional sound effect to be played. It is okay to call this many times in order to play many voices in a row. The EffectVoiceOverCallback is not called until ALL voices have finished.&lt;br /&gt;
&lt;br /&gt;
#''asVoiceFile ''- the voice to play&lt;br /&gt;
#''asEffectFile ''- the sound effect to play&lt;br /&gt;
#''asTextCat ''- the category in the .lang file, usually &amp;quot;Voice&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''abUsePosition ''- plays using 3D from the entity, or without 3D&lt;br /&gt;
#''asPosEntity ''- the entity at which the voice and sound are played from&lt;br /&gt;
#''afMinDistance ''- minimum distance the voice and sound are heard&lt;br /&gt;
#''afMaxDistance ''- maximum distance the voice and sound are heard&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopAllEffectVoices(float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all voices and calls the EffectVoiceOverCallback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEffectVoiceActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether EffectVoices are still active.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetEffectVoiceOverCallback(string &amp;amp;in asFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to be called when the EffectVoices are finished. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundVolume(float afDestVolume, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound volume, that means everything you can hear '''from the world'''. This does not affect music of GUI sounds.&lt;br /&gt;
&lt;br /&gt;
#''afDestVolume ''- desired volume&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired volume&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundSpeed(float afDestSpeed, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound speed.&lt;br /&gt;
&lt;br /&gt;
#''afDestSpeed ''- desired speed&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired speed&lt;br /&gt;
&lt;br /&gt;
===Lights===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightVisible(string &amp;amp;in asLightName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables lights.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''abVisible ''- determines the state of the light&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeLightTo(string &amp;amp;in asLightName, float afR, float afG, float afB, float afA, float afRadius, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the properties of a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''afRadius ''- radius of the light. -1 means keeping the radius&lt;br /&gt;
#''afTime ''- time in seconds until change is done&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightFlickerActive(string &amp;amp;in asLightName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates flickering on a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName'' - The internal light name&lt;br /&gt;
#''abActive'' - true = active, false = inactive&lt;br /&gt;
&lt;br /&gt;
==Game scripts==&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartCredits(string &amp;amp;in asMusic, bool abLoopMusic, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alEndNum);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts the end credits screen.&lt;br /&gt;
&lt;br /&gt;
#''asMusic ''- the music to play (including .ogg)&lt;br /&gt;
#''abLoopMusic ''- determines whether the music should loop&lt;br /&gt;
#''asTextCat ''- the category to be used in the .lang file, usually &amp;quot;Ending&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alEndNum ''- Amnesia has 3 different endings and displays a code at the bottom. Determines which code is displayed. 0-2 will display codes, any other integer will not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartDemoEnd();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shows the demo end screen. The background and UI elements are defined in demo.cfg, with the text using the entries in the &amp;quot;Demo&amp;quot; category of the .lang file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AutoSave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an auto save file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CheckPoint(string &amp;amp;in asName, string &amp;amp;in asStartPos, string &amp;amp;in asCallback, string &amp;amp;in asDeathHintCat, string &amp;amp;in asDeathHintEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a checkpoint at which the player will respawn in case he dies. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asName, int alCount)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;Count is 0 on the first checkpoint load!&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the editor&lt;br /&gt;
#''asCallback ''- the function to call when the player dies/respawns&lt;br /&gt;
#''asDeathHintCat ''- the category of the death hint message to be used in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asDeathHintEntry ''- the entry in the .lang file&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeMap(string &amp;amp;in asMapName, string &amp;amp;in asStartPos, string &amp;amp;in asStartSound, string &amp;amp;in asEndSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Loads another map after a 1.5 second fade out.&lt;br /&gt;
&lt;br /&gt;
#''asMapName ''- the file to load&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the next map&lt;br /&gt;
#''asStartSound ''- the sound that is played when the change starts&lt;br /&gt;
#''asEndSound ''- the sound that is played when the new map is loaded&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ClearSavedMaps();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the &amp;quot;history&amp;quot; of the save, useful to do when you know the player will not be able to go back anymore. Makes the next save much smaller in size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateDataCache();&lt;br /&gt;
void DestroyDataCache();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This caches all current textures and models and they are not released until destroy is called. If there is already cached data it is destroyed.&lt;br /&gt;
Create caches to enable faster loading when going back to a map. Destroy the cache if you know the player won't go back to that map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMapDisplayNameEntry(string &amp;amp;in asNameEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the map name shown in save file names. If none is set NULL is assumed.&lt;br /&gt;
&lt;br /&gt;
#''asNameEntry ''- the entry to display, category must be &amp;quot;Levels&amp;quot;!&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the skybox.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxTexture(string &amp;amp;in asTexture);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the texture of the skybox.&lt;br /&gt;
&lt;br /&gt;
#''asTexture''  - The texture file to set. Extension: .dds&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the solid color of the skybox rather than a texture.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the global fog.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the color to use for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogProperties(float afStart, float afEnd, float afFalloffExp, bool abCulling);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the properties for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afStart ''- how many meters from the camera should the fog begin&lt;br /&gt;
#''afEnd ''- how many meters from the camera should the fog reach full thickness&lt;br /&gt;
#''afFalloffExp ''- the amount by which the thinkness increases&lt;br /&gt;
#''abCulling ''- whether occlusion culling is active for the fog; this prevents objects behind the fog from being loaded&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetupLoadScreen(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alRandomNum, string &amp;amp;in asImageFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which loading screen will be shown when changing maps.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category of the loading text in the .lang file to be shown on the loading screen, usually &amp;quot;LoadingText&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alRandomNum ''- if greater 1, then it will randomize between 1 and alRandom for each LoadScreen giving entry the suffix XX (eg 01). If &amp;lt; =1 then no suffix is added&lt;br /&gt;
#''asImageFile ''- the image to be shown (optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void UnlockAchievement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlocks the specified achievement. Only able to be used for the ending achievements.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the achievement. Only the following strings are valid:&lt;br /&gt;
::* Benefactor&lt;br /&gt;
::* Survivor&lt;br /&gt;
::* Sacrifice&lt;br /&gt;
::* Quitter&lt;br /&gt;
::* Egotist&lt;br /&gt;
::* Altruist&lt;br /&gt;
::* Vacillator&lt;br /&gt;
&lt;br /&gt;
===Game Timer===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddTimer(string &amp;amp;in asName, float afTime, string &amp;amp;in asFunction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a timer which calls a function when it expires. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asTimer)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the name of the timer&lt;br /&gt;
#''afTime ''- time in seconds&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveTimer(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a timer, no matter how much time is left.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the timer.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetTimerTimeLeft(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the time left on a timer.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - the internal name of the timer.&lt;br /&gt;
&lt;br /&gt;
===Screen Effects===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeOut(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to black.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen is completly black&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeIn(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen back to normal.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeImageTrailTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies the image trail effect to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeSepiaColorTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the screen go dark red.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0) &lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeRadialBlurTo(float afSize, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies radial blur effects to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afSize ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetRadialBlurStartDist(float afStartDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines at which distance the radial blur effects appear.&lt;br /&gt;
&lt;br /&gt;
#''afStartDist ''- the distance at which the effect starts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectFlash(float afFadeIn, float afWhite, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white.&lt;br /&gt;
&lt;br /&gt;
#''afFadeIn ''- time in seconds until screen is white&lt;br /&gt;
#''afWhite ''- determines to which percentage the screen fades to white (1.0 = completly white)&lt;br /&gt;
#''afFadeOut ''- time in seconds until screen is back to normal again&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectEmotionFlash(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white and shows a text message.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''asSound ''- the sound to play while fading&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetFlashbackIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a flashback is still in effect.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerSpawnPS(string &amp;amp;in asSPSFile);&lt;br /&gt;
void StopPlayerSpawnPS();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Continuously spawn regular particle systems (''.ps'') around the player. Particles created by this script carry over from map to map.&lt;br /&gt;
&lt;br /&gt;
#''asSPSFile''  - the ''.sps''  file to use. Example ''.sps''  files are located in the ''/misc''  folder in the main game directory.&amp;lt;br&amp;gt;Custom ''.sps''  files can be created by hand in a text editor (see existing ones and mimic how those are written). &amp;lt;br /&amp;gt;Since ''StopPlayerSpawnPS()''  doesn't seem to work, to stop an SPS you must create an ''.sps''  file with an empty particle field field and override the old SPS by calling ''StartPlayerSpawnPS''  again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shakes the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity of the shake&lt;br /&gt;
#''afTime ''- duration of the shake&lt;br /&gt;
#''afFadeInTime ''- time in seconds until full intensity is reached&lt;br /&gt;
#''afFadeOutTime ''- time until screen is back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInDarknessEffectsActive(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the sanity drain and night vision effects while in the darkness.&lt;br /&gt;
&lt;br /&gt;
''bool abX''  - Enable/disable effects.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowScreenImage(string &amp;amp;in asImageName, float afX, float afY, float afScale, bool abUseRelativeCoordinates, float afDuration, float afFadeIn, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
Displays an image file directly onto the screen. See [[HPL2/Tutorials/ShowScreenImage()|ShowScreenImage()]] in the tutorials section for more information.&lt;br /&gt;
&lt;br /&gt;
# ''asImageName'' - The image file to render (.jpg, .png, .tga, .dds)&lt;br /&gt;
# ''afX'' - The X position of the image&lt;br /&gt;
# ''afY'' - The Y position of the image&lt;br /&gt;
# ''afScale'' - The size of the image in pixels (not scale), or original image size if negative&lt;br /&gt;
# ''abUseRelativeCoordinates'' - Whether X and Y are relative to the screen resoltion, or pixel co-ordinates if not&lt;br /&gt;
# ''afDuration'' - The duration that the image is displayed for&lt;br /&gt;
# ''afFadeIn'' - The time, in seconds, to fade in the image&lt;br /&gt;
# ''afFadeOut'' - The time, in seconds, to fade out the image&lt;br /&gt;
&lt;br /&gt;
===Insanity===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInsanitySetEnabled(string &amp;amp;in asSet, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which InsanitySets are enabled.&lt;br /&gt;
&lt;br /&gt;
#''asSet ''- the set&lt;br /&gt;
#''abX ''- enabled or not&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartInsanityEvent(string &amp;amp;in asEventName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Starts a specified insanity event.&lt;br /&gt;
&lt;br /&gt;
#''asEventName ''- Insanity event to play.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartRandomInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts a random insanity event from the available sets.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopCurrentInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Stops the currently playing insanity event.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void InsanityEventIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an insanity event is currently in effect.&amp;lt;br&amp;gt;Not useful at all due to having a return type of &amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; when it should be &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Player===&lt;br /&gt;
&lt;br /&gt;
Note that the player's maximum health and sanity is 100.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enabled/Disable player controlled movement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangePlayerStateToNormal();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets the player's state, forcing them to stop interacting with objects. It also clears the inventory item to be used (as if it was double-clicked on in the inventory again) and dismounts the player from ladders.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerCrouching(bool abCrouch);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddPlayerBodyForce(float afX, float afY, float afZ, bool abUseLocalCoords);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pushes the player into a certain direction. Note that you need values above ~2000 to see any effects.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - amount along the X-axis&lt;br /&gt;
#''afY'' - amount along the Y-axis&lt;br /&gt;
#''afZ'' - amount along the Z-axis&lt;br /&gt;
#''abUseLocalCoords'' - If true, axes are based on where the player is facing, not the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowPlayerCrossHairIcons(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the icons when a player has something in focus.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerSanity(float afSanity);&lt;br /&gt;
void AddPlayerSanity(float afSanity);&lt;br /&gt;
float GetPlayerSanity();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerHealth(float afHealth);&lt;br /&gt;
void AddPlayerHealth(float afHealth);&lt;br /&gt;
float GetPlayerHealth();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerLampOil(float afOil);&lt;br /&gt;
void AddPlayerLampOil(float afOil);&lt;br /&gt;
float GetPlayerLampOil();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the lamp oil of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerSpeed();&lt;br /&gt;
float GetPlayerYSpeed();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current speed of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSanityDrainDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables sanity drain from darkness.&lt;br /&gt;
{{bug|Sanity drain is reenabled on loading a save, as the game is unable to load the value properly from the save data.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoost();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a large amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! New Sanity&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || 100&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || 90&lt;br /&gt;
|-&lt;br /&gt;
| 50-74 || 80&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoostSmall();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a small amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! Sanity Bonus&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || +20&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || +15&lt;br /&gt;
|-&lt;br /&gt;
| 50-75 || +10&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityDamage(float afAmount, bool abUseEffect);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount'' - amount of sanity damage done&lt;br /&gt;
#''abUseEffect'' - if a sound is played and screen effects are shown when the sanity damage is dealt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GivePlayerDamage(float afAmount, string &amp;amp;in asType, bool abSpinHead, bool abLethal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the health of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount'' - amount of damage done to health&lt;br /&gt;
#''asType'' - plays a certain effect on the screen when the damage is dealt (BloodSplat, Claws, or Slash) &lt;br /&gt;
#''abSpinHead'' - changes the camera view when damage is dealt&lt;br /&gt;
#''abLethal'' - set to true if player can die from given damage. If ''false'' and the damage would have left the player with less than 10 health, health is set to 10.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerFOVMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the field of view of the player. A shorter FOV will create a zoom effect.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - multiplier of default FOV (1 is default)&lt;br /&gt;
#''afSpeed'' - the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerAspectMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the aspect ratio of the player. Basically stretches or narrows the screen horizontally.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - multiplier of default aspect (default is 1)&lt;br /&gt;
#''afSpeed'' - the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - angle of rotation of head, positive being counter-clockwise&lt;br /&gt;
#''afSpeedMul'' - speed (possibly acceleration) multiplier of the rotation (default 1, which is really slow)&lt;br /&gt;
#''afMaxSpeed'' - maximum speed of rotation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerForward(float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Moves the player forward. It needs to be called in a timer that updates 60 times / second.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- amount along the X-axis&lt;br /&gt;
#''afY ''- amount along the Y-axis&lt;br /&gt;
#''afZ ''- amount along the Z-axis&lt;br /&gt;
#''afSpeed ''- speed at which the change happens&lt;br /&gt;
#''afSlowDownDist ''- distance at which to start slowing down (prevents the head from abruptly stopping)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerLookAt(string &amp;amp;in asEntityName, float afSpeedMul, float afMaxSpeed, string &amp;amp;in asAtTargetCallback);&lt;br /&gt;
void StopPlayerLookAt();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to look at a certain entity until StopPlayerLookAt is used.&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- the entity to look at &lt;br /&gt;
#''afSpeedMul ''- how fast should the player look at the entity&lt;br /&gt;
#''afMaxSpeed ''- maximum speed allowed&lt;br /&gt;
#''asAtTargetCallback ''- function to call when player looks at target&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerMoveSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerRunSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerLookSpeedMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the player's move/run/look speed. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpForceMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the player's jump multiplier. Higher values = higher jumps. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpDisabled(bool abX);&lt;br /&gt;
void SetPlayerCrouchDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to jump/crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportPlayer(string &amp;amp;in asStartPosName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly teleports the player to the target StartPos.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternActive(bool abX, bool abUseEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the player use his lantern.&lt;br /&gt;
&lt;br /&gt;
# ''abX'' - Set lantern to be active (true) or inactive (false)&lt;br /&gt;
# ''abUseEffects'' - Play on/off sounds&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetLanternActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player is currently using the lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to use the lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternLitCallback(string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to call when the player uses the lantern. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;MyFunc(bool abLit)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message on the screen.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory'' - the category in the .lang file&lt;br /&gt;
#''asTextEntry'' - the entry in the .lang file&lt;br /&gt;
#''afTime'' - determines how long the message is displayed. If time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetDeathHint(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the message that appears when the player dies.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory'' - the category in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asTextEntry'' - the entry in the .lang file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DisableDeathStartSound();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the death sound when the player dies. This must be called directly before player is killed! The variable as soon as player dies too.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPermaDeathSound(string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Sets the sound played after the player dies when permadeath is active. Permadeath is only active when the game is launched with the &amp;lt;code&amp;gt;ptest&amp;lt;/code&amp;gt; command line parameter. Only used for the post-death Suitor lines in ''Justine''.&lt;br /&gt;
&lt;br /&gt;
#''asSound'' - The sound to be played after death. Expects a voice-type sound.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerFallDamageDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the player's ability to take fall damage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPos(float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the player's position within the level.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - X co-ordinate position.&lt;br /&gt;
#''afY'' - Y co-ordinate position.&lt;br /&gt;
#''afZ'' - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerPosX();&lt;br /&gt;
float GetPlayerPosY();&lt;br /&gt;
float GetPlayerPosZ();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the player's position within the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
===Journal===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddNote(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a note to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _Name and _Text and be in category &amp;quot;Journal&amp;quot;!&lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDiary(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a diary to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _NameX and _TextY whereas X and Y are numbers of the parts (_Name1: first diary, _Text1: first page) and be in category &amp;quot;Journal&amp;quot;! &lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ReturnOpenJournal(bool abOpenJournal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Only called in the pickup diary callback! If true the journal displays the entry else not.&lt;br /&gt;
&lt;br /&gt;
===Quests===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a quest to the player's journal under mementos. Completed quests cannot be readded.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name to be used&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot;Quest_&amp;lt;texthere&amp;gt;_Text”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CompleteQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Completes a quest. If the quest has not been added, it's marked as complete anyway, preventing it from being added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot; Quest_&amp;lt;texthere&amp;gt;_Text ”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool QuestIsCompleted(string &amp;amp;in asName);&lt;br /&gt;
bool QuestIsAdded(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a quest is completed/added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetNumberOfQuestsInMap(int alNumberOfQuests);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the number of quests in the map. Obsolete; formerly used to calculate a completion percentage when looking at a level door.&lt;br /&gt;
&lt;br /&gt;
#''alNumberOfQuests ''- Amount of quests&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveHint(string &amp;amp;in asName, string &amp;amp;in asMessageCat, string &amp;amp;in asMessageEntry, float afTimeShown);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a hint on the player's screen.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asMessageCat ''- the category in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asMessageEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTimeShown ''- time in seconds until the message disappears. If time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void BlockHint(string &amp;amp;in asName);&lt;br /&gt;
void UnBlockHint(string &amp;amp;in asName);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Blocking a hint prevents it from being shown. Blocked hints are included in savefiles, so they should persist between levels. Unblocking a hint allows it to be shown.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; blocks the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveHint(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes the hint from the list of already shown hints, allowing it to appear again.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; reenables the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
===Inventory===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ExitInventory();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Exits the inventory by force.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the player's ability to open his inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a message on the inventory screen. Used for feedback messages when failing to combine items.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory ''- the category in the .lang file, usually &amp;quot;Inventory&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTime ''- time in seconds until the message disappears. If life time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItem(string &amp;amp;in asName, string &amp;amp;in asType, string &amp;amp;in asSubTypeName, string &amp;amp;in asImageName, float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds an item to the inventory of the player. Note that the item does not have to exist as entity in the world to be able to do this.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asType ''- item type to give, Available types are:&lt;br /&gt;
::*Puzzle&lt;br /&gt;
::*Lantern&lt;br /&gt;
::*Health&lt;br /&gt;
::*Sanity&lt;br /&gt;
::*LampOil&lt;br /&gt;
::*Tinderbox&lt;br /&gt;
#''asSubTypeName ''- item name for .lang file&lt;br /&gt;
#''asImageName ''- the image which will appear in inventory. For example: &amp;lt;code&amp;gt;void GiveItem(&amp;quot;chemical_container_full_1&amp;quot;, &amp;quot;Puzzle&amp;quot;, &amp;quot;chemical_container_full&amp;quot;, &amp;quot;chemical_container_full.tga&amp;quot;, 1);&amp;lt;/code&amp;gt; will use the image from &amp;lt;code&amp;gt;graphics/item/chemical_container_full.tga&amp;lt;/code&amp;gt; &lt;br /&gt;
#''afAmount ''- amount the item gives, - For example: Oil potions will fill the oil meter by this amount, Health potions will heal by this amount, etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item from the player's inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool HasItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player has an item in his inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItemFromFile(string &amp;amp;in asName, string &amp;amp;in asFileName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a single item to the player's inventory. This is meant to be used for debug mostly as it creates the actual item and then destroys it.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asFileName ''- item to give + extension (.ent)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddCombineCallback(string &amp;amp;in asName, string &amp;amp;in asItemA, string &amp;amp;in asItemB, string &amp;amp;in asFunction, bool abAutoRemove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to combine items in his inventory. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItemA, string &amp;amp;in asItemB)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name for the callback&lt;br /&gt;
#''asItemA ''- internal name of first item&lt;br /&gt;
#''asItemB ''- internal name of second item&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
#''abAutoRemove ''- determines whether the callback should be removed when the items are combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveCombineCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a combine callback.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the callback to be removed (as specified in AddCombineCallback)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddUseItemCallback(string &amp;amp;in asName, string &amp;amp;in asItem, string &amp;amp;in asEntity, string &amp;amp;in asFunction, bool abAutoDestroy);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to use items on the world. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItem, string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
#''asItem ''- internal name of the item&lt;br /&gt;
#''asEntity ''- entity to be able to use the item on&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abAutoDestroy ''- determines whether the callback should be removed when the item is used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveUseItemCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item callback.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
&lt;br /&gt;
===Entities===&lt;br /&gt;
&lt;br /&gt;
====General====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityActive(string &amp;amp;in asName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityVisible(string &amp;amp;in asName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity's visual mesh. The collision body remains.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the entity.&lt;br /&gt;
#''abActive''  - Activate/deactivate mesh.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntityExists(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an entity exists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCustomFocusCrossHair(string &amp;amp;in asName, string&amp;amp; asCrossHair);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the crosshair that is used when focusing an entity.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCrossHair ''- desired crosshair, can be: &lt;br /&gt;
::*Default (no crosshair)&lt;br /&gt;
::*Grab&lt;br /&gt;
::*Push&lt;br /&gt;
::*Ignite&lt;br /&gt;
::*Pick&lt;br /&gt;
::*LevelDoor&lt;br /&gt;
::*Ladder&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void CreateEntityAtArea(string &amp;amp;in asEntityName, string &amp;amp;in asEntityFile, string &amp;amp;in asAreaName, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an entity at an area. When creating an enemy though, it cannot chase properly along PathNodes (using for example &amp;lt;code&amp;gt;ShowEnemyPlayerPosition&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- internal name&lt;br /&gt;
#''asEntityFile ''- entity to be used extension .ent&lt;br /&gt;
#''asAreaName ''- the area to create the entity at&lt;br /&gt;
#''abFullGameSave ''- determines whether an entity &amp;quot;remembers&amp;quot; its state&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ReplaceEntity(string &amp;amp;in asName, string &amp;amp;in asBodyName, string &amp;amp;in asNewEntityName, string &amp;amp;in asNewEntityFile, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Removes an entity and places a new one in its place.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to replace.&lt;br /&gt;
#''asBodyName'' - Name of the body of the entity to place the new entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''asNewEntityName'' - Name of the new entity.&lt;br /&gt;
#''asNewEntityFile'' - Name of the new entity file. Extension .ent. &lt;br /&gt;
#''abFullGameSave'' - Whether ALL properties of this entity should be saved throughout levels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaceEntityAtEntity(string &amp;amp;in asName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBodyName, bool abUseRotation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Places an entity at the position of another entity. Does not work for enemies, use TeleportEnemyToEntity instead.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to place.&lt;br /&gt;
#''asTargetEntity'' - Name of the other entity to place the first entity at.&lt;br /&gt;
#''asTargetBodyName'' - Name of the body of the entity to place the first entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''abUseRotation'' - Whether the entity should be rotated like the target entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPos(string &amp;amp;in asName, float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Moves an entity to a position in the level.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to move.&lt;br /&gt;
#''afX'' - X co-ordinate position.&lt;br /&gt;
#''afY'' - Y co-ordinate position.&lt;br /&gt;
#''afZ'' - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetEntityPosX(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosY(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosZ(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns an entity's position in the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerLookAtCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveWhenLookedAt);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player looks at a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = looking, -1 = not looking&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveWhenLookedAt ''- determines whether the callback should be removed when the player looked at the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerInteractCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveOnInteraction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player interacts with a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveOnInteraction ''- determines whether the callback should be removed when the player interacts with the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCallbackFunc(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when certain events occur with an entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, string &amp;amp;in asType)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;asType&amp;lt;/code&amp;gt; values depend on entity type:&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! asType Value&lt;br /&gt;
|-&lt;br /&gt;
| Object || Break&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || OnIgnite&lt;br /&gt;
|-&lt;br /&gt;
| Item || OnPickup&lt;br /&gt;
|-&lt;br /&gt;
| Enemy || OnDeath&lt;br /&gt;
|-&lt;br /&gt;
| Enemy_Grunt&amp;lt;br&amp;gt;Enemy_Manpig || OnAutoDisabled&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityConnectionStateChangeCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A callback called when ever the connection state changes (button being switched on, lever switched, etc). &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void Func(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: -1 = off, 0 = between, 1 = on&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityInteractionDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disallows interaction with an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void BreakJoint (string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Breaks a joint. Do not use this on joints in SwingDoors, Levers, Wheels, etc. where the joint is part of an interaction. That will make the game crash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void AddEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName, string &amp;amp;in asFunction, bool abDeleteOnCollide, int alStates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when two entities collide. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asParent, string &amp;amp;in asChild, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = enter, -1 = leave&lt;br /&gt;
&lt;br /&gt;
#''asParentName ''- internal name of main object&lt;br /&gt;
#''asChildName ''- internal name of object that collides with main object (asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) NOT supported!)&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abDeleteOnCollide ''- determines whether the callback after it was called&lt;br /&gt;
#''alStates ''- 1 = only enter, -1 = only leave, 0 = both&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an EntityCollideCallback. Asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) not supported in ''asChildName''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntitiesCollide(string &amp;amp;in asEntityA, string &amp;amp;in asEntityB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether two entities collide. This function does NOT support asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) or &amp;quot;Player&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetBodyMass(string &amp;amp;in asName, float afMass);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName.&lt;br /&gt;
#''afMass''  - The mass to set.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetBodyMass(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName. &lt;br /&gt;
#''afMass''  - The mass to get.&lt;br /&gt;
&lt;br /&gt;
====Props====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropEffectActive(string &amp;amp;in asName, bool abActive, bool abFadeAndPlaySounds);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Turns the texture illumination, billboards, particles, light flicker, and sounds of a prop on or off.&lt;br /&gt;
&lt;br /&gt;
Can be used on coal to give it the black color it should have.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name &lt;br /&gt;
#''abActive'' - active state&lt;br /&gt;
#''abFadeAndPlaySounds'' - if all effects should fade in/out or not&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropActiveAndFade(string &amp;amp;in asName, bool abActive, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates a prop.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''abActive ''- nothing to add&lt;br /&gt;
#''afFadeTime ''- time in seconds until prop fully fades&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropStaticPhysics(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates the physics of a prop, setting the mass to 0. Setting as true will make entities static in midair.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetPropIsInteractedWith(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a prop is interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RotatePropToSpeed(string &amp;amp;in asName, float afAcc, float afGoalSpeed, float afAxisX, float afAxisY, float afAxisZ, bool abResetSpeed, string &amp;amp;in asOffsetArea);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the prop up to a set speed.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afGoalSpeed ''- desired speed &lt;br /&gt;
#''afAxisX ''- rotation around X axis&lt;br /&gt;
#''afAxisY ''- rotation around Y axis&lt;br /&gt;
#''afAxisZ ''- rotation around Z axis&lt;br /&gt;
#''abResetSpeed ''- determines whether the speed is resetted after goal speed is reached&lt;br /&gt;
#''asOffsetArea ''- the area to rotate around, if empty, then the center of the body is used Note: The entity you want to rotate MUST be a &amp;quot;StaticObject&amp;quot; entity!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void StopPropMovement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all movement of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddAttachedPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop.&lt;br /&gt;
&lt;br /&gt;
#''asPropName''- the prop to attach another prop at &lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop&lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
{{bug|''afRotZ '' is used for both the ZX rotation and the Z position of the attached prop. Unwanted rotation can be avoided by using: &amp;lt;br /&amp;gt;''AddAttachedPropToProp(asPropName, asAttachName, asAttachFile, afPosX, afPosY, '''0''', afPosZ, '''90.0f''', afPosZ)''}}&lt;br /&gt;
&lt;br /&gt;
{{bug|Attaching a breakable prop to a physically active prop, and then breaking the attached prop, will cause the game to crash, should the parent object be moved or reset.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop. Fixed version of &amp;lt;code&amp;gt;AddAttachedPropToProp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
#''asPropName ''- the prop to attach another prop at&lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop &lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveAttachedPropFromProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches a prop from a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
void AddPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
float GetPropHealth(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ResetProp(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets a prop's state to the original one when the map was loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void PlayPropAnimation(string &amp;amp;in asProp, string &amp;amp;in asAnimation, float afFadeTime, bool abLoop, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the prop play an animation and calls a function. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asProp)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asProp ''- internal name of the prop&lt;br /&gt;
#''asAnimation ''- animation to play&lt;br /&gt;
#''afFadeTime ''- Fade time between current and new animations&lt;br /&gt;
#''abLoop ''- determines whether the animation loops &lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddPropForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddPropImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These functions push objects. Note that rather high values are needed when applying ''forces''  (on the order of ~100 (weak) to ~10000 (strong)), but not impulses (values less than 10 can be appropriate). Forces are external influences, and will have different effect depending on the mass of the object they are being applied to; impulses disregard mass, and can cause objects to break, as if hit. A &amp;quot;Body&amp;quot; is a physics-related helper object, to which a force or an impulse can be applied. Entities can consist of several bodies, interconnected in various ways (you can create/examine bodies in the model editor).&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the object to push; for bodies, use this format: &amp;quot;''entityName''_''bodyName''&amp;quot;&lt;br /&gt;
#''afX ''- magnitude along the X-axis&lt;br /&gt;
#''afY ''- magnitude along the Y-axis&lt;br /&gt;
#''afZ ''- magnitude along the Z-axis&lt;br /&gt;
#''asCoordSystem ''- determines which coordinate system is used, &amp;quot;local&amp;quot; or &amp;quot;world&amp;quot;&lt;br /&gt;
&lt;br /&gt;
All of these functions are ''additive''  - when called consecutively, for each call, the vectors defined by (afX, afY, afZ) will be added together, and a resultant force/impulse will be calculated ''before''  any physics simulation is applied to the target object.&lt;br /&gt;
&lt;br /&gt;
====Connections====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithRope(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asRopeName, bool abInteractOnly, float afSpeedMul, float afToMinSpeed, float afToMaxSpeed, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects a prop with the movement of a rope (i.e. turn a wheel to move a rope). For Levers, the rope only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName''- The name of the connection&lt;br /&gt;
#''asPropName'' - The name of the prop; can be a Lever or Wheel&lt;br /&gt;
#''asRopeName'' - The name of the rope&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''afSpeedMul'' - Speed multiplier of how quickly the rope moves&lt;br /&gt;
#''afToMinSpeed'' - The slowest the rope can move&lt;br /&gt;
#''afToMaxSpeed'' - The fastest the rope can move&lt;br /&gt;
#''abInvert'' - Whether to invert the direction the rope moves&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithMoveObject(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asMoveObjectName, bool abInteractOnly, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This one should only be used if there must be an exact correspondence to prop &amp;quot;amount&amp;quot; and the MoveObject open amount. It is best used for Wheel-door connections, where the MoveObject moves continuously along with the Wheel. For Levers, the MoveObject only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asPropName'' - The entity that controls the movement; can be a Lever or Wheel&lt;br /&gt;
#''asMoveObject'' - The MoveObject to move&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''abInvert'' - If the state is inverted, making the MoveObject move in the opposite direction&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ConnectEntities(string &amp;amp;in asName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, bool abInvertStateSent, int alStatesUsed, string &amp;amp;in asCallbackFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects two entities together so that changing the state of the main entity changes the state of the connected entity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! Max State (1) !! Min State (-1)&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || Lit || Unlit&lt;br /&gt;
|-&lt;br /&gt;
| MoveObject || Open || Close&lt;br /&gt;
|-&lt;br /&gt;
| SwingDoor&lt;br /&gt;
|rowspan=2| Locked&lt;br /&gt;
|rowspan=2| Unlocked&lt;br /&gt;
|-&lt;br /&gt;
| Chest&lt;br /&gt;
|-&lt;br /&gt;
| Button || Switched on || Switched off&lt;br /&gt;
|-&lt;br /&gt;
| Lever&lt;br /&gt;
|rowspan=2| Unstuck&lt;br /&gt;
|rowspan=2| Stuck (at min)&lt;br /&gt;
|-&lt;br /&gt;
| Wheel&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asMainEntity'' - The entity that causes the change; can be a Lever, Wheel, Button, or Photocell&lt;br /&gt;
#''asConnectEntity'' - The entity that is affected by the change&lt;br /&gt;
#''abInvertStateSent'' - If the state is inverted, making the connected entity change to the opposite state&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
#''asCallbackFunc'' - The name of the connection callback&lt;br /&gt;
&lt;br /&gt;
Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asConnectionName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, int alState)&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;alState is what is sent to connection entity and will be inverted if abInvertStateSent = true!&lt;br /&gt;
&lt;br /&gt;
====Lamps====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLampLit(string &amp;amp;in asName, bool abLit, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Turns a lamp on or off.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the lamp&lt;br /&gt;
#''abLit ''- Set true if you want the lamp to be lit, set to false if you want the lamp to be unlit&lt;br /&gt;
#''abEffects ''- If you want to have the lamp fade in/out when it gets lit/unlit&lt;br /&gt;
&lt;br /&gt;
====Doors====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorLocked(string &amp;amp;in asName, bool abLocked, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abLocked'' - Locked/unlocked&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is locked/unlocked&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorClosed(string &amp;amp;in asName, bool abClosed, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abClosed'' - Closed/open&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is closed/opened&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
bool GetSwingDoorLocked(string &amp;amp;in asName);&lt;br /&gt;
bool GetSwingDoorClosed(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a swing door is locked/closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorDisableAutoClose(string &amp;amp;in asName, bool abDisableAutoClose);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deactivates the &amp;quot;auto-close&amp;quot; when a door is nearly closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetSwingDoorState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns an integer depending on how far the door is opened. &amp;lt;br /&amp;gt;-1 = angle is close to 0°, 1 = angle is 70% or higher of max, 0 = inbetween -1 and 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLocked(string &amp;amp;in asName, bool abLocked);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a level door. Note that level doors are NOT swing doors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedSound(string &amp;amp;in asName, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which sound is played when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedText(string &amp;amp;in asName, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectState(string &amp;amp;in asName, float afState);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween (and above, for example, the bridge_metal_vert) are valid too!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectStateExt(string &amp;amp;in asName, float afState, float afAcc, float afMaxSpeed, float afSlowdownDist, bool abResetSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state, extended method.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween are valid too!&lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afMaxSpeed ''- maximum speed&lt;br /&gt;
#''afSlowdownDist ''- Distance to the target state before deceleration occurs.&lt;br /&gt;
#''abResetSpeed ''- Set to ''true'' if the prop's speed should be reset before performing the movement, else the prop will accelerate from its current speed to afMaxSpeed.&lt;br /&gt;
&lt;br /&gt;
====Levers, wheels and buttons====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropObjectStuckState(string &amp;amp;in asName, int alState);&lt;br /&gt;
void SetWheelStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
void SetLeverStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes an object/wheel/lever stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name&lt;br /&gt;
#''alState'' - 0 = not stuck, 1 = at max, -1 = at min &lt;br /&gt;
#''abEffects'' - play sound effects&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelAngle(string &amp;amp;in asName, float afAngle, bool abAutoMove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves a wheel to a certain angle.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name&lt;br /&gt;
#''afAngle'' - angle&lt;br /&gt;
#''abAutoMove'' - determines whether the wheel should move on its own&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
void SetLeverInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to make a wheel/lever unstuck when interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetLeverState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the state of the lever. &amp;lt;br /&amp;gt;0 = not stuck, 1 = at max, -1 = at min&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderStuckState(string &amp;amp;in asName, int alStuckState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes a MultiSlider stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when state changes. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetButtonSwitchedOn(string &amp;amp;in asName, bool abSwitchedOn, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Sticky areas====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetAllowStickyAreaAttachment(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows entities to stick to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asProp);&lt;br /&gt;
void AttachBodyToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asBody);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop/body to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void DetachFromStickyArea(string &amp;amp;in asAreaName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches everything from a StickyArea.&lt;br /&gt;
&lt;br /&gt;
====NPCs====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCAwake(string &amp;amp;in asName, bool abAwake, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wakes/sleeps a NPC.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the NPC&lt;br /&gt;
#''abAwake'' - ''true'' to awaken, ''false'' to sleep&lt;br /&gt;
#''abEffects'' - Play the &amp;quot;Awake&amp;quot; or &amp;quot;Sleep&amp;quot; animations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCFollowPlayer(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a NPC's head to follow the player's movements.&lt;br /&gt;
&lt;br /&gt;
====Enemies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables an enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyIsHallucination(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes an enemy a hallucination. Hallucinations fade to smoke when they get near the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void FadeEnemyToSmoke(string &amp;amp;in asName, bool abPlaySound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly fades an enemy to smoke.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ShowEnemyPlayerPosition(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the enemy run to the player, no matter where he is.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AlertEnemyOfPlayerPresence(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gives the specified enemy the player's current position and makes it search the area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisableTriggers(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables or disables enemy triggers. If disabled, enemy will not react to player or attack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddEnemyPatrolNode(string &amp;amp;in asName, string &amp;amp;in asNodeName, float afWaitTime, string &amp;amp;in asAnimation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a patrol node to the enemy's path.&lt;br /&gt;
&lt;br /&gt;
#''asName''- Internal name of the enemy &lt;br /&gt;
#''asNodeName'' - Path node &lt;br /&gt;
#''afWaitTime'' - Time in seconds that the enemy waits at the path node before continuing. If 0, randomized between 1-3.&lt;br /&gt;
#''asAnimation'' - The animation the enemy uses when reaching the path node&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ClearEnemyPatrolNodes(string &amp;amp;in asEnemyName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the current path of patrol nodes of the enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemySanityDecreaseActive(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether an enemy activates the player's sanity drain when stared at.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy &lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToNode(string &amp;amp;in asEnemyName, string &amp;amp;in asNodeName, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific PathNode.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asNodeName'' - Internal name of the node to teleport to &lt;br /&gt;
#''abChangeY'' - Whether the Y position of the node will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToEntity(string &amp;amp;in asEnemyName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBody, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific entity.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asTargetEntity'' - Internal name of the entity to teleport to&lt;br /&gt;
#''asTargetBody'' - Internal name of the entity's body name to teleport to. If empty, the first body will be used (might be unstable, recommended to input a body anyway)&lt;br /&gt;
#''abChangeY'' - Whether the Y position of the entity will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeManPigPose(string &amp;amp;in asName, string &amp;amp;in asPoseType);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the pose a specified ManPig.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''asPoseType'' - Name of the ManPig pose to use. Can be &amp;quot;Biped&amp;quot; or &amp;quot;Quadruped&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigFadeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should fade the player's view in and out.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigSoundDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should play the proximity sounds.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigEasyEscapeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should be easier to escape from when hunted. If not disabled, easy escape is activated if the player is more than 12.35 meters away, the enemy can't see the player, and the player has less than 75 health. When this occurs, the enemy is forced to stop hunting and wait for half a second.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ForceTeslaPigSighting(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Forces a Tesla ManPig to be visible for a short time.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; GetEnemyStateName(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the name of the state a specified enemy is current in.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
Possible states for all enemies:&lt;br /&gt;
*Idle&lt;br /&gt;
*Wait&lt;br /&gt;
*Patrol&lt;br /&gt;
*Investigate&lt;br /&gt;
*Alert&lt;br /&gt;
*Search&lt;br /&gt;
*Hurt&lt;br /&gt;
*Hunt&lt;br /&gt;
*HuntPause&lt;br /&gt;
*HuntWander&lt;br /&gt;
*AttackMeleeShort&lt;br /&gt;
*AttackMeleeLong&lt;br /&gt;
*BreakDoor&lt;br /&gt;
*Dead&lt;br /&gt;
&lt;br /&gt;
Waterlurker-only states:&lt;br /&gt;
*GoHome&lt;br /&gt;
*Eat&lt;br /&gt;
&lt;br /&gt;
ManPig-only states: &lt;br /&gt;
*Flee&lt;br /&gt;
*Stalk&lt;br /&gt;
*Track&lt;br /&gt;
&lt;br /&gt;
Unused states:&lt;br /&gt;
*AttackRange&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=7021</id>
		<title>HPL2/Engine Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=7021"/>
		<updated>2025-10-16T18:31:26Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Player */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TocRight}}&lt;br /&gt;
&lt;br /&gt;
This page documents all scripts available in Amnesia: The Dark Descent.&lt;br /&gt;
&lt;br /&gt;
{{note|'''Note''': Some of the functions require the Amnesia 1.3 or 1.5 update. Steam and other online store copies should be automatically updated. Other copies can get 1.3 [http://www.frictionalgames.com/forum/thread-24334.html here].}}&lt;br /&gt;
&lt;br /&gt;
== Directives ==&lt;br /&gt;
&lt;br /&gt;
First off, &amp;lt;code&amp;gt;#include &amp;quot;file.hps&amp;quot;&amp;lt;/code&amp;gt; can be used to programmatically merge together multiple separate files to make organizing scripts easier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
==Engine scripts==&lt;br /&gt;
===Main===&lt;br /&gt;
&lt;br /&gt;
The following functions are the main hps functions that the HPL2 engine looks to run on certain events - similar to the C++ int main() function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void OnStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the map is loaded for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnEnter();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs whenever the player enters a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnLeave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the player leaves a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnGameStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is found in the global.hps file and the inventory.hps file, and is run when the game is first started by the player (ie via &amp;quot;Start New Game&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnUpdate(float afStep);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
This function is executed for every game update or &amp;quot;tick&amp;quot;. Can be used for rapid-firing updates instead of looping timers. Keep in mind that this can affect game performance if not used with care.&lt;br /&gt;
&lt;br /&gt;
#''afStep''- Time elapsed in seconds since the last frame. Multiply speeds, distances etc. by this argument to avoid framerate dependence issues (for example: if you move something in this function with constant speed, it will move faster on computers which run the game with high FPS and slower on computers with low FPS).&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float RandFloat(float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random float.&lt;br /&gt;
&lt;br /&gt;
#''afMin ''- minimum value&lt;br /&gt;
#''afMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int RandInt(int alMin, int alMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random int. Note: the maximum value is ''inclusive''  - the RandInt() function may return this value.&lt;br /&gt;
&lt;br /&gt;
#''alMin ''- minimum value&lt;br /&gt;
#''alMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringContains(string &amp;amp;in asString, string &amp;amp;in asSubString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a string contains the specified string. &amp;lt;br /&amp;gt;Example: searching for &amp;quot;hello&amp;quot; in &amp;quot;hello world&amp;quot; would return '''true'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to check&lt;br /&gt;
#''asSubString ''- the string to search for&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; StringSub(string &amp;amp;in asString, int alStart, int alCount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the substring in a string. &amp;lt;br /&amp;gt;Example: in the string &amp;quot;frictional games rocks&amp;quot;, using 4 as ''alStart''  and 6 as ''alCount''  would return '''&amp;quot;tional&amp;quot;'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string&lt;br /&gt;
#''alStart ''- starting character of the string, with 0 being the first character&lt;br /&gt;
#''alCount ''- amount of characters&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int StringToInt(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns an integer converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float StringToFloat(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a float converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringToBool(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a boolean converted from a string, else returns false.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&lt;br /&gt;
===Mathematical Operations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathCos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathTan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAsin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAcos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan2(float afX, float afY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Calculates and returns the arc tangent of the specified values.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - First value to operate.&lt;br /&gt;
#''afY''  - Second value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSqrt(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the square root of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathPow(float afBase, float afExp);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the value of afBase raised to the power of afExp.&lt;br /&gt;
&lt;br /&gt;
#''afBase''  - The base value.&lt;br /&gt;
#''afExp''  - Value to calculate the base with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMin(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the lowest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMax(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the highest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathClamp(float afX, float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns afX clamped between afMin and afMax. If afX &amp;lt; afMin, returns afMin, and if afX &amp;gt; afMax, returns afMax.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - The value to clamp.&lt;br /&gt;
#''afMin''  - The minimum value to clamp afX with.&lt;br /&gt;
#''afMax''  - The maximum value to clamp afX with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAbs(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the absolute value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&lt;br /&gt;
===Debugging===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void Print(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a string to the log file (''hpl.log'').&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDebugMessage(string &amp;amp;in asString, bool abCheckForDuplicates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a line of text to the debug console at the bottom left of the screen. Debug mode must be enabled for the console messages to be visible.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to print&lt;br /&gt;
#''abCheckForDuplicates ''- if true, the string won't be printed more than once on screen until it disappears&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ProgLog(string &amp;amp;in asLevel, string &amp;amp;in asMessage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints an entry to the ProgLog (progression log). &amp;lt;br /&amp;gt;ProgLog is a file created in Documents/Amnesia/main (or an FC folder if one is being used). It logs certain events, such us opening the menu or picking up the lantern, as well as the player's state (Health, Sanity, Oil, Tinderboxes, Coins), for the purpose of documenting a tester's playstyle. &amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt;This function allows to log custom messages.The messages in the ProgLog file are sorted by time elapsed since a map was loaded.&lt;br /&gt;
&lt;br /&gt;
ProgLog has to be enabled for a player profile in ''user_settings.cfg''  before it starts working.&lt;br /&gt;
&lt;br /&gt;
#''asLevel ''- can be &amp;quot;Low&amp;quot;, &amp;quot;Medium&amp;quot; or &amp;quot;High&amp;quot;. It's a tag which appears in each log entry, for event prioritising.&lt;br /&gt;
#''asMessage ''- The custom message to be printed to the log.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool ScriptDebugOn();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the debug mode is enabled. &amp;lt;br /&amp;gt;See [[HPL2/Development_Environment|&amp;quot;Setting up Development Environment&amp;quot;]] to setup debug mode on your own computer.&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
{{warning|Regular variables (int, float, etc.) are '''not''' saved by the game. Using them in important parts of yor script will break it upon loading a game save. In HPL, those variables should only be used for disposable counters, like spawning objects in a &amp;quot;for&amp;quot; loop. For variables which need to be saved, use the wrappers as described below.}}&lt;br /&gt;
&lt;br /&gt;
====Local====&lt;br /&gt;
&lt;br /&gt;
Local variables can be used throughout the same script file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetLocalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetLocalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddLocalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetLocalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Global====&lt;br /&gt;
&lt;br /&gt;
Global variables can be used throughout several maps and can be accessed by several script files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetGlobalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetGlobalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddGlobalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetGlobalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Particle Systems===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadParticleSystem(string &amp;amp;in asPSFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asPSFile''  - The particle system file to load. Extension: .ps&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntity(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntityExt(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS,&lt;br /&gt;
float afR, float afG, float afB, float afA, bool abFadeAtDistance, float afFadeMinEnd, float afFadeMinStart,&lt;br /&gt;
float afFadeMaxStart, float afFadeMaxEnd);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity, extended method with more options.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''abFadeAtDistance ''- determines whether a particle system fades from a certain distance on&lt;br /&gt;
#''afFadeMinEnd ''- minimum distance at which the particle system stops fading&lt;br /&gt;
#''afFadeMinStart ''- minimum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxStart ''- maximum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxEnd ''- maximum distance at which the particle system stops fading&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DestroyParticleSystem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Destroys a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - The internal name of the particle system&lt;br /&gt;
&lt;br /&gt;
===Sounds &amp;amp; Music===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadSound(string &amp;amp;in asSoundFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile''  - The sound file to load (extension .snt optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayGuiSound(string &amp;amp;in asSoundFile, float afVolume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays a sound, not using 3D.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile ''- the sound to play (extension .snt/.ogg optional)&lt;br /&gt;
#''afVolume ''- the volume of the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaySoundAtEntity(string &amp;amp;in asSoundName, string &amp;amp;in asSoundFile, string &amp;amp;in asEntity, float afFadeTime, bool abSaveSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a sound at an entity.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''asSoundFile ''- the sound to use (extension .snt optional)&lt;br /&gt;
#''asEntity ''- the entity to create the sound at. Using &amp;quot;Player&amp;quot; is effectively the same as &amp;lt;code&amp;gt;PlayGuiSound&amp;lt;/code&amp;gt;, yet this function allows a looping sound to be saved&lt;br /&gt;
#''afFadeTime ''- time in seconds the sound needs to fade. Avoids enemies hearing the sound if afFadeTime is at least 0.1f&lt;br /&gt;
#''abSaveSound ''- if ''true'', a looping sound will &amp;quot;remember&amp;quot; its playback state (currently playing/stopped), and that state will be restored the next time the level is entered. If ''true'', the sound is never attached to the entity! Note that saving should only be used on ''looping sounds''!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeInSound(string &amp;amp;in asSoundName, float afFadeTime, bool abPlayStart);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades in a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds&lt;br /&gt;
#''abPlayStart ''- Play the sound defined in the &amp;lt;code&amp;gt;&amp;lt;Start&amp;gt;&amp;lt;/code&amp;gt; section of the .snt before playing the main sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopSound(string &amp;amp;in asSoundName, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades out a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds, use 0 to immediately stop the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayMusic(string &amp;amp;in asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays music.&lt;br /&gt;
&lt;br /&gt;
#''asMusicFile ''- the music file to play (extension .ogg optional)&lt;br /&gt;
#''abLoop ''- determines whether a music track should loop&lt;br /&gt;
#''afVolume ''- volume of the music&lt;br /&gt;
#''afFadeTime ''- time in seconds until music reaches full volume&lt;br /&gt;
#''alPrio ''- priority of the music. Note that only the music with the highest priority can be heard! 0 - lowest, 1 - higher, etc.&lt;br /&gt;
#''abResume''  - if ''true'', playback will be continued from where the track stopped after the call to &amp;lt;code&amp;gt;StopMusic()&amp;lt;/code&amp;gt;. If ''false'', the track will be restarted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopMusic(float afFadeTime, int alPrio);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops music.&lt;br /&gt;
&lt;br /&gt;
#''afFadeTime ''- time in seconds until music stops&lt;br /&gt;
#''alPrio ''- the priority of the music that should stop&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice(string &amp;amp;in asVoiceFile, string &amp;amp;in asEffectFile, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry,&lt;br /&gt;
bool abUsePosition, string &amp;amp;in asPosEntity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This adds a voice and an additional sound effect to be played. It is okay to call this many times in order to play many voices in a row. The EffectVoiceOverCallback is not called until ALL voices have finished.&lt;br /&gt;
&lt;br /&gt;
#''asVoiceFile ''- the voice to play&lt;br /&gt;
#''asEffectFile ''- the sound effect to play&lt;br /&gt;
#''asTextCat ''- the category in the .lang file, usually &amp;quot;Voice&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''abUsePosition ''- plays using 3D from the entity, or without 3D&lt;br /&gt;
#''asPosEntity ''- the entity at which the voice and sound are played from&lt;br /&gt;
#''afMinDistance ''- minimum distance the voice and sound are heard&lt;br /&gt;
#''afMaxDistance ''- maximum distance the voice and sound are heard&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopAllEffectVoices(float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all voices and calls the EffectVoiceOverCallback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEffectVoiceActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether EffectVoices are still active.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetEffectVoiceOverCallback(string &amp;amp;in asFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to be called when the EffectVoices are finished. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundVolume(float afDestVolume, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound volume, that means everything you can hear '''from the world'''. This does not affect music of GUI sounds.&lt;br /&gt;
&lt;br /&gt;
#''afDestVolume ''- desired volume&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired volume&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundSpeed(float afDestSpeed, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound speed.&lt;br /&gt;
&lt;br /&gt;
#''afDestSpeed ''- desired speed&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired speed&lt;br /&gt;
&lt;br /&gt;
===Lights===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightVisible(string &amp;amp;in asLightName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables lights.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''abVisible ''- determines the state of the light&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeLightTo(string &amp;amp;in asLightName, float afR, float afG, float afB, float afA, float afRadius, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the properties of a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''afRadius ''- radius of the light. -1 means keeping the radius&lt;br /&gt;
#''afTime ''- time in seconds until change is done&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightFlickerActive(string &amp;amp;in asLightName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates flickering on a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName'' - The internal light name&lt;br /&gt;
#''abActive'' - true = active, false = inactive&lt;br /&gt;
&lt;br /&gt;
==Game scripts==&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartCredits(string &amp;amp;in asMusic, bool abLoopMusic, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alEndNum);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts the end credits screen.&lt;br /&gt;
&lt;br /&gt;
#''asMusic ''- the music to play (including .ogg)&lt;br /&gt;
#''abLoopMusic ''- determines whether the music should loop&lt;br /&gt;
#''asTextCat ''- the category to be used in the .lang file, usually &amp;quot;Ending&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alEndNum ''- Amnesia has 3 different endings and displays a code at the bottom. Determines which code is displayed. 0-2 will display codes, any other integer will not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartDemoEnd();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shows the demo end screen. The background and UI elements are defined in demo.cfg, with the text using the entries in the &amp;quot;Demo&amp;quot; category of the .lang file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AutoSave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an auto save file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CheckPoint(string &amp;amp;in asName, string &amp;amp;in asStartPos, string &amp;amp;in asCallback, string &amp;amp;in asDeathHintCat, string &amp;amp;in asDeathHintEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a checkpoint at which the player will respawn in case he dies. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asName, int alCount)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;Count is 0 on the first checkpoint load!&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the editor&lt;br /&gt;
#''asCallback ''- the function to call when the player dies/respawns&lt;br /&gt;
#''asDeathHintCat ''- the category of the death hint message to be used in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asDeathHintEntry ''- the entry in the .lang file&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeMap(string &amp;amp;in asMapName, string &amp;amp;in asStartPos, string &amp;amp;in asStartSound, string &amp;amp;in asEndSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Loads another map after a 1.5 second fade out.&lt;br /&gt;
&lt;br /&gt;
#''asMapName ''- the file to load&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the next map&lt;br /&gt;
#''asStartSound ''- the sound that is played when the change starts&lt;br /&gt;
#''asEndSound ''- the sound that is played when the new map is loaded&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ClearSavedMaps();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the &amp;quot;history&amp;quot; of the save, useful to do when you know the player will not be able to go back anymore. Makes the next save much smaller in size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateDataCache();&lt;br /&gt;
void DestroyDataCache();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This caches all current textures and models and they are not released until destroy is called. If there is already cached data it is destroyed.&lt;br /&gt;
Create caches to enable faster loading when going back to a map. Destroy the cache if you know the player won't go back to that map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMapDisplayNameEntry(string &amp;amp;in asNameEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the map name shown in save file names. If none is set NULL is assumed.&lt;br /&gt;
&lt;br /&gt;
#''asNameEntry ''- the entry to display, category must be &amp;quot;Levels&amp;quot;!&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the skybox.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxTexture(string &amp;amp;in asTexture);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the texture of the skybox.&lt;br /&gt;
&lt;br /&gt;
#''asTexture''  - The texture file to set. Extension: .dds&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the solid color of the skybox rather than a texture.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the global fog.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the color to use for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogProperties(float afStart, float afEnd, float afFalloffExp, bool abCulling);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the properties for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afStart ''- how many meters from the camera should the fog begin&lt;br /&gt;
#''afEnd ''- how many meters from the camera should the fog reach full thickness&lt;br /&gt;
#''afFalloffExp ''- the amount by which the thinkness increases&lt;br /&gt;
#''abCulling ''- whether occlusion culling is active for the fog; this prevents objects behind the fog from being loaded&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetupLoadScreen(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alRandomNum, string &amp;amp;in asImageFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which loading screen will be shown when changing maps.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category of the loading text in the .lang file to be shown on the loading screen, usually &amp;quot;LoadingText&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alRandomNum ''- if greater 1, then it will randomize between 1 and alRandom for each LoadScreen giving entry the suffix XX (eg 01). If &amp;lt; =1 then no suffix is added&lt;br /&gt;
#''asImageFile ''- the image to be shown (optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void UnlockAchievement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlocks the specified achievement. Only able to be used for the ending achievements.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the achievement. Only the following strings are valid:&lt;br /&gt;
::* Benefactor&lt;br /&gt;
::* Survivor&lt;br /&gt;
::* Sacrifice&lt;br /&gt;
::* Quitter&lt;br /&gt;
::* Egotist&lt;br /&gt;
::* Altruist&lt;br /&gt;
::* Vacillator&lt;br /&gt;
&lt;br /&gt;
===Game Timer===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddTimer(string &amp;amp;in asName, float afTime, string &amp;amp;in asFunction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a timer which calls a function when it expires. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asTimer)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the name of the timer&lt;br /&gt;
#''afTime ''- time in seconds&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveTimer(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a timer, no matter how much time is left.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the timer.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetTimerTimeLeft(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the time left on a timer.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - the internal name of the timer.&lt;br /&gt;
&lt;br /&gt;
===Screen Effects===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeOut(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to black.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen is completly black&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeIn(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen back to normal.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeImageTrailTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies the image trail effect to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeSepiaColorTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the screen go dark red.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0) &lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeRadialBlurTo(float afSize, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies radial blur effects to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afSize ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetRadialBlurStartDist(float afStartDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines at which distance the radial blur effects appear.&lt;br /&gt;
&lt;br /&gt;
#''afStartDist ''- the distance at which the effect starts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectFlash(float afFadeIn, float afWhite, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white.&lt;br /&gt;
&lt;br /&gt;
#''afFadeIn ''- time in seconds until screen is white&lt;br /&gt;
#''afWhite ''- determines to which percentage the screen fades to white (1.0 = completly white)&lt;br /&gt;
#''afFadeOut ''- time in seconds until screen is back to normal again&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectEmotionFlash(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white and shows a text message.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''asSound ''- the sound to play while fading&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetFlashbackIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a flashback is still in effect.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerSpawnPS(string &amp;amp;in asSPSFile);&lt;br /&gt;
void StopPlayerSpawnPS();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Continuously spawn regular particle systems (''.ps'') around the player. Particles created by this script carry over from map to map.&lt;br /&gt;
&lt;br /&gt;
#''asSPSFile''  - the ''.sps''  file to use. Example ''.sps''  files are located in the ''/misc''  folder in the main game directory.&amp;lt;br&amp;gt;Custom ''.sps''  files can be created by hand in a text editor (see existing ones and mimic how those are written). &amp;lt;br /&amp;gt;Since ''StopPlayerSpawnPS()''  doesn't seem to work, to stop an SPS you must create an ''.sps''  file with an empty particle field field and override the old SPS by calling ''StartPlayerSpawnPS''  again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shakes the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity of the shake&lt;br /&gt;
#''afTime ''- duration of the shake&lt;br /&gt;
#''afFadeInTime ''- time in seconds until full intensity is reached&lt;br /&gt;
#''afFadeOutTime ''- time until screen is back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInDarknessEffectsActive(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the sanity drain and night vision effects while in the darkness.&lt;br /&gt;
&lt;br /&gt;
''bool abX''  - Enable/disable effects.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowScreenImage(string &amp;amp;in asImageName, float afX, float afY, float afScale, bool abUseRelativeCoordinates, float afDuration, float afFadeIn, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
Displays an image file directly onto the screen. See [[HPL2/Tutorials/ShowScreenImage()|ShowScreenImage()]] in the tutorials section for more information.&lt;br /&gt;
&lt;br /&gt;
# ''asImageName'' - The image file to render (.jpg, .png, .tga, .dds)&lt;br /&gt;
# ''afX'' - The X position of the image&lt;br /&gt;
# ''afY'' - The Y position of the image&lt;br /&gt;
# ''afScale'' - The size of the image in pixels (not scale), or original image size if negative&lt;br /&gt;
# ''abUseRelativeCoordinates'' - Whether X and Y are relative to the screen resoltion, or pixel co-ordinates if not&lt;br /&gt;
# ''afDuration'' - The duration that the image is displayed for&lt;br /&gt;
# ''afFadeIn'' - The time, in seconds, to fade in the image&lt;br /&gt;
# ''afFadeOut'' - The time, in seconds, to fade out the image&lt;br /&gt;
&lt;br /&gt;
===Insanity===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInsanitySetEnabled(string &amp;amp;in asSet, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which InsanitySets are enabled.&lt;br /&gt;
&lt;br /&gt;
#''asSet ''- the set&lt;br /&gt;
#''abX ''- enabled or not&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartInsanityEvent(string &amp;amp;in asEventName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Starts a specified insanity event.&lt;br /&gt;
&lt;br /&gt;
#''asEventName ''- Insanity event to play.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartRandomInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts a random insanity event from the available sets.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopCurrentInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Stops the currently playing insanity event.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void InsanityEventIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an insanity event is currently in effect.&amp;lt;br&amp;gt;Not useful at all due to having a return type of &amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; when it should be &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Player===&lt;br /&gt;
&lt;br /&gt;
Note that the player's maximum health and sanity is 100.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enabled/Disable player controlled movement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangePlayerStateToNormal();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets the player's state, forcing them to stop interacting with objects. It also clears the inventory item to be used (as if it was double-clicked on in the inventory again) and dismounts the player from ladders.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerCrouching(bool abCrouch);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddPlayerBodyForce(float afX, float afY, float afZ, bool abUseLocalCoords);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pushes the player into a certain direction. Note that you need values above ~2000 to see any effects.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - amount along the X-axis&lt;br /&gt;
#''afY'' - amount along the Y-axis&lt;br /&gt;
#''afZ'' - amount along the Z-axis&lt;br /&gt;
#''abUseLocalCoords'' - If true, axes are based on where the player is facing, not the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowPlayerCrossHairIcons(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the icons when a player has something in focus.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerSanity(float afSanity);&lt;br /&gt;
void AddPlayerSanity(float afSanity);&lt;br /&gt;
float GetPlayerSanity();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerHealth(float afHealth);&lt;br /&gt;
void AddPlayerHealth(float afHealth);&lt;br /&gt;
float GetPlayerHealth();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerLampOil(float afOil);&lt;br /&gt;
void AddPlayerLampOil(float afOil);&lt;br /&gt;
float GetPlayerLampOil();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the lamp oil of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerSpeed();&lt;br /&gt;
float GetPlayerYSpeed();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current speed of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSanityDrainDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables sanity drain from darkness.&lt;br /&gt;
{{bug|Sanity drain is reenabled on loading a save, as the game is unable to load the value properly from the save data.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoost();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a large amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! New Sanity&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || 100&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || 90&lt;br /&gt;
|-&lt;br /&gt;
| 50-74 || 80&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoostSmall();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a small amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! Sanity Bonus&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || +20&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || +15&lt;br /&gt;
|-&lt;br /&gt;
| 50-75 || +10&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityDamage(float afAmount, bool abUseEffect);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount'' - amount of sanity damage done&lt;br /&gt;
#''abUseEffect'' - if a sound is played and screen effects are shown when the sanity damage is dealt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GivePlayerDamage(float afAmount, string &amp;amp;in asType, bool abSpinHead, bool abLethal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the health of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount'' - amount of damage done to health&lt;br /&gt;
#''asType'' - plays a certain effect on the screen when the damage is dealt (BloodSplat, Claws, or Slash) &lt;br /&gt;
#''abSpinHead'' - changes the camera view when damage is dealt&lt;br /&gt;
#''abLethal'' - set to true if player can die from given damage. If ''false'' and the damage would have left the player with less than 10 health, health is set to 10.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerFOVMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the field of view of the player. A shorter FOV will create a zoom effect.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - multiplier of default FOV (1 is default)&lt;br /&gt;
#''afSpeed'' - the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerAspectMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the aspect ratio of the player. Basically stretches or narrows the screen horizontally.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - multiplier of default aspect (default is 1)&lt;br /&gt;
#''afSpeed'' - the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - angle of rotation of head, positive being counter-clockwise&lt;br /&gt;
#''afSpeedMul'' - speed (possibly acceleration) multiplier of the rotation (default 1, which is really slow)&lt;br /&gt;
#''afMaxSpeed'' - maximum speed of rotation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerForward(float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Moves the player forward. It needs to be called in a timer that updates 60 times / second.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- amount along the X-axis&lt;br /&gt;
#''afY ''- amount along the Y-axis&lt;br /&gt;
#''afZ ''- amount along the Z-axis&lt;br /&gt;
#''afSpeed ''- speed at which the change happens&lt;br /&gt;
#''afSlowDownDist ''- distance at which to start slowing down (prevents the head from abruptly stopping)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerLookAt(string &amp;amp;in asEntityName, float afSpeedMul, float afMaxSpeed, string &amp;amp;in asAtTargetCallback);&lt;br /&gt;
void StopPlayerLookAt();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to look at a certain entity until StopPlayerLookAt is used.&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- the entity to look at &lt;br /&gt;
#''afSpeedMul ''- how fast should the player look at the entity&lt;br /&gt;
#''afMaxSpeed ''- maximum speed allowed&lt;br /&gt;
#''asAtTargetCallback ''- function to call when player looks at target&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerMoveSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerRunSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerLookSpeedMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the player's move/run/look speed. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpForceMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the player's jump multiplier. Higher values = higher jumps. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpDisabled(bool abX);&lt;br /&gt;
void SetPlayerCrouchDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to jump/crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportPlayer(string &amp;amp;in asStartPosName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly teleports the player to the target StartPos.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternActive(bool abX, bool abUseEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the player use his lantern.&lt;br /&gt;
&lt;br /&gt;
# ''abX'' - Set lantern to be active (true) or inactive (false)&lt;br /&gt;
# ''abUseEffects'' - Play on/off sounds&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetLanternActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player is currently using the lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to use the lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternLitCallback(string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to call when the player uses the lantern. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;MyFunc(bool abLit)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message on the screen.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory'' - the category in the .lang file&lt;br /&gt;
#''asTextEntry'' - the entry in the .lang file&lt;br /&gt;
#''afTime'' - determines how long the message is displayed. If time is &amp;lt; =0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetDeathHint(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the message that appears when the player dies.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory'' - the category in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asTextEntry'' - the entry in the .lang file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DisableDeathStartSound();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the death sound when the player dies. This must be called directly before player is killed! The variable as soon as player dies too.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPermaDeathSound(string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Sets the sound played after the player dies when permadeath is active. Permadeath is only active when the game is launched with the &amp;lt;code&amp;gt;ptest&amp;lt;/code&amp;gt; command line parameter. Only used for the post-death Suitor lines in ''Justine''.&lt;br /&gt;
&lt;br /&gt;
#''asSound'' - The sound to be played after death. Expects a voice-type sound.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerFallDamageDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the player's ability to take fall damage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPos(float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the player's position within the level.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - X co-ordinate position.&lt;br /&gt;
#''afY'' - Y co-ordinate position.&lt;br /&gt;
#''afZ'' - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerPosX();&lt;br /&gt;
float GetPlayerPosY();&lt;br /&gt;
float GetPlayerPosZ();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the player's position within the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
===Journal===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddNote(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a note to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _Name and _Text and be in category &amp;quot;Journal&amp;quot;!&lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDiary(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a diary to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _NameX and _TextY whereas X and Y are numbers of the parts (_Name1: first diary, _Text1: first page) and be in category &amp;quot;Journal&amp;quot;! &lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ReturnOpenJournal(bool abOpenJournal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Only called in the pickup diary callback! If true the journal displays the entry else not.&lt;br /&gt;
&lt;br /&gt;
===Quests===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a quest to the player's journal under mementos. Completed quests cannot be readded.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name to be used&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot;Quest_&amp;lt;texthere&amp;gt;_Text”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CompleteQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Completes a quest. If the quest has not been added, it's marked as complete anyway, preventing it from being added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot; Quest_&amp;lt;texthere&amp;gt;_Text ”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool QuestIsCompleted(string &amp;amp;in asName);&lt;br /&gt;
bool QuestIsAdded(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a quest is completed/added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetNumberOfQuestsInMap(int alNumberOfQuests);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the number of quests in the map. Obsolete; formerly used to calculate a completion percentage when looking at a level door.&lt;br /&gt;
&lt;br /&gt;
#''alNumberOfQuests ''- Amount of quests&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveHint(string &amp;amp;in asName, string &amp;amp;in asMessageCat, string &amp;amp;in asMessageEntry, float afTimeShown);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a hint on the player's screen.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asMessageCat ''- the category in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asMessageEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTimeShown ''- time in seconds until the message disappears. If time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void BlockHint(string &amp;amp;in asName);&lt;br /&gt;
void UnBlockHint(string &amp;amp;in asName);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Blocking a hint prevents it from being shown. Blocked hints are included in savefiles, so they should persist between levels. Unblocking a hint allows it to be shown.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; blocks the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveHint(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes the hint from the list of already shown hints, allowing it to appear again.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; reenables the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
===Inventory===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ExitInventory();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Exits the inventory by force.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the player's ability to open his inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a message on the inventory screen. Used for feedback messages when failing to combine items.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory ''- the category in the .lang file, usually &amp;quot;Inventory&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTime ''- time in seconds until the message disappears. If life time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItem(string &amp;amp;in asName, string &amp;amp;in asType, string &amp;amp;in asSubTypeName, string &amp;amp;in asImageName, float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds an item to the inventory of the player. Note that the item does not have to exist as entity in the world to be able to do this.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asType ''- item type to give, Available types are:&lt;br /&gt;
::*Puzzle&lt;br /&gt;
::*Lantern&lt;br /&gt;
::*Health&lt;br /&gt;
::*Sanity&lt;br /&gt;
::*LampOil&lt;br /&gt;
::*Tinderbox&lt;br /&gt;
#''asSubTypeName ''- item name for .lang file&lt;br /&gt;
#''asImageName ''- the image which will appear in inventory. For example: &amp;lt;code&amp;gt;void GiveItem(&amp;quot;chemical_container_full_1&amp;quot;, &amp;quot;Puzzle&amp;quot;, &amp;quot;chemical_container_full&amp;quot;, &amp;quot;chemical_container_full.tga&amp;quot;, 1);&amp;lt;/code&amp;gt; will use the image from &amp;lt;code&amp;gt;graphics/item/chemical_container_full.tga&amp;lt;/code&amp;gt; &lt;br /&gt;
#''afAmount ''- amount the item gives, - For example: Oil potions will fill the oil meter by this amount, Health potions will heal by this amount, etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item from the player's inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool HasItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player has an item in his inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItemFromFile(string &amp;amp;in asName, string &amp;amp;in asFileName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a single item to the player's inventory. This is meant to be used for debug mostly as it creates the actual item and then destroys it.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asFileName ''- item to give + extension (.ent)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddCombineCallback(string &amp;amp;in asName, string &amp;amp;in asItemA, string &amp;amp;in asItemB, string &amp;amp;in asFunction, bool abAutoRemove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to combine items in his inventory. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItemA, string &amp;amp;in asItemB)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name for the callback&lt;br /&gt;
#''asItemA ''- internal name of first item&lt;br /&gt;
#''asItemB ''- internal name of second item&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
#''abAutoRemove ''- determines whether the callback should be removed when the items are combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveCombineCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a combine callback.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the callback to be removed (as specified in AddCombineCallback)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddUseItemCallback(string &amp;amp;in asName, string &amp;amp;in asItem, string &amp;amp;in asEntity, string &amp;amp;in asFunction, bool abAutoDestroy);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to use items on the world. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItem, string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
#''asItem ''- internal name of the item&lt;br /&gt;
#''asEntity ''- entity to be able to use the item on&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abAutoDestroy ''- determines whether the callback should be removed when the item is used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveUseItemCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item callback.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
&lt;br /&gt;
===Entities===&lt;br /&gt;
&lt;br /&gt;
====General====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityActive(string &amp;amp;in asName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityVisible(string &amp;amp;in asName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity's visual mesh. The collision body remains.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the entity.&lt;br /&gt;
#''abActive''  - Activate/deactivate mesh.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntityExists(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an entity exists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCustomFocusCrossHair(string &amp;amp;in asName, string&amp;amp; asCrossHair);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the crosshair that is used when focusing an entity.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCrossHair ''- desired crosshair, can be: &lt;br /&gt;
::*Default (no crosshair)&lt;br /&gt;
::*Grab&lt;br /&gt;
::*Push&lt;br /&gt;
::*Ignite&lt;br /&gt;
::*Pick&lt;br /&gt;
::*LevelDoor&lt;br /&gt;
::*Ladder&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void CreateEntityAtArea(string &amp;amp;in asEntityName, string &amp;amp;in asEntityFile, string &amp;amp;in asAreaName, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an entity at an area. When creating an enemy though, it cannot chase properly along PathNodes (using for example &amp;lt;code&amp;gt;ShowEnemyPlayerPosition&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- internal name&lt;br /&gt;
#''asEntityFile ''- entity to be used extension .ent&lt;br /&gt;
#''asAreaName ''- the area to create the entity at&lt;br /&gt;
#''abFullGameSave ''- determines whether an entity &amp;quot;remembers&amp;quot; its state&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ReplaceEntity(string &amp;amp;in asName, string &amp;amp;in asBodyName, string &amp;amp;in asNewEntityName, string &amp;amp;in asNewEntityFile, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Removes an entity and places a new one in its place.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to replace.&lt;br /&gt;
#''asBodyName'' - Name of the body of the entity to place the new entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''asNewEntityName'' - Name of the new entity.&lt;br /&gt;
#''asNewEntityFile'' - Name of the new entity file. Extension .ent. &lt;br /&gt;
#''abFullGameSave'' - Whether ALL properties of this entity should be saved throughout levels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaceEntityAtEntity(string &amp;amp;in asName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBodyName, bool abUseRotation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Places an entity at the position of another entity. Does not work for enemies, use TeleportEnemyToEntity instead.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to place.&lt;br /&gt;
#''asTargetEntity'' - Name of the other entity to place the first entity at.&lt;br /&gt;
#''asTargetBodyName'' - Name of the body of the entity to place the first entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''abUseRotation'' - Whether the entity should be rotated like the target entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPos(string &amp;amp;in asName, float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Moves an entity to a position in the level.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to move.&lt;br /&gt;
#''afX'' - X co-ordinate position.&lt;br /&gt;
#''afY'' - Y co-ordinate position.&lt;br /&gt;
#''afZ'' - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetEntityPosX(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosY(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosZ(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns an entity's position in the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerLookAtCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveWhenLookedAt);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player looks at a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = looking, -1 = not looking&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveWhenLookedAt ''- determines whether the callback should be removed when the player looked at the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerInteractCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveOnInteraction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player interacts with a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveOnInteraction ''- determines whether the callback should be removed when the player interacts with the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCallbackFunc(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when certain events occur with an entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, string &amp;amp;in asType)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;asType&amp;lt;/code&amp;gt; values depend on entity type:&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! asType Value&lt;br /&gt;
|-&lt;br /&gt;
| Object || Break&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || OnIgnite&lt;br /&gt;
|-&lt;br /&gt;
| Item || OnPickup&lt;br /&gt;
|-&lt;br /&gt;
| Enemy || OnDeath&lt;br /&gt;
|-&lt;br /&gt;
| Enemy_Grunt&amp;lt;br&amp;gt;Enemy_Manpig || OnAutoDisabled&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityConnectionStateChangeCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A callback called when ever the connection state changes (button being switched on, lever switched, etc). &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void Func(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: -1 = off, 0 = between, 1 = on&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityInteractionDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disallows interaction with an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void BreakJoint (string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Breaks a joint. Do not use this on joints in SwingDoors, Levers, Wheels, etc. where the joint is part of an interaction. That will make the game crash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void AddEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName, string &amp;amp;in asFunction, bool abDeleteOnCollide, int alStates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when two entities collide. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asParent, string &amp;amp;in asChild, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = enter, -1 = leave&lt;br /&gt;
&lt;br /&gt;
#''asParentName ''- internal name of main object&lt;br /&gt;
#''asChildName ''- internal name of object that collides with main object (asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) NOT supported!)&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abDeleteOnCollide ''- determines whether the callback after it was called&lt;br /&gt;
#''alStates ''- 1 = only enter, -1 = only leave, 0 = both&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an EntityCollideCallback. Asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) not supported in ''asChildName''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntitiesCollide(string &amp;amp;in asEntityA, string &amp;amp;in asEntityB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether two entities collide. This function does NOT support asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) or &amp;quot;Player&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetBodyMass(string &amp;amp;in asName, float afMass);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName.&lt;br /&gt;
#''afMass''  - The mass to set.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetBodyMass(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName. &lt;br /&gt;
#''afMass''  - The mass to get.&lt;br /&gt;
&lt;br /&gt;
====Props====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropEffectActive(string &amp;amp;in asName, bool abActive, bool abFadeAndPlaySounds);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Turns the texture illumination, billboards, particles, light flicker, and sounds of a prop on or off.&lt;br /&gt;
&lt;br /&gt;
Can be used on coal to give it the black color it should have.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name &lt;br /&gt;
#''abActive'' - active state&lt;br /&gt;
#''abFadeAndPlaySounds'' - if all effects should fade in/out or not&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropActiveAndFade(string &amp;amp;in asName, bool abActive, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates a prop.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''abActive ''- nothing to add&lt;br /&gt;
#''afFadeTime ''- time in seconds until prop fully fades&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropStaticPhysics(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates the physics of a prop, setting the mass to 0. Setting as true will make entities static in midair.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetPropIsInteractedWith(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a prop is interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RotatePropToSpeed(string &amp;amp;in asName, float afAcc, float afGoalSpeed, float afAxisX, float afAxisY, float afAxisZ, bool abResetSpeed, string &amp;amp;in asOffsetArea);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the prop up to a set speed.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afGoalSpeed ''- desired speed &lt;br /&gt;
#''afAxisX ''- rotation around X axis&lt;br /&gt;
#''afAxisY ''- rotation around Y axis&lt;br /&gt;
#''afAxisZ ''- rotation around Z axis&lt;br /&gt;
#''abResetSpeed ''- determines whether the speed is resetted after goal speed is reached&lt;br /&gt;
#''asOffsetArea ''- the area to rotate around, if empty, then the center of the body is used Note: The entity you want to rotate MUST be a &amp;quot;StaticObject&amp;quot; entity!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void StopPropMovement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all movement of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddAttachedPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop.&lt;br /&gt;
&lt;br /&gt;
#''asPropName''- the prop to attach another prop at &lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop&lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
{{bug|''afRotZ '' is used for both the ZX rotation and the Z position of the attached prop. Unwanted rotation can be avoided by using: &amp;lt;br /&amp;gt;''AddAttachedPropToProp(asPropName, asAttachName, asAttachFile, afPosX, afPosY, '''0''', afPosZ, '''90.0f''', afPosZ)''}}&lt;br /&gt;
&lt;br /&gt;
{{bug|Attaching a breakable prop to a physically active prop, and then breaking the attached prop, will cause the game to crash, should the parent object be moved or reset.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop. Fixed version of &amp;lt;code&amp;gt;AddAttachedPropToProp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
#''asPropName ''- the prop to attach another prop at&lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop &lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveAttachedPropFromProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches a prop from a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
void AddPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
float GetPropHealth(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ResetProp(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets a prop's state to the original one when the map was loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void PlayPropAnimation(string &amp;amp;in asProp, string &amp;amp;in asAnimation, float afFadeTime, bool abLoop, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the prop play an animation and calls a function. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asProp)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asProp ''- internal name of the prop&lt;br /&gt;
#''asAnimation ''- animation to play&lt;br /&gt;
#''afFadeTime ''- Fade time between current and new animations&lt;br /&gt;
#''abLoop ''- determines whether the animation loops &lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddPropForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddPropImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These functions push objects. Note that rather high values are needed when applying ''forces''  (on the order of ~100 (weak) to ~10000 (strong)), but not impulses (values less than 10 can be appropriate). Forces are external influences, and will have different effect depending on the mass of the object they are being applied to; impulses disregard mass, and can cause objects to break, as if hit. A &amp;quot;Body&amp;quot; is a physics-related helper object, to which a force or an impulse can be applied. Entities can consist of several bodies, interconnected in various ways (you can create/examine bodies in the model editor).&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the object to push; for bodies, use this format: &amp;quot;''entityName''_''bodyName''&amp;quot;&lt;br /&gt;
#''afX ''- magnitude along the X-axis&lt;br /&gt;
#''afY ''- magnitude along the Y-axis&lt;br /&gt;
#''afZ ''- magnitude along the Z-axis&lt;br /&gt;
#''asCoordSystem ''- determines which coordinate system is used, &amp;quot;local&amp;quot; or &amp;quot;world&amp;quot;&lt;br /&gt;
&lt;br /&gt;
All of these functions are ''additive''  - when called consecutively, for each call, the vectors defined by (afX, afY, afZ) will be added together, and a resultant force/impulse will be calculated ''before''  any physics simulation is applied to the target object.&lt;br /&gt;
&lt;br /&gt;
====Connections====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithRope(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asRopeName, bool abInteractOnly, float afSpeedMul, float afToMinSpeed, float afToMaxSpeed, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects a prop with the movement of a rope (i.e. turn a wheel to move a rope). For Levers, the rope only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName''- The name of the connection&lt;br /&gt;
#''asPropName'' - The name of the prop; can be a Lever or Wheel&lt;br /&gt;
#''asRopeName'' - The name of the rope&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''afSpeedMul'' - Speed multiplier of how quickly the rope moves&lt;br /&gt;
#''afToMinSpeed'' - The slowest the rope can move&lt;br /&gt;
#''afToMaxSpeed'' - The fastest the rope can move&lt;br /&gt;
#''abInvert'' - Whether to invert the direction the rope moves&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithMoveObject(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asMoveObjectName, bool abInteractOnly, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This one should only be used if there must be an exact correspondence to prop &amp;quot;amount&amp;quot; and the MoveObject open amount. It is best used for Wheel-door connections, where the MoveObject moves continuously along with the Wheel. For Levers, the MoveObject only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asPropName'' - The entity that controls the movement; can be a Lever or Wheel&lt;br /&gt;
#''asMoveObject'' - The MoveObject to move&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''abInvert'' - If the state is inverted, making the MoveObject move in the opposite direction&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ConnectEntities(string &amp;amp;in asName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, bool abInvertStateSent, int alStatesUsed, string &amp;amp;in asCallbackFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects two entities together so that changing the state of the main entity changes the state of the connected entity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! Max State (1) !! Min State (-1)&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || Lit || Unlit&lt;br /&gt;
|-&lt;br /&gt;
| MoveObject || Open || Close&lt;br /&gt;
|-&lt;br /&gt;
| SwingDoor&lt;br /&gt;
|rowspan=2| Locked&lt;br /&gt;
|rowspan=2| Unlocked&lt;br /&gt;
|-&lt;br /&gt;
| Chest&lt;br /&gt;
|-&lt;br /&gt;
| Button || Switched on || Switched off&lt;br /&gt;
|-&lt;br /&gt;
| Lever&lt;br /&gt;
|rowspan=2| Unstuck&lt;br /&gt;
|rowspan=2| Stuck (at min)&lt;br /&gt;
|-&lt;br /&gt;
| Wheel&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asMainEntity'' - The entity that causes the change; can be a Lever, Wheel, Button, or Photocell&lt;br /&gt;
#''asConnectEntity'' - The entity that is affected by the change&lt;br /&gt;
#''abInvertStateSent'' - If the state is inverted, making the connected entity change to the opposite state&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
#''asCallbackFunc'' - The name of the connection callback&lt;br /&gt;
&lt;br /&gt;
Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asConnectionName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, int alState)&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;alState is what is sent to connection entity and will be inverted if abInvertStateSent = true!&lt;br /&gt;
&lt;br /&gt;
====Lamps====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLampLit(string &amp;amp;in asName, bool abLit, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Turns a lamp on or off.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the lamp&lt;br /&gt;
#''abLit ''- Set true if you want the lamp to be lit, set to false if you want the lamp to be unlit&lt;br /&gt;
#''abEffects ''- If you want to have the lamp fade in/out when it gets lit/unlit&lt;br /&gt;
&lt;br /&gt;
====Doors====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorLocked(string &amp;amp;in asName, bool abLocked, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abLocked'' - Locked/unlocked&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is locked/unlocked&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorClosed(string &amp;amp;in asName, bool abClosed, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abClosed'' - Closed/open&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is closed/opened&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
bool GetSwingDoorLocked(string &amp;amp;in asName);&lt;br /&gt;
bool GetSwingDoorClosed(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a swing door is locked/closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorDisableAutoClose(string &amp;amp;in asName, bool abDisableAutoClose);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deactivates the &amp;quot;auto-close&amp;quot; when a door is nearly closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetSwingDoorState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns an integer depending on how far the door is opened. &amp;lt;br /&amp;gt;-1 = angle is close to 0°, 1 = angle is 70% or higher of max, 0 = inbetween -1 and 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLocked(string &amp;amp;in asName, bool abLocked);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a level door. Note that level doors are NOT swing doors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedSound(string &amp;amp;in asName, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which sound is played when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedText(string &amp;amp;in asName, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectState(string &amp;amp;in asName, float afState);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween (and above, for example, the bridge_metal_vert) are valid too!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectStateExt(string &amp;amp;in asName, float afState, float afAcc, float afMaxSpeed, float afSlowdownDist, bool abResetSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state, extended method.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween are valid too!&lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afMaxSpeed ''- maximum speed&lt;br /&gt;
#''afSlowdownDist ''- Distance to the target state before deceleration occurs.&lt;br /&gt;
#''abResetSpeed ''- Set to ''true'' if the prop's speed should be reset before performing the movement, else the prop will accelerate from its current speed to afMaxSpeed.&lt;br /&gt;
&lt;br /&gt;
====Levers, wheels and buttons====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropObjectStuckState(string &amp;amp;in asName, int alState);&lt;br /&gt;
void SetWheelStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
void SetLeverStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes an object/wheel/lever stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name&lt;br /&gt;
#''alState'' - 0 = not stuck, 1 = at max, -1 = at min &lt;br /&gt;
#''abEffects'' - play sound effects&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelAngle(string &amp;amp;in asName, float afAngle, bool abAutoMove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves a wheel to a certain angle.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name&lt;br /&gt;
#''afAngle'' - angle&lt;br /&gt;
#''abAutoMove'' - determines whether the wheel should move on its own&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
void SetLeverInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to make a wheel/lever unstuck when interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetLeverState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the state of the lever. &amp;lt;br /&amp;gt;0 = not stuck, 1 = at max, -1 = at min&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderStuckState(string &amp;amp;in asName, int alStuckState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes a MultiSlider stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when state changes. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetButtonSwitchedOn(string &amp;amp;in asName, bool abSwitchedOn, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Sticky areas====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetAllowStickyAreaAttachment(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows entities to stick to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asProp);&lt;br /&gt;
void AttachBodyToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asBody);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop/body to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void DetachFromStickyArea(string &amp;amp;in asAreaName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches everything from a StickyArea.&lt;br /&gt;
&lt;br /&gt;
====NPCs====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCAwake(string &amp;amp;in asName, bool abAwake, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wakes/sleeps a NPC.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the NPC&lt;br /&gt;
#''abAwake'' - ''true'' to awaken, ''false'' to sleep&lt;br /&gt;
#''abEffects'' - Play the &amp;quot;Awake&amp;quot; or &amp;quot;Sleep&amp;quot; animations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCFollowPlayer(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a NPC's head to follow the player's movements.&lt;br /&gt;
&lt;br /&gt;
====Enemies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables an enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyIsHallucination(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes an enemy a hallucination. Hallucinations fade to smoke when they get near the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void FadeEnemyToSmoke(string &amp;amp;in asName, bool abPlaySound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly fades an enemy to smoke.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ShowEnemyPlayerPosition(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the enemy run to the player, no matter where he is.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AlertEnemyOfPlayerPresence(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gives the specified enemy the player's current position and makes it search the area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisableTriggers(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables or disables enemy triggers. If disabled, enemy will not react to player or attack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddEnemyPatrolNode(string &amp;amp;in asName, string &amp;amp;in asNodeName, float afWaitTime, string &amp;amp;in asAnimation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a patrol node to the enemy's path.&lt;br /&gt;
&lt;br /&gt;
#''asName''- Internal name of the enemy &lt;br /&gt;
#''asNodeName'' - Path node &lt;br /&gt;
#''afWaitTime'' - Time in seconds that the enemy waits at the path node before continuing. If 0, randomized between 1-3.&lt;br /&gt;
#''asAnimation'' - The animation the enemy uses when reaching the path node&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ClearEnemyPatrolNodes(string &amp;amp;in asEnemyName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the current path of patrol nodes of the enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemySanityDecreaseActive(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether an enemy activates the player's sanity drain when stared at.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy &lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToNode(string &amp;amp;in asEnemyName, string &amp;amp;in asNodeName, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific PathNode.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asNodeName'' - Internal name of the node to teleport to &lt;br /&gt;
#''abChangeY'' - Whether the Y position of the node will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToEntity(string &amp;amp;in asEnemyName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBody, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific entity.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asTargetEntity'' - Internal name of the entity to teleport to&lt;br /&gt;
#''asTargetBody'' - Internal name of the entity's body name to teleport to. If empty, the first body will be used (might be unstable, recommended to input a body anyway)&lt;br /&gt;
#''abChangeY'' - Whether the Y position of the entity will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeManPigPose(string &amp;amp;in asName, string &amp;amp;in asPoseType);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the pose a specified ManPig.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''asPoseType'' - Name of the ManPig pose to use. Can be &amp;quot;Biped&amp;quot; or &amp;quot;Quadruped&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigFadeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should fade the player's view in and out.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigSoundDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should play the proximity sounds.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigEasyEscapeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should be easier to escape from when hunted. If not disabled, easy escape is activated if the player is more than 12.35 meters away, the enemy can't see the player, and the player has less than 75 health. When this occurs, the enemy is forced to stop hunting and wait for half a second.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ForceTeslaPigSighting(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Forces a Tesla ManPig to be visible for a short time.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; GetEnemyStateName(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the name of the state a specified enemy is current in.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
Possible states for all enemies:&lt;br /&gt;
*Idle&lt;br /&gt;
*Wait&lt;br /&gt;
*Patrol&lt;br /&gt;
*Investigate&lt;br /&gt;
*Alert&lt;br /&gt;
*Search&lt;br /&gt;
*Hurt&lt;br /&gt;
*Hunt&lt;br /&gt;
*HuntPause&lt;br /&gt;
*HuntWander&lt;br /&gt;
*AttackMeleeShort&lt;br /&gt;
*AttackMeleeLong&lt;br /&gt;
*BreakDoor&lt;br /&gt;
*Dead&lt;br /&gt;
&lt;br /&gt;
Waterlurker-only states:&lt;br /&gt;
*GoHome&lt;br /&gt;
*Eat&lt;br /&gt;
&lt;br /&gt;
ManPig-only states: &lt;br /&gt;
*Flee&lt;br /&gt;
*Stalk&lt;br /&gt;
*Track&lt;br /&gt;
&lt;br /&gt;
Unused states:&lt;br /&gt;
*AttackRange&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=7020</id>
		<title>HPL2/Engine Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=7020"/>
		<updated>2025-09-25T02:35:09Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Props */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TocRight}}&lt;br /&gt;
&lt;br /&gt;
This page documents all scripts available in Amnesia: The Dark Descent.&lt;br /&gt;
&lt;br /&gt;
{{note|'''Note''': Some of the functions require the Amnesia 1.3 or 1.5 update. Steam and other online store copies should be automatically updated. Other copies can get 1.3 [http://www.frictionalgames.com/forum/thread-24334.html here].}}&lt;br /&gt;
&lt;br /&gt;
== Directives ==&lt;br /&gt;
&lt;br /&gt;
First off, &amp;lt;code&amp;gt;#include &amp;quot;file.hps&amp;quot;&amp;lt;/code&amp;gt; can be used to programmatically merge together multiple separate files to make organizing scripts easier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
==Engine scripts==&lt;br /&gt;
===Main===&lt;br /&gt;
&lt;br /&gt;
The following functions are the main hps functions that the HPL2 engine looks to run on certain events - similar to the C++ int main() function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void OnStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the map is loaded for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnEnter();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs whenever the player enters a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnLeave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the player leaves a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnGameStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is found in the global.hps file and the inventory.hps file, and is run when the game is first started by the player (ie via &amp;quot;Start New Game&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnUpdate(float afStep);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
This function is executed for every game update or &amp;quot;tick&amp;quot;. Can be used for rapid-firing updates instead of looping timers. Keep in mind that this can affect game performance if not used with care.&lt;br /&gt;
&lt;br /&gt;
#''afStep''- Time elapsed in seconds since the last frame. Multiply speeds, distances etc. by this argument to avoid framerate dependence issues (for example: if you move something in this function with constant speed, it will move faster on computers which run the game with high FPS and slower on computers with low FPS).&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float RandFloat(float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random float.&lt;br /&gt;
&lt;br /&gt;
#''afMin ''- minimum value&lt;br /&gt;
#''afMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int RandInt(int alMin, int alMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random int. Note: the maximum value is ''inclusive''  - the RandInt() function may return this value.&lt;br /&gt;
&lt;br /&gt;
#''alMin ''- minimum value&lt;br /&gt;
#''alMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringContains(string &amp;amp;in asString, string &amp;amp;in asSubString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a string contains the specified string. &amp;lt;br /&amp;gt;Example: searching for &amp;quot;hello&amp;quot; in &amp;quot;hello world&amp;quot; would return '''true'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to check&lt;br /&gt;
#''asSubString ''- the string to search for&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; StringSub(string &amp;amp;in asString, int alStart, int alCount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the substring in a string. &amp;lt;br /&amp;gt;Example: in the string &amp;quot;frictional games rocks&amp;quot;, using 4 as ''alStart''  and 6 as ''alCount''  would return '''&amp;quot;tional&amp;quot;'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string&lt;br /&gt;
#''alStart ''- starting character of the string, with 0 being the first character&lt;br /&gt;
#''alCount ''- amount of characters&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int StringToInt(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns an integer converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float StringToFloat(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a float converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringToBool(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a boolean converted from a string, else returns false.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&lt;br /&gt;
===Mathematical Operations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathCos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathTan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAsin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAcos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan2(float afX, float afY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Calculates and returns the arc tangent of the specified values.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - First value to operate.&lt;br /&gt;
#''afY''  - Second value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSqrt(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the square root of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathPow(float afBase, float afExp);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the value of afBase raised to the power of afExp.&lt;br /&gt;
&lt;br /&gt;
#''afBase''  - The base value.&lt;br /&gt;
#''afExp''  - Value to calculate the base with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMin(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the lowest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMax(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the highest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathClamp(float afX, float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns afX clamped between afMin and afMax. If afX &amp;lt; afMin, returns afMin, and if afX &amp;gt; afMax, returns afMax.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - The value to clamp.&lt;br /&gt;
#''afMin''  - The minimum value to clamp afX with.&lt;br /&gt;
#''afMax''  - The maximum value to clamp afX with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAbs(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the absolute value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&lt;br /&gt;
===Debugging===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void Print(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a string to the log file (''hpl.log'').&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDebugMessage(string &amp;amp;in asString, bool abCheckForDuplicates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a line of text to the debug console at the bottom left of the screen. Debug mode must be enabled for the console messages to be visible.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to print&lt;br /&gt;
#''abCheckForDuplicates ''- if true, the string won't be printed more than once on screen until it disappears&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ProgLog(string &amp;amp;in asLevel, string &amp;amp;in asMessage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints an entry to the ProgLog (progression log). &amp;lt;br /&amp;gt;ProgLog is a file created in Documents/Amnesia/main (or an FC folder if one is being used). It logs certain events, such us opening the menu or picking up the lantern, as well as the player's state (Health, Sanity, Oil, Tinderboxes, Coins), for the purpose of documenting a tester's playstyle. &amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt;This function allows to log custom messages.The messages in the ProgLog file are sorted by time elapsed since a map was loaded.&lt;br /&gt;
&lt;br /&gt;
ProgLog has to be enabled for a player profile in ''user_settings.cfg''  before it starts working.&lt;br /&gt;
&lt;br /&gt;
#''asLevel ''- can be &amp;quot;Low&amp;quot;, &amp;quot;Medium&amp;quot; or &amp;quot;High&amp;quot;. It's a tag which appears in each log entry, for event prioritising.&lt;br /&gt;
#''asMessage ''- The custom message to be printed to the log.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool ScriptDebugOn();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the debug mode is enabled. &amp;lt;br /&amp;gt;See [[HPL2/Development_Environment|&amp;quot;Setting up Development Environment&amp;quot;]] to setup debug mode on your own computer.&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
{{warning|Regular variables (int, float, etc.) are '''not''' saved by the game. Using them in important parts of yor script will break it upon loading a game save. In HPL, those variables should only be used for disposable counters, like spawning objects in a &amp;quot;for&amp;quot; loop. For variables which need to be saved, use the wrappers as described below.}}&lt;br /&gt;
&lt;br /&gt;
====Local====&lt;br /&gt;
&lt;br /&gt;
Local variables can be used throughout the same script file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetLocalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetLocalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddLocalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetLocalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Global====&lt;br /&gt;
&lt;br /&gt;
Global variables can be used throughout several maps and can be accessed by several script files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetGlobalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetGlobalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddGlobalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetGlobalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Particle Systems===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadParticleSystem(string &amp;amp;in asPSFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asPSFile''  - The particle system file to load. Extension: .ps&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntity(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntityExt(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS,&lt;br /&gt;
float afR, float afG, float afB, float afA, bool abFadeAtDistance, float afFadeMinEnd, float afFadeMinStart,&lt;br /&gt;
float afFadeMaxStart, float afFadeMaxEnd);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity, extended method with more options.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''abFadeAtDistance ''- determines whether a particle system fades from a certain distance on&lt;br /&gt;
#''afFadeMinEnd ''- minimum distance at which the particle system stops fading&lt;br /&gt;
#''afFadeMinStart ''- minimum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxStart ''- maximum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxEnd ''- maximum distance at which the particle system stops fading&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DestroyParticleSystem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Destroys a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - The internal name of the particle system&lt;br /&gt;
&lt;br /&gt;
===Sounds &amp;amp; Music===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadSound(string &amp;amp;in asSoundFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile''  - The sound file to load (extension .snt optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayGuiSound(string &amp;amp;in asSoundFile, float afVolume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays a sound, not using 3D.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile ''- the sound to play (extension .snt/.ogg optional)&lt;br /&gt;
#''afVolume ''- the volume of the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaySoundAtEntity(string &amp;amp;in asSoundName, string &amp;amp;in asSoundFile, string &amp;amp;in asEntity, float afFadeTime, bool abSaveSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a sound at an entity.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''asSoundFile ''- the sound to use (extension .snt optional)&lt;br /&gt;
#''asEntity ''- the entity to create the sound at. Using &amp;quot;Player&amp;quot; is effectively the same as &amp;lt;code&amp;gt;PlayGuiSound&amp;lt;/code&amp;gt;, yet this function allows a looping sound to be saved&lt;br /&gt;
#''afFadeTime ''- time in seconds the sound needs to fade. Avoids enemies hearing the sound if afFadeTime is at least 0.1f&lt;br /&gt;
#''abSaveSound ''- if ''true'', a looping sound will &amp;quot;remember&amp;quot; its playback state (currently playing/stopped), and that state will be restored the next time the level is entered. If ''true'', the sound is never attached to the entity! Note that saving should only be used on ''looping sounds''!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeInSound(string &amp;amp;in asSoundName, float afFadeTime, bool abPlayStart);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades in a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds&lt;br /&gt;
#''abPlayStart ''- Play the sound defined in the &amp;lt;code&amp;gt;&amp;lt;Start&amp;gt;&amp;lt;/code&amp;gt; section of the .snt before playing the main sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopSound(string &amp;amp;in asSoundName, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades out a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds, use 0 to immediately stop the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayMusic(string &amp;amp;in asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays music.&lt;br /&gt;
&lt;br /&gt;
#''asMusicFile ''- the music file to play (extension .ogg optional)&lt;br /&gt;
#''abLoop ''- determines whether a music track should loop&lt;br /&gt;
#''afVolume ''- volume of the music&lt;br /&gt;
#''afFadeTime ''- time in seconds until music reaches full volume&lt;br /&gt;
#''alPrio ''- priority of the music. Note that only the music with the highest priority can be heard! 0 - lowest, 1 - higher, etc.&lt;br /&gt;
#''abResume''  - if ''true'', playback will be continued from where the track stopped after the call to &amp;lt;code&amp;gt;StopMusic()&amp;lt;/code&amp;gt;. If ''false'', the track will be restarted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopMusic(float afFadeTime, int alPrio);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops music.&lt;br /&gt;
&lt;br /&gt;
#''afFadeTime ''- time in seconds until music stops&lt;br /&gt;
#''alPrio ''- the priority of the music that should stop&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice(string &amp;amp;in asVoiceFile, string &amp;amp;in asEffectFile, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry,&lt;br /&gt;
bool abUsePosition, string &amp;amp;in asPosEntity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This adds a voice and an additional sound effect to be played. It is okay to call this many times in order to play many voices in a row. The EffectVoiceOverCallback is not called until ALL voices have finished.&lt;br /&gt;
&lt;br /&gt;
#''asVoiceFile ''- the voice to play&lt;br /&gt;
#''asEffectFile ''- the sound effect to play&lt;br /&gt;
#''asTextCat ''- the category in the .lang file, usually &amp;quot;Voice&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''abUsePosition ''- plays using 3D from the entity, or without 3D&lt;br /&gt;
#''asPosEntity ''- the entity at which the voice and sound are played from&lt;br /&gt;
#''afMinDistance ''- minimum distance the voice and sound are heard&lt;br /&gt;
#''afMaxDistance ''- maximum distance the voice and sound are heard&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopAllEffectVoices(float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all voices and calls the EffectVoiceOverCallback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEffectVoiceActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether EffectVoices are still active.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetEffectVoiceOverCallback(string &amp;amp;in asFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to be called when the EffectVoices are finished. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundVolume(float afDestVolume, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound volume, that means everything you can hear '''from the world'''. This does not affect music of GUI sounds.&lt;br /&gt;
&lt;br /&gt;
#''afDestVolume ''- desired volume&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired volume&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundSpeed(float afDestSpeed, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound speed.&lt;br /&gt;
&lt;br /&gt;
#''afDestSpeed ''- desired speed&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired speed&lt;br /&gt;
&lt;br /&gt;
===Lights===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightVisible(string &amp;amp;in asLightName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables lights.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''abVisible ''- determines the state of the light&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeLightTo(string &amp;amp;in asLightName, float afR, float afG, float afB, float afA, float afRadius, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the properties of a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''afRadius ''- radius of the light. -1 means keeping the radius&lt;br /&gt;
#''afTime ''- time in seconds until change is done&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightFlickerActive(string &amp;amp;in asLightName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates flickering on a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName'' - The internal light name&lt;br /&gt;
#''abActive'' - true = active, false = inactive&lt;br /&gt;
&lt;br /&gt;
==Game scripts==&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartCredits(string &amp;amp;in asMusic, bool abLoopMusic, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alEndNum);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts the end credits screen.&lt;br /&gt;
&lt;br /&gt;
#''asMusic ''- the music to play (including .ogg)&lt;br /&gt;
#''abLoopMusic ''- determines whether the music should loop&lt;br /&gt;
#''asTextCat ''- the category to be used in the .lang file, usually &amp;quot;Ending&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alEndNum ''- Amnesia has 3 different endings and displays a code at the bottom. Determines which code is displayed. 0-2 will display codes, any other integer will not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartDemoEnd();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shows the demo end screen. The background and UI elements are defined in demo.cfg, with the text using the entries in the &amp;quot;Demo&amp;quot; category of the .lang file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AutoSave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an auto save file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CheckPoint(string &amp;amp;in asName, string &amp;amp;in asStartPos, string &amp;amp;in asCallback, string &amp;amp;in asDeathHintCat, string &amp;amp;in asDeathHintEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a checkpoint at which the player will respawn in case he dies. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asName, int alCount)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;Count is 0 on the first checkpoint load!&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the editor&lt;br /&gt;
#''asCallback ''- the function to call when the player dies/respawns&lt;br /&gt;
#''asDeathHintCat ''- the category of the death hint message to be used in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asDeathHintEntry ''- the entry in the .lang file&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeMap(string &amp;amp;in asMapName, string &amp;amp;in asStartPos, string &amp;amp;in asStartSound, string &amp;amp;in asEndSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Loads another map after a 1.5 second fade out.&lt;br /&gt;
&lt;br /&gt;
#''asMapName ''- the file to load&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the next map&lt;br /&gt;
#''asStartSound ''- the sound that is played when the change starts&lt;br /&gt;
#''asEndSound ''- the sound that is played when the new map is loaded&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ClearSavedMaps();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the &amp;quot;history&amp;quot; of the save, useful to do when you know the player will not be able to go back anymore. Makes the next save much smaller in size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateDataCache();&lt;br /&gt;
void DestroyDataCache();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This caches all current textures and models and they are not released until destroy is called. If there is already cached data it is destroyed.&lt;br /&gt;
Create caches to enable faster loading when going back to a map. Destroy the cache if you know the player won't go back to that map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMapDisplayNameEntry(string &amp;amp;in asNameEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the map name shown in save file names. If none is set NULL is assumed.&lt;br /&gt;
&lt;br /&gt;
#''asNameEntry ''- the entry to display, category must be &amp;quot;Levels&amp;quot;!&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the skybox.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxTexture(string &amp;amp;in asTexture);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the texture of the skybox.&lt;br /&gt;
&lt;br /&gt;
#''asTexture''  - The texture file to set. Extension: .dds&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the solid color of the skybox rather than a texture.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the global fog.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the color to use for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogProperties(float afStart, float afEnd, float afFalloffExp, bool abCulling);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the properties for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afStart ''- how many meters from the camera should the fog begin&lt;br /&gt;
#''afEnd ''- how many meters from the camera should the fog reach full thickness&lt;br /&gt;
#''afFalloffExp ''- the amount by which the thinkness increases&lt;br /&gt;
#''abCulling ''- whether occlusion culling is active for the fog; this prevents objects behind the fog from being loaded&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetupLoadScreen(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alRandomNum, string &amp;amp;in asImageFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which loading screen will be shown when changing maps.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category of the loading text in the .lang file to be shown on the loading screen, usually &amp;quot;LoadingText&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alRandomNum ''- if greater 1, then it will randomize between 1 and alRandom for each LoadScreen giving entry the suffix XX (eg 01). If &amp;lt; =1 then no suffix is added&lt;br /&gt;
#''asImageFile ''- the image to be shown (optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void UnlockAchievement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlocks the specified achievement. Only able to be used for the ending achievements.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the achievement. Only the following strings are valid:&lt;br /&gt;
::* Benefactor&lt;br /&gt;
::* Survivor&lt;br /&gt;
::* Sacrifice&lt;br /&gt;
::* Quitter&lt;br /&gt;
::* Egotist&lt;br /&gt;
::* Altruist&lt;br /&gt;
::* Vacillator&lt;br /&gt;
&lt;br /&gt;
===Game Timer===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddTimer(string &amp;amp;in asName, float afTime, string &amp;amp;in asFunction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a timer which calls a function when it expires. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asTimer)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the name of the timer&lt;br /&gt;
#''afTime ''- time in seconds&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveTimer(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a timer, no matter how much time is left.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the timer.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetTimerTimeLeft(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the time left on a timer.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - the internal name of the timer.&lt;br /&gt;
&lt;br /&gt;
===Screen Effects===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeOut(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to black.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen is completly black&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeIn(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen back to normal.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeImageTrailTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies the image trail effect to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeSepiaColorTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the screen go dark red.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0) &lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeRadialBlurTo(float afSize, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies radial blur effects to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afSize ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetRadialBlurStartDist(float afStartDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines at which distance the radial blur effects appear.&lt;br /&gt;
&lt;br /&gt;
#''afStartDist ''- the distance at which the effect starts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectFlash(float afFadeIn, float afWhite, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white.&lt;br /&gt;
&lt;br /&gt;
#''afFadeIn ''- time in seconds until screen is white&lt;br /&gt;
#''afWhite ''- determines to which percentage the screen fades to white (1.0 = completly white)&lt;br /&gt;
#''afFadeOut ''- time in seconds until screen is back to normal again&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectEmotionFlash(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white and shows a text message.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''asSound ''- the sound to play while fading&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetFlashbackIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a flashback is still in effect.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerSpawnPS(string &amp;amp;in asSPSFile);&lt;br /&gt;
void StopPlayerSpawnPS();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Continuously spawn regular particle systems (''.ps'') around the player. Particles created by this script carry over from map to map.&lt;br /&gt;
&lt;br /&gt;
#''asSPSFile''  - the ''.sps''  file to use. Example ''.sps''  files are located in the ''/misc''  folder in the main game directory.&amp;lt;br&amp;gt;Custom ''.sps''  files can be created by hand in a text editor (see existing ones and mimic how those are written). &amp;lt;br /&amp;gt;Since ''StopPlayerSpawnPS()''  doesn't seem to work, to stop an SPS you must create an ''.sps''  file with an empty particle field field and override the old SPS by calling ''StartPlayerSpawnPS''  again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shakes the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity of the shake&lt;br /&gt;
#''afTime ''- duration of the shake&lt;br /&gt;
#''afFadeInTime ''- time in seconds until full intensity is reached&lt;br /&gt;
#''afFadeOutTime ''- time until screen is back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInDarknessEffectsActive(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the sanity drain and night vision effects while in the darkness.&lt;br /&gt;
&lt;br /&gt;
''bool abX''  - Enable/disable effects.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowScreenImage(string &amp;amp;in asImageName, float afX, float afY, float afScale, bool abUseRelativeCoordinates, float afDuration, float afFadeIn, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
Displays an image file directly onto the screen. See [[HPL2/Tutorials/ShowScreenImage()|ShowScreenImage()]] in the tutorials section for more information.&lt;br /&gt;
&lt;br /&gt;
# ''asImageName'' - The image file to render (.jpg, .png, .tga, .dds)&lt;br /&gt;
# ''afX'' - The X position of the image&lt;br /&gt;
# ''afY'' - The Y position of the image&lt;br /&gt;
# ''afScale'' - The size of the image in pixels (not scale), or original image size if negative&lt;br /&gt;
# ''abUseRelativeCoordinates'' - Whether X and Y are relative to the screen resoltion, or pixel co-ordinates if not&lt;br /&gt;
# ''afDuration'' - The duration that the image is displayed for&lt;br /&gt;
# ''afFadeIn'' - The time, in seconds, to fade in the image&lt;br /&gt;
# ''afFadeOut'' - The time, in seconds, to fade out the image&lt;br /&gt;
&lt;br /&gt;
===Insanity===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInsanitySetEnabled(string &amp;amp;in asSet, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which InsanitySets are enabled.&lt;br /&gt;
&lt;br /&gt;
#''asSet ''- the set&lt;br /&gt;
#''abX ''- enabled or not&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartInsanityEvent(string &amp;amp;in asEventName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Starts a specified insanity event.&lt;br /&gt;
&lt;br /&gt;
#''asEventName ''- Insanity event to play.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartRandomInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts a random insanity event from the available sets.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopCurrentInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Stops the currently playing insanity event.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void InsanityEventIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an insanity event is currently in effect.&amp;lt;br&amp;gt;Not useful at all due to having a return type of &amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; when it should be &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Player===&lt;br /&gt;
&lt;br /&gt;
Note that the player's maximum health and sanity is 100.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enabled/Disable player controlled movement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangePlayerStateToNormal();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets the player's state, forcing them to stop interacting with objects. It also clears the inventory item to be used (as if it was double-clicked on in the inventory again) and dismounts the player from ladders.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerCrouching(bool abCrouch);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddPlayerBodyForce(float afX, float afY, float afZ, bool abUseLocalCoords);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pushes the player into a certain direction. Note that you need values above ~2000 to see any effects.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - amount along the X-axis&lt;br /&gt;
#''afY'' - amount along the Y-axis&lt;br /&gt;
#''afZ'' - amount along the Z-axis&lt;br /&gt;
#''abUseLocalCoords'' - If true, axes are based on where the player is facing, not the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowPlayerCrossHairIcons(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the icons when a player has something in focus.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerSanity(float afSanity);&lt;br /&gt;
void AddPlayerSanity(float afSanity);&lt;br /&gt;
float GetPlayerSanity();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerHealth(float afHealth);&lt;br /&gt;
void AddPlayerHealth(float afHealth);&lt;br /&gt;
float GetPlayerHealth();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerLampOil(float afOil);&lt;br /&gt;
void AddPlayerLampOil(float afOil);&lt;br /&gt;
float GetPlayerLampOil();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the lamp oil of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerSpeed();&lt;br /&gt;
float GetPlayerYSpeed();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current speed of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSanityDrainDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables sanity drain from darkness.&lt;br /&gt;
{{bug|Sanity drain is reenabled on loading a save, as the game is unable to load the value properly from the save data.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoost();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a large amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! New Sanity&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || 100&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || 90&lt;br /&gt;
|-&lt;br /&gt;
| 50-74 || 80&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoostSmall();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a small amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! Sanity Bonus&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || +20&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || +15&lt;br /&gt;
|-&lt;br /&gt;
| 50-75 || +10&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityDamage(float afAmount, bool abUseEffect);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount'' - amount of sanity damage done&lt;br /&gt;
#''abUseEffect'' - if a sound is played and screen effects are shown when the sanity damage is dealt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GivePlayerDamage(float afAmount, string &amp;amp;in asType, bool abSpinHead, bool abLethal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the health of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount'' - amount of damage done to health&lt;br /&gt;
#''asType'' - plays a certain effect on the screen when the damage is dealt (BloodSplat, Claws, or Slash) &lt;br /&gt;
#''abSpinHead'' - changes the camera view when damage is dealt&lt;br /&gt;
#''abLethal'' - set to true if player can die from given damage. If ''false'' and the damage would have left the player with less than 10 health, health is set to 10.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerFOVMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the field of view of the player. A shorter FOV will create a zoom effect.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - multiplier of default FOV (1 is default)&lt;br /&gt;
#''afSpeed'' - the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerAspectMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the aspect ratio of the player. Basically stretches or narrows the screen horizontally.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - multiplier of default aspect (default is 1)&lt;br /&gt;
#''afSpeed'' - the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - angle of rotation of head, positive being counter-clockwise&lt;br /&gt;
#''afSpeedMul'' - speed (possibly acceleration) multiplier of the rotation (default 1, which is really slow)&lt;br /&gt;
#''afMaxSpeed'' - maximum speed of rotation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerForward(float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Moves the player forward. It needs to be called in a timer that updates 60 times / second.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- amount along the X-axis&lt;br /&gt;
#''afY ''- amount along the Y-axis&lt;br /&gt;
#''afZ ''- amount along the Z-axis&lt;br /&gt;
#''afSpeed ''- speed at which the change happens&lt;br /&gt;
#''afSlowDownDist ''- distance at which to start slowing down (prevents the head from abruptly stopping)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerLookAt(string &amp;amp;in asEntityName, float afSpeedMul, float afMaxSpeed, string &amp;amp;in asAtTargetCallback);&lt;br /&gt;
void StopPlayerLookAt();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to look at a certain entity until StopPlayerLookAt is used.&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- the entity to look at &lt;br /&gt;
#''afSpeedMul ''- how fast should the player look at the entity&lt;br /&gt;
#''afMaxSpeed ''- maximum speed allowed&lt;br /&gt;
#''asAtTargetCallback ''- function to call when player looks at target&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerMoveSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerRunSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerLookSpeedMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the player's move/run/look speed. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpForceMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the player's jump multiplier. Higher values = higher jumps. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpDisabled(bool abX);&lt;br /&gt;
void SetPlayerCrouchDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to jump/crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportPlayer(string &amp;amp;in asStartPosName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly teleports the player to the target StartPos.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternActive(bool abX, bool abUseEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the player use his lantern.&lt;br /&gt;
&lt;br /&gt;
# ''abX'' - Set lantern to be active (true) or inactive (false)&lt;br /&gt;
# ''abUseEffects'' - Play on/off sounds&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetLanternActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player is currently using the lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to use the lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternLitCallback(string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to call when the player uses the lantern. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;MyFunc(bool abLit)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message on the screen.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory'' - the category in the .lang file&lt;br /&gt;
#''asTextEntry'' - the entry in the .lang file&lt;br /&gt;
#''afTime'' - determines how long the message is displayed. If time is &amp;lt; =0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetDeathHint(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the message that appears when the player dies.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory'' - the category in the .lang file&lt;br /&gt;
#''asTextEntry'' - the entry in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DisableDeathStartSound();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the death sound when the player dies. This must be called directly before player is killed! The variable as soon as player dies too.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPermaDeathSound(string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Sets the sound played after the player dies when permadeath is active. Permadeath is only active when the game is launched with the &amp;lt;code&amp;gt;ptest&amp;lt;/code&amp;gt; command line parameter. Only used for the post-death Suitor lines in ''Justine''.&lt;br /&gt;
&lt;br /&gt;
#''asSound'' - The sound to be played after death. Expects a voice-type sound.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerFallDamageDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the player's ability to take fall damage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPos(float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the player's position within the level.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - X co-ordinate position.&lt;br /&gt;
#''afY'' - Y co-ordinate position.&lt;br /&gt;
#''afZ'' - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerPosX();&lt;br /&gt;
float GetPlayerPosY();&lt;br /&gt;
float GetPlayerPosZ();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the player's position within the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
===Journal===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddNote(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a note to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _Name and _Text and be in category &amp;quot;Journal&amp;quot;!&lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDiary(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a diary to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _NameX and _TextY whereas X and Y are numbers of the parts (_Name1: first diary, _Text1: first page) and be in category &amp;quot;Journal&amp;quot;! &lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ReturnOpenJournal(bool abOpenJournal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Only called in the pickup diary callback! If true the journal displays the entry else not.&lt;br /&gt;
&lt;br /&gt;
===Quests===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a quest to the player's journal under mementos. Completed quests cannot be readded.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name to be used&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot;Quest_&amp;lt;texthere&amp;gt;_Text”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CompleteQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Completes a quest. If the quest has not been added, it's marked as complete anyway, preventing it from being added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot; Quest_&amp;lt;texthere&amp;gt;_Text ”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool QuestIsCompleted(string &amp;amp;in asName);&lt;br /&gt;
bool QuestIsAdded(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a quest is completed/added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetNumberOfQuestsInMap(int alNumberOfQuests);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the number of quests in the map. Obsolete; formerly used to calculate a completion percentage when looking at a level door.&lt;br /&gt;
&lt;br /&gt;
#''alNumberOfQuests ''- Amount of quests&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveHint(string &amp;amp;in asName, string &amp;amp;in asMessageCat, string &amp;amp;in asMessageEntry, float afTimeShown);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a hint on the player's screen.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asMessageCat ''- the category in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asMessageEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTimeShown ''- time in seconds until the message disappears. If time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void BlockHint(string &amp;amp;in asName);&lt;br /&gt;
void UnBlockHint(string &amp;amp;in asName);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Blocking a hint prevents it from being shown. Blocked hints are included in savefiles, so they should persist between levels. Unblocking a hint allows it to be shown.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; blocks the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveHint(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes the hint from the list of already shown hints, allowing it to appear again.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; reenables the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
===Inventory===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ExitInventory();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Exits the inventory by force.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the player's ability to open his inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a message on the inventory screen. Used for feedback messages when failing to combine items.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory ''- the category in the .lang file, usually &amp;quot;Inventory&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTime ''- time in seconds until the message disappears. If life time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItem(string &amp;amp;in asName, string &amp;amp;in asType, string &amp;amp;in asSubTypeName, string &amp;amp;in asImageName, float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds an item to the inventory of the player. Note that the item does not have to exist as entity in the world to be able to do this.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asType ''- item type to give, Available types are:&lt;br /&gt;
::*Puzzle&lt;br /&gt;
::*Lantern&lt;br /&gt;
::*Health&lt;br /&gt;
::*Sanity&lt;br /&gt;
::*LampOil&lt;br /&gt;
::*Tinderbox&lt;br /&gt;
#''asSubTypeName ''- item name for .lang file&lt;br /&gt;
#''asImageName ''- the image which will appear in inventory. For example: &amp;lt;code&amp;gt;void GiveItem(&amp;quot;chemical_container_full_1&amp;quot;, &amp;quot;Puzzle&amp;quot;, &amp;quot;chemical_container_full&amp;quot;, &amp;quot;chemical_container_full.tga&amp;quot;, 1);&amp;lt;/code&amp;gt; will use the image from &amp;lt;code&amp;gt;graphics/item/chemical_container_full.tga&amp;lt;/code&amp;gt; &lt;br /&gt;
#''afAmount ''- amount the item gives, - For example: Oil potions will fill the oil meter by this amount, Health potions will heal by this amount, etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item from the player's inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool HasItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player has an item in his inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItemFromFile(string &amp;amp;in asName, string &amp;amp;in asFileName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a single item to the player's inventory. This is meant to be used for debug mostly as it creates the actual item and then destroys it.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asFileName ''- item to give + extension (.ent)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddCombineCallback(string &amp;amp;in asName, string &amp;amp;in asItemA, string &amp;amp;in asItemB, string &amp;amp;in asFunction, bool abAutoRemove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to combine items in his inventory. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItemA, string &amp;amp;in asItemB)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name for the callback&lt;br /&gt;
#''asItemA ''- internal name of first item&lt;br /&gt;
#''asItemB ''- internal name of second item&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
#''abAutoRemove ''- determines whether the callback should be removed when the items are combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveCombineCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a combine callback.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the callback to be removed (as specified in AddCombineCallback)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddUseItemCallback(string &amp;amp;in asName, string &amp;amp;in asItem, string &amp;amp;in asEntity, string &amp;amp;in asFunction, bool abAutoDestroy);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to use items on the world. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItem, string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
#''asItem ''- internal name of the item&lt;br /&gt;
#''asEntity ''- entity to be able to use the item on&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abAutoDestroy ''- determines whether the callback should be removed when the item is used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveUseItemCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item callback.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
&lt;br /&gt;
===Entities===&lt;br /&gt;
&lt;br /&gt;
====General====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityActive(string &amp;amp;in asName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityVisible(string &amp;amp;in asName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity's visual mesh. The collision body remains.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the entity.&lt;br /&gt;
#''abActive''  - Activate/deactivate mesh.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntityExists(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an entity exists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCustomFocusCrossHair(string &amp;amp;in asName, string&amp;amp; asCrossHair);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the crosshair that is used when focusing an entity.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCrossHair ''- desired crosshair, can be: &lt;br /&gt;
::*Default (no crosshair)&lt;br /&gt;
::*Grab&lt;br /&gt;
::*Push&lt;br /&gt;
::*Ignite&lt;br /&gt;
::*Pick&lt;br /&gt;
::*LevelDoor&lt;br /&gt;
::*Ladder&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void CreateEntityAtArea(string &amp;amp;in asEntityName, string &amp;amp;in asEntityFile, string &amp;amp;in asAreaName, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an entity at an area. When creating an enemy though, it cannot chase properly along PathNodes (using for example &amp;lt;code&amp;gt;ShowEnemyPlayerPosition&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- internal name&lt;br /&gt;
#''asEntityFile ''- entity to be used extension .ent&lt;br /&gt;
#''asAreaName ''- the area to create the entity at&lt;br /&gt;
#''abFullGameSave ''- determines whether an entity &amp;quot;remembers&amp;quot; its state&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ReplaceEntity(string &amp;amp;in asName, string &amp;amp;in asBodyName, string &amp;amp;in asNewEntityName, string &amp;amp;in asNewEntityFile, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Removes an entity and places a new one in its place.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to replace.&lt;br /&gt;
#''asBodyName'' - Name of the body of the entity to place the new entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''asNewEntityName'' - Name of the new entity.&lt;br /&gt;
#''asNewEntityFile'' - Name of the new entity file. Extension .ent. &lt;br /&gt;
#''abFullGameSave'' - Whether ALL properties of this entity should be saved throughout levels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaceEntityAtEntity(string &amp;amp;in asName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBodyName, bool abUseRotation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Places an entity at the position of another entity. Does not work for enemies, use TeleportEnemyToEntity instead.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to place.&lt;br /&gt;
#''asTargetEntity'' - Name of the other entity to place the first entity at.&lt;br /&gt;
#''asTargetBodyName'' - Name of the body of the entity to place the first entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''abUseRotation'' - Whether the entity should be rotated like the target entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPos(string &amp;amp;in asName, float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Moves an entity to a position in the level.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to move.&lt;br /&gt;
#''afX'' - X co-ordinate position.&lt;br /&gt;
#''afY'' - Y co-ordinate position.&lt;br /&gt;
#''afZ'' - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetEntityPosX(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosY(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosZ(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns an entity's position in the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerLookAtCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveWhenLookedAt);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player looks at a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = looking, -1 = not looking&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveWhenLookedAt ''- determines whether the callback should be removed when the player looked at the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerInteractCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveOnInteraction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player interacts with a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveOnInteraction ''- determines whether the callback should be removed when the player interacts with the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCallbackFunc(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when certain events occur with an entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, string &amp;amp;in asType)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;asType&amp;lt;/code&amp;gt; values depend on entity type:&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! asType Value&lt;br /&gt;
|-&lt;br /&gt;
| Object || Break&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || OnIgnite&lt;br /&gt;
|-&lt;br /&gt;
| Item || OnPickup&lt;br /&gt;
|-&lt;br /&gt;
| Enemy || OnDeath&lt;br /&gt;
|-&lt;br /&gt;
| Enemy_Grunt&amp;lt;br&amp;gt;Enemy_Manpig || OnAutoDisabled&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityConnectionStateChangeCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A callback called when ever the connection state changes (button being switched on, lever switched, etc). &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void Func(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: -1 = off, 0 = between, 1 = on&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityInteractionDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disallows interaction with an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void BreakJoint (string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Breaks a joint. Do not use this on joints in SwingDoors, Levers, Wheels, etc. where the joint is part of an interaction. That will make the game crash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void AddEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName, string &amp;amp;in asFunction, bool abDeleteOnCollide, int alStates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when two entities collide. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asParent, string &amp;amp;in asChild, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = enter, -1 = leave&lt;br /&gt;
&lt;br /&gt;
#''asParentName ''- internal name of main object&lt;br /&gt;
#''asChildName ''- internal name of object that collides with main object (asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) NOT supported!)&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abDeleteOnCollide ''- determines whether the callback after it was called&lt;br /&gt;
#''alStates ''- 1 = only enter, -1 = only leave, 0 = both&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an EntityCollideCallback. Asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) not supported in ''asChildName''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntitiesCollide(string &amp;amp;in asEntityA, string &amp;amp;in asEntityB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether two entities collide. This function does NOT support asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) or &amp;quot;Player&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetBodyMass(string &amp;amp;in asName, float afMass);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName.&lt;br /&gt;
#''afMass''  - The mass to set.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetBodyMass(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName. &lt;br /&gt;
#''afMass''  - The mass to get.&lt;br /&gt;
&lt;br /&gt;
====Props====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropEffectActive(string &amp;amp;in asName, bool abActive, bool abFadeAndPlaySounds);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Turns the texture illumination, billboards, particles, light flicker, and sounds of a prop on or off.&lt;br /&gt;
&lt;br /&gt;
Can be used on coal to give it the black color it should have.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name &lt;br /&gt;
#''abActive'' - active state&lt;br /&gt;
#''abFadeAndPlaySounds'' - if all effects should fade in/out or not&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropActiveAndFade(string &amp;amp;in asName, bool abActive, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates a prop.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''abActive ''- nothing to add&lt;br /&gt;
#''afFadeTime ''- time in seconds until prop fully fades&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropStaticPhysics(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates the physics of a prop, setting the mass to 0. Setting as true will make entities static in midair.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetPropIsInteractedWith(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a prop is interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RotatePropToSpeed(string &amp;amp;in asName, float afAcc, float afGoalSpeed, float afAxisX, float afAxisY, float afAxisZ, bool abResetSpeed, string &amp;amp;in asOffsetArea);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the prop up to a set speed.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afGoalSpeed ''- desired speed &lt;br /&gt;
#''afAxisX ''- rotation around X axis&lt;br /&gt;
#''afAxisY ''- rotation around Y axis&lt;br /&gt;
#''afAxisZ ''- rotation around Z axis&lt;br /&gt;
#''abResetSpeed ''- determines whether the speed is resetted after goal speed is reached&lt;br /&gt;
#''asOffsetArea ''- the area to rotate around, if empty, then the center of the body is used Note: The entity you want to rotate MUST be a &amp;quot;StaticObject&amp;quot; entity!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void StopPropMovement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all movement of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddAttachedPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop.&lt;br /&gt;
&lt;br /&gt;
#''asPropName''- the prop to attach another prop at &lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop&lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
{{bug|''afRotZ '' is used for both the ZX rotation and the Z position of the attached prop. Unwanted rotation can be avoided by using: &amp;lt;br /&amp;gt;''AddAttachedPropToProp(asPropName, asAttachName, asAttachFile, afPosX, afPosY, '''0''', afPosZ, '''90.0f''', afPosZ)''}}&lt;br /&gt;
&lt;br /&gt;
{{bug|Attaching a breakable prop to a physically active prop, and then breaking the attached prop, will cause the game to crash, should the parent object be moved or reset.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop. Fixed version of &amp;lt;code&amp;gt;AddAttachedPropToProp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
#''asPropName ''- the prop to attach another prop at&lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop &lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveAttachedPropFromProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches a prop from a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
void AddPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
float GetPropHealth(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ResetProp(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets a prop's state to the original one when the map was loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void PlayPropAnimation(string &amp;amp;in asProp, string &amp;amp;in asAnimation, float afFadeTime, bool abLoop, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the prop play an animation and calls a function. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asProp)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asProp ''- internal name of the prop&lt;br /&gt;
#''asAnimation ''- animation to play&lt;br /&gt;
#''afFadeTime ''- Fade time between current and new animations&lt;br /&gt;
#''abLoop ''- determines whether the animation loops &lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddPropForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddPropImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These functions push objects. Note that rather high values are needed when applying ''forces''  (on the order of ~100 (weak) to ~10000 (strong)), but not impulses (values less than 10 can be appropriate). Forces are external influences, and will have different effect depending on the mass of the object they are being applied to; impulses disregard mass, and can cause objects to break, as if hit. A &amp;quot;Body&amp;quot; is a physics-related helper object, to which a force or an impulse can be applied. Entities can consist of several bodies, interconnected in various ways (you can create/examine bodies in the model editor).&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the object to push; for bodies, use this format: &amp;quot;''entityName''_''bodyName''&amp;quot;&lt;br /&gt;
#''afX ''- magnitude along the X-axis&lt;br /&gt;
#''afY ''- magnitude along the Y-axis&lt;br /&gt;
#''afZ ''- magnitude along the Z-axis&lt;br /&gt;
#''asCoordSystem ''- determines which coordinate system is used, &amp;quot;local&amp;quot; or &amp;quot;world&amp;quot;&lt;br /&gt;
&lt;br /&gt;
All of these functions are ''additive''  - when called consecutively, for each call, the vectors defined by (afX, afY, afZ) will be added together, and a resultant force/impulse will be calculated ''before''  any physics simulation is applied to the target object.&lt;br /&gt;
&lt;br /&gt;
====Connections====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithRope(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asRopeName, bool abInteractOnly, float afSpeedMul, float afToMinSpeed, float afToMaxSpeed, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects a prop with the movement of a rope (i.e. turn a wheel to move a rope). For Levers, the rope only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName''- The name of the connection&lt;br /&gt;
#''asPropName'' - The name of the prop; can be a Lever or Wheel&lt;br /&gt;
#''asRopeName'' - The name of the rope&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''afSpeedMul'' - Speed multiplier of how quickly the rope moves&lt;br /&gt;
#''afToMinSpeed'' - The slowest the rope can move&lt;br /&gt;
#''afToMaxSpeed'' - The fastest the rope can move&lt;br /&gt;
#''abInvert'' - Whether to invert the direction the rope moves&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithMoveObject(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asMoveObjectName, bool abInteractOnly, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This one should only be used if there must be an exact correspondence to prop &amp;quot;amount&amp;quot; and the MoveObject open amount. It is best used for Wheel-door connections, where the MoveObject moves continuously along with the Wheel. For Levers, the MoveObject only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asPropName'' - The entity that controls the movement; can be a Lever or Wheel&lt;br /&gt;
#''asMoveObject'' - The MoveObject to move&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''abInvert'' - If the state is inverted, making the MoveObject move in the opposite direction&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ConnectEntities(string &amp;amp;in asName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, bool abInvertStateSent, int alStatesUsed, string &amp;amp;in asCallbackFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects two entities together so that changing the state of the main entity changes the state of the connected entity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! Max State (1) !! Min State (-1)&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || Lit || Unlit&lt;br /&gt;
|-&lt;br /&gt;
| MoveObject || Open || Close&lt;br /&gt;
|-&lt;br /&gt;
| SwingDoor&lt;br /&gt;
|rowspan=2| Locked&lt;br /&gt;
|rowspan=2| Unlocked&lt;br /&gt;
|-&lt;br /&gt;
| Chest&lt;br /&gt;
|-&lt;br /&gt;
| Button || Switched on || Switched off&lt;br /&gt;
|-&lt;br /&gt;
| Lever&lt;br /&gt;
|rowspan=2| Unstuck&lt;br /&gt;
|rowspan=2| Stuck (at min)&lt;br /&gt;
|-&lt;br /&gt;
| Wheel&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asMainEntity'' - The entity that causes the change; can be a Lever, Wheel, Button, or Photocell&lt;br /&gt;
#''asConnectEntity'' - The entity that is affected by the change&lt;br /&gt;
#''abInvertStateSent'' - If the state is inverted, making the connected entity change to the opposite state&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
#''asCallbackFunc'' - The name of the connection callback&lt;br /&gt;
&lt;br /&gt;
Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asConnectionName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, int alState)&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;alState is what is sent to connection entity and will be inverted if abInvertStateSent = true!&lt;br /&gt;
&lt;br /&gt;
====Lamps====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLampLit(string &amp;amp;in asName, bool abLit, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Turns a lamp on or off.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the lamp&lt;br /&gt;
#''abLit ''- Set true if you want the lamp to be lit, set to false if you want the lamp to be unlit&lt;br /&gt;
#''abEffects ''- If you want to have the lamp fade in/out when it gets lit/unlit&lt;br /&gt;
&lt;br /&gt;
====Doors====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorLocked(string &amp;amp;in asName, bool abLocked, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abLocked'' - Locked/unlocked&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is locked/unlocked&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorClosed(string &amp;amp;in asName, bool abClosed, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abClosed'' - Closed/open&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is closed/opened&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
bool GetSwingDoorLocked(string &amp;amp;in asName);&lt;br /&gt;
bool GetSwingDoorClosed(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a swing door is locked/closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorDisableAutoClose(string &amp;amp;in asName, bool abDisableAutoClose);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deactivates the &amp;quot;auto-close&amp;quot; when a door is nearly closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetSwingDoorState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns an integer depending on how far the door is opened. &amp;lt;br /&amp;gt;-1 = angle is close to 0°, 1 = angle is 70% or higher of max, 0 = inbetween -1 and 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLocked(string &amp;amp;in asName, bool abLocked);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a level door. Note that level doors are NOT swing doors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedSound(string &amp;amp;in asName, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which sound is played when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedText(string &amp;amp;in asName, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectState(string &amp;amp;in asName, float afState);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween (and above, for example, the bridge_metal_vert) are valid too!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectStateExt(string &amp;amp;in asName, float afState, float afAcc, float afMaxSpeed, float afSlowdownDist, bool abResetSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state, extended method.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween are valid too!&lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afMaxSpeed ''- maximum speed&lt;br /&gt;
#''afSlowdownDist ''- Distance to the target state before deceleration occurs.&lt;br /&gt;
#''abResetSpeed ''- Set to ''true'' if the prop's speed should be reset before performing the movement, else the prop will accelerate from its current speed to afMaxSpeed.&lt;br /&gt;
&lt;br /&gt;
====Levers, wheels and buttons====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropObjectStuckState(string &amp;amp;in asName, int alState);&lt;br /&gt;
void SetWheelStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
void SetLeverStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes an object/wheel/lever stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name&lt;br /&gt;
#''alState'' - 0 = not stuck, 1 = at max, -1 = at min &lt;br /&gt;
#''abEffects'' - play sound effects&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelAngle(string &amp;amp;in asName, float afAngle, bool abAutoMove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves a wheel to a certain angle.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name&lt;br /&gt;
#''afAngle'' - angle&lt;br /&gt;
#''abAutoMove'' - determines whether the wheel should move on its own&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
void SetLeverInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to make a wheel/lever unstuck when interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetLeverState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the state of the lever. &amp;lt;br /&amp;gt;0 = not stuck, 1 = at max, -1 = at min&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderStuckState(string &amp;amp;in asName, int alStuckState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes a MultiSlider stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when state changes. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetButtonSwitchedOn(string &amp;amp;in asName, bool abSwitchedOn, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Sticky areas====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetAllowStickyAreaAttachment(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows entities to stick to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asProp);&lt;br /&gt;
void AttachBodyToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asBody);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop/body to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void DetachFromStickyArea(string &amp;amp;in asAreaName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches everything from a StickyArea.&lt;br /&gt;
&lt;br /&gt;
====NPCs====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCAwake(string &amp;amp;in asName, bool abAwake, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wakes/sleeps a NPC.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the NPC&lt;br /&gt;
#''abAwake'' - ''true'' to awaken, ''false'' to sleep&lt;br /&gt;
#''abEffects'' - Play the &amp;quot;Awake&amp;quot; or &amp;quot;Sleep&amp;quot; animations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCFollowPlayer(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a NPC's head to follow the player's movements.&lt;br /&gt;
&lt;br /&gt;
====Enemies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables an enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyIsHallucination(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes an enemy a hallucination. Hallucinations fade to smoke when they get near the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void FadeEnemyToSmoke(string &amp;amp;in asName, bool abPlaySound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly fades an enemy to smoke.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ShowEnemyPlayerPosition(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the enemy run to the player, no matter where he is.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AlertEnemyOfPlayerPresence(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gives the specified enemy the player's current position and makes it search the area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisableTriggers(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables or disables enemy triggers. If disabled, enemy will not react to player or attack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddEnemyPatrolNode(string &amp;amp;in asName, string &amp;amp;in asNodeName, float afWaitTime, string &amp;amp;in asAnimation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a patrol node to the enemy's path.&lt;br /&gt;
&lt;br /&gt;
#''asName''- Internal name of the enemy &lt;br /&gt;
#''asNodeName'' - Path node &lt;br /&gt;
#''afWaitTime'' - Time in seconds that the enemy waits at the path node before continuing. If 0, randomized between 1-3.&lt;br /&gt;
#''asAnimation'' - The animation the enemy uses when reaching the path node&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ClearEnemyPatrolNodes(string &amp;amp;in asEnemyName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the current path of patrol nodes of the enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemySanityDecreaseActive(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether an enemy activates the player's sanity drain when stared at.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy &lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToNode(string &amp;amp;in asEnemyName, string &amp;amp;in asNodeName, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific PathNode.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asNodeName'' - Internal name of the node to teleport to &lt;br /&gt;
#''abChangeY'' - Whether the Y position of the node will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToEntity(string &amp;amp;in asEnemyName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBody, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific entity.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asTargetEntity'' - Internal name of the entity to teleport to&lt;br /&gt;
#''asTargetBody'' - Internal name of the entity's body name to teleport to. If empty, the first body will be used (might be unstable, recommended to input a body anyway)&lt;br /&gt;
#''abChangeY'' - Whether the Y position of the entity will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeManPigPose(string &amp;amp;in asName, string &amp;amp;in asPoseType);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the pose a specified ManPig.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''asPoseType'' - Name of the ManPig pose to use. Can be &amp;quot;Biped&amp;quot; or &amp;quot;Quadruped&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigFadeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should fade the player's view in and out.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigSoundDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should play the proximity sounds.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigEasyEscapeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should be easier to escape from when hunted. If not disabled, easy escape is activated if the player is more than 12.35 meters away, the enemy can't see the player, and the player has less than 75 health. When this occurs, the enemy is forced to stop hunting and wait for half a second.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ForceTeslaPigSighting(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Forces a Tesla ManPig to be visible for a short time.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; GetEnemyStateName(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the name of the state a specified enemy is current in.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
Possible states for all enemies:&lt;br /&gt;
*Idle&lt;br /&gt;
*Wait&lt;br /&gt;
*Patrol&lt;br /&gt;
*Investigate&lt;br /&gt;
*Alert&lt;br /&gt;
*Search&lt;br /&gt;
*Hurt&lt;br /&gt;
*Hunt&lt;br /&gt;
*HuntPause&lt;br /&gt;
*HuntWander&lt;br /&gt;
*AttackMeleeShort&lt;br /&gt;
*AttackMeleeLong&lt;br /&gt;
*BreakDoor&lt;br /&gt;
*Dead&lt;br /&gt;
&lt;br /&gt;
Waterlurker-only states:&lt;br /&gt;
*GoHome&lt;br /&gt;
*Eat&lt;br /&gt;
&lt;br /&gt;
ManPig-only states: &lt;br /&gt;
*Flee&lt;br /&gt;
*Stalk&lt;br /&gt;
*Track&lt;br /&gt;
&lt;br /&gt;
Unused states:&lt;br /&gt;
*AttackRange&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=7019</id>
		<title>HPL2/Engine Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=7019"/>
		<updated>2025-09-25T02:34:45Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Props */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TocRight}}&lt;br /&gt;
&lt;br /&gt;
This page documents all scripts available in Amnesia: The Dark Descent.&lt;br /&gt;
&lt;br /&gt;
{{note|'''Note''': Some of the functions require the Amnesia 1.3 or 1.5 update. Steam and other online store copies should be automatically updated. Other copies can get 1.3 [http://www.frictionalgames.com/forum/thread-24334.html here].}}&lt;br /&gt;
&lt;br /&gt;
== Directives ==&lt;br /&gt;
&lt;br /&gt;
First off, &amp;lt;code&amp;gt;#include &amp;quot;file.hps&amp;quot;&amp;lt;/code&amp;gt; can be used to programmatically merge together multiple separate files to make organizing scripts easier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
==Engine scripts==&lt;br /&gt;
===Main===&lt;br /&gt;
&lt;br /&gt;
The following functions are the main hps functions that the HPL2 engine looks to run on certain events - similar to the C++ int main() function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void OnStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the map is loaded for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnEnter();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs whenever the player enters a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnLeave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the player leaves a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnGameStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is found in the global.hps file and the inventory.hps file, and is run when the game is first started by the player (ie via &amp;quot;Start New Game&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnUpdate(float afStep);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
This function is executed for every game update or &amp;quot;tick&amp;quot;. Can be used for rapid-firing updates instead of looping timers. Keep in mind that this can affect game performance if not used with care.&lt;br /&gt;
&lt;br /&gt;
#''afStep''- Time elapsed in seconds since the last frame. Multiply speeds, distances etc. by this argument to avoid framerate dependence issues (for example: if you move something in this function with constant speed, it will move faster on computers which run the game with high FPS and slower on computers with low FPS).&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float RandFloat(float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random float.&lt;br /&gt;
&lt;br /&gt;
#''afMin ''- minimum value&lt;br /&gt;
#''afMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int RandInt(int alMin, int alMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random int. Note: the maximum value is ''inclusive''  - the RandInt() function may return this value.&lt;br /&gt;
&lt;br /&gt;
#''alMin ''- minimum value&lt;br /&gt;
#''alMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringContains(string &amp;amp;in asString, string &amp;amp;in asSubString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a string contains the specified string. &amp;lt;br /&amp;gt;Example: searching for &amp;quot;hello&amp;quot; in &amp;quot;hello world&amp;quot; would return '''true'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to check&lt;br /&gt;
#''asSubString ''- the string to search for&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; StringSub(string &amp;amp;in asString, int alStart, int alCount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the substring in a string. &amp;lt;br /&amp;gt;Example: in the string &amp;quot;frictional games rocks&amp;quot;, using 4 as ''alStart''  and 6 as ''alCount''  would return '''&amp;quot;tional&amp;quot;'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string&lt;br /&gt;
#''alStart ''- starting character of the string, with 0 being the first character&lt;br /&gt;
#''alCount ''- amount of characters&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int StringToInt(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns an integer converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float StringToFloat(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a float converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringToBool(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a boolean converted from a string, else returns false.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&lt;br /&gt;
===Mathematical Operations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathCos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathTan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAsin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAcos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan2(float afX, float afY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Calculates and returns the arc tangent of the specified values.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - First value to operate.&lt;br /&gt;
#''afY''  - Second value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSqrt(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the square root of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathPow(float afBase, float afExp);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the value of afBase raised to the power of afExp.&lt;br /&gt;
&lt;br /&gt;
#''afBase''  - The base value.&lt;br /&gt;
#''afExp''  - Value to calculate the base with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMin(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the lowest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMax(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the highest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathClamp(float afX, float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns afX clamped between afMin and afMax. If afX &amp;lt; afMin, returns afMin, and if afX &amp;gt; afMax, returns afMax.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - The value to clamp.&lt;br /&gt;
#''afMin''  - The minimum value to clamp afX with.&lt;br /&gt;
#''afMax''  - The maximum value to clamp afX with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAbs(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the absolute value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&lt;br /&gt;
===Debugging===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void Print(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a string to the log file (''hpl.log'').&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDebugMessage(string &amp;amp;in asString, bool abCheckForDuplicates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a line of text to the debug console at the bottom left of the screen. Debug mode must be enabled for the console messages to be visible.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to print&lt;br /&gt;
#''abCheckForDuplicates ''- if true, the string won't be printed more than once on screen until it disappears&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ProgLog(string &amp;amp;in asLevel, string &amp;amp;in asMessage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints an entry to the ProgLog (progression log). &amp;lt;br /&amp;gt;ProgLog is a file created in Documents/Amnesia/main (or an FC folder if one is being used). It logs certain events, such us opening the menu or picking up the lantern, as well as the player's state (Health, Sanity, Oil, Tinderboxes, Coins), for the purpose of documenting a tester's playstyle. &amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt;This function allows to log custom messages.The messages in the ProgLog file are sorted by time elapsed since a map was loaded.&lt;br /&gt;
&lt;br /&gt;
ProgLog has to be enabled for a player profile in ''user_settings.cfg''  before it starts working.&lt;br /&gt;
&lt;br /&gt;
#''asLevel ''- can be &amp;quot;Low&amp;quot;, &amp;quot;Medium&amp;quot; or &amp;quot;High&amp;quot;. It's a tag which appears in each log entry, for event prioritising.&lt;br /&gt;
#''asMessage ''- The custom message to be printed to the log.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool ScriptDebugOn();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the debug mode is enabled. &amp;lt;br /&amp;gt;See [[HPL2/Development_Environment|&amp;quot;Setting up Development Environment&amp;quot;]] to setup debug mode on your own computer.&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
{{warning|Regular variables (int, float, etc.) are '''not''' saved by the game. Using them in important parts of yor script will break it upon loading a game save. In HPL, those variables should only be used for disposable counters, like spawning objects in a &amp;quot;for&amp;quot; loop. For variables which need to be saved, use the wrappers as described below.}}&lt;br /&gt;
&lt;br /&gt;
====Local====&lt;br /&gt;
&lt;br /&gt;
Local variables can be used throughout the same script file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetLocalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetLocalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddLocalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetLocalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Global====&lt;br /&gt;
&lt;br /&gt;
Global variables can be used throughout several maps and can be accessed by several script files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetGlobalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetGlobalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddGlobalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetGlobalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Particle Systems===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadParticleSystem(string &amp;amp;in asPSFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asPSFile''  - The particle system file to load. Extension: .ps&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntity(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntityExt(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS,&lt;br /&gt;
float afR, float afG, float afB, float afA, bool abFadeAtDistance, float afFadeMinEnd, float afFadeMinStart,&lt;br /&gt;
float afFadeMaxStart, float afFadeMaxEnd);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity, extended method with more options.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''abFadeAtDistance ''- determines whether a particle system fades from a certain distance on&lt;br /&gt;
#''afFadeMinEnd ''- minimum distance at which the particle system stops fading&lt;br /&gt;
#''afFadeMinStart ''- minimum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxStart ''- maximum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxEnd ''- maximum distance at which the particle system stops fading&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DestroyParticleSystem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Destroys a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - The internal name of the particle system&lt;br /&gt;
&lt;br /&gt;
===Sounds &amp;amp; Music===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadSound(string &amp;amp;in asSoundFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile''  - The sound file to load (extension .snt optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayGuiSound(string &amp;amp;in asSoundFile, float afVolume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays a sound, not using 3D.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile ''- the sound to play (extension .snt/.ogg optional)&lt;br /&gt;
#''afVolume ''- the volume of the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaySoundAtEntity(string &amp;amp;in asSoundName, string &amp;amp;in asSoundFile, string &amp;amp;in asEntity, float afFadeTime, bool abSaveSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a sound at an entity.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''asSoundFile ''- the sound to use (extension .snt optional)&lt;br /&gt;
#''asEntity ''- the entity to create the sound at. Using &amp;quot;Player&amp;quot; is effectively the same as &amp;lt;code&amp;gt;PlayGuiSound&amp;lt;/code&amp;gt;, yet this function allows a looping sound to be saved&lt;br /&gt;
#''afFadeTime ''- time in seconds the sound needs to fade. Avoids enemies hearing the sound if afFadeTime is at least 0.1f&lt;br /&gt;
#''abSaveSound ''- if ''true'', a looping sound will &amp;quot;remember&amp;quot; its playback state (currently playing/stopped), and that state will be restored the next time the level is entered. If ''true'', the sound is never attached to the entity! Note that saving should only be used on ''looping sounds''!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeInSound(string &amp;amp;in asSoundName, float afFadeTime, bool abPlayStart);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades in a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds&lt;br /&gt;
#''abPlayStart ''- Play the sound defined in the &amp;lt;code&amp;gt;&amp;lt;Start&amp;gt;&amp;lt;/code&amp;gt; section of the .snt before playing the main sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopSound(string &amp;amp;in asSoundName, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades out a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds, use 0 to immediately stop the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayMusic(string &amp;amp;in asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays music.&lt;br /&gt;
&lt;br /&gt;
#''asMusicFile ''- the music file to play (extension .ogg optional)&lt;br /&gt;
#''abLoop ''- determines whether a music track should loop&lt;br /&gt;
#''afVolume ''- volume of the music&lt;br /&gt;
#''afFadeTime ''- time in seconds until music reaches full volume&lt;br /&gt;
#''alPrio ''- priority of the music. Note that only the music with the highest priority can be heard! 0 - lowest, 1 - higher, etc.&lt;br /&gt;
#''abResume''  - if ''true'', playback will be continued from where the track stopped after the call to &amp;lt;code&amp;gt;StopMusic()&amp;lt;/code&amp;gt;. If ''false'', the track will be restarted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopMusic(float afFadeTime, int alPrio);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops music.&lt;br /&gt;
&lt;br /&gt;
#''afFadeTime ''- time in seconds until music stops&lt;br /&gt;
#''alPrio ''- the priority of the music that should stop&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice(string &amp;amp;in asVoiceFile, string &amp;amp;in asEffectFile, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry,&lt;br /&gt;
bool abUsePosition, string &amp;amp;in asPosEntity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This adds a voice and an additional sound effect to be played. It is okay to call this many times in order to play many voices in a row. The EffectVoiceOverCallback is not called until ALL voices have finished.&lt;br /&gt;
&lt;br /&gt;
#''asVoiceFile ''- the voice to play&lt;br /&gt;
#''asEffectFile ''- the sound effect to play&lt;br /&gt;
#''asTextCat ''- the category in the .lang file, usually &amp;quot;Voice&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''abUsePosition ''- plays using 3D from the entity, or without 3D&lt;br /&gt;
#''asPosEntity ''- the entity at which the voice and sound are played from&lt;br /&gt;
#''afMinDistance ''- minimum distance the voice and sound are heard&lt;br /&gt;
#''afMaxDistance ''- maximum distance the voice and sound are heard&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopAllEffectVoices(float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all voices and calls the EffectVoiceOverCallback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEffectVoiceActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether EffectVoices are still active.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetEffectVoiceOverCallback(string &amp;amp;in asFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to be called when the EffectVoices are finished. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundVolume(float afDestVolume, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound volume, that means everything you can hear '''from the world'''. This does not affect music of GUI sounds.&lt;br /&gt;
&lt;br /&gt;
#''afDestVolume ''- desired volume&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired volume&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundSpeed(float afDestSpeed, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound speed.&lt;br /&gt;
&lt;br /&gt;
#''afDestSpeed ''- desired speed&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired speed&lt;br /&gt;
&lt;br /&gt;
===Lights===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightVisible(string &amp;amp;in asLightName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables lights.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''abVisible ''- determines the state of the light&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeLightTo(string &amp;amp;in asLightName, float afR, float afG, float afB, float afA, float afRadius, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the properties of a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''afRadius ''- radius of the light. -1 means keeping the radius&lt;br /&gt;
#''afTime ''- time in seconds until change is done&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightFlickerActive(string &amp;amp;in asLightName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates flickering on a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName'' - The internal light name&lt;br /&gt;
#''abActive'' - true = active, false = inactive&lt;br /&gt;
&lt;br /&gt;
==Game scripts==&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartCredits(string &amp;amp;in asMusic, bool abLoopMusic, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alEndNum);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts the end credits screen.&lt;br /&gt;
&lt;br /&gt;
#''asMusic ''- the music to play (including .ogg)&lt;br /&gt;
#''abLoopMusic ''- determines whether the music should loop&lt;br /&gt;
#''asTextCat ''- the category to be used in the .lang file, usually &amp;quot;Ending&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alEndNum ''- Amnesia has 3 different endings and displays a code at the bottom. Determines which code is displayed. 0-2 will display codes, any other integer will not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartDemoEnd();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shows the demo end screen. The background and UI elements are defined in demo.cfg, with the text using the entries in the &amp;quot;Demo&amp;quot; category of the .lang file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AutoSave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an auto save file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CheckPoint(string &amp;amp;in asName, string &amp;amp;in asStartPos, string &amp;amp;in asCallback, string &amp;amp;in asDeathHintCat, string &amp;amp;in asDeathHintEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a checkpoint at which the player will respawn in case he dies. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asName, int alCount)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;Count is 0 on the first checkpoint load!&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the editor&lt;br /&gt;
#''asCallback ''- the function to call when the player dies/respawns&lt;br /&gt;
#''asDeathHintCat ''- the category of the death hint message to be used in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asDeathHintEntry ''- the entry in the .lang file&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeMap(string &amp;amp;in asMapName, string &amp;amp;in asStartPos, string &amp;amp;in asStartSound, string &amp;amp;in asEndSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Loads another map after a 1.5 second fade out.&lt;br /&gt;
&lt;br /&gt;
#''asMapName ''- the file to load&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the next map&lt;br /&gt;
#''asStartSound ''- the sound that is played when the change starts&lt;br /&gt;
#''asEndSound ''- the sound that is played when the new map is loaded&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ClearSavedMaps();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the &amp;quot;history&amp;quot; of the save, useful to do when you know the player will not be able to go back anymore. Makes the next save much smaller in size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateDataCache();&lt;br /&gt;
void DestroyDataCache();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This caches all current textures and models and they are not released until destroy is called. If there is already cached data it is destroyed.&lt;br /&gt;
Create caches to enable faster loading when going back to a map. Destroy the cache if you know the player won't go back to that map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMapDisplayNameEntry(string &amp;amp;in asNameEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the map name shown in save file names. If none is set NULL is assumed.&lt;br /&gt;
&lt;br /&gt;
#''asNameEntry ''- the entry to display, category must be &amp;quot;Levels&amp;quot;!&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the skybox.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxTexture(string &amp;amp;in asTexture);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the texture of the skybox.&lt;br /&gt;
&lt;br /&gt;
#''asTexture''  - The texture file to set. Extension: .dds&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the solid color of the skybox rather than a texture.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the global fog.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the color to use for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogProperties(float afStart, float afEnd, float afFalloffExp, bool abCulling);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the properties for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afStart ''- how many meters from the camera should the fog begin&lt;br /&gt;
#''afEnd ''- how many meters from the camera should the fog reach full thickness&lt;br /&gt;
#''afFalloffExp ''- the amount by which the thinkness increases&lt;br /&gt;
#''abCulling ''- whether occlusion culling is active for the fog; this prevents objects behind the fog from being loaded&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetupLoadScreen(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alRandomNum, string &amp;amp;in asImageFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which loading screen will be shown when changing maps.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category of the loading text in the .lang file to be shown on the loading screen, usually &amp;quot;LoadingText&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alRandomNum ''- if greater 1, then it will randomize between 1 and alRandom for each LoadScreen giving entry the suffix XX (eg 01). If &amp;lt; =1 then no suffix is added&lt;br /&gt;
#''asImageFile ''- the image to be shown (optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void UnlockAchievement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlocks the specified achievement. Only able to be used for the ending achievements.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the achievement. Only the following strings are valid:&lt;br /&gt;
::* Benefactor&lt;br /&gt;
::* Survivor&lt;br /&gt;
::* Sacrifice&lt;br /&gt;
::* Quitter&lt;br /&gt;
::* Egotist&lt;br /&gt;
::* Altruist&lt;br /&gt;
::* Vacillator&lt;br /&gt;
&lt;br /&gt;
===Game Timer===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddTimer(string &amp;amp;in asName, float afTime, string &amp;amp;in asFunction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a timer which calls a function when it expires. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asTimer)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the name of the timer&lt;br /&gt;
#''afTime ''- time in seconds&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveTimer(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a timer, no matter how much time is left.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the timer.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetTimerTimeLeft(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the time left on a timer.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - the internal name of the timer.&lt;br /&gt;
&lt;br /&gt;
===Screen Effects===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeOut(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to black.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen is completly black&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeIn(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen back to normal.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeImageTrailTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies the image trail effect to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeSepiaColorTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the screen go dark red.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0) &lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeRadialBlurTo(float afSize, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies radial blur effects to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afSize ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetRadialBlurStartDist(float afStartDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines at which distance the radial blur effects appear.&lt;br /&gt;
&lt;br /&gt;
#''afStartDist ''- the distance at which the effect starts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectFlash(float afFadeIn, float afWhite, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white.&lt;br /&gt;
&lt;br /&gt;
#''afFadeIn ''- time in seconds until screen is white&lt;br /&gt;
#''afWhite ''- determines to which percentage the screen fades to white (1.0 = completly white)&lt;br /&gt;
#''afFadeOut ''- time in seconds until screen is back to normal again&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectEmotionFlash(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white and shows a text message.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''asSound ''- the sound to play while fading&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetFlashbackIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a flashback is still in effect.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerSpawnPS(string &amp;amp;in asSPSFile);&lt;br /&gt;
void StopPlayerSpawnPS();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Continuously spawn regular particle systems (''.ps'') around the player. Particles created by this script carry over from map to map.&lt;br /&gt;
&lt;br /&gt;
#''asSPSFile''  - the ''.sps''  file to use. Example ''.sps''  files are located in the ''/misc''  folder in the main game directory.&amp;lt;br&amp;gt;Custom ''.sps''  files can be created by hand in a text editor (see existing ones and mimic how those are written). &amp;lt;br /&amp;gt;Since ''StopPlayerSpawnPS()''  doesn't seem to work, to stop an SPS you must create an ''.sps''  file with an empty particle field field and override the old SPS by calling ''StartPlayerSpawnPS''  again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shakes the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity of the shake&lt;br /&gt;
#''afTime ''- duration of the shake&lt;br /&gt;
#''afFadeInTime ''- time in seconds until full intensity is reached&lt;br /&gt;
#''afFadeOutTime ''- time until screen is back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInDarknessEffectsActive(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the sanity drain and night vision effects while in the darkness.&lt;br /&gt;
&lt;br /&gt;
''bool abX''  - Enable/disable effects.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowScreenImage(string &amp;amp;in asImageName, float afX, float afY, float afScale, bool abUseRelativeCoordinates, float afDuration, float afFadeIn, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
Displays an image file directly onto the screen. See [[HPL2/Tutorials/ShowScreenImage()|ShowScreenImage()]] in the tutorials section for more information.&lt;br /&gt;
&lt;br /&gt;
# ''asImageName'' - The image file to render (.jpg, .png, .tga, .dds)&lt;br /&gt;
# ''afX'' - The X position of the image&lt;br /&gt;
# ''afY'' - The Y position of the image&lt;br /&gt;
# ''afScale'' - The size of the image in pixels (not scale), or original image size if negative&lt;br /&gt;
# ''abUseRelativeCoordinates'' - Whether X and Y are relative to the screen resoltion, or pixel co-ordinates if not&lt;br /&gt;
# ''afDuration'' - The duration that the image is displayed for&lt;br /&gt;
# ''afFadeIn'' - The time, in seconds, to fade in the image&lt;br /&gt;
# ''afFadeOut'' - The time, in seconds, to fade out the image&lt;br /&gt;
&lt;br /&gt;
===Insanity===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInsanitySetEnabled(string &amp;amp;in asSet, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which InsanitySets are enabled.&lt;br /&gt;
&lt;br /&gt;
#''asSet ''- the set&lt;br /&gt;
#''abX ''- enabled or not&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartInsanityEvent(string &amp;amp;in asEventName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Starts a specified insanity event.&lt;br /&gt;
&lt;br /&gt;
#''asEventName ''- Insanity event to play.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartRandomInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts a random insanity event from the available sets.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopCurrentInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Stops the currently playing insanity event.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void InsanityEventIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an insanity event is currently in effect.&amp;lt;br&amp;gt;Not useful at all due to having a return type of &amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; when it should be &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Player===&lt;br /&gt;
&lt;br /&gt;
Note that the player's maximum health and sanity is 100.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enabled/Disable player controlled movement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangePlayerStateToNormal();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets the player's state, forcing them to stop interacting with objects. It also clears the inventory item to be used (as if it was double-clicked on in the inventory again) and dismounts the player from ladders.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerCrouching(bool abCrouch);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddPlayerBodyForce(float afX, float afY, float afZ, bool abUseLocalCoords);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pushes the player into a certain direction. Note that you need values above ~2000 to see any effects.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - amount along the X-axis&lt;br /&gt;
#''afY'' - amount along the Y-axis&lt;br /&gt;
#''afZ'' - amount along the Z-axis&lt;br /&gt;
#''abUseLocalCoords'' - If true, axes are based on where the player is facing, not the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowPlayerCrossHairIcons(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the icons when a player has something in focus.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerSanity(float afSanity);&lt;br /&gt;
void AddPlayerSanity(float afSanity);&lt;br /&gt;
float GetPlayerSanity();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerHealth(float afHealth);&lt;br /&gt;
void AddPlayerHealth(float afHealth);&lt;br /&gt;
float GetPlayerHealth();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerLampOil(float afOil);&lt;br /&gt;
void AddPlayerLampOil(float afOil);&lt;br /&gt;
float GetPlayerLampOil();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the lamp oil of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerSpeed();&lt;br /&gt;
float GetPlayerYSpeed();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current speed of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSanityDrainDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables sanity drain from darkness.&lt;br /&gt;
{{bug|Sanity drain is reenabled on loading a save, as the game is unable to load the value properly from the save data.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoost();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a large amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! New Sanity&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || 100&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || 90&lt;br /&gt;
|-&lt;br /&gt;
| 50-74 || 80&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoostSmall();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a small amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! Sanity Bonus&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || +20&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || +15&lt;br /&gt;
|-&lt;br /&gt;
| 50-75 || +10&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityDamage(float afAmount, bool abUseEffect);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount'' - amount of sanity damage done&lt;br /&gt;
#''abUseEffect'' - if a sound is played and screen effects are shown when the sanity damage is dealt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GivePlayerDamage(float afAmount, string &amp;amp;in asType, bool abSpinHead, bool abLethal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the health of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount'' - amount of damage done to health&lt;br /&gt;
#''asType'' - plays a certain effect on the screen when the damage is dealt (BloodSplat, Claws, or Slash) &lt;br /&gt;
#''abSpinHead'' - changes the camera view when damage is dealt&lt;br /&gt;
#''abLethal'' - set to true if player can die from given damage. If ''false'' and the damage would have left the player with less than 10 health, health is set to 10.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerFOVMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the field of view of the player. A shorter FOV will create a zoom effect.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - multiplier of default FOV (1 is default)&lt;br /&gt;
#''afSpeed'' - the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerAspectMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the aspect ratio of the player. Basically stretches or narrows the screen horizontally.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - multiplier of default aspect (default is 1)&lt;br /&gt;
#''afSpeed'' - the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - angle of rotation of head, positive being counter-clockwise&lt;br /&gt;
#''afSpeedMul'' - speed (possibly acceleration) multiplier of the rotation (default 1, which is really slow)&lt;br /&gt;
#''afMaxSpeed'' - maximum speed of rotation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerForward(float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Moves the player forward. It needs to be called in a timer that updates 60 times / second.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- amount along the X-axis&lt;br /&gt;
#''afY ''- amount along the Y-axis&lt;br /&gt;
#''afZ ''- amount along the Z-axis&lt;br /&gt;
#''afSpeed ''- speed at which the change happens&lt;br /&gt;
#''afSlowDownDist ''- distance at which to start slowing down (prevents the head from abruptly stopping)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerLookAt(string &amp;amp;in asEntityName, float afSpeedMul, float afMaxSpeed, string &amp;amp;in asAtTargetCallback);&lt;br /&gt;
void StopPlayerLookAt();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to look at a certain entity until StopPlayerLookAt is used.&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- the entity to look at &lt;br /&gt;
#''afSpeedMul ''- how fast should the player look at the entity&lt;br /&gt;
#''afMaxSpeed ''- maximum speed allowed&lt;br /&gt;
#''asAtTargetCallback ''- function to call when player looks at target&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerMoveSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerRunSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerLookSpeedMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the player's move/run/look speed. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpForceMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the player's jump multiplier. Higher values = higher jumps. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpDisabled(bool abX);&lt;br /&gt;
void SetPlayerCrouchDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to jump/crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportPlayer(string &amp;amp;in asStartPosName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly teleports the player to the target StartPos.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternActive(bool abX, bool abUseEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the player use his lantern.&lt;br /&gt;
&lt;br /&gt;
# ''abX'' - Set lantern to be active (true) or inactive (false)&lt;br /&gt;
# ''abUseEffects'' - Play on/off sounds&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetLanternActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player is currently using the lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to use the lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternLitCallback(string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to call when the player uses the lantern. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;MyFunc(bool abLit)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message on the screen.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory'' - the category in the .lang file&lt;br /&gt;
#''asTextEntry'' - the entry in the .lang file&lt;br /&gt;
#''afTime'' - determines how long the message is displayed. If time is &amp;lt; =0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetDeathHint(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the message that appears when the player dies.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory'' - the category in the .lang file&lt;br /&gt;
#''asTextEntry'' - the entry in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DisableDeathStartSound();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the death sound when the player dies. This must be called directly before player is killed! The variable as soon as player dies too.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPermaDeathSound(string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Sets the sound played after the player dies when permadeath is active. Permadeath is only active when the game is launched with the &amp;lt;code&amp;gt;ptest&amp;lt;/code&amp;gt; command line parameter. Only used for the post-death Suitor lines in ''Justine''.&lt;br /&gt;
&lt;br /&gt;
#''asSound'' - The sound to be played after death. Expects a voice-type sound.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerFallDamageDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the player's ability to take fall damage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPos(float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the player's position within the level.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - X co-ordinate position.&lt;br /&gt;
#''afY'' - Y co-ordinate position.&lt;br /&gt;
#''afZ'' - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerPosX();&lt;br /&gt;
float GetPlayerPosY();&lt;br /&gt;
float GetPlayerPosZ();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the player's position within the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
===Journal===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddNote(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a note to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _Name and _Text and be in category &amp;quot;Journal&amp;quot;!&lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDiary(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a diary to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _NameX and _TextY whereas X and Y are numbers of the parts (_Name1: first diary, _Text1: first page) and be in category &amp;quot;Journal&amp;quot;! &lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ReturnOpenJournal(bool abOpenJournal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Only called in the pickup diary callback! If true the journal displays the entry else not.&lt;br /&gt;
&lt;br /&gt;
===Quests===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a quest to the player's journal under mementos. Completed quests cannot be readded.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name to be used&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot;Quest_&amp;lt;texthere&amp;gt;_Text”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CompleteQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Completes a quest. If the quest has not been added, it's marked as complete anyway, preventing it from being added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot; Quest_&amp;lt;texthere&amp;gt;_Text ”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool QuestIsCompleted(string &amp;amp;in asName);&lt;br /&gt;
bool QuestIsAdded(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a quest is completed/added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetNumberOfQuestsInMap(int alNumberOfQuests);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the number of quests in the map. Obsolete; formerly used to calculate a completion percentage when looking at a level door.&lt;br /&gt;
&lt;br /&gt;
#''alNumberOfQuests ''- Amount of quests&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveHint(string &amp;amp;in asName, string &amp;amp;in asMessageCat, string &amp;amp;in asMessageEntry, float afTimeShown);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a hint on the player's screen.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asMessageCat ''- the category in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asMessageEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTimeShown ''- time in seconds until the message disappears. If time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void BlockHint(string &amp;amp;in asName);&lt;br /&gt;
void UnBlockHint(string &amp;amp;in asName);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Blocking a hint prevents it from being shown. Blocked hints are included in savefiles, so they should persist between levels. Unblocking a hint allows it to be shown.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; blocks the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveHint(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes the hint from the list of already shown hints, allowing it to appear again.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; reenables the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
===Inventory===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ExitInventory();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Exits the inventory by force.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the player's ability to open his inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a message on the inventory screen. Used for feedback messages when failing to combine items.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory ''- the category in the .lang file, usually &amp;quot;Inventory&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTime ''- time in seconds until the message disappears. If life time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItem(string &amp;amp;in asName, string &amp;amp;in asType, string &amp;amp;in asSubTypeName, string &amp;amp;in asImageName, float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds an item to the inventory of the player. Note that the item does not have to exist as entity in the world to be able to do this.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asType ''- item type to give, Available types are:&lt;br /&gt;
::*Puzzle&lt;br /&gt;
::*Lantern&lt;br /&gt;
::*Health&lt;br /&gt;
::*Sanity&lt;br /&gt;
::*LampOil&lt;br /&gt;
::*Tinderbox&lt;br /&gt;
#''asSubTypeName ''- item name for .lang file&lt;br /&gt;
#''asImageName ''- the image which will appear in inventory. For example: &amp;lt;code&amp;gt;void GiveItem(&amp;quot;chemical_container_full_1&amp;quot;, &amp;quot;Puzzle&amp;quot;, &amp;quot;chemical_container_full&amp;quot;, &amp;quot;chemical_container_full.tga&amp;quot;, 1);&amp;lt;/code&amp;gt; will use the image from &amp;lt;code&amp;gt;graphics/item/chemical_container_full.tga&amp;lt;/code&amp;gt; &lt;br /&gt;
#''afAmount ''- amount the item gives, - For example: Oil potions will fill the oil meter by this amount, Health potions will heal by this amount, etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item from the player's inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool HasItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player has an item in his inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItemFromFile(string &amp;amp;in asName, string &amp;amp;in asFileName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a single item to the player's inventory. This is meant to be used for debug mostly as it creates the actual item and then destroys it.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asFileName ''- item to give + extension (.ent)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddCombineCallback(string &amp;amp;in asName, string &amp;amp;in asItemA, string &amp;amp;in asItemB, string &amp;amp;in asFunction, bool abAutoRemove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to combine items in his inventory. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItemA, string &amp;amp;in asItemB)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name for the callback&lt;br /&gt;
#''asItemA ''- internal name of first item&lt;br /&gt;
#''asItemB ''- internal name of second item&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
#''abAutoRemove ''- determines whether the callback should be removed when the items are combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveCombineCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a combine callback.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the callback to be removed (as specified in AddCombineCallback)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddUseItemCallback(string &amp;amp;in asName, string &amp;amp;in asItem, string &amp;amp;in asEntity, string &amp;amp;in asFunction, bool abAutoDestroy);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to use items on the world. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItem, string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
#''asItem ''- internal name of the item&lt;br /&gt;
#''asEntity ''- entity to be able to use the item on&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abAutoDestroy ''- determines whether the callback should be removed when the item is used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveUseItemCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item callback.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
&lt;br /&gt;
===Entities===&lt;br /&gt;
&lt;br /&gt;
====General====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityActive(string &amp;amp;in asName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityVisible(string &amp;amp;in asName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity's visual mesh. The collision body remains.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the entity.&lt;br /&gt;
#''abActive''  - Activate/deactivate mesh.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntityExists(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an entity exists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCustomFocusCrossHair(string &amp;amp;in asName, string&amp;amp; asCrossHair);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the crosshair that is used when focusing an entity.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCrossHair ''- desired crosshair, can be: &lt;br /&gt;
::*Default (no crosshair)&lt;br /&gt;
::*Grab&lt;br /&gt;
::*Push&lt;br /&gt;
::*Ignite&lt;br /&gt;
::*Pick&lt;br /&gt;
::*LevelDoor&lt;br /&gt;
::*Ladder&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void CreateEntityAtArea(string &amp;amp;in asEntityName, string &amp;amp;in asEntityFile, string &amp;amp;in asAreaName, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an entity at an area. When creating an enemy though, it cannot chase properly along PathNodes (using for example &amp;lt;code&amp;gt;ShowEnemyPlayerPosition&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- internal name&lt;br /&gt;
#''asEntityFile ''- entity to be used extension .ent&lt;br /&gt;
#''asAreaName ''- the area to create the entity at&lt;br /&gt;
#''abFullGameSave ''- determines whether an entity &amp;quot;remembers&amp;quot; its state&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ReplaceEntity(string &amp;amp;in asName, string &amp;amp;in asBodyName, string &amp;amp;in asNewEntityName, string &amp;amp;in asNewEntityFile, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Removes an entity and places a new one in its place.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to replace.&lt;br /&gt;
#''asBodyName'' - Name of the body of the entity to place the new entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''asNewEntityName'' - Name of the new entity.&lt;br /&gt;
#''asNewEntityFile'' - Name of the new entity file. Extension .ent. &lt;br /&gt;
#''abFullGameSave'' - Whether ALL properties of this entity should be saved throughout levels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaceEntityAtEntity(string &amp;amp;in asName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBodyName, bool abUseRotation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Places an entity at the position of another entity. Does not work for enemies, use TeleportEnemyToEntity instead.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to place.&lt;br /&gt;
#''asTargetEntity'' - Name of the other entity to place the first entity at.&lt;br /&gt;
#''asTargetBodyName'' - Name of the body of the entity to place the first entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''abUseRotation'' - Whether the entity should be rotated like the target entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPos(string &amp;amp;in asName, float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Moves an entity to a position in the level.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to move.&lt;br /&gt;
#''afX'' - X co-ordinate position.&lt;br /&gt;
#''afY'' - Y co-ordinate position.&lt;br /&gt;
#''afZ'' - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetEntityPosX(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosY(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosZ(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns an entity's position in the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerLookAtCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveWhenLookedAt);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player looks at a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = looking, -1 = not looking&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveWhenLookedAt ''- determines whether the callback should be removed when the player looked at the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerInteractCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveOnInteraction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player interacts with a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveOnInteraction ''- determines whether the callback should be removed when the player interacts with the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCallbackFunc(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when certain events occur with an entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, string &amp;amp;in asType)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;asType&amp;lt;/code&amp;gt; values depend on entity type:&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! asType Value&lt;br /&gt;
|-&lt;br /&gt;
| Object || Break&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || OnIgnite&lt;br /&gt;
|-&lt;br /&gt;
| Item || OnPickup&lt;br /&gt;
|-&lt;br /&gt;
| Enemy || OnDeath&lt;br /&gt;
|-&lt;br /&gt;
| Enemy_Grunt&amp;lt;br&amp;gt;Enemy_Manpig || OnAutoDisabled&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityConnectionStateChangeCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A callback called when ever the connection state changes (button being switched on, lever switched, etc). &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void Func(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: -1 = off, 0 = between, 1 = on&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityInteractionDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disallows interaction with an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void BreakJoint (string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Breaks a joint. Do not use this on joints in SwingDoors, Levers, Wheels, etc. where the joint is part of an interaction. That will make the game crash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void AddEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName, string &amp;amp;in asFunction, bool abDeleteOnCollide, int alStates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when two entities collide. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asParent, string &amp;amp;in asChild, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = enter, -1 = leave&lt;br /&gt;
&lt;br /&gt;
#''asParentName ''- internal name of main object&lt;br /&gt;
#''asChildName ''- internal name of object that collides with main object (asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) NOT supported!)&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abDeleteOnCollide ''- determines whether the callback after it was called&lt;br /&gt;
#''alStates ''- 1 = only enter, -1 = only leave, 0 = both&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an EntityCollideCallback. Asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) not supported in ''asChildName''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntitiesCollide(string &amp;amp;in asEntityA, string &amp;amp;in asEntityB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether two entities collide. This function does NOT support asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) or &amp;quot;Player&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetBodyMass(string &amp;amp;in asName, float afMass);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName.&lt;br /&gt;
#''afMass''  - The mass to set.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetBodyMass(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName. &lt;br /&gt;
#''afMass''  - The mass to get.&lt;br /&gt;
&lt;br /&gt;
====Props====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropEffectActive(string &amp;amp;in asName, bool abActive, bool abFadeAndPlaySounds);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Turns the texture illumination, billboards, particles, light flicker, and sounds of a prop on or off.&lt;br /&gt;
&lt;br /&gt;
Can be used on coal to give it the black color it should have.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name &lt;br /&gt;
#''abActive'' - active state&lt;br /&gt;
#''afFadeAndPlaySounds'' - if all effects should fade in/out or not&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropActiveAndFade(string &amp;amp;in asName, bool abActive, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates a prop.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''abActive ''- nothing to add&lt;br /&gt;
#''afFadeTime ''- time in seconds until prop fully fades&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropStaticPhysics(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates the physics of a prop, setting the mass to 0. Setting as true will make entities static in midair.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetPropIsInteractedWith(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a prop is interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RotatePropToSpeed(string &amp;amp;in asName, float afAcc, float afGoalSpeed, float afAxisX, float afAxisY, float afAxisZ, bool abResetSpeed, string &amp;amp;in asOffsetArea);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the prop up to a set speed.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afGoalSpeed ''- desired speed &lt;br /&gt;
#''afAxisX ''- rotation around X axis&lt;br /&gt;
#''afAxisY ''- rotation around Y axis&lt;br /&gt;
#''afAxisZ ''- rotation around Z axis&lt;br /&gt;
#''abResetSpeed ''- determines whether the speed is resetted after goal speed is reached&lt;br /&gt;
#''asOffsetArea ''- the area to rotate around, if empty, then the center of the body is used Note: The entity you want to rotate MUST be a &amp;quot;StaticObject&amp;quot; entity!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void StopPropMovement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all movement of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddAttachedPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop.&lt;br /&gt;
&lt;br /&gt;
#''asPropName''- the prop to attach another prop at &lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop&lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
{{bug|''afRotZ '' is used for both the ZX rotation and the Z position of the attached prop. Unwanted rotation can be avoided by using: &amp;lt;br /&amp;gt;''AddAttachedPropToProp(asPropName, asAttachName, asAttachFile, afPosX, afPosY, '''0''', afPosZ, '''90.0f''', afPosZ)''}}&lt;br /&gt;
&lt;br /&gt;
{{bug|Attaching a breakable prop to a physically active prop, and then breaking the attached prop, will cause the game to crash, should the parent object be moved or reset.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop. Fixed version of &amp;lt;code&amp;gt;AddAttachedPropToProp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
#''asPropName ''- the prop to attach another prop at&lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop &lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveAttachedPropFromProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches a prop from a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
void AddPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
float GetPropHealth(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ResetProp(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets a prop's state to the original one when the map was loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void PlayPropAnimation(string &amp;amp;in asProp, string &amp;amp;in asAnimation, float afFadeTime, bool abLoop, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the prop play an animation and calls a function. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asProp)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asProp ''- internal name of the prop&lt;br /&gt;
#''asAnimation ''- animation to play&lt;br /&gt;
#''afFadeTime ''- Fade time between current and new animations&lt;br /&gt;
#''abLoop ''- determines whether the animation loops &lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddPropForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddPropImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These functions push objects. Note that rather high values are needed when applying ''forces''  (on the order of ~100 (weak) to ~10000 (strong)), but not impulses (values less than 10 can be appropriate). Forces are external influences, and will have different effect depending on the mass of the object they are being applied to; impulses disregard mass, and can cause objects to break, as if hit. A &amp;quot;Body&amp;quot; is a physics-related helper object, to which a force or an impulse can be applied. Entities can consist of several bodies, interconnected in various ways (you can create/examine bodies in the model editor).&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the object to push; for bodies, use this format: &amp;quot;''entityName''_''bodyName''&amp;quot;&lt;br /&gt;
#''afX ''- magnitude along the X-axis&lt;br /&gt;
#''afY ''- magnitude along the Y-axis&lt;br /&gt;
#''afZ ''- magnitude along the Z-axis&lt;br /&gt;
#''asCoordSystem ''- determines which coordinate system is used, &amp;quot;local&amp;quot; or &amp;quot;world&amp;quot;&lt;br /&gt;
&lt;br /&gt;
All of these functions are ''additive''  - when called consecutively, for each call, the vectors defined by (afX, afY, afZ) will be added together, and a resultant force/impulse will be calculated ''before''  any physics simulation is applied to the target object.&lt;br /&gt;
&lt;br /&gt;
====Connections====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithRope(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asRopeName, bool abInteractOnly, float afSpeedMul, float afToMinSpeed, float afToMaxSpeed, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects a prop with the movement of a rope (i.e. turn a wheel to move a rope). For Levers, the rope only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName''- The name of the connection&lt;br /&gt;
#''asPropName'' - The name of the prop; can be a Lever or Wheel&lt;br /&gt;
#''asRopeName'' - The name of the rope&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''afSpeedMul'' - Speed multiplier of how quickly the rope moves&lt;br /&gt;
#''afToMinSpeed'' - The slowest the rope can move&lt;br /&gt;
#''afToMaxSpeed'' - The fastest the rope can move&lt;br /&gt;
#''abInvert'' - Whether to invert the direction the rope moves&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithMoveObject(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asMoveObjectName, bool abInteractOnly, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This one should only be used if there must be an exact correspondence to prop &amp;quot;amount&amp;quot; and the MoveObject open amount. It is best used for Wheel-door connections, where the MoveObject moves continuously along with the Wheel. For Levers, the MoveObject only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asPropName'' - The entity that controls the movement; can be a Lever or Wheel&lt;br /&gt;
#''asMoveObject'' - The MoveObject to move&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''abInvert'' - If the state is inverted, making the MoveObject move in the opposite direction&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ConnectEntities(string &amp;amp;in asName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, bool abInvertStateSent, int alStatesUsed, string &amp;amp;in asCallbackFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects two entities together so that changing the state of the main entity changes the state of the connected entity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! Max State (1) !! Min State (-1)&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || Lit || Unlit&lt;br /&gt;
|-&lt;br /&gt;
| MoveObject || Open || Close&lt;br /&gt;
|-&lt;br /&gt;
| SwingDoor&lt;br /&gt;
|rowspan=2| Locked&lt;br /&gt;
|rowspan=2| Unlocked&lt;br /&gt;
|-&lt;br /&gt;
| Chest&lt;br /&gt;
|-&lt;br /&gt;
| Button || Switched on || Switched off&lt;br /&gt;
|-&lt;br /&gt;
| Lever&lt;br /&gt;
|rowspan=2| Unstuck&lt;br /&gt;
|rowspan=2| Stuck (at min)&lt;br /&gt;
|-&lt;br /&gt;
| Wheel&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asMainEntity'' - The entity that causes the change; can be a Lever, Wheel, Button, or Photocell&lt;br /&gt;
#''asConnectEntity'' - The entity that is affected by the change&lt;br /&gt;
#''abInvertStateSent'' - If the state is inverted, making the connected entity change to the opposite state&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
#''asCallbackFunc'' - The name of the connection callback&lt;br /&gt;
&lt;br /&gt;
Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asConnectionName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, int alState)&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;alState is what is sent to connection entity and will be inverted if abInvertStateSent = true!&lt;br /&gt;
&lt;br /&gt;
====Lamps====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLampLit(string &amp;amp;in asName, bool abLit, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Turns a lamp on or off.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the lamp&lt;br /&gt;
#''abLit ''- Set true if you want the lamp to be lit, set to false if you want the lamp to be unlit&lt;br /&gt;
#''abEffects ''- If you want to have the lamp fade in/out when it gets lit/unlit&lt;br /&gt;
&lt;br /&gt;
====Doors====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorLocked(string &amp;amp;in asName, bool abLocked, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abLocked'' - Locked/unlocked&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is locked/unlocked&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorClosed(string &amp;amp;in asName, bool abClosed, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abClosed'' - Closed/open&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is closed/opened&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
bool GetSwingDoorLocked(string &amp;amp;in asName);&lt;br /&gt;
bool GetSwingDoorClosed(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a swing door is locked/closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorDisableAutoClose(string &amp;amp;in asName, bool abDisableAutoClose);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deactivates the &amp;quot;auto-close&amp;quot; when a door is nearly closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetSwingDoorState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns an integer depending on how far the door is opened. &amp;lt;br /&amp;gt;-1 = angle is close to 0°, 1 = angle is 70% or higher of max, 0 = inbetween -1 and 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLocked(string &amp;amp;in asName, bool abLocked);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a level door. Note that level doors are NOT swing doors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedSound(string &amp;amp;in asName, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which sound is played when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedText(string &amp;amp;in asName, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectState(string &amp;amp;in asName, float afState);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween (and above, for example, the bridge_metal_vert) are valid too!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectStateExt(string &amp;amp;in asName, float afState, float afAcc, float afMaxSpeed, float afSlowdownDist, bool abResetSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state, extended method.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween are valid too!&lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afMaxSpeed ''- maximum speed&lt;br /&gt;
#''afSlowdownDist ''- Distance to the target state before deceleration occurs.&lt;br /&gt;
#''abResetSpeed ''- Set to ''true'' if the prop's speed should be reset before performing the movement, else the prop will accelerate from its current speed to afMaxSpeed.&lt;br /&gt;
&lt;br /&gt;
====Levers, wheels and buttons====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropObjectStuckState(string &amp;amp;in asName, int alState);&lt;br /&gt;
void SetWheelStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
void SetLeverStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes an object/wheel/lever stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name&lt;br /&gt;
#''alState'' - 0 = not stuck, 1 = at max, -1 = at min &lt;br /&gt;
#''abEffects'' - play sound effects&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelAngle(string &amp;amp;in asName, float afAngle, bool abAutoMove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves a wheel to a certain angle.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name&lt;br /&gt;
#''afAngle'' - angle&lt;br /&gt;
#''abAutoMove'' - determines whether the wheel should move on its own&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
void SetLeverInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to make a wheel/lever unstuck when interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetLeverState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the state of the lever. &amp;lt;br /&amp;gt;0 = not stuck, 1 = at max, -1 = at min&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderStuckState(string &amp;amp;in asName, int alStuckState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes a MultiSlider stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when state changes. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetButtonSwitchedOn(string &amp;amp;in asName, bool abSwitchedOn, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Sticky areas====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetAllowStickyAreaAttachment(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows entities to stick to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asProp);&lt;br /&gt;
void AttachBodyToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asBody);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop/body to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void DetachFromStickyArea(string &amp;amp;in asAreaName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches everything from a StickyArea.&lt;br /&gt;
&lt;br /&gt;
====NPCs====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCAwake(string &amp;amp;in asName, bool abAwake, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wakes/sleeps a NPC.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the NPC&lt;br /&gt;
#''abAwake'' - ''true'' to awaken, ''false'' to sleep&lt;br /&gt;
#''abEffects'' - Play the &amp;quot;Awake&amp;quot; or &amp;quot;Sleep&amp;quot; animations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCFollowPlayer(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a NPC's head to follow the player's movements.&lt;br /&gt;
&lt;br /&gt;
====Enemies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables an enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyIsHallucination(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes an enemy a hallucination. Hallucinations fade to smoke when they get near the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void FadeEnemyToSmoke(string &amp;amp;in asName, bool abPlaySound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly fades an enemy to smoke.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ShowEnemyPlayerPosition(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the enemy run to the player, no matter where he is.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AlertEnemyOfPlayerPresence(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gives the specified enemy the player's current position and makes it search the area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisableTriggers(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables or disables enemy triggers. If disabled, enemy will not react to player or attack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddEnemyPatrolNode(string &amp;amp;in asName, string &amp;amp;in asNodeName, float afWaitTime, string &amp;amp;in asAnimation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a patrol node to the enemy's path.&lt;br /&gt;
&lt;br /&gt;
#''asName''- Internal name of the enemy &lt;br /&gt;
#''asNodeName'' - Path node &lt;br /&gt;
#''afWaitTime'' - Time in seconds that the enemy waits at the path node before continuing. If 0, randomized between 1-3.&lt;br /&gt;
#''asAnimation'' - The animation the enemy uses when reaching the path node&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ClearEnemyPatrolNodes(string &amp;amp;in asEnemyName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the current path of patrol nodes of the enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemySanityDecreaseActive(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether an enemy activates the player's sanity drain when stared at.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy &lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToNode(string &amp;amp;in asEnemyName, string &amp;amp;in asNodeName, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific PathNode.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asNodeName'' - Internal name of the node to teleport to &lt;br /&gt;
#''abChangeY'' - Whether the Y position of the node will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToEntity(string &amp;amp;in asEnemyName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBody, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific entity.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asTargetEntity'' - Internal name of the entity to teleport to&lt;br /&gt;
#''asTargetBody'' - Internal name of the entity's body name to teleport to. If empty, the first body will be used (might be unstable, recommended to input a body anyway)&lt;br /&gt;
#''abChangeY'' - Whether the Y position of the entity will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeManPigPose(string &amp;amp;in asName, string &amp;amp;in asPoseType);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the pose a specified ManPig.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''asPoseType'' - Name of the ManPig pose to use. Can be &amp;quot;Biped&amp;quot; or &amp;quot;Quadruped&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigFadeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should fade the player's view in and out.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigSoundDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should play the proximity sounds.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigEasyEscapeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should be easier to escape from when hunted. If not disabled, easy escape is activated if the player is more than 12.35 meters away, the enemy can't see the player, and the player has less than 75 health. When this occurs, the enemy is forced to stop hunting and wait for half a second.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ForceTeslaPigSighting(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Forces a Tesla ManPig to be visible for a short time.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; GetEnemyStateName(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the name of the state a specified enemy is current in.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
Possible states for all enemies:&lt;br /&gt;
*Idle&lt;br /&gt;
*Wait&lt;br /&gt;
*Patrol&lt;br /&gt;
*Investigate&lt;br /&gt;
*Alert&lt;br /&gt;
*Search&lt;br /&gt;
*Hurt&lt;br /&gt;
*Hunt&lt;br /&gt;
*HuntPause&lt;br /&gt;
*HuntWander&lt;br /&gt;
*AttackMeleeShort&lt;br /&gt;
*AttackMeleeLong&lt;br /&gt;
*BreakDoor&lt;br /&gt;
*Dead&lt;br /&gt;
&lt;br /&gt;
Waterlurker-only states:&lt;br /&gt;
*GoHome&lt;br /&gt;
*Eat&lt;br /&gt;
&lt;br /&gt;
ManPig-only states: &lt;br /&gt;
*Flee&lt;br /&gt;
*Stalk&lt;br /&gt;
*Track&lt;br /&gt;
&lt;br /&gt;
Unused states:&lt;br /&gt;
*AttackRange&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=7018</id>
		<title>HPL2/Engine Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=7018"/>
		<updated>2025-09-05T06:25:27Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* General */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TocRight}}&lt;br /&gt;
&lt;br /&gt;
This page documents all scripts available in Amnesia: The Dark Descent.&lt;br /&gt;
&lt;br /&gt;
{{note|'''Note''': Some of the functions require the Amnesia 1.3 or 1.5 update. Steam and other online store copies should be automatically updated. Other copies can get 1.3 [http://www.frictionalgames.com/forum/thread-24334.html here].}}&lt;br /&gt;
&lt;br /&gt;
== Directives ==&lt;br /&gt;
&lt;br /&gt;
First off, &amp;lt;code&amp;gt;#include &amp;quot;file.hps&amp;quot;&amp;lt;/code&amp;gt; can be used to programmatically merge together multiple separate files to make organizing scripts easier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
==Engine scripts==&lt;br /&gt;
===Main===&lt;br /&gt;
&lt;br /&gt;
The following functions are the main hps functions that the HPL2 engine looks to run on certain events - similar to the C++ int main() function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void OnStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the map is loaded for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnEnter();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs whenever the player enters a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnLeave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the player leaves a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnGameStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is found in the global.hps file and the inventory.hps file, and is run when the game is first started by the player (ie via &amp;quot;Start New Game&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnUpdate(float afStep);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
This function is executed for every game update or &amp;quot;tick&amp;quot;. Can be used for rapid-firing updates instead of looping timers. Keep in mind that this can affect game performance if not used with care.&lt;br /&gt;
&lt;br /&gt;
#''afStep''- Time elapsed in seconds since the last frame. Multiply speeds, distances etc. by this argument to avoid framerate dependence issues (for example: if you move something in this function with constant speed, it will move faster on computers which run the game with high FPS and slower on computers with low FPS).&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float RandFloat(float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random float.&lt;br /&gt;
&lt;br /&gt;
#''afMin ''- minimum value&lt;br /&gt;
#''afMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int RandInt(int alMin, int alMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random int. Note: the maximum value is ''inclusive''  - the RandInt() function may return this value.&lt;br /&gt;
&lt;br /&gt;
#''alMin ''- minimum value&lt;br /&gt;
#''alMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringContains(string &amp;amp;in asString, string &amp;amp;in asSubString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a string contains the specified string. &amp;lt;br /&amp;gt;Example: searching for &amp;quot;hello&amp;quot; in &amp;quot;hello world&amp;quot; would return '''true'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to check&lt;br /&gt;
#''asSubString ''- the string to search for&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; StringSub(string &amp;amp;in asString, int alStart, int alCount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the substring in a string. &amp;lt;br /&amp;gt;Example: in the string &amp;quot;frictional games rocks&amp;quot;, using 4 as ''alStart''  and 6 as ''alCount''  would return '''&amp;quot;tional&amp;quot;'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string&lt;br /&gt;
#''alStart ''- starting character of the string, with 0 being the first character&lt;br /&gt;
#''alCount ''- amount of characters&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int StringToInt(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns an integer converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float StringToFloat(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a float converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringToBool(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a boolean converted from a string, else returns false.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&lt;br /&gt;
===Mathematical Operations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathCos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathTan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAsin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAcos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan2(float afX, float afY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Calculates and returns the arc tangent of the specified values.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - First value to operate.&lt;br /&gt;
#''afY''  - Second value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSqrt(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the square root of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathPow(float afBase, float afExp);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the value of afBase raised to the power of afExp.&lt;br /&gt;
&lt;br /&gt;
#''afBase''  - The base value.&lt;br /&gt;
#''afExp''  - Value to calculate the base with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMin(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the lowest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMax(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the highest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathClamp(float afX, float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns afX clamped between afMin and afMax. If afX &amp;lt; afMin, returns afMin, and if afX &amp;gt; afMax, returns afMax.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - The value to clamp.&lt;br /&gt;
#''afMin''  - The minimum value to clamp afX with.&lt;br /&gt;
#''afMax''  - The maximum value to clamp afX with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAbs(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the absolute value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&lt;br /&gt;
===Debugging===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void Print(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a string to the log file (''hpl.log'').&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDebugMessage(string &amp;amp;in asString, bool abCheckForDuplicates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a line of text to the debug console at the bottom left of the screen. Debug mode must be enabled for the console messages to be visible.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to print&lt;br /&gt;
#''abCheckForDuplicates ''- if true, the string won't be printed more than once on screen until it disappears&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ProgLog(string &amp;amp;in asLevel, string &amp;amp;in asMessage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints an entry to the ProgLog (progression log). &amp;lt;br /&amp;gt;ProgLog is a file created in Documents/Amnesia/main (or an FC folder if one is being used). It logs certain events, such us opening the menu or picking up the lantern, as well as the player's state (Health, Sanity, Oil, Tinderboxes, Coins), for the purpose of documenting a tester's playstyle. &amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt;This function allows to log custom messages.The messages in the ProgLog file are sorted by time elapsed since a map was loaded.&lt;br /&gt;
&lt;br /&gt;
ProgLog has to be enabled for a player profile in ''user_settings.cfg''  before it starts working.&lt;br /&gt;
&lt;br /&gt;
#''asLevel ''- can be &amp;quot;Low&amp;quot;, &amp;quot;Medium&amp;quot; or &amp;quot;High&amp;quot;. It's a tag which appears in each log entry, for event prioritising.&lt;br /&gt;
#''asMessage ''- The custom message to be printed to the log.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool ScriptDebugOn();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the debug mode is enabled. &amp;lt;br /&amp;gt;See [[HPL2/Development_Environment|&amp;quot;Setting up Development Environment&amp;quot;]] to setup debug mode on your own computer.&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
{{warning|Regular variables (int, float, etc.) are '''not''' saved by the game. Using them in important parts of yor script will break it upon loading a game save. In HPL, those variables should only be used for disposable counters, like spawning objects in a &amp;quot;for&amp;quot; loop. For variables which need to be saved, use the wrappers as described below.}}&lt;br /&gt;
&lt;br /&gt;
====Local====&lt;br /&gt;
&lt;br /&gt;
Local variables can be used throughout the same script file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetLocalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetLocalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddLocalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetLocalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Global====&lt;br /&gt;
&lt;br /&gt;
Global variables can be used throughout several maps and can be accessed by several script files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetGlobalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetGlobalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddGlobalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetGlobalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Particle Systems===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadParticleSystem(string &amp;amp;in asPSFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asPSFile''  - The particle system file to load. Extension: .ps&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntity(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntityExt(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS,&lt;br /&gt;
float afR, float afG, float afB, float afA, bool abFadeAtDistance, float afFadeMinEnd, float afFadeMinStart,&lt;br /&gt;
float afFadeMaxStart, float afFadeMaxEnd);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity, extended method with more options.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''abFadeAtDistance ''- determines whether a particle system fades from a certain distance on&lt;br /&gt;
#''afFadeMinEnd ''- minimum distance at which the particle system stops fading&lt;br /&gt;
#''afFadeMinStart ''- minimum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxStart ''- maximum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxEnd ''- maximum distance at which the particle system stops fading&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DestroyParticleSystem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Destroys a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - The internal name of the particle system&lt;br /&gt;
&lt;br /&gt;
===Sounds &amp;amp; Music===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadSound(string &amp;amp;in asSoundFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile''  - The sound file to load (extension .snt optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayGuiSound(string &amp;amp;in asSoundFile, float afVolume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays a sound, not using 3D.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile ''- the sound to play (extension .snt/.ogg optional)&lt;br /&gt;
#''afVolume ''- the volume of the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaySoundAtEntity(string &amp;amp;in asSoundName, string &amp;amp;in asSoundFile, string &amp;amp;in asEntity, float afFadeTime, bool abSaveSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a sound at an entity.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''asSoundFile ''- the sound to use (extension .snt optional)&lt;br /&gt;
#''asEntity ''- the entity to create the sound at. Using &amp;quot;Player&amp;quot; is effectively the same as &amp;lt;code&amp;gt;PlayGuiSound&amp;lt;/code&amp;gt;, yet this function allows a looping sound to be saved&lt;br /&gt;
#''afFadeTime ''- time in seconds the sound needs to fade. Avoids enemies hearing the sound if afFadeTime is at least 0.1f&lt;br /&gt;
#''abSaveSound ''- if ''true'', a looping sound will &amp;quot;remember&amp;quot; its playback state (currently playing/stopped), and that state will be restored the next time the level is entered. If ''true'', the sound is never attached to the entity! Note that saving should only be used on ''looping sounds''!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeInSound(string &amp;amp;in asSoundName, float afFadeTime, bool abPlayStart);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades in a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds&lt;br /&gt;
#''abPlayStart ''- Play the sound defined in the &amp;lt;code&amp;gt;&amp;lt;Start&amp;gt;&amp;lt;/code&amp;gt; section of the .snt before playing the main sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopSound(string &amp;amp;in asSoundName, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades out a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds, use 0 to immediately stop the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayMusic(string &amp;amp;in asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays music.&lt;br /&gt;
&lt;br /&gt;
#''asMusicFile ''- the music file to play (extension .ogg optional)&lt;br /&gt;
#''abLoop ''- determines whether a music track should loop&lt;br /&gt;
#''afVolume ''- volume of the music&lt;br /&gt;
#''afFadeTime ''- time in seconds until music reaches full volume&lt;br /&gt;
#''alPrio ''- priority of the music. Note that only the music with the highest priority can be heard! 0 - lowest, 1 - higher, etc.&lt;br /&gt;
#''abResume''  - if ''true'', playback will be continued from where the track stopped after the call to &amp;lt;code&amp;gt;StopMusic()&amp;lt;/code&amp;gt;. If ''false'', the track will be restarted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopMusic(float afFadeTime, int alPrio);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops music.&lt;br /&gt;
&lt;br /&gt;
#''afFadeTime ''- time in seconds until music stops&lt;br /&gt;
#''alPrio ''- the priority of the music that should stop&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice(string &amp;amp;in asVoiceFile, string &amp;amp;in asEffectFile, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry,&lt;br /&gt;
bool abUsePosition, string &amp;amp;in asPosEntity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This adds a voice and an additional sound effect to be played. It is okay to call this many times in order to play many voices in a row. The EffectVoiceOverCallback is not called until ALL voices have finished.&lt;br /&gt;
&lt;br /&gt;
#''asVoiceFile ''- the voice to play&lt;br /&gt;
#''asEffectFile ''- the sound effect to play&lt;br /&gt;
#''asTextCat ''- the category in the .lang file, usually &amp;quot;Voice&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''abUsePosition ''- plays using 3D from the entity, or without 3D&lt;br /&gt;
#''asPosEntity ''- the entity at which the voice and sound are played from&lt;br /&gt;
#''afMinDistance ''- minimum distance the voice and sound are heard&lt;br /&gt;
#''afMaxDistance ''- maximum distance the voice and sound are heard&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopAllEffectVoices(float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all voices and calls the EffectVoiceOverCallback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEffectVoiceActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether EffectVoices are still active.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetEffectVoiceOverCallback(string &amp;amp;in asFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to be called when the EffectVoices are finished. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundVolume(float afDestVolume, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound volume, that means everything you can hear '''from the world'''. This does not affect music of GUI sounds.&lt;br /&gt;
&lt;br /&gt;
#''afDestVolume ''- desired volume&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired volume&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundSpeed(float afDestSpeed, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound speed.&lt;br /&gt;
&lt;br /&gt;
#''afDestSpeed ''- desired speed&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired speed&lt;br /&gt;
&lt;br /&gt;
===Lights===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightVisible(string &amp;amp;in asLightName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables lights.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''abVisible ''- determines the state of the light&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeLightTo(string &amp;amp;in asLightName, float afR, float afG, float afB, float afA, float afRadius, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the properties of a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''afRadius ''- radius of the light. -1 means keeping the radius&lt;br /&gt;
#''afTime ''- time in seconds until change is done&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightFlickerActive(string &amp;amp;in asLightName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates flickering on a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName'' - The internal light name&lt;br /&gt;
#''abActive'' - true = active, false = inactive&lt;br /&gt;
&lt;br /&gt;
==Game scripts==&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartCredits(string &amp;amp;in asMusic, bool abLoopMusic, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alEndNum);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts the end credits screen.&lt;br /&gt;
&lt;br /&gt;
#''asMusic ''- the music to play (including .ogg)&lt;br /&gt;
#''abLoopMusic ''- determines whether the music should loop&lt;br /&gt;
#''asTextCat ''- the category to be used in the .lang file, usually &amp;quot;Ending&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alEndNum ''- Amnesia has 3 different endings and displays a code at the bottom. Determines which code is displayed. 0-2 will display codes, any other integer will not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartDemoEnd();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shows the demo end screen. The background and UI elements are defined in demo.cfg, with the text using the entries in the &amp;quot;Demo&amp;quot; category of the .lang file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AutoSave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an auto save file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CheckPoint(string &amp;amp;in asName, string &amp;amp;in asStartPos, string &amp;amp;in asCallback, string &amp;amp;in asDeathHintCat, string &amp;amp;in asDeathHintEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a checkpoint at which the player will respawn in case he dies. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asName, int alCount)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;Count is 0 on the first checkpoint load!&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the editor&lt;br /&gt;
#''asCallback ''- the function to call when the player dies/respawns&lt;br /&gt;
#''asDeathHintCat ''- the category of the death hint message to be used in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asDeathHintEntry ''- the entry in the .lang file&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeMap(string &amp;amp;in asMapName, string &amp;amp;in asStartPos, string &amp;amp;in asStartSound, string &amp;amp;in asEndSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Loads another map after a 1.5 second fade out.&lt;br /&gt;
&lt;br /&gt;
#''asMapName ''- the file to load&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the next map&lt;br /&gt;
#''asStartSound ''- the sound that is played when the change starts&lt;br /&gt;
#''asEndSound ''- the sound that is played when the new map is loaded&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ClearSavedMaps();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the &amp;quot;history&amp;quot; of the save, useful to do when you know the player will not be able to go back anymore. Makes the next save much smaller in size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateDataCache();&lt;br /&gt;
void DestroyDataCache();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This caches all current textures and models and they are not released until destroy is called. If there is already cached data it is destroyed.&lt;br /&gt;
Create caches to enable faster loading when going back to a map. Destroy the cache if you know the player won't go back to that map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMapDisplayNameEntry(string &amp;amp;in asNameEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the map name shown in save file names. If none is set NULL is assumed.&lt;br /&gt;
&lt;br /&gt;
#''asNameEntry ''- the entry to display, category must be &amp;quot;Levels&amp;quot;!&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the skybox.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxTexture(string &amp;amp;in asTexture);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the texture of the skybox.&lt;br /&gt;
&lt;br /&gt;
#''asTexture''  - The texture file to set. Extension: .dds&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the solid color of the skybox rather than a texture.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the global fog.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the color to use for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogProperties(float afStart, float afEnd, float afFalloffExp, bool abCulling);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the properties for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afStart ''- how many meters from the camera should the fog begin&lt;br /&gt;
#''afEnd ''- how many meters from the camera should the fog reach full thickness&lt;br /&gt;
#''afFalloffExp ''- the amount by which the thinkness increases&lt;br /&gt;
#''abCulling ''- whether occlusion culling is active for the fog; this prevents objects behind the fog from being loaded&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetupLoadScreen(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alRandomNum, string &amp;amp;in asImageFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which loading screen will be shown when changing maps.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category of the loading text in the .lang file to be shown on the loading screen, usually &amp;quot;LoadingText&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alRandomNum ''- if greater 1, then it will randomize between 1 and alRandom for each LoadScreen giving entry the suffix XX (eg 01). If &amp;lt; =1 then no suffix is added&lt;br /&gt;
#''asImageFile ''- the image to be shown (optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void UnlockAchievement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlocks the specified achievement. Only able to be used for the ending achievements.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the achievement. Only the following strings are valid:&lt;br /&gt;
::* Benefactor&lt;br /&gt;
::* Survivor&lt;br /&gt;
::* Sacrifice&lt;br /&gt;
::* Quitter&lt;br /&gt;
::* Egotist&lt;br /&gt;
::* Altruist&lt;br /&gt;
::* Vacillator&lt;br /&gt;
&lt;br /&gt;
===Game Timer===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddTimer(string &amp;amp;in asName, float afTime, string &amp;amp;in asFunction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a timer which calls a function when it expires. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asTimer)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the name of the timer&lt;br /&gt;
#''afTime ''- time in seconds&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveTimer(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a timer, no matter how much time is left.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the timer.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetTimerTimeLeft(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the time left on a timer.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - the internal name of the timer.&lt;br /&gt;
&lt;br /&gt;
===Screen Effects===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeOut(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to black.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen is completly black&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeIn(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen back to normal.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeImageTrailTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies the image trail effect to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeSepiaColorTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the screen go dark red.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0) &lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeRadialBlurTo(float afSize, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies radial blur effects to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afSize ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetRadialBlurStartDist(float afStartDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines at which distance the radial blur effects appear.&lt;br /&gt;
&lt;br /&gt;
#''afStartDist ''- the distance at which the effect starts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectFlash(float afFadeIn, float afWhite, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white.&lt;br /&gt;
&lt;br /&gt;
#''afFadeIn ''- time in seconds until screen is white&lt;br /&gt;
#''afWhite ''- determines to which percentage the screen fades to white (1.0 = completly white)&lt;br /&gt;
#''afFadeOut ''- time in seconds until screen is back to normal again&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectEmotionFlash(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white and shows a text message.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''asSound ''- the sound to play while fading&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetFlashbackIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a flashback is still in effect.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerSpawnPS(string &amp;amp;in asSPSFile);&lt;br /&gt;
void StopPlayerSpawnPS();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Continuously spawn regular particle systems (''.ps'') around the player. Particles created by this script carry over from map to map.&lt;br /&gt;
&lt;br /&gt;
#''asSPSFile''  - the ''.sps''  file to use. Example ''.sps''  files are located in the ''/misc''  folder in the main game directory.&amp;lt;br&amp;gt;Custom ''.sps''  files can be created by hand in a text editor (see existing ones and mimic how those are written). &amp;lt;br /&amp;gt;Since ''StopPlayerSpawnPS()''  doesn't seem to work, to stop an SPS you must create an ''.sps''  file with an empty particle field field and override the old SPS by calling ''StartPlayerSpawnPS''  again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shakes the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity of the shake&lt;br /&gt;
#''afTime ''- duration of the shake&lt;br /&gt;
#''afFadeInTime ''- time in seconds until full intensity is reached&lt;br /&gt;
#''afFadeOutTime ''- time until screen is back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInDarknessEffectsActive(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the sanity drain and night vision effects while in the darkness.&lt;br /&gt;
&lt;br /&gt;
''bool abX''  - Enable/disable effects.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowScreenImage(string &amp;amp;in asImageName, float afX, float afY, float afScale, bool abUseRelativeCoordinates, float afDuration, float afFadeIn, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
Displays an image file directly onto the screen. See [[HPL2/Tutorials/ShowScreenImage()|ShowScreenImage()]] in the tutorials section for more information.&lt;br /&gt;
&lt;br /&gt;
# ''asImageName'' - The image file to render (.jpg, .png, .tga, .dds)&lt;br /&gt;
# ''afX'' - The X position of the image&lt;br /&gt;
# ''afY'' - The Y position of the image&lt;br /&gt;
# ''afScale'' - The size of the image in pixels (not scale), or original image size if negative&lt;br /&gt;
# ''abUseRelativeCoordinates'' - Whether X and Y are relative to the screen resoltion, or pixel co-ordinates if not&lt;br /&gt;
# ''afDuration'' - The duration that the image is displayed for&lt;br /&gt;
# ''afFadeIn'' - The time, in seconds, to fade in the image&lt;br /&gt;
# ''afFadeOut'' - The time, in seconds, to fade out the image&lt;br /&gt;
&lt;br /&gt;
===Insanity===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInsanitySetEnabled(string &amp;amp;in asSet, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which InsanitySets are enabled.&lt;br /&gt;
&lt;br /&gt;
#''asSet ''- the set&lt;br /&gt;
#''abX ''- enabled or not&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartInsanityEvent(string &amp;amp;in asEventName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Starts a specified insanity event.&lt;br /&gt;
&lt;br /&gt;
#''asEventName ''- Insanity event to play.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartRandomInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts a random insanity event from the available sets.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopCurrentInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Stops the currently playing insanity event.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void InsanityEventIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an insanity event is currently in effect.&amp;lt;br&amp;gt;Not useful at all due to having a return type of &amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; when it should be &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Player===&lt;br /&gt;
&lt;br /&gt;
Note that the player's maximum health and sanity is 100.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enabled/Disable player controlled movement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangePlayerStateToNormal();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets the player's state, forcing them to stop interacting with objects. It also clears the inventory item to be used (as if it was double-clicked on in the inventory again) and dismounts the player from ladders.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerCrouching(bool abCrouch);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddPlayerBodyForce(float afX, float afY, float afZ, bool abUseLocalCoords);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pushes the player into a certain direction. Note that you need values above ~2000 to see any effects.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - amount along the X-axis&lt;br /&gt;
#''afY'' - amount along the Y-axis&lt;br /&gt;
#''afZ'' - amount along the Z-axis&lt;br /&gt;
#''abUseLocalCoords'' - If true, axes are based on where the player is facing, not the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowPlayerCrossHairIcons(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the icons when a player has something in focus.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerSanity(float afSanity);&lt;br /&gt;
void AddPlayerSanity(float afSanity);&lt;br /&gt;
float GetPlayerSanity();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerHealth(float afHealth);&lt;br /&gt;
void AddPlayerHealth(float afHealth);&lt;br /&gt;
float GetPlayerHealth();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerLampOil(float afOil);&lt;br /&gt;
void AddPlayerLampOil(float afOil);&lt;br /&gt;
float GetPlayerLampOil();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the lamp oil of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerSpeed();&lt;br /&gt;
float GetPlayerYSpeed();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current speed of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSanityDrainDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables sanity drain from darkness.&lt;br /&gt;
{{bug|Sanity drain is reenabled on loading a save, as the game is unable to load the value properly from the save data.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoost();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a large amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! New Sanity&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || 100&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || 90&lt;br /&gt;
|-&lt;br /&gt;
| 50-74 || 80&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoostSmall();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a small amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! Sanity Bonus&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || +20&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || +15&lt;br /&gt;
|-&lt;br /&gt;
| 50-75 || +10&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityDamage(float afAmount, bool abUseEffect);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount'' - amount of sanity damage done&lt;br /&gt;
#''abUseEffect'' - if a sound is played and screen effects are shown when the sanity damage is dealt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GivePlayerDamage(float afAmount, string &amp;amp;in asType, bool abSpinHead, bool abLethal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the health of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount'' - amount of damage done to health&lt;br /&gt;
#''asType'' - plays a certain effect on the screen when the damage is dealt (BloodSplat, Claws, or Slash) &lt;br /&gt;
#''abSpinHead'' - changes the camera view when damage is dealt&lt;br /&gt;
#''abLethal'' - set to true if player can die from given damage. If ''false'' and the damage would have left the player with less than 10 health, health is set to 10.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerFOVMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the field of view of the player. A shorter FOV will create a zoom effect.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - multiplier of default FOV (1 is default)&lt;br /&gt;
#''afSpeed'' - the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerAspectMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the aspect ratio of the player. Basically stretches or narrows the screen horizontally.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - multiplier of default aspect (default is 1)&lt;br /&gt;
#''afSpeed'' - the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - angle of rotation of head, positive being counter-clockwise&lt;br /&gt;
#''afSpeedMul'' - speed (possibly acceleration) multiplier of the rotation (default 1, which is really slow)&lt;br /&gt;
#''afMaxSpeed'' - maximum speed of rotation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerForward(float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Moves the player forward. It needs to be called in a timer that updates 60 times / second.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- amount along the X-axis&lt;br /&gt;
#''afY ''- amount along the Y-axis&lt;br /&gt;
#''afZ ''- amount along the Z-axis&lt;br /&gt;
#''afSpeed ''- speed at which the change happens&lt;br /&gt;
#''afSlowDownDist ''- distance at which to start slowing down (prevents the head from abruptly stopping)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerLookAt(string &amp;amp;in asEntityName, float afSpeedMul, float afMaxSpeed, string &amp;amp;in asAtTargetCallback);&lt;br /&gt;
void StopPlayerLookAt();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to look at a certain entity until StopPlayerLookAt is used.&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- the entity to look at &lt;br /&gt;
#''afSpeedMul ''- how fast should the player look at the entity&lt;br /&gt;
#''afMaxSpeed ''- maximum speed allowed&lt;br /&gt;
#''asAtTargetCallback ''- function to call when player looks at target&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerMoveSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerRunSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerLookSpeedMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the player's move/run/look speed. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpForceMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the player's jump multiplier. Higher values = higher jumps. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpDisabled(bool abX);&lt;br /&gt;
void SetPlayerCrouchDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to jump/crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportPlayer(string &amp;amp;in asStartPosName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly teleports the player to the target StartPos.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternActive(bool abX, bool abUseEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the player use his lantern.&lt;br /&gt;
&lt;br /&gt;
# ''abX'' - Set lantern to be active (true) or inactive (false)&lt;br /&gt;
# ''abUseEffects'' - Play on/off sounds&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetLanternActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player is currently using the lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to use the lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternLitCallback(string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to call when the player uses the lantern. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;MyFunc(bool abLit)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message on the screen.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory'' - the category in the .lang file&lt;br /&gt;
#''asTextEntry'' - the entry in the .lang file&lt;br /&gt;
#''afTime'' - determines how long the message is displayed. If time is &amp;lt; =0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetDeathHint(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the message that appears when the player dies.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory'' - the category in the .lang file&lt;br /&gt;
#''asTextEntry'' - the entry in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DisableDeathStartSound();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the death sound when the player dies. This must be called directly before player is killed! The variable as soon as player dies too.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPermaDeathSound(string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Sets the sound played after the player dies when permadeath is active. Permadeath is only active when the game is launched with the &amp;lt;code&amp;gt;ptest&amp;lt;/code&amp;gt; command line parameter. Only used for the post-death Suitor lines in ''Justine''.&lt;br /&gt;
&lt;br /&gt;
#''asSound'' - The sound to be played after death. Expects a voice-type sound.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerFallDamageDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the player's ability to take fall damage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPos(float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the player's position within the level.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - X co-ordinate position.&lt;br /&gt;
#''afY'' - Y co-ordinate position.&lt;br /&gt;
#''afZ'' - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerPosX();&lt;br /&gt;
float GetPlayerPosY();&lt;br /&gt;
float GetPlayerPosZ();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the player's position within the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
===Journal===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddNote(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a note to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _Name and _Text and be in category &amp;quot;Journal&amp;quot;!&lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDiary(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a diary to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _NameX and _TextY whereas X and Y are numbers of the parts (_Name1: first diary, _Text1: first page) and be in category &amp;quot;Journal&amp;quot;! &lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ReturnOpenJournal(bool abOpenJournal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Only called in the pickup diary callback! If true the journal displays the entry else not.&lt;br /&gt;
&lt;br /&gt;
===Quests===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a quest to the player's journal under mementos. Completed quests cannot be readded.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name to be used&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot;Quest_&amp;lt;texthere&amp;gt;_Text”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CompleteQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Completes a quest. If the quest has not been added, it's marked as complete anyway, preventing it from being added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot; Quest_&amp;lt;texthere&amp;gt;_Text ”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool QuestIsCompleted(string &amp;amp;in asName);&lt;br /&gt;
bool QuestIsAdded(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a quest is completed/added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetNumberOfQuestsInMap(int alNumberOfQuests);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the number of quests in the map. Obsolete; formerly used to calculate a completion percentage when looking at a level door.&lt;br /&gt;
&lt;br /&gt;
#''alNumberOfQuests ''- Amount of quests&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveHint(string &amp;amp;in asName, string &amp;amp;in asMessageCat, string &amp;amp;in asMessageEntry, float afTimeShown);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a hint on the player's screen.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asMessageCat ''- the category in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asMessageEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTimeShown ''- time in seconds until the message disappears. If time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void BlockHint(string &amp;amp;in asName);&lt;br /&gt;
void UnBlockHint(string &amp;amp;in asName);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Blocking a hint prevents it from being shown. Blocked hints are included in savefiles, so they should persist between levels. Unblocking a hint allows it to be shown.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; blocks the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveHint(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes the hint from the list of already shown hints, allowing it to appear again.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; reenables the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
===Inventory===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ExitInventory();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Exits the inventory by force.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the player's ability to open his inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a message on the inventory screen. Used for feedback messages when failing to combine items.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory ''- the category in the .lang file, usually &amp;quot;Inventory&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTime ''- time in seconds until the message disappears. If life time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItem(string &amp;amp;in asName, string &amp;amp;in asType, string &amp;amp;in asSubTypeName, string &amp;amp;in asImageName, float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds an item to the inventory of the player. Note that the item does not have to exist as entity in the world to be able to do this.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asType ''- item type to give, Available types are:&lt;br /&gt;
::*Puzzle&lt;br /&gt;
::*Lantern&lt;br /&gt;
::*Health&lt;br /&gt;
::*Sanity&lt;br /&gt;
::*LampOil&lt;br /&gt;
::*Tinderbox&lt;br /&gt;
#''asSubTypeName ''- item name for .lang file&lt;br /&gt;
#''asImageName ''- the image which will appear in inventory. For example: &amp;lt;code&amp;gt;void GiveItem(&amp;quot;chemical_container_full_1&amp;quot;, &amp;quot;Puzzle&amp;quot;, &amp;quot;chemical_container_full&amp;quot;, &amp;quot;chemical_container_full.tga&amp;quot;, 1);&amp;lt;/code&amp;gt; will use the image from &amp;lt;code&amp;gt;graphics/item/chemical_container_full.tga&amp;lt;/code&amp;gt; &lt;br /&gt;
#''afAmount ''- amount the item gives, - For example: Oil potions will fill the oil meter by this amount, Health potions will heal by this amount, etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item from the player's inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool HasItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player has an item in his inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItemFromFile(string &amp;amp;in asName, string &amp;amp;in asFileName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a single item to the player's inventory. This is meant to be used for debug mostly as it creates the actual item and then destroys it.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asFileName ''- item to give + extension (.ent)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddCombineCallback(string &amp;amp;in asName, string &amp;amp;in asItemA, string &amp;amp;in asItemB, string &amp;amp;in asFunction, bool abAutoRemove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to combine items in his inventory. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItemA, string &amp;amp;in asItemB)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name for the callback&lt;br /&gt;
#''asItemA ''- internal name of first item&lt;br /&gt;
#''asItemB ''- internal name of second item&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
#''abAutoRemove ''- determines whether the callback should be removed when the items are combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveCombineCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a combine callback.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the callback to be removed (as specified in AddCombineCallback)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddUseItemCallback(string &amp;amp;in asName, string &amp;amp;in asItem, string &amp;amp;in asEntity, string &amp;amp;in asFunction, bool abAutoDestroy);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to use items on the world. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItem, string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
#''asItem ''- internal name of the item&lt;br /&gt;
#''asEntity ''- entity to be able to use the item on&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abAutoDestroy ''- determines whether the callback should be removed when the item is used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveUseItemCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item callback.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
&lt;br /&gt;
===Entities===&lt;br /&gt;
&lt;br /&gt;
====General====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityActive(string &amp;amp;in asName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityVisible(string &amp;amp;in asName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity's visual mesh. The collision body remains.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the entity.&lt;br /&gt;
#''abActive''  - Activate/deactivate mesh.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntityExists(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an entity exists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCustomFocusCrossHair(string &amp;amp;in asName, string&amp;amp; asCrossHair);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the crosshair that is used when focusing an entity.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCrossHair ''- desired crosshair, can be: &lt;br /&gt;
::*Default (no crosshair)&lt;br /&gt;
::*Grab&lt;br /&gt;
::*Push&lt;br /&gt;
::*Ignite&lt;br /&gt;
::*Pick&lt;br /&gt;
::*LevelDoor&lt;br /&gt;
::*Ladder&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void CreateEntityAtArea(string &amp;amp;in asEntityName, string &amp;amp;in asEntityFile, string &amp;amp;in asAreaName, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an entity at an area. When creating an enemy though, it cannot chase properly along PathNodes (using for example &amp;lt;code&amp;gt;ShowEnemyPlayerPosition&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- internal name&lt;br /&gt;
#''asEntityFile ''- entity to be used extension .ent&lt;br /&gt;
#''asAreaName ''- the area to create the entity at&lt;br /&gt;
#''abFullGameSave ''- determines whether an entity &amp;quot;remembers&amp;quot; its state&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ReplaceEntity(string &amp;amp;in asName, string &amp;amp;in asBodyName, string &amp;amp;in asNewEntityName, string &amp;amp;in asNewEntityFile, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Removes an entity and places a new one in its place.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to replace.&lt;br /&gt;
#''asBodyName'' - Name of the body of the entity to place the new entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''asNewEntityName'' - Name of the new entity.&lt;br /&gt;
#''asNewEntityFile'' - Name of the new entity file. Extension .ent. &lt;br /&gt;
#''abFullGameSave'' - Whether ALL properties of this entity should be saved throughout levels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaceEntityAtEntity(string &amp;amp;in asName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBodyName, bool abUseRotation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Places an entity at the position of another entity. Does not work for enemies, use TeleportEnemyToEntity instead.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to place.&lt;br /&gt;
#''asTargetEntity'' - Name of the other entity to place the first entity at.&lt;br /&gt;
#''asTargetBodyName'' - Name of the body of the entity to place the first entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''abUseRotation'' - Whether the entity should be rotated like the target entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPos(string &amp;amp;in asName, float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Moves an entity to a position in the level.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to move.&lt;br /&gt;
#''afX'' - X co-ordinate position.&lt;br /&gt;
#''afY'' - Y co-ordinate position.&lt;br /&gt;
#''afZ'' - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetEntityPosX(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosY(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosZ(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns an entity's position in the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerLookAtCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveWhenLookedAt);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player looks at a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = looking, -1 = not looking&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveWhenLookedAt ''- determines whether the callback should be removed when the player looked at the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerInteractCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveOnInteraction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player interacts with a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveOnInteraction ''- determines whether the callback should be removed when the player interacts with the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCallbackFunc(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when certain events occur with an entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, string &amp;amp;in asType)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;asType&amp;lt;/code&amp;gt; values depend on entity type:&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! asType Value&lt;br /&gt;
|-&lt;br /&gt;
| Object || Break&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || OnIgnite&lt;br /&gt;
|-&lt;br /&gt;
| Item || OnPickup&lt;br /&gt;
|-&lt;br /&gt;
| Enemy || OnDeath&lt;br /&gt;
|-&lt;br /&gt;
| Enemy_Grunt&amp;lt;br&amp;gt;Enemy_Manpig || OnAutoDisabled&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityConnectionStateChangeCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A callback called when ever the connection state changes (button being switched on, lever switched, etc). &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void Func(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: -1 = off, 0 = between, 1 = on&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityInteractionDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disallows interaction with an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void BreakJoint (string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Breaks a joint. Do not use this on joints in SwingDoors, Levers, Wheels, etc. where the joint is part of an interaction. That will make the game crash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void AddEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName, string &amp;amp;in asFunction, bool abDeleteOnCollide, int alStates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when two entities collide. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asParent, string &amp;amp;in asChild, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = enter, -1 = leave&lt;br /&gt;
&lt;br /&gt;
#''asParentName ''- internal name of main object&lt;br /&gt;
#''asChildName ''- internal name of object that collides with main object (asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) NOT supported!)&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abDeleteOnCollide ''- determines whether the callback after it was called&lt;br /&gt;
#''alStates ''- 1 = only enter, -1 = only leave, 0 = both&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an EntityCollideCallback. Asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) not supported in ''asChildName''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntitiesCollide(string &amp;amp;in asEntityA, string &amp;amp;in asEntityB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether two entities collide. This function does NOT support asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) or &amp;quot;Player&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetBodyMass(string &amp;amp;in asName, float afMass);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName.&lt;br /&gt;
#''afMass''  - The mass to set.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetBodyMass(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName. &lt;br /&gt;
#''afMass''  - The mass to get.&lt;br /&gt;
&lt;br /&gt;
====Props====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropEffectActive(string &amp;amp;in asName, bool abActive, bool abFadeAndPlaySounds);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Can be used on coal to give it the black color it should have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropActiveAndFade(string &amp;amp;in asName, bool abActive, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates a prop.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''abActive ''- nothing to add&lt;br /&gt;
#''afFadeTime ''- time in seconds until prop fully fades&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropStaticPhysics(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates the physics of a prop, setting the mass to 0. Setting as true will make entities static in midair.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetPropIsInteractedWith(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a prop is interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RotatePropToSpeed(string &amp;amp;in asName, float afAcc, float afGoalSpeed, float afAxisX, float afAxisY, float afAxisZ, bool abResetSpeed, string &amp;amp;in asOffsetArea);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the prop up to a set speed.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afGoalSpeed ''- desired speed &lt;br /&gt;
#''afAxisX ''- rotation around X axis&lt;br /&gt;
#''afAxisY ''- rotation around Y axis&lt;br /&gt;
#''afAxisZ ''- rotation around Z axis&lt;br /&gt;
#''abResetSpeed ''- determines whether the speed is resetted after goal speed is reached&lt;br /&gt;
#''asOffsetArea ''- the area to rotate around, if empty, then the center of the body is used Note: The entity you want to rotate MUST be a &amp;quot;StaticObject&amp;quot; entity!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void StopPropMovement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all movement of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddAttachedPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop.&lt;br /&gt;
&lt;br /&gt;
#''asPropName''- the prop to attach another prop at &lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop&lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
{{bug|''afRotZ '' is used for both the ZX rotation and the Z position of the attached prop. Unwanted rotation can be avoided by using: &amp;lt;br /&amp;gt;''AddAttachedPropToProp(asPropName, asAttachName, asAttachFile, afPosX, afPosY, '''0''', afPosZ, '''90.0f''', afPosZ)''}}&lt;br /&gt;
&lt;br /&gt;
{{bug|Attaching a breakable prop to a physically active prop, and then breaking the attached prop, will cause the game to crash, should the parent object be moved or reset.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop. Fixed version of &amp;lt;code&amp;gt;AddAttachedPropToProp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
#''asPropName ''- the prop to attach another prop at&lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop &lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveAttachedPropFromProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches a prop from a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
void AddPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
float GetPropHealth(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ResetProp(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets a prop's state to the original one when the map was loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void PlayPropAnimation(string &amp;amp;in asProp, string &amp;amp;in asAnimation, float afFadeTime, bool abLoop, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the prop play an animation and calls a function. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asProp)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asProp ''- internal name of the prop&lt;br /&gt;
#''asAnimation ''- animation to play&lt;br /&gt;
#''afFadeTime ''- Fade time between current and new animations&lt;br /&gt;
#''abLoop ''- determines whether the animation loops &lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddPropForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddPropImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These functions push objects. Note that rather high values are needed when applying ''forces''  (on the order of ~100 (weak) to ~10000 (strong)), but not impulses (values less than 10 can be appropriate). Forces are external influences, and will have different effect depending on the mass of the object they are being applied to; impulses disregard mass, and can cause objects to break, as if hit. A &amp;quot;Body&amp;quot; is a physics-related helper object, to which a force or an impulse can be applied. Entities can consist of several bodies, interconnected in various ways (you can create/examine bodies in the model editor).&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the object to push; for bodies, use this format: &amp;quot;''entityName''_''bodyName''&amp;quot;&lt;br /&gt;
#''afX ''- magnitude along the X-axis&lt;br /&gt;
#''afY ''- magnitude along the Y-axis&lt;br /&gt;
#''afZ ''- magnitude along the Z-axis&lt;br /&gt;
#''asCoordSystem ''- determines which coordinate system is used, &amp;quot;local&amp;quot; or &amp;quot;world&amp;quot;&lt;br /&gt;
&lt;br /&gt;
All of these functions are ''additive''  - when called consecutively, for each call, the vectors defined by (afX, afY, afZ) will be added together, and a resultant force/impulse will be calculated ''before''  any physics simulation is applied to the target object.&lt;br /&gt;
&lt;br /&gt;
====Connections====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithRope(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asRopeName, bool abInteractOnly, float afSpeedMul, float afToMinSpeed, float afToMaxSpeed, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects a prop with the movement of a rope (i.e. turn a wheel to move a rope). For Levers, the rope only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName''- The name of the connection&lt;br /&gt;
#''asPropName'' - The name of the prop; can be a Lever or Wheel&lt;br /&gt;
#''asRopeName'' - The name of the rope&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''afSpeedMul'' - Speed multiplier of how quickly the rope moves&lt;br /&gt;
#''afToMinSpeed'' - The slowest the rope can move&lt;br /&gt;
#''afToMaxSpeed'' - The fastest the rope can move&lt;br /&gt;
#''abInvert'' - Whether to invert the direction the rope moves&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithMoveObject(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asMoveObjectName, bool abInteractOnly, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This one should only be used if there must be an exact correspondence to prop &amp;quot;amount&amp;quot; and the MoveObject open amount. It is best used for Wheel-door connections, where the MoveObject moves continuously along with the Wheel. For Levers, the MoveObject only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asPropName'' - The entity that controls the movement; can be a Lever or Wheel&lt;br /&gt;
#''asMoveObject'' - The MoveObject to move&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''abInvert'' - If the state is inverted, making the MoveObject move in the opposite direction&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ConnectEntities(string &amp;amp;in asName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, bool abInvertStateSent, int alStatesUsed, string &amp;amp;in asCallbackFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects two entities together so that changing the state of the main entity changes the state of the connected entity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! Max State (1) !! Min State (-1)&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || Lit || Unlit&lt;br /&gt;
|-&lt;br /&gt;
| MoveObject || Open || Close&lt;br /&gt;
|-&lt;br /&gt;
| SwingDoor&lt;br /&gt;
|rowspan=2| Locked&lt;br /&gt;
|rowspan=2| Unlocked&lt;br /&gt;
|-&lt;br /&gt;
| Chest&lt;br /&gt;
|-&lt;br /&gt;
| Button || Switched on || Switched off&lt;br /&gt;
|-&lt;br /&gt;
| Lever&lt;br /&gt;
|rowspan=2| Unstuck&lt;br /&gt;
|rowspan=2| Stuck (at min)&lt;br /&gt;
|-&lt;br /&gt;
| Wheel&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asMainEntity'' - The entity that causes the change; can be a Lever, Wheel, Button, or Photocell&lt;br /&gt;
#''asConnectEntity'' - The entity that is affected by the change&lt;br /&gt;
#''abInvertStateSent'' - If the state is inverted, making the connected entity change to the opposite state&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
#''asCallbackFunc'' - The name of the connection callback&lt;br /&gt;
&lt;br /&gt;
Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asConnectionName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, int alState)&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;alState is what is sent to connection entity and will be inverted if abInvertStateSent = true!&lt;br /&gt;
&lt;br /&gt;
====Lamps====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLampLit(string &amp;amp;in asName, bool abLit, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Turns a lamp on or off.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the lamp&lt;br /&gt;
#''abLit ''- Set true if you want the lamp to be lit, set to false if you want the lamp to be unlit&lt;br /&gt;
#''abEffects ''- If you want to have the lamp fade in/out when it gets lit/unlit&lt;br /&gt;
&lt;br /&gt;
====Doors====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorLocked(string &amp;amp;in asName, bool abLocked, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abLocked'' - Locked/unlocked&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is locked/unlocked&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorClosed(string &amp;amp;in asName, bool abClosed, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abClosed'' - Closed/open&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is closed/opened&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
bool GetSwingDoorLocked(string &amp;amp;in asName);&lt;br /&gt;
bool GetSwingDoorClosed(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a swing door is locked/closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorDisableAutoClose(string &amp;amp;in asName, bool abDisableAutoClose);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deactivates the &amp;quot;auto-close&amp;quot; when a door is nearly closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetSwingDoorState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns an integer depending on how far the door is opened. &amp;lt;br /&amp;gt;-1 = angle is close to 0°, 1 = angle is 70% or higher of max, 0 = inbetween -1 and 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLocked(string &amp;amp;in asName, bool abLocked);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a level door. Note that level doors are NOT swing doors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedSound(string &amp;amp;in asName, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which sound is played when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedText(string &amp;amp;in asName, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectState(string &amp;amp;in asName, float afState);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween (and above, for example, the bridge_metal_vert) are valid too!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectStateExt(string &amp;amp;in asName, float afState, float afAcc, float afMaxSpeed, float afSlowdownDist, bool abResetSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state, extended method.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween are valid too!&lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afMaxSpeed ''- maximum speed&lt;br /&gt;
#''afSlowdownDist ''- Distance to the target state before deceleration occurs.&lt;br /&gt;
#''abResetSpeed ''- Set to ''true'' if the prop's speed should be reset before performing the movement, else the prop will accelerate from its current speed to afMaxSpeed.&lt;br /&gt;
&lt;br /&gt;
====Levers, wheels and buttons====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropObjectStuckState(string &amp;amp;in asName, int alState);&lt;br /&gt;
void SetWheelStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
void SetLeverStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes an object/wheel/lever stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name&lt;br /&gt;
#''alState'' - 0 = not stuck, 1 = at max, -1 = at min &lt;br /&gt;
#''abEffects'' - play sound effects&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelAngle(string &amp;amp;in asName, float afAngle, bool abAutoMove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves a wheel to a certain angle.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name&lt;br /&gt;
#''afAngle'' - angle&lt;br /&gt;
#''abAutoMove'' - determines whether the wheel should move on its own&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
void SetLeverInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to make a wheel/lever unstuck when interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetLeverState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the state of the lever. &amp;lt;br /&amp;gt;0 = not stuck, 1 = at max, -1 = at min&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderStuckState(string &amp;amp;in asName, int alStuckState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes a MultiSlider stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when state changes. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetButtonSwitchedOn(string &amp;amp;in asName, bool abSwitchedOn, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Sticky areas====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetAllowStickyAreaAttachment(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows entities to stick to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asProp);&lt;br /&gt;
void AttachBodyToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asBody);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop/body to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void DetachFromStickyArea(string &amp;amp;in asAreaName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches everything from a StickyArea.&lt;br /&gt;
&lt;br /&gt;
====NPCs====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCAwake(string &amp;amp;in asName, bool abAwake, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wakes/sleeps a NPC.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the NPC&lt;br /&gt;
#''abAwake'' - ''true'' to awaken, ''false'' to sleep&lt;br /&gt;
#''abEffects'' - Play the &amp;quot;Awake&amp;quot; or &amp;quot;Sleep&amp;quot; animations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCFollowPlayer(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a NPC's head to follow the player's movements.&lt;br /&gt;
&lt;br /&gt;
====Enemies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables an enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyIsHallucination(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes an enemy a hallucination. Hallucinations fade to smoke when they get near the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void FadeEnemyToSmoke(string &amp;amp;in asName, bool abPlaySound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly fades an enemy to smoke.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ShowEnemyPlayerPosition(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the enemy run to the player, no matter where he is.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AlertEnemyOfPlayerPresence(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gives the specified enemy the player's current position and makes it search the area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisableTriggers(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables or disables enemy triggers. If disabled, enemy will not react to player or attack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddEnemyPatrolNode(string &amp;amp;in asName, string &amp;amp;in asNodeName, float afWaitTime, string &amp;amp;in asAnimation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a patrol node to the enemy's path.&lt;br /&gt;
&lt;br /&gt;
#''asName''- Internal name of the enemy &lt;br /&gt;
#''asNodeName'' - Path node &lt;br /&gt;
#''afWaitTime'' - Time in seconds that the enemy waits at the path node before continuing. If 0, randomized between 1-3.&lt;br /&gt;
#''asAnimation'' - The animation the enemy uses when reaching the path node&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ClearEnemyPatrolNodes(string &amp;amp;in asEnemyName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the current path of patrol nodes of the enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemySanityDecreaseActive(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether an enemy activates the player's sanity drain when stared at.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy &lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToNode(string &amp;amp;in asEnemyName, string &amp;amp;in asNodeName, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific PathNode.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asNodeName'' - Internal name of the node to teleport to &lt;br /&gt;
#''abChangeY'' - Whether the Y position of the node will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToEntity(string &amp;amp;in asEnemyName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBody, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific entity.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asTargetEntity'' - Internal name of the entity to teleport to&lt;br /&gt;
#''asTargetBody'' - Internal name of the entity's body name to teleport to. If empty, the first body will be used (might be unstable, recommended to input a body anyway)&lt;br /&gt;
#''abChangeY'' - Whether the Y position of the entity will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeManPigPose(string &amp;amp;in asName, string &amp;amp;in asPoseType);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the pose a specified ManPig.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''asPoseType'' - Name of the ManPig pose to use. Can be &amp;quot;Biped&amp;quot; or &amp;quot;Quadruped&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigFadeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should fade the player's view in and out.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigSoundDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should play the proximity sounds.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigEasyEscapeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should be easier to escape from when hunted. If not disabled, easy escape is activated if the player is more than 12.35 meters away, the enemy can't see the player, and the player has less than 75 health. When this occurs, the enemy is forced to stop hunting and wait for half a second.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ForceTeslaPigSighting(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Forces a Tesla ManPig to be visible for a short time.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; GetEnemyStateName(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the name of the state a specified enemy is current in.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
Possible states for all enemies:&lt;br /&gt;
*Idle&lt;br /&gt;
*Wait&lt;br /&gt;
*Patrol&lt;br /&gt;
*Investigate&lt;br /&gt;
*Alert&lt;br /&gt;
*Search&lt;br /&gt;
*Hurt&lt;br /&gt;
*Hunt&lt;br /&gt;
*HuntPause&lt;br /&gt;
*HuntWander&lt;br /&gt;
*AttackMeleeShort&lt;br /&gt;
*AttackMeleeLong&lt;br /&gt;
*BreakDoor&lt;br /&gt;
*Dead&lt;br /&gt;
&lt;br /&gt;
Waterlurker-only states:&lt;br /&gt;
*GoHome&lt;br /&gt;
*Eat&lt;br /&gt;
&lt;br /&gt;
ManPig-only states: &lt;br /&gt;
*Flee&lt;br /&gt;
*Stalk&lt;br /&gt;
*Track&lt;br /&gt;
&lt;br /&gt;
Unused states:&lt;br /&gt;
*AttackRange&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=Audacity&amp;diff=7017</id>
		<title>Audacity</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=Audacity&amp;diff=7017"/>
		<updated>2025-09-05T04:05:41Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Reverb settings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Audacity =&lt;br /&gt;
&lt;br /&gt;
[https://www.audacityteam.org/ Audacity] is a free and open-source audio editor. It is great for simple audio edits and applying effects.&lt;br /&gt;
&lt;br /&gt;
== Flashback Voice Effect ==&lt;br /&gt;
&lt;br /&gt;
Audacity can be used to create the flashback voice effect from the original Amnesia game. This effect can be achieved with the following steps:&lt;br /&gt;
&lt;br /&gt;
# Effect &amp;gt; Reverse (This reverses the audio back in time). &lt;br /&gt;
# Use a reverb effect of your choice. Make sure to not make it too strong, as it might overwhelm the actual speech.&lt;br /&gt;
# Effect &amp;gt; Reverse.&lt;br /&gt;
&lt;br /&gt;
===Reverb settings===&lt;br /&gt;
* Effect &amp;gt; Reverb:&lt;br /&gt;
**Room Size: 10&lt;br /&gt;
**Pre-delay: 10&lt;br /&gt;
**Reverberance: 40&lt;br /&gt;
**Damping: 0&lt;br /&gt;
**Tone Low: 100&lt;br /&gt;
**Tone High: 100&lt;br /&gt;
**Wet Gain: -1&lt;br /&gt;
**Dry Gain: 0&lt;br /&gt;
**Stereo Width: 100&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{warning|GVerb is only available in older versions of Audacity. It was able to be readded for a time with a plugin, though it appears it's no longer compatible with more recent versions.}}&lt;br /&gt;
* Effect &amp;gt; GVerb:&lt;br /&gt;
**Roomsize: 10&lt;br /&gt;
**Reverb time: 0.75&lt;br /&gt;
**Damping: 0&lt;br /&gt;
**Input bandwidth: 1&lt;br /&gt;
**Dry signal level: 0&lt;br /&gt;
**Early reflection level: -15&lt;br /&gt;
**Tail level: -17.5&lt;br /&gt;
&lt;br /&gt;
== Convert to OGG format ==&lt;br /&gt;
OGG format is the recommended format for audio files for HPL, and Audacity comes with support for exporting in OGG.  &lt;br /&gt;
&lt;br /&gt;
If you need to convert an MP3 (or any other audio), simply import (or open) an audio file into Audacity, then click on ''File &amp;gt; Export'' and choose OGG Vorbis for the file type.&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=7016</id>
		<title>HPL2/Engine Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=7016"/>
		<updated>2025-08-29T06:32:58Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Player */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TocRight}}&lt;br /&gt;
&lt;br /&gt;
This page documents all scripts available in Amnesia: The Dark Descent.&lt;br /&gt;
&lt;br /&gt;
{{note|'''Note''': Some of the functions require the Amnesia 1.3 or 1.5 update. Steam and other online store copies should be automatically updated. Other copies can get 1.3 [http://www.frictionalgames.com/forum/thread-24334.html here].}}&lt;br /&gt;
&lt;br /&gt;
== Directives ==&lt;br /&gt;
&lt;br /&gt;
First off, &amp;lt;code&amp;gt;#include &amp;quot;file.hps&amp;quot;&amp;lt;/code&amp;gt; can be used to programmatically merge together multiple separate files to make organizing scripts easier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
==Engine scripts==&lt;br /&gt;
===Main===&lt;br /&gt;
&lt;br /&gt;
The following functions are the main hps functions that the HPL2 engine looks to run on certain events - similar to the C++ int main() function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void OnStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the map is loaded for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnEnter();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs whenever the player enters a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnLeave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the player leaves a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnGameStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is found in the global.hps file and the inventory.hps file, and is run when the game is first started by the player (ie via &amp;quot;Start New Game&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnUpdate(float afStep);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
This function is executed for every game update or &amp;quot;tick&amp;quot;. Can be used for rapid-firing updates instead of looping timers. Keep in mind that this can affect game performance if not used with care.&lt;br /&gt;
&lt;br /&gt;
#''afStep''- Time elapsed in seconds since the last frame. Multiply speeds, distances etc. by this argument to avoid framerate dependence issues (for example: if you move something in this function with constant speed, it will move faster on computers which run the game with high FPS and slower on computers with low FPS).&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float RandFloat(float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random float.&lt;br /&gt;
&lt;br /&gt;
#''afMin ''- minimum value&lt;br /&gt;
#''afMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int RandInt(int alMin, int alMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random int. Note: the maximum value is ''inclusive''  - the RandInt() function may return this value.&lt;br /&gt;
&lt;br /&gt;
#''alMin ''- minimum value&lt;br /&gt;
#''alMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringContains(string &amp;amp;in asString, string &amp;amp;in asSubString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a string contains the specified string. &amp;lt;br /&amp;gt;Example: searching for &amp;quot;hello&amp;quot; in &amp;quot;hello world&amp;quot; would return '''true'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to check&lt;br /&gt;
#''asSubString ''- the string to search for&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; StringSub(string &amp;amp;in asString, int alStart, int alCount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the substring in a string. &amp;lt;br /&amp;gt;Example: in the string &amp;quot;frictional games rocks&amp;quot;, using 4 as ''alStart''  and 6 as ''alCount''  would return '''&amp;quot;tional&amp;quot;'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string&lt;br /&gt;
#''alStart ''- start position in the string&lt;br /&gt;
#''alCount ''- amount of characters&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int StringToInt(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns an integer converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float StringToFloat(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a float converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringToBool(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a boolean converted from a string, else returns false.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&lt;br /&gt;
===Mathematical Operations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathCos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathTan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAsin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAcos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan2(float afX, float afY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Calculates and returns the arc tangent of the specified values.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - First value to operate.&lt;br /&gt;
#''afY''  - Second value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSqrt(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the square root of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathPow(float afBase, float afExp);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the value of afBase raised to the power of afExp.&lt;br /&gt;
&lt;br /&gt;
#''afBase''  - The base value.&lt;br /&gt;
#''afExp''  - Value to calculate the base with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMin(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the lowest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMax(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the highest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathClamp(float afX, float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns afX clamped between afMin and afMax. If afX &amp;lt; afMin, returns afMin, and if afX &amp;gt; afMax, returns afMax.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - The value to clamp.&lt;br /&gt;
#''afMin''  - The minimum value to clamp afX with.&lt;br /&gt;
#''afMax''  - The maximum value to clamp afX with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAbs(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the absolute value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&lt;br /&gt;
===Debugging===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void Print(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a string to the log file (''hpl.log'').&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDebugMessage(string &amp;amp;in asString, bool abCheckForDuplicates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a line of text to the debug console at the bottom left of the screen. Debug mode must be enabled for the console messages to be visible.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to print&lt;br /&gt;
#''abCheckForDuplicates ''- if true, the string won't be printed more than once on screen until it disappears&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ProgLog(string &amp;amp;in asLevel, string &amp;amp;in asMessage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints an entry to the ProgLog (progression log). &amp;lt;br /&amp;gt;ProgLog is a file created in Documents/Amnesia/main (or an FC folder if one is being used). It logs certain events, such us opening the menu or picking up the lantern, as well as the player's state (Health, Sanity, Oil, Tinderboxes, Coins), for the purpose of documenting a tester's playstyle. &amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt;This function allows to log custom messages.The messages in the ProgLog file are sorted by time elapsed since a map was loaded.&lt;br /&gt;
&lt;br /&gt;
ProgLog has to be enabled for a player profile in ''user_settings.cfg''  before it starts working.&lt;br /&gt;
&lt;br /&gt;
#''asLevel ''- can be &amp;quot;Low&amp;quot;, &amp;quot;Medium&amp;quot; or &amp;quot;High&amp;quot;. It's a tag which appears in each log entry, for event prioritising.&lt;br /&gt;
#''asMessage ''- The custom message to be printed to the log.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool ScriptDebugOn();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the debug mode is enabled. &amp;lt;br /&amp;gt;See [[HPL2/Development_Environment|&amp;quot;Setting up Development Environment&amp;quot;]] to setup debug mode on your own computer.&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
{{warning|Regular variables (int, float, etc.) are '''not''' saved by the game. Using them in important parts of yor script will break it upon loading a game save. In HPL, those variables should only be used for disposable counters, like spawning objects in a &amp;quot;for&amp;quot; loop. For variables which need to be saved, use the wrappers as described below.}}&lt;br /&gt;
&lt;br /&gt;
====Local====&lt;br /&gt;
&lt;br /&gt;
Local variables can be used throughout the same script file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetLocalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetLocalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddLocalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetLocalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Global====&lt;br /&gt;
&lt;br /&gt;
Global variables can be used throughout several maps and can be accessed by several script files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetGlobalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetGlobalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddGlobalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetGlobalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Particle Systems===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadParticleSystem(string &amp;amp;in asPSFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asPSFile''  - The particle system file to load. Extension: .ps&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntity(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntityExt(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS,&lt;br /&gt;
float afR, float afG, float afB, float afA, bool abFadeAtDistance, float afFadeMinEnd, float afFadeMinStart,&lt;br /&gt;
float afFadeMaxStart, float afFadeMaxEnd);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity, extended method with more options.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''abFadeAtDistance ''- determines whether a particle system fades from a certain distance on&lt;br /&gt;
#''afFadeMinEnd ''- minimum distance at which the particle system stops fading&lt;br /&gt;
#''afFadeMinStart ''- minimum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxStart ''- maximum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxEnd ''- maximum distance at which the particle system stops fading&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DestroyParticleSystem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Destroys a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - The internal name of the particle system&lt;br /&gt;
&lt;br /&gt;
===Sounds &amp;amp; Music===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadSound(string &amp;amp;in asSoundFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile''  - The sound file to load (extension .snt optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayGuiSound(string &amp;amp;in asSoundFile, float afVolume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays a sound, not using 3D.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile ''- the sound to play (extension .snt/.ogg optional)&lt;br /&gt;
#''afVolume ''- the volume of the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaySoundAtEntity(string &amp;amp;in asSoundName, string &amp;amp;in asSoundFile, string &amp;amp;in asEntity, float afFadeTime, bool abSaveSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a sound at an entity.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''asSoundFile ''- the sound to use (extension .snt optional)&lt;br /&gt;
#''asEntity ''- the entity to create the sound at. Using &amp;quot;Player&amp;quot; is effectively the same as &amp;lt;code&amp;gt;PlayGuiSound&amp;lt;/code&amp;gt;, yet this function allows a looping sound to be saved&lt;br /&gt;
#''afFadeTime ''- time in seconds the sound needs to fade. Avoids enemies hearing the sound if afFadeTime is at least 0.1f&lt;br /&gt;
#''abSaveSound ''- if ''true'', a looping sound will &amp;quot;remember&amp;quot; its playback state (currently playing/stopped), and that state will be restored the next time the level is entered. If ''true'', the sound is never attached to the entity! Note that saving should only be used on ''looping sounds''!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeInSound(string &amp;amp;in asSoundName, float afFadeTime, bool abPlayStart);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades in a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds&lt;br /&gt;
#''abPlayStart ''- Play the sound defined in the &amp;lt;code&amp;gt;&amp;lt;Start&amp;gt;&amp;lt;/code&amp;gt; section of the .snt before playing the main sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopSound(string &amp;amp;in asSoundName, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades out a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds, use 0 to immediately stop the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayMusic(string &amp;amp;in asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays music.&lt;br /&gt;
&lt;br /&gt;
#''asMusicFile ''- the music file to play (extension .ogg optional)&lt;br /&gt;
#''abLoop ''- determines whether a music track should loop&lt;br /&gt;
#''afVolume ''- volume of the music&lt;br /&gt;
#''afFadeTime ''- time in seconds until music reaches full volume&lt;br /&gt;
#''alPrio ''- priority of the music. Note that only the music with the highest priority can be heard! 0 - lowest, 1 - higher, etc.&lt;br /&gt;
#''abResume''  - if ''true'', playback will be continued from where the track stopped after the call to &amp;lt;code&amp;gt;StopMusic()&amp;lt;/code&amp;gt;. If ''false'', the track will be restarted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopMusic(float afFadeTime, int alPrio);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops music.&lt;br /&gt;
&lt;br /&gt;
#''afFadeTime ''- time in seconds until music stops&lt;br /&gt;
#''alPrio ''- the priority of the music that should stop&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice(string &amp;amp;in asVoiceFile, string &amp;amp;in asEffectFile, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry,&lt;br /&gt;
bool abUsePosition, string &amp;amp;in asPosEntity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This adds a voice and an additional sound effect to be played. It is okay to call this many times in order to play many voices in a row. The EffectVoiceOverCallback is not called until ALL voices have finished.&lt;br /&gt;
&lt;br /&gt;
#''asVoiceFile ''- the voice to play&lt;br /&gt;
#''asEffectFile ''- the sound effect to play&lt;br /&gt;
#''asTextCat ''- the category in the .lang file, usually &amp;quot;Voice&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''abUsePosition ''- plays using 3D from the entity, or without 3D&lt;br /&gt;
#''asPosEntity ''- the entity at which the voice and sound are played from&lt;br /&gt;
#''afMinDistance ''- minimum distance the voice and sound are heard&lt;br /&gt;
#''afMaxDistance ''- maximum distance the voice and sound are heard&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopAllEffectVoices(float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all voices and calls the EffectVoiceOverCallback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEffectVoiceActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether EffectVoices are still active.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetEffectVoiceOverCallback(string &amp;amp;in asFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to be called when the EffectVoices are finished. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundVolume(float afDestVolume, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound volume, that means everything you can hear '''from the world'''. This does not affect music of GUI sounds.&lt;br /&gt;
&lt;br /&gt;
#''afDestVolume ''- desired volume&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired volume&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundSpeed(float afDestSpeed, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound speed.&lt;br /&gt;
&lt;br /&gt;
#''afDestSpeed ''- desired speed&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired speed&lt;br /&gt;
&lt;br /&gt;
===Lights===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightVisible(string &amp;amp;in asLightName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables lights.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''abVisible ''- determines the state of the light&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeLightTo(string &amp;amp;in asLightName, float afR, float afG, float afB, float afA, float afRadius, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the properties of a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''afRadius ''- radius of the light. -1 means keeping the radius&lt;br /&gt;
#''afTime ''- time in seconds until change is done&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightFlickerActive(string &amp;amp;in asLightName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates flickering on a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName'' - The internal light name&lt;br /&gt;
#''abActive'' - true = active, false = inactive&lt;br /&gt;
&lt;br /&gt;
==Game scripts==&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartCredits(string &amp;amp;in asMusic, bool abLoopMusic, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alEndNum);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts the end credits screen.&lt;br /&gt;
&lt;br /&gt;
#''asMusic ''- the music to play (including .ogg)&lt;br /&gt;
#''abLoopMusic ''- determines whether the music should loop&lt;br /&gt;
#''asTextCat ''- the category to be used in the .lang file, usually &amp;quot;Ending&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alEndNum ''- Amnesia has 3 different endings and displays a code at the bottom. Determines which code is displayed. 0-2 will display codes, any other integer will not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartDemoEnd();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shows the demo end screen. The background and UI elements are defined in demo.cfg, with the text using the entries in the &amp;quot;Demo&amp;quot; category of the .lang file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AutoSave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an auto save file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CheckPoint(string &amp;amp;in asName, string &amp;amp;in asStartPos, string &amp;amp;in asCallback, string &amp;amp;in asDeathHintCat, string &amp;amp;in asDeathHintEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a checkpoint at which the player will respawn in case he dies. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asName, int alCount)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;Count is 0 on the first checkpoint load!&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the editor&lt;br /&gt;
#''asCallback ''- the function to call when the player dies/respawns&lt;br /&gt;
#''asDeathHintCat ''- the category of the death hint message to be used in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asDeathHintEntry ''- the entry in the .lang file&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeMap(string &amp;amp;in asMapName, string &amp;amp;in asStartPos, string &amp;amp;in asStartSound, string &amp;amp;in asEndSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Loads another map after a 1.5 second fade out.&lt;br /&gt;
&lt;br /&gt;
#''asMapName ''- the file to load&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the next map&lt;br /&gt;
#''asStartSound ''- the sound that is played when the change starts&lt;br /&gt;
#''asEndSound ''- the sound that is played when the new map is loaded&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ClearSavedMaps();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the &amp;quot;history&amp;quot; of the save, useful to do when you know the player will not be able to go back anymore. Makes the next save much smaller in size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateDataCache();&lt;br /&gt;
void DestroyDataCache();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This caches all current textures and models and they are not released until destroy is called. If there is already cached data it is destroyed.&lt;br /&gt;
Create caches to enable faster loading when going back to a map. Destroy the cache if you know the player won't go back to that map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMapDisplayNameEntry(string &amp;amp;in asNameEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the map name shown in save file names. If none is set NULL is assumed.&lt;br /&gt;
&lt;br /&gt;
#''asNameEntry ''- the entry to display, category must be &amp;quot;Levels&amp;quot;!&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the skybox.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxTexture(string &amp;amp;in asTexture);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the texture of the skybox.&lt;br /&gt;
&lt;br /&gt;
#''asTexture''  - The texture file to set. Extension: .dds&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the solid color of the skybox rather than a texture.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the global fog.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the color to use for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogProperties(float afStart, float afEnd, float afFalloffExp, bool abCulling);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the properties for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afStart ''- how many meters from the camera should the fog begin&lt;br /&gt;
#''afEnd ''- how many meters from the camera should the fog reach full thickness&lt;br /&gt;
#''afFalloffExp ''- the amount by which the thinkness increases&lt;br /&gt;
#''abCulling ''- whether occlusion culling is active for the fog; this prevents objects behind the fog from being loaded&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetupLoadScreen(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alRandomNum, string &amp;amp;in asImageFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which loading screen will be shown when changing maps.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category of the loading text in the .lang file to be shown on the loading screen, usually &amp;quot;LoadingText&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alRandomNum ''- if greater 1, then it will randomize between 1 and alRandom for each LoadScreen giving entry the suffix XX (eg 01). If &amp;lt; =1 then no suffix is added&lt;br /&gt;
#''asImageFile ''- the image to be shown (optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void UnlockAchievement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlocks the specified achievement. Only able to be used for the ending achievements.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the achievement. Only the following strings are valid:&lt;br /&gt;
::* Benefactor&lt;br /&gt;
::* Survivor&lt;br /&gt;
::* Sacrifice&lt;br /&gt;
::* Quitter&lt;br /&gt;
::* Egotist&lt;br /&gt;
::* Altruist&lt;br /&gt;
::* Vacillator&lt;br /&gt;
&lt;br /&gt;
===Game Timer===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddTimer(string &amp;amp;in asName, float afTime, string &amp;amp;in asFunction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a timer which calls a function when it expires. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asTimer)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the name of the timer&lt;br /&gt;
#''afTime ''- time in seconds&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveTimer(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a timer, no matter how much time is left.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the timer.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetTimerTimeLeft(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the time left on a timer.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - the internal name of the timer.&lt;br /&gt;
&lt;br /&gt;
===Screen Effects===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeOut(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to black.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen is completly black&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeIn(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen back to normal.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeImageTrailTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies the image trail effect to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeSepiaColorTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the screen go dark red.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0) &lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeRadialBlurTo(float afSize, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies radial blur effects to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afSize ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetRadialBlurStartDist(float afStartDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines at which distance the radial blur effects appear.&lt;br /&gt;
&lt;br /&gt;
#''afStartDist ''- the distance at which the effect starts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectFlash(float afFadeIn, float afWhite, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white.&lt;br /&gt;
&lt;br /&gt;
#''afFadeIn ''- time in seconds until screen is white&lt;br /&gt;
#''afWhite ''- determines to which percentage the screen fades to white (1.0 = completly white)&lt;br /&gt;
#''afFadeOut ''- time in seconds until screen is back to normal again&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectEmotionFlash(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white and shows a text message.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''asSound ''- the sound to play while fading&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetFlashbackIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a flashback is still in effect.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerSpawnPS(string &amp;amp;in asSPSFile);&lt;br /&gt;
void StopPlayerSpawnPS();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Continuously spawn regular particle systems (''.ps'') around the player. Particles created by this script carry over from map to map.&lt;br /&gt;
&lt;br /&gt;
#''asSPSFile''  - the ''.sps''  file to use. Example ''.sps''  files are located in the ''/misc''  folder in the main game directory.&amp;lt;br&amp;gt;Custom ''.sps''  files can be created by hand in a text editor (see existing ones and mimic how those are written). &amp;lt;br /&amp;gt;Since ''StopPlayerSpawnPS()''  doesn't seem to work, to stop an SPS you must create an ''.sps''  file with an empty particle field field and override the old SPS by calling ''StartPlayerSpawnPS''  again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shakes the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity of the shake&lt;br /&gt;
#''afTime ''- duration of the shake&lt;br /&gt;
#''afFadeInTime ''- time in seconds until full intensity is reached&lt;br /&gt;
#''afFadeOutTime ''- time until screen is back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInDarknessEffectsActive(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the sanity drain and night vision effects while in the darkness.&lt;br /&gt;
&lt;br /&gt;
''bool abX''  - Enable/disable effects.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowScreenImage(string &amp;amp;in asImageName, float afX, float afY, float afScale, bool abUseRelativeCoordinates, float afDuration, float afFadeIn, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
Displays an image file directly onto the screen. See [[HPL2/Tutorials/ShowScreenImage()|ShowScreenImage()]] in the tutorials section for more information.&lt;br /&gt;
&lt;br /&gt;
# ''asImageName'' - The image file to render (.jpg, .png, .tga, .dds)&lt;br /&gt;
# ''afX'' - The X position of the image&lt;br /&gt;
# ''afY'' - The Y position of the image&lt;br /&gt;
# ''afScale'' - The size of the image in pixels (not scale), or original image size if negative&lt;br /&gt;
# ''abUseRelativeCoordinates'' - Whether X and Y are relative to the screen resoltion, or pixel co-ordinates if not&lt;br /&gt;
# ''afDuration'' - The duration that the image is displayed for&lt;br /&gt;
# ''afFadeIn'' - The time, in seconds, to fade in the image&lt;br /&gt;
# ''afFadeOut'' - The time, in seconds, to fade out the image&lt;br /&gt;
&lt;br /&gt;
===Insanity===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInsanitySetEnabled(string &amp;amp;in asSet, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which InsanitySets are enabled.&lt;br /&gt;
&lt;br /&gt;
#''asSet ''- the set&lt;br /&gt;
#''abX ''- enabled or not&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartInsanityEvent(string &amp;amp;in asEventName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Starts a specified insanity event.&lt;br /&gt;
&lt;br /&gt;
#''asEventName ''- Insanity event to play.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartRandomInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts a random insanity event from the available sets.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopCurrentInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Stops the currently playing insanity event.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void InsanityEventIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an insanity event is currently in effect.&amp;lt;br&amp;gt;Not useful at all due to having a return type of &amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; when it should be &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Player===&lt;br /&gt;
&lt;br /&gt;
Note that the player's maximum health and sanity is 100.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enabled/Disable player controlled movement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangePlayerStateToNormal();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets the player's state, forcing them to stop interacting with objects. It also clears the inventory item to be used (as if it was double-clicked on in the inventory again) and dismounts the player from ladders.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerCrouching(bool abCrouch);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddPlayerBodyForce(float afX, float afY, float afZ, bool abUseLocalCoords);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pushes the player into a certain direction. Note that you need values above ~2000 to see any effects.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - amount along the X-axis&lt;br /&gt;
#''afY'' - amount along the Y-axis&lt;br /&gt;
#''afZ'' - amount along the Z-axis&lt;br /&gt;
#''abUseLocalCoords'' - If true, axes are based on where the player is facing, not the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowPlayerCrossHairIcons(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the icons when a player has something in focus.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerSanity(float afSanity);&lt;br /&gt;
void AddPlayerSanity(float afSanity);&lt;br /&gt;
float GetPlayerSanity();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerHealth(float afHealth);&lt;br /&gt;
void AddPlayerHealth(float afHealth);&lt;br /&gt;
float GetPlayerHealth();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerLampOil(float afOil);&lt;br /&gt;
void AddPlayerLampOil(float afOil);&lt;br /&gt;
float GetPlayerLampOil();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the lamp oil of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerSpeed();&lt;br /&gt;
float GetPlayerYSpeed();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current speed of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSanityDrainDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables sanity drain from darkness.&lt;br /&gt;
{{bug|Sanity drain is reenabled on loading a save, as the game is unable to load the value properly from the save data.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoost();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a large amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! New Sanity&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || 100&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || 90&lt;br /&gt;
|-&lt;br /&gt;
| 50-74 || 80&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoostSmall();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a small amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! Sanity Bonus&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || +20&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || +15&lt;br /&gt;
|-&lt;br /&gt;
| 50-75 || +10&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityDamage(float afAmount, bool abUseEffect);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount'' - amount of sanity damage done&lt;br /&gt;
#''abUseEffect'' - if a sound is played and screen effects are shown when the sanity damage is dealt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GivePlayerDamage(float afAmount, string &amp;amp;in asType, bool abSpinHead, bool abLethal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the health of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount'' - amount of damage done to health&lt;br /&gt;
#''asType'' - plays a certain effect on the screen when the damage is dealt (BloodSplat, Claws, or Slash) &lt;br /&gt;
#''abSpinHead'' - changes the camera view when damage is dealt&lt;br /&gt;
#''abLethal'' - set to true if player can die from given damage. If ''false'' and the damage would have left the player with less than 10 health, health is set to 10.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerFOVMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the field of view of the player. A shorter FOV will create a zoom effect.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - multiplier of default FOV (1 is default)&lt;br /&gt;
#''afSpeed'' - the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerAspectMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the aspect ratio of the player. Basically stretches or narrows the screen horizontally.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - multiplier of default aspect (default is 1)&lt;br /&gt;
#''afSpeed'' - the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - angle of rotation of head, positive being counter-clockwise&lt;br /&gt;
#''afSpeedMul'' - speed (possibly acceleration) multiplier of the rotation (default 1, which is really slow)&lt;br /&gt;
#''afMaxSpeed'' - maximum speed of rotation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerForward(float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Moves the player forward. It needs to be called in a timer that updates 60 times / second.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- amount along the X-axis&lt;br /&gt;
#''afY ''- amount along the Y-axis&lt;br /&gt;
#''afZ ''- amount along the Z-axis&lt;br /&gt;
#''afSpeed ''- speed at which the change happens&lt;br /&gt;
#''afSlowDownDist ''- distance at which to start slowing down (prevents the head from abruptly stopping)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerLookAt(string &amp;amp;in asEntityName, float afSpeedMul, float afMaxSpeed, string &amp;amp;in asAtTargetCallback);&lt;br /&gt;
void StopPlayerLookAt();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to look at a certain entity until StopPlayerLookAt is used.&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- the entity to look at &lt;br /&gt;
#''afSpeedMul ''- how fast should the player look at the entity&lt;br /&gt;
#''afMaxSpeed ''- maximum speed allowed&lt;br /&gt;
#''asAtTargetCallback ''- function to call when player looks at target&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerMoveSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerRunSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerLookSpeedMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the player's move/run/look speed. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpForceMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the player's jump multiplier. Higher values = higher jumps. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpDisabled(bool abX);&lt;br /&gt;
void SetPlayerCrouchDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to jump/crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportPlayer(string &amp;amp;in asStartPosName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly teleports the player to the target StartPos.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternActive(bool abX, bool abUseEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the player use his lantern.&lt;br /&gt;
&lt;br /&gt;
# ''abX'' - Set lantern to be active (true) or inactive (false)&lt;br /&gt;
# ''abUseEffects'' - Play on/off sounds&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetLanternActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player is currently using the lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to use the lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternLitCallback(string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to call when the player uses the lantern. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;MyFunc(bool abLit)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message on the screen.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory'' - the category in the .lang file&lt;br /&gt;
#''asTextEntry'' - the entry in the .lang file&lt;br /&gt;
#''afTime'' - determines how long the message is displayed. If time is &amp;lt; =0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetDeathHint(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the message that appears when the player dies.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory'' - the category in the .lang file&lt;br /&gt;
#''asTextEntry'' - the entry in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DisableDeathStartSound();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the death sound when the player dies. This must be called directly before player is killed! The variable as soon as player dies too.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPermaDeathSound(string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Sets the sound played after the player dies when permadeath is active. Permadeath is only active when the game is launched with the &amp;lt;code&amp;gt;ptest&amp;lt;/code&amp;gt; command line parameter. Only used for the post-death Suitor lines in ''Justine''.&lt;br /&gt;
&lt;br /&gt;
#''asSound'' - The sound to be played after death. Expects a voice-type sound.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerFallDamageDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the player's ability to take fall damage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPos(float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the player's position within the level.&lt;br /&gt;
&lt;br /&gt;
#''afX'' - X co-ordinate position.&lt;br /&gt;
#''afY'' - Y co-ordinate position.&lt;br /&gt;
#''afZ'' - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerPosX();&lt;br /&gt;
float GetPlayerPosY();&lt;br /&gt;
float GetPlayerPosZ();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the player's position within the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
===Journal===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddNote(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a note to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _Name and _Text and be in category &amp;quot;Journal&amp;quot;!&lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDiary(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a diary to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _NameX and _TextY whereas X and Y are numbers of the parts (_Name1: first diary, _Text1: first page) and be in category &amp;quot;Journal&amp;quot;! &lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ReturnOpenJournal(bool abOpenJournal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Only called in the pickup diary callback! If true the journal displays the entry else not.&lt;br /&gt;
&lt;br /&gt;
===Quests===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a quest to the player's journal under mementos. Completed quests cannot be readded.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name to be used&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot;Quest_&amp;lt;texthere&amp;gt;_Text”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CompleteQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Completes a quest. If the quest has not been added, it's marked as complete anyway, preventing it from being added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot; Quest_&amp;lt;texthere&amp;gt;_Text ”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool QuestIsCompleted(string &amp;amp;in asName);&lt;br /&gt;
bool QuestIsAdded(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a quest is completed/added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetNumberOfQuestsInMap(int alNumberOfQuests);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the number of quests in the map. Obsolete; formerly used to calculate a completion percentage when looking at a level door.&lt;br /&gt;
&lt;br /&gt;
#''alNumberOfQuests ''- Amount of quests&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveHint(string &amp;amp;in asName, string &amp;amp;in asMessageCat, string &amp;amp;in asMessageEntry, float afTimeShown);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a hint on the player's screen.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asMessageCat ''- the category in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asMessageEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTimeShown ''- time in seconds until the message disappears. If time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void BlockHint(string &amp;amp;in asName);&lt;br /&gt;
void UnBlockHint(string &amp;amp;in asName);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Blocking a hint prevents it from being shown. Blocked hints are included in savefiles, so they should persist between levels. Unblocking a hint allows it to be shown.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; blocks the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveHint(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes the hint from the list of already shown hints, allowing it to appear again.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; reenables the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
===Inventory===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ExitInventory();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Exits the inventory by force.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the player's ability to open his inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a message on the inventory screen. Used for feedback messages when failing to combine items.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory ''- the category in the .lang file, usually &amp;quot;Inventory&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTime ''- time in seconds until the message disappears. If life time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItem(string &amp;amp;in asName, string &amp;amp;in asType, string &amp;amp;in asSubTypeName, string &amp;amp;in asImageName, float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds an item to the inventory of the player. Note that the item does not have to exist as entity in the world to be able to do this.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asType ''- item type to give, Available types are:&lt;br /&gt;
::*Puzzle&lt;br /&gt;
::*Lantern&lt;br /&gt;
::*Health&lt;br /&gt;
::*Sanity&lt;br /&gt;
::*LampOil&lt;br /&gt;
::*Tinderbox&lt;br /&gt;
#''asSubTypeName ''- item name for .lang file&lt;br /&gt;
#''asImageName ''- the image which will appear in inventory. For example: &amp;lt;code&amp;gt;void GiveItem(&amp;quot;chemical_container_full_1&amp;quot;, &amp;quot;Puzzle&amp;quot;, &amp;quot;chemical_container_full&amp;quot;, &amp;quot;chemical_container_full.tga&amp;quot;, 1);&amp;lt;/code&amp;gt; will use the image from &amp;lt;code&amp;gt;graphics/item/chemical_container_full.tga&amp;lt;/code&amp;gt; &lt;br /&gt;
#''afAmount ''- amount the item gives, - For example: Oil potions will fill the oil meter by this amount, Health potions will heal by this amount, etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item from the player's inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool HasItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player has an item in his inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItemFromFile(string &amp;amp;in asName, string &amp;amp;in asFileName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a single item to the player's inventory. This is meant to be used for debug mostly as it creates the actual item and then destroys it.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asFileName ''- item to give + extension (.ent)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddCombineCallback(string &amp;amp;in asName, string &amp;amp;in asItemA, string &amp;amp;in asItemB, string &amp;amp;in asFunction, bool abAutoRemove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to combine items in his inventory. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItemA, string &amp;amp;in asItemB)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name for the callback&lt;br /&gt;
#''asItemA ''- internal name of first item&lt;br /&gt;
#''asItemB ''- internal name of second item&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
#''abAutoRemove ''- determines whether the callback should be removed when the items are combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveCombineCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a combine callback.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the callback to be removed (as specified in AddCombineCallback)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddUseItemCallback(string &amp;amp;in asName, string &amp;amp;in asItem, string &amp;amp;in asEntity, string &amp;amp;in asFunction, bool abAutoDestroy);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to use items on the world. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItem, string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
#''asItem ''- internal name of the item&lt;br /&gt;
#''asEntity ''- entity to be able to use the item on&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abAutoDestroy ''- determines whether the callback should be removed when the item is used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveUseItemCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item callback.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
&lt;br /&gt;
===Entities===&lt;br /&gt;
&lt;br /&gt;
====General====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityActive(string &amp;amp;in asName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityVisible(string &amp;amp;in asName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity's visual mesh. The collision body remains.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the entity.&lt;br /&gt;
#''abActive''  - Activate/deactivate mesh.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntityExists(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an entity exists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCustomFocusCrossHair(string &amp;amp;in asName, string&amp;amp; asCrossHair);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the crosshair that is used when focusing an entity.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCrossHair ''- desired crosshair, can be: &lt;br /&gt;
::*Default (no crosshair)&lt;br /&gt;
::*Grab&lt;br /&gt;
::*Push&lt;br /&gt;
::*Ignite&lt;br /&gt;
::*Pick&lt;br /&gt;
::*LevelDoor&lt;br /&gt;
::*Ladder&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void CreateEntityAtArea(string &amp;amp;in asEntityName, string &amp;amp;in asEntityFile, string &amp;amp;in asAreaName, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an entity at an area. When creating an enemy though, it cannot chase properly along PathNodes (using for example &amp;lt;code&amp;gt;ShowEnemyPlayerPosition&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- internal name&lt;br /&gt;
#''asEntityFile ''- entity to be used extension .ent&lt;br /&gt;
#''asAreaName ''- the area to create the entity at&lt;br /&gt;
#''abFullGameSave ''- determines whether an entity &amp;quot;remembers&amp;quot; its state&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ReplaceEntity(string &amp;amp;in asName, string &amp;amp;in asBodyName, string &amp;amp;in asNewEntityName, string &amp;amp;in asNewEntityFile, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Removes an entity and places a new one in its place.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to replace.&lt;br /&gt;
#''asBodyName'' - Name of the body of the entity to place the new entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''asNewEntityName'' - Name of the new entity.&lt;br /&gt;
#''asNewEntityFile'' - Name of the new entity file. Extension .ent. &lt;br /&gt;
#''abFullGameSave'' - Whether ALL properties of this entity should be saved throughout levels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaceEntityAtEntity(string &amp;amp;in asName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBodyName, bool abUseRotation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Places an entity at the position of another entity. Does not work for enemies, use TeleportEnemyToEntity instead.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to place.&lt;br /&gt;
#''asTargetEntity'' - Name of the other entity to place the first entity at.&lt;br /&gt;
#''asTargetBodyName'' - Name of the body of the entity to place the first entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''abUseRotation'' - Whether the entity should be rotated like the target entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPos(string &amp;amp;in asName, float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Moves an entity to a position in the level.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to move.&lt;br /&gt;
#''afX'' - X co-ordinate position.&lt;br /&gt;
#''afY'' - Y co-ordinate position.&lt;br /&gt;
#''afZ'' - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetEntityPosX(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosY(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosZ(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns an entity's position in the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerLookAtCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveWhenLookedAt);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player looks at a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = looking, -1 = not looking&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveWhenLookedAt ''- determines whether the callback should be removed when the player looked at the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerInteractCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveOnInteraction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player interacts with a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveOnInteraction ''- determines whether the callback should be removed when the player interacts with the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCallbackFunc(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when certain events occur with an entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, string &amp;amp;in asType)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;asType&amp;lt;/code&amp;gt; values depend on entity type:&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! asType Value&lt;br /&gt;
|-&lt;br /&gt;
| Object || Break&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || OnIgnite&lt;br /&gt;
|-&lt;br /&gt;
| Item || OnPickup&lt;br /&gt;
|-&lt;br /&gt;
| Enemy || OnDeath&lt;br /&gt;
|-&lt;br /&gt;
| Enemy_Grunt&amp;lt;br&amp;gt;Enemy_Manpig || OnAutoDisabled&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityConnectionStateChangeCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A callback called when ever the connection state changes (button being switched on, lever switched, etc). &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void Func(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: -1 = off, 0 = between, 1 = on&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityInteractionDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disallows interaction with an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void BreakJoint (string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Breaks a joint. Do not use this on joints in SwingDoors, Levers, Wheels, etc. where the joint is part of an interaction. That will make the game crash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void AddEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName, string &amp;amp;in asFunction, bool abDeleteOnCollide, int alStates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when two entities collide. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asParent, string &amp;amp;in asChild, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = enter, -1 = leave&lt;br /&gt;
&lt;br /&gt;
#''asParentName ''- internal name of main object&lt;br /&gt;
#''asChildName ''- internal name of object that collides with main object (asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) NOT supported!)&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abDeleteOnCollide ''- determines whether the callback after it was called&lt;br /&gt;
#''alStates ''- 1 = only enter, -1 = only leave, 0 = both&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an EntityCollideCallback. Asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) not supported in ''asChildName''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntitiesCollide(string &amp;amp;in asEntityA, string &amp;amp;in asEntityB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether two entities collide. This function does NOT support asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) or &amp;quot;Player&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetBodyMass(string &amp;amp;in asName, float afMass);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName.&lt;br /&gt;
#''afMass''  - The mass to set.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetBodyMass(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName. &lt;br /&gt;
#''afMass''  - The mass to get.&lt;br /&gt;
&lt;br /&gt;
====Props====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropEffectActive(string &amp;amp;in asName, bool abActive, bool abFadeAndPlaySounds);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Can be used on coal to give it the black color it should have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropActiveAndFade(string &amp;amp;in asName, bool abActive, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates a prop.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''abActive ''- nothing to add&lt;br /&gt;
#''afFadeTime ''- time in seconds until prop fully fades&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropStaticPhysics(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates the physics of a prop, setting the mass to 0. Setting as true will make entities static in midair.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetPropIsInteractedWith(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a prop is interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RotatePropToSpeed(string &amp;amp;in asName, float afAcc, float afGoalSpeed, float afAxisX, float afAxisY, float afAxisZ, bool abResetSpeed, string &amp;amp;in asOffsetArea);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the prop up to a set speed.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afGoalSpeed ''- desired speed &lt;br /&gt;
#''afAxisX ''- rotation around X axis&lt;br /&gt;
#''afAxisY ''- rotation around Y axis&lt;br /&gt;
#''afAxisZ ''- rotation around Z axis&lt;br /&gt;
#''abResetSpeed ''- determines whether the speed is resetted after goal speed is reached&lt;br /&gt;
#''asOffsetArea ''- the area to rotate around, if empty, then the center of the body is used Note: The entity you want to rotate MUST be a &amp;quot;StaticObject&amp;quot; entity!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void StopPropMovement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all movement of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddAttachedPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop.&lt;br /&gt;
&lt;br /&gt;
#''asPropName''- the prop to attach another prop at &lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop&lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
{{bug|''afRotZ '' is used for both the ZX rotation and the Z position of the attached prop. Unwanted rotation can be avoided by using: &amp;lt;br /&amp;gt;''AddAttachedPropToProp(asPropName, asAttachName, asAttachFile, afPosX, afPosY, '''0''', afPosZ, '''90.0f''', afPosZ)''}}&lt;br /&gt;
&lt;br /&gt;
{{bug|Attaching a breakable prop to a physically active prop, and then breaking the attached prop, will cause the game to crash, should the parent object be moved or reset.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop. Fixed version of &amp;lt;code&amp;gt;AddAttachedPropToProp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
#''asPropName ''- the prop to attach another prop at&lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop &lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveAttachedPropFromProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches a prop from a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
void AddPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
float GetPropHealth(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ResetProp(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets a prop's state to the original one when the map was loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void PlayPropAnimation(string &amp;amp;in asProp, string &amp;amp;in asAnimation, float afFadeTime, bool abLoop, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the prop play an animation and calls a function. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asProp)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asProp ''- internal name of the prop&lt;br /&gt;
#''asAnimation ''- animation to play&lt;br /&gt;
#''afFadeTime ''- Fade time between current and new animations&lt;br /&gt;
#''abLoop ''- determines whether the animation loops &lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddPropForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddPropImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These functions push objects. Note that rather high values are needed when applying ''forces''  (on the order of ~100 (weak) to ~10000 (strong)), but not impulses (values less than 10 can be appropriate). Forces are external influences, and will have different effect depending on the mass of the object they are being applied to; impulses disregard mass, and can cause objects to break, as if hit. A &amp;quot;Body&amp;quot; is a physics-related helper object, to which a force or an impulse can be applied. Entities can consist of several bodies, interconnected in various ways (you can create/examine bodies in the model editor).&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the object to push; for bodies, use this format: &amp;quot;''entityName''_''bodyName''&amp;quot;&lt;br /&gt;
#''afX ''- magnitude along the X-axis&lt;br /&gt;
#''afY ''- magnitude along the Y-axis&lt;br /&gt;
#''afZ ''- magnitude along the Z-axis&lt;br /&gt;
#''asCoordSystem ''- determines which coordinate system is used, &amp;quot;local&amp;quot; or &amp;quot;world&amp;quot;&lt;br /&gt;
&lt;br /&gt;
All of these functions are ''additive''  - when called consecutively, for each call, the vectors defined by (afX, afY, afZ) will be added together, and a resultant force/impulse will be calculated ''before''  any physics simulation is applied to the target object.&lt;br /&gt;
&lt;br /&gt;
====Connections====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithRope(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asRopeName, bool abInteractOnly, float afSpeedMul, float afToMinSpeed, float afToMaxSpeed, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects a prop with the movement of a rope (i.e. turn a wheel to move a rope). For Levers, the rope only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName''- The name of the connection&lt;br /&gt;
#''asPropName'' - The name of the prop; can be a Lever or Wheel&lt;br /&gt;
#''asRopeName'' - The name of the rope&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''afSpeedMul'' - Speed multiplier of how quickly the rope moves&lt;br /&gt;
#''afToMinSpeed'' - The slowest the rope can move&lt;br /&gt;
#''afToMaxSpeed'' - The fastest the rope can move&lt;br /&gt;
#''abInvert'' - Whether to invert the direction the rope moves&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithMoveObject(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asMoveObjectName, bool abInteractOnly, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This one should only be used if there must be an exact correspondence to prop &amp;quot;amount&amp;quot; and the MoveObject open amount. It is best used for Wheel-door connections, where the MoveObject moves continuously along with the Wheel. For Levers, the MoveObject only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asPropName'' - The entity that controls the movement; can be a Lever or Wheel&lt;br /&gt;
#''asMoveObject'' - The MoveObject to move&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''abInvert'' - If the state is inverted, making the MoveObject move in the opposite direction&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ConnectEntities(string &amp;amp;in asName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, bool abInvertStateSent, int alStatesUsed, string &amp;amp;in asCallbackFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects two entities together so that changing the state of the main entity changes the state of the connected entity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! Max State (1) !! Min State (-1)&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || Lit || Unlit&lt;br /&gt;
|-&lt;br /&gt;
| MoveObject || Open || Close&lt;br /&gt;
|-&lt;br /&gt;
| SwingDoor&lt;br /&gt;
|rowspan=2| Locked&lt;br /&gt;
|rowspan=2| Unlocked&lt;br /&gt;
|-&lt;br /&gt;
| Chest&lt;br /&gt;
|-&lt;br /&gt;
| Button || Switched on || Switched off&lt;br /&gt;
|-&lt;br /&gt;
| Lever&lt;br /&gt;
|rowspan=2| Unstuck&lt;br /&gt;
|rowspan=2| Stuck (at min)&lt;br /&gt;
|-&lt;br /&gt;
| Wheel&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asMainEntity'' - The entity that causes the change; can be a Lever, Wheel, Button, or Photocell&lt;br /&gt;
#''asConnectEntity'' - The entity that is affected by the change&lt;br /&gt;
#''abInvertStateSent'' - If the state is inverted, making the connected entity change to the opposite state&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
#''asCallbackFunc'' - The name of the connection callback&lt;br /&gt;
&lt;br /&gt;
Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asConnectionName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, int alState)&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;alState is what is sent to connection entity and will be inverted if abInvertStateSent = true!&lt;br /&gt;
&lt;br /&gt;
====Lamps====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLampLit(string &amp;amp;in asName, bool abLit, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Turns a lamp on or off.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the lamp&lt;br /&gt;
#''abLit ''- Set true if you want the lamp to be lit, set to false if you want the lamp to be unlit&lt;br /&gt;
#''abEffects ''- If you want to have the lamp fade in/out when it gets lit/unlit&lt;br /&gt;
&lt;br /&gt;
====Doors====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorLocked(string &amp;amp;in asName, bool abLocked, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abLocked'' - Locked/unlocked&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is locked/unlocked&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorClosed(string &amp;amp;in asName, bool abClosed, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abClosed'' - Closed/open&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is closed/opened&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
bool GetSwingDoorLocked(string &amp;amp;in asName);&lt;br /&gt;
bool GetSwingDoorClosed(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a swing door is locked/closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorDisableAutoClose(string &amp;amp;in asName, bool abDisableAutoClose);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deactivates the &amp;quot;auto-close&amp;quot; when a door is nearly closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetSwingDoorState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns an integer depending on how far the door is opened. &amp;lt;br /&amp;gt;-1 = angle is close to 0°, 1 = angle is 70% or higher of max, 0 = inbetween -1 and 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLocked(string &amp;amp;in asName, bool abLocked);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a level door. Note that level doors are NOT swing doors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedSound(string &amp;amp;in asName, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which sound is played when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedText(string &amp;amp;in asName, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectState(string &amp;amp;in asName, float afState);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween (and above, for example, the bridge_metal_vert) are valid too!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectStateExt(string &amp;amp;in asName, float afState, float afAcc, float afMaxSpeed, float afSlowdownDist, bool abResetSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state, extended method.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween are valid too!&lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afMaxSpeed ''- maximum speed&lt;br /&gt;
#''afSlowdownDist ''- Distance to the target state before deceleration occurs.&lt;br /&gt;
#''abResetSpeed ''- Set to ''true'' if the prop's speed should be reset before performing the movement, else the prop will accelerate from its current speed to afMaxSpeed.&lt;br /&gt;
&lt;br /&gt;
====Levers, wheels and buttons====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropObjectStuckState(string &amp;amp;in asName, int alState);&lt;br /&gt;
void SetWheelStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
void SetLeverStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes an object/wheel/lever stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name&lt;br /&gt;
#''alState'' - 0 = not stuck, 1 = at max, -1 = at min &lt;br /&gt;
#''abEffects'' - play sound effects&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelAngle(string &amp;amp;in asName, float afAngle, bool abAutoMove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves a wheel to a certain angle.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name&lt;br /&gt;
#''afAngle'' - angle&lt;br /&gt;
#''abAutoMove'' - determines whether the wheel should move on its own&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
void SetLeverInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to make a wheel/lever unstuck when interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetLeverState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the state of the lever. &amp;lt;br /&amp;gt;0 = not stuck, 1 = at max, -1 = at min&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderStuckState(string &amp;amp;in asName, int alStuckState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes a MultiSlider stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when state changes. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetButtonSwitchedOn(string &amp;amp;in asName, bool abSwitchedOn, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Sticky areas====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetAllowStickyAreaAttachment(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows entities to stick to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asProp);&lt;br /&gt;
void AttachBodyToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asBody);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop/body to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void DetachFromStickyArea(string &amp;amp;in asAreaName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches everything from a StickyArea.&lt;br /&gt;
&lt;br /&gt;
====NPCs====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCAwake(string &amp;amp;in asName, bool abAwake, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wakes/sleeps a NPC.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the NPC&lt;br /&gt;
#''abAwake'' - ''true'' to awaken, ''false'' to sleep&lt;br /&gt;
#''abEffects'' - Play the &amp;quot;Awake&amp;quot; or &amp;quot;Sleep&amp;quot; animations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCFollowPlayer(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a NPC's head to follow the player's movements.&lt;br /&gt;
&lt;br /&gt;
====Enemies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables an enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyIsHallucination(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes an enemy a hallucination. Hallucinations fade to smoke when they get near the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void FadeEnemyToSmoke(string &amp;amp;in asName, bool abPlaySound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly fades an enemy to smoke.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ShowEnemyPlayerPosition(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the enemy run to the player, no matter where he is.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AlertEnemyOfPlayerPresence(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gives the specified enemy the player's current position and makes it search the area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisableTriggers(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables or disables enemy triggers. If disabled, enemy will not react to player or attack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddEnemyPatrolNode(string &amp;amp;in asName, string &amp;amp;in asNodeName, float afWaitTime, string &amp;amp;in asAnimation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a patrol node to the enemy's path.&lt;br /&gt;
&lt;br /&gt;
#''asName''- Internal name of the enemy &lt;br /&gt;
#''asNodeName'' - Path node &lt;br /&gt;
#''afWaitTime'' - Time in seconds that the enemy waits at the path node before continuing. If 0, randomized between 1-3.&lt;br /&gt;
#''asAnimation'' - The animation the enemy uses when reaching the path node&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ClearEnemyPatrolNodes(string &amp;amp;in asEnemyName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the current path of patrol nodes of the enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemySanityDecreaseActive(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether an enemy activates the player's sanity drain when stared at.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy &lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToNode(string &amp;amp;in asEnemyName, string &amp;amp;in asNodeName, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific PathNode.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asNodeName'' - Internal name of the node to teleport to &lt;br /&gt;
#''abChangeY'' - Whether the Y position of the node will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToEntity(string &amp;amp;in asEnemyName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBody, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific entity.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asTargetEntity'' - Internal name of the entity to teleport to&lt;br /&gt;
#''asTargetBody'' - Internal name of the entity's body name to teleport to. If empty, the first body will be used (might be unstable, recommended to input a body anyway)&lt;br /&gt;
#''abChangeY'' - Whether the Y position of the entity will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeManPigPose(string &amp;amp;in asName, string &amp;amp;in asPoseType);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the pose a specified ManPig.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''asPoseType'' - Name of the ManPig pose to use. Can be &amp;quot;Biped&amp;quot; or &amp;quot;Quadruped&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigFadeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should fade the player's view in and out.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigSoundDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should play the proximity sounds.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigEasyEscapeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should be easier to escape from when hunted. If not disabled, easy escape is activated if the player is more than 12.35 meters away, the enemy can't see the player, and the player has less than 75 health. When this occurs, the enemy is forced to stop hunting and wait for half a second.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ForceTeslaPigSighting(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Forces a Tesla ManPig to be visible for a short time.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; GetEnemyStateName(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the name of the state a specified enemy is current in.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
Possible states for all enemies:&lt;br /&gt;
*Idle&lt;br /&gt;
*Wait&lt;br /&gt;
*Patrol&lt;br /&gt;
*Investigate&lt;br /&gt;
*Alert&lt;br /&gt;
*Search&lt;br /&gt;
*Hurt&lt;br /&gt;
*Hunt&lt;br /&gt;
*HuntPause&lt;br /&gt;
*HuntWander&lt;br /&gt;
*AttackMeleeShort&lt;br /&gt;
*AttackMeleeLong&lt;br /&gt;
*BreakDoor&lt;br /&gt;
*Dead&lt;br /&gt;
&lt;br /&gt;
Waterlurker-only states:&lt;br /&gt;
*GoHome&lt;br /&gt;
*Eat&lt;br /&gt;
&lt;br /&gt;
ManPig-only states: &lt;br /&gt;
*Flee&lt;br /&gt;
*Stalk&lt;br /&gt;
*Track&lt;br /&gt;
&lt;br /&gt;
Unused states:&lt;br /&gt;
*AttackRange&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/TDD/Entity_Types&amp;diff=7015</id>
		<title>HPL2/TDD/Entity Types</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/TDD/Entity_Types&amp;diff=7015"/>
		<updated>2025-08-28T20:32:34Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Item */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TocRight}}&lt;br /&gt;
&lt;br /&gt;
This page lists the different types of entities found within the HPL2 engine. The type determines how the entity will be set up, what kind it is, what it does under different circumstances etc. Using the Model Editor you can identify and specify which type an entity has and its type vars, in Settings &amp;gt; User defined variables. In the Level Editor, the different types have different settings applicable for them, known as instance vars. For example, a MoveObject type will have the OffsetArea box available in the Level Editor, and an Item (Note) type will have a NoteText box available.&lt;br /&gt;
&lt;br /&gt;
A list of all the types and subtypes can be found in the table of contents to the right.&lt;br /&gt;
&lt;br /&gt;
== StaticProp ==&lt;br /&gt;
&lt;br /&gt;
A StaticProp entity resembles a static object. They have no available type properties, but they can still use physics bodies (collision boxes) and have mass/gravity. Note that they cannot be interacted with in the game, and cannot be disabled. If you need this feature, use Object (Static) instead.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CastShadows || Bool || true || If entity casts shadows.&lt;br /&gt;
|-&lt;br /&gt;
| IsAffectedByDecal || Bool || true || If decals can be created on entity.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CommentaryIcon ==&lt;br /&gt;
&lt;br /&gt;
A CommentaryIcon entity is simply an object that can execute commentary sound files, as it was done in the main game. These only appear if the player has &amp;quot;Commentary&amp;quot; enabled in their settings.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| RotateSubMesh || String || || The name of the submesh that is to be rotated&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| File || File (.comment) || || The .comment file for the commentary.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Object ==&lt;br /&gt;
&lt;br /&gt;
Objects are entities that can be activated/deactivated, broken, and interact with physics.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| BreakActive || Bool || false || If entity is broken when hit hard enough or health is 0.&lt;br /&gt;
|-&lt;br /&gt;
| BreakDestroyJoints || Bool || false || If all physics joints should be destroyed when broken.&lt;br /&gt;
|-&lt;br /&gt;
| BreakMinEnergy || Float || 100 || The minimum energy needed for breakage. Energy = Object1Speed * Object1Mass + Object2Speed * Object2Mass. Speed = m/s. If Object 2 is floor or something static, its speed is always 0 and does not contribute to total energy!&lt;br /&gt;
|-&lt;br /&gt;
| BreakEntity || File (.ent) || || The entity this entity turns into when broken.&lt;br /&gt;
|-&lt;br /&gt;
| BreakEntityAlignBody || String || || The body BreakEntity uses to align itself when created. No entity is created if left empty.&lt;br /&gt;
|-&lt;br /&gt;
| BreakSound || File (.snt) || || The sound made when broken.&lt;br /&gt;
|-&lt;br /&gt;
| BreakParticleSystem || File (.ps) || || Particle system shown when broken.&lt;br /&gt;
|-&lt;br /&gt;
| BreakImpulse || Float || 4 || Impulse (speed in m/s really) added to all bodies in BreakEntity when created. The direction of impulse is outwards from center of entity.&lt;br /&gt;
|-&lt;br /&gt;
| HitDamageAmount || Float || 5 || The amount of damage made when hitting an enemy or player.&lt;br /&gt;
|-&lt;br /&gt;
| HitDamageStrength || Int || 1 || The strength of the damage.&lt;br /&gt;
|-&lt;br /&gt;
| MinHitDamageSpeed || Float || 3 || The minimum speed (m/s) needed for damage to be made.&lt;br /&gt;
|-&lt;br /&gt;
| LifeLength || Float || 0 || A time after which the entity automatically breaks. 0=lasts forever.&lt;br /&gt;
|-&lt;br /&gt;
| IsFood || Bool || false || If this is food for some enemies and can be used to lure them. Needs to have break active and health determines how long the food lasts.&amp;lt;br&amp;gt;Waterlurkers are the only enemy type that is lured by and eats food objects.&lt;br /&gt;
|-&lt;br /&gt;
| ShowHints || Bool || true || If a hint can be triggered by interacting with the prop.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| ContainedItem || String || None || An item that is created when entity breaks.&amp;lt;br&amp;gt;Must match an entity file name (extension .ent optional) in the &amp;quot;items&amp;quot; folder.&lt;br /&gt;
|-&lt;br /&gt;
| DisableBreakable || Bool || false || If the entity is breakable then having this true will make it unbreakable.&lt;br /&gt;
|-&lt;br /&gt;
| IsInsanityVision || Bool || false || If the prop is only shown when insanity is low enough.&lt;br /&gt;
|-&lt;br /&gt;
| VisionMaxSanity || Float || 30 || The max sanity the player can have for prop to show if it is an insanity vision.&amp;lt;br&amp;gt;The object will only be visible if the player's sanity is less than this value.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Static ===&lt;br /&gt;
&lt;br /&gt;
Not to be confused with an actual static object. This Object subtype is a generic object with common properties. The static subtype simply disables any additional properties from the other subtypes. An Object (Static) is similar in concept to a StaticProp type entity, however the Object (Static) can be deactivated, can break, has physics, and can have an interact callback set.&lt;br /&gt;
&lt;br /&gt;
=== Grab ===&lt;br /&gt;
&lt;br /&gt;
A Grab subtype is a normal Object entity with the ability to be grabbed by the player in the game. In order for this to work, the object must have a mass above 0.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| GrabUseDepth || Bool || false || If GrabDepth is used. If not the interaction distance is used.&lt;br /&gt;
|-&lt;br /&gt;
| GrabDepth || Float || 1.5 || The distance which a grabbed object is automatically placed at.&lt;br /&gt;
|-&lt;br /&gt;
| GrabDepthInc || Float || 0.15 || Steps that the entity will move in when moving the mouse scroll.&lt;br /&gt;
|-&lt;br /&gt;
| GrabMinDepth || Float || 1.0 || Minimum distance the entity can be from player when grabbed.&lt;br /&gt;
|-&lt;br /&gt;
| GrabMaxDepth || Float || 2.2 || Maximum distance the entity can be from player when grabbed.&lt;br /&gt;
|-&lt;br /&gt;
| GrabUseOffset || Bool || false || If rotation and position offset is used. If not offset will be relative to the interact position.&lt;br /&gt;
|-&lt;br /&gt;
| GrabPositionOffset || Vector3f || 0 || Positional offset of entity.&lt;br /&gt;
|-&lt;br /&gt;
| GrabRotationOffset || Vector3f || 0 || Rotational offset of entity. It will automatically rotate to this when grabbed.&lt;br /&gt;
|-&lt;br /&gt;
| GrabThrowImpulse || Float || 10 || The speed (m/s) at which the entity is thrown.&lt;br /&gt;
|-&lt;br /&gt;
| GrabMassMul || Float || 0.1 || How much the object will weight when grabbed. Useful for heavier objects since they can wreck mayhem otherwise. 0.5% means half (50%) of the original weight.&lt;br /&gt;
|-&lt;br /&gt;
| GrabForceMul || Float || 1 || Change how much force is added to grabbed object.&lt;br /&gt;
|-&lt;br /&gt;
| GrabTorqueMul || Float || 1 || Change how much torque is added to grabbed object.&lt;br /&gt;
|-&lt;br /&gt;
| GrabUseRotation || Bool || true || If rotation should be used on grabbed object&lt;br /&gt;
|-&lt;br /&gt;
| GrabSkipNonOuterBodies || Bool || false || If true, then bodies that are inside a chain (has two or more joints attached to it) will not be grabbed.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Push ===&lt;br /&gt;
&lt;br /&gt;
Similar to the Grab subtype, the Push subtype allows the player to push the object by taking hold of it and walking or right clicking. Examples include large rocks and the bed covering the hole in the floor in the Prison - Southern Block.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| PushAtPoint || Bool || false || If the push force should be applied to the point at the object where interaction took place.&lt;br /&gt;
|-&lt;br /&gt;
| PushForceMul || Float || 1 || Multiplier for force applied. Used to fine tune interaction.&lt;br /&gt;
|-&lt;br /&gt;
| PushImpulse || Float || 2 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Slide ===&lt;br /&gt;
&lt;br /&gt;
A Slide Object is similar to the Grab subtype, except it can only be slid in a single direction for a certain amount. An existing (but unused) entity that uses this is the secret floor carpet you can slide to the side.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| SlideMaxSpeed || Float || 10 || The maximum speed it can be moved.&lt;br /&gt;
|-&lt;br /&gt;
| SlideSlowDownFactor || Float || 1 || Amount of slowdown applied to object when not moved.&lt;br /&gt;
|-&lt;br /&gt;
| SlideSpeedFactor || Float || 1 || The higher value the more speed gain a mouse movement makes.&lt;br /&gt;
|-&lt;br /&gt;
| SlideThrowImpulse || Float || 3 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SwingDoor ==&lt;br /&gt;
&lt;br /&gt;
A SwingDoor entity is standard hinged door. Any door you can grab and swing open is considered a SwingDoor. To use a SwingDoor, you need to attach joints to where you want the door to swing around. These are usually placed by the hinges of the door. On the joint you can set the min and max values to limit how much the door can be opened. These are usually approximately 90 degrees apart in either positive or negative directions.&lt;br /&gt;
&lt;br /&gt;
If the FullGameSave instance var is not enabled, SwingDoors will reset to their initial open amount when leaving a level and returning to it.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MoveMaxSpeed || Float || 13.5 || The maximum speed it can be moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSlowDownFactor || Float || 3.0 || Amount of slowdown applied to object when not moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSpeedFactor || Float || 1.0 || The higher value the more speed gain a mouse movement makes.&lt;br /&gt;
|-&lt;br /&gt;
| MoveThrowImpulse || Float || 6.0 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
| CanInteractWithStaticBody || Bool || false || If by interacting with a static body in the entity, the door is interacted with. Meaning that interacting with any part of the entity will work.&lt;br /&gt;
|-&lt;br /&gt;
| CloseOnSound || File (.snt) || || Sound played when the door is closed.&lt;br /&gt;
|-&lt;br /&gt;
| CloseOffSound || File (.snt) || || Sound played when the door is opened.&lt;br /&gt;
|-&lt;br /&gt;
| LockOnSound || File (.snt) || || Sound played when the door is locked.&lt;br /&gt;
|-&lt;br /&gt;
| LockOffSound || File (.snt) || || Sound played when the door is unlocked.&lt;br /&gt;
|-&lt;br /&gt;
| InteractLockedSound || File (.snt) || || Sound made when player interacts with a locked door.&lt;br /&gt;
|-&lt;br /&gt;
| Breakable || Bool || false || Can the door be broken.&lt;br /&gt;
|-&lt;br /&gt;
| DamageMesh1 || File (.dae/.msh/.mesh) || || Mesh used when health is below HealthDamage1&lt;br /&gt;
|-&lt;br /&gt;
| DamageMesh2 || File (.dae/.msh/.mesh) || || Mesh used when health is below HealthDamage2&lt;br /&gt;
|-&lt;br /&gt;
| BrokenEntity || File (.ent) || || The entity this entity turns into when broken.&lt;br /&gt;
|-&lt;br /&gt;
| DamageSound || File (.snt) || || Sound made when a new damage mesh is used.&lt;br /&gt;
|-&lt;br /&gt;
| DamagePS || File (.ps) || || Particles created when a new damage mesh is used.&lt;br /&gt;
|-&lt;br /&gt;
| BreakSound || File (.snt) || || Sound made when broken.&lt;br /&gt;
|-&lt;br /&gt;
| BreakPS || File (.ps) || || Particles created when broken.&lt;br /&gt;
|-&lt;br /&gt;
| BreakImpulse || Float || 3 || Impulse set to objects in broken mesh.&amp;lt;br&amp;gt;Incorrectly defined as a sound file in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| HealthDamage1 || Float || 66 || Health when damage mesh 1 is used.&lt;br /&gt;
|-&lt;br /&gt;
| HealthDamage2 || Float || 33 || Health when damage mesh 2 is used.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| Locked || Bool || false || If the door is locked&lt;br /&gt;
|-&lt;br /&gt;
| OpenAmount || Float || 0 || The amount the door is open. 0 - 1.&lt;br /&gt;
|-&lt;br /&gt;
| DisableBreakable || Bool || false || If the entity is breakable then having this true will make it unbreakable.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Lever ==&lt;br /&gt;
&lt;br /&gt;
A Lever entity is an entity that can be swung between states to trigger callbacks. A lever requires a joint to swing around.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MoveMaxSpeed || Float || 13.5 || The maximum speed it can be moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSlowDownFactor || Float || 3.0 || Amount of slowdown applied to object when not moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSpeedFactor || Float || 1.0 || The higher value the more speed gain a mouse movement makes.&lt;br /&gt;
|-&lt;br /&gt;
| MoveThrowImpulse || Float || 6.0 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
| CanInteractWithStaticBody || Bool || false || If by interacting with a static body in the entity, the lever is interacted with. Meaning that interacting with any part of the entity will work.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitRange || Float || 5.0 || The distance from min the joint can be to be considered at min limit.&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitRange || Float || 5.0 || The distance from max the joint can be to be considered at max limit.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitSound || File (.snt) || || Sound played when at min limit&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitSound || File (.snt) || || Sound played when at max limit&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitStuck || Bool || false || If the lever becomes stuck when reaching min.&amp;lt;br&amp;gt;Missing from EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitStuck || Bool || false || If the lever becomes stuck when reaching max.&amp;lt;br&amp;gt;Missing from EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| StuckSound || File (.snt) || || Sound played when stuck&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| MiddleAngleAmount || Float || 0 || The amount between min and max that is considered middle. -1 to 1. -1=at min, 0=exactly between min and max, 1=at max&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveToAngle || Bool || True || If the lever should move to position when not interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveSpeedFactor || Float || 2 || Multiplier applied to speed to determine the speed it moves towards wanted position. The higher the faster it gets to the position.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveMaxSpeed || Float || 8 || Max speed it can move at to the wanted position&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveGoal || String || Middle || Where it should go when auto moving.&amp;lt;br&amp;gt;Can be &amp;quot;Middle&amp;quot;, &amp;quot;Min&amp;quot;, or &amp;quot;Max&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| StuckState || String || None || The initial stuck state for the lever.&amp;lt;br&amp;gt;Can be &amp;quot;None&amp;quot;, &amp;quot;Min&amp;quot;, or &amp;quot;Max&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| InteractionDisablesStuck || Bool || false || If stuck is disabled when player interacts.&lt;br /&gt;
|-&lt;br /&gt;
| OverrideDefaults || Bool || false || If normal settings, set in ent file, should be overridden by settings below.&lt;br /&gt;
|-&lt;br /&gt;
| MiddleAngleAmount || Float || 0 || The amount between min and max that is considered middle. -1 to 1. -1=at min, 0=exactly between min and max, 1=at max&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveToAngle || Bool || True || If the lever should move to position when not interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveGoal || String || Middle || Where it should go when auto moving.&amp;lt;br&amp;gt;Can be &amp;quot;Middle&amp;quot;, &amp;quot;Min&amp;quot;, or &amp;quot;Max&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Wheel ==&lt;br /&gt;
&lt;br /&gt;
A Wheel entity is a wheel that can be turned. They use states similar to the levers. Some wheels can be turned indefinitely and some (mostly valves) can be turned for a fixed amount in order to trigger an event. Wheels require a joint.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MoveMaxSpeed || Float || 13.5 || The maximum speed it can be moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSlowDownFactor || Float || 3.0 || Amount of slowdown applied to object when not moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSpeedFactor || Float || 1.0 || The higher value the more speed gain a mouse movement makes.&lt;br /&gt;
|-&lt;br /&gt;
| MoveThrowImpulse || Float || 6.0 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
| CanInteractWithStaticBody || Bool || false || If by interacting with a static body in the entity, the wheel is interacted with. Meaning that interacting with any part of the entity will work.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimit || Float || -180 || Min limit of the wheel, should be equal or below 0 but can be as low as wanted. Several revolutions are supported!&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimit || Float || 180 || Max limit of the wheel, should be equal or above 0 but can be as high as wanted. Several revolutions are supported!&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitRange || Float || 5.0 || The distance from min the joint can be to be considered at min limit.&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitRange || Float || 5.0 || The distance from max the joint can be to be considered at max limit.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitStuck || Bool || false || If the wheel becomes stuck when reaching min limit.&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitStuck || Bool || false || If the wheel becomes stuck when reaching max limit.&lt;br /&gt;
|-&lt;br /&gt;
| SpinDir || String || BothWays || The direction the wheel can be spun&amp;lt;br&amp;gt;Can be &amp;quot;BothWays&amp;quot;, &amp;quot;ToMin&amp;quot;, or &amp;quot;ToMax&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitSound || File (.snt) || || Sound played at min limit&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitSound || File (.snt) || || Sound played at max limit&lt;br /&gt;
|-&lt;br /&gt;
| StuckSound || File (.snt) || || Sound played when stuck.&lt;br /&gt;
|-&lt;br /&gt;
| SlowDownRotation || Bool || true || If rotation should be slowed to 0 when not interacting.&lt;br /&gt;
|-&lt;br /&gt;
| SkipMiddleState || Bool || true || If the middle state (when not in max or min) should be skipped by script and connections.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| StuckState || String || None || The stuck state for the wheel.&amp;lt;br&amp;gt;Can be &amp;quot;None&amp;quot;, &amp;quot;Min&amp;quot;, or &amp;quot;Max&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| InteractionDisablesStuck || Bool || false || If stuck is disabled when player interacts.&lt;br /&gt;
|-&lt;br /&gt;
| OverrideDefaults || Bool || false || If normal settings, set in ent file, should be overridden by settings below.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimit || Float || -180 || Min limit of the wheel, should be equal or below 0 but can be as low as wanted. Several revolutions are supported!&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimit || Float || 180 || Max limit of the wheel, should be equal or above 0 but can be as high as wanted. Several revolutions are supported!&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitStuck || Bool || false || If the wheel becomes stuck when reaching min limit.&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitStuck || Bool || false || If the wheel becomes stuck when reaching max limit.&lt;br /&gt;
|-&lt;br /&gt;
| SpinDir || String || BothWays || The direction the wheel can be spun&amp;lt;br&amp;gt;Can be &amp;quot;BothWays&amp;quot;, &amp;quot;ToMin&amp;quot;, or &amp;quot;ToMax&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MultiSlider ==&lt;br /&gt;
&lt;br /&gt;
A sliding-type lever that can be set to multiple states. Used for the gear levers in the Sewer.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| SlideMaxSpeed || Float || 10 || The maximum speed it can be moved.&lt;br /&gt;
|-&lt;br /&gt;
| SlideSlowDownFactor || Float || 1 || Amount of slowdown applied to object when not moved.&lt;br /&gt;
|-&lt;br /&gt;
| SlideSpeedFactor || Float || 1 || The higher value the more speed gain a mouse movement makes.&lt;br /&gt;
|-&lt;br /&gt;
| SlideThrowImpulse || Float || 3 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
| NumOfStates || Int || 3 || The number of states used.&lt;br /&gt;
|-&lt;br /&gt;
| StickToStateMaxDist || Float || 0.1 || The distance from a state that the slider sticks.&lt;br /&gt;
|-&lt;br /&gt;
| CanInteractWithStaticBody || Bool || false || If by interacting with a static body in the entity, the lever is interacted with. Meaning that interacting with any part of the entity will work.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveToCurrentState || Bool || true || If body should automove to current state when not interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveSpeedFactor || Float || 2 || Multiplier applied to speed to determine the speed it moves towards wanted position. The higher the faster it gets to the postion.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveMaxSpeed || Float || 8 || Max speed it can move at to the wanted position&lt;br /&gt;
|-&lt;br /&gt;
| ChangeStateSound || File (.snt) || || Sound played when state is changed&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| StuckSound || File (.snt) || || Sound played when stuck&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| StuckState || String || None || The stuck state for the wheel.&amp;lt;br&amp;gt;Can be &amp;quot;None&amp;quot;, &amp;quot;Min&amp;quot;, or &amp;quot;Max&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| InteractionDisablesStuck || Bool || false || If stuck is disabled when player interacts.&lt;br /&gt;
|-&lt;br /&gt;
| ChangeStateCallback || String || || Called when state changes Syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;Used instead of ConnectionStateChangeCallback, as this entity type can have more than two possible states.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Lamp ==&lt;br /&gt;
&lt;br /&gt;
A Lamp entity is a light source. If they are unlit, they can be lit by the player, consuming a tinderbox. Examples are torches and candles.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CanBeLitByPlayer || Bool || true || If the player can use a tinderbox on it to light it.&lt;br /&gt;
|-&lt;br /&gt;
| CanBeGrabbed || Bool || false || If it can be grabbed by the player.&amp;lt;br&amp;gt;No effect. Presumably intended to make the entity behave like a Grab Object, yet this is unimplemented.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| Lit || Bool || true || If the lamp is lit or not.&lt;br /&gt;
|-&lt;br /&gt;
| ConnectedLight || String || || Name of a light (that is not in an entity!) that will be connected to the this light and will increase/decrease in color as the lamp is turned on/off.&lt;br /&gt;
|-&lt;br /&gt;
| ConnectionLightAmount || Float || 1 || The amount to multiply the lamp's color by before adding it to the connected light's color.&lt;br /&gt;
|-&lt;br /&gt;
| ConnectionLightUseOnColor || Bool || true || If the on color should always be used. If false the light color (which might be flickering) is used.&lt;br /&gt;
|-&lt;br /&gt;
| ConnectionLightUseSpec || Bool || false || If the specular of the lamp color should be used.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Button ==&lt;br /&gt;
&lt;br /&gt;
A Button entity acts like a Lever, except it does not use a joint. It simply changes its connection state and toggles effects when interacted with.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| SwitchedOn || Bool || false || If the button starts as on or off&lt;br /&gt;
|-&lt;br /&gt;
| CanBeSwitchedOn || Bool || true || If player can switch it on.&lt;br /&gt;
|-&lt;br /&gt;
| CanBeSwitchedOff || Bool || false || If player can switch it off.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Photocell ==&lt;br /&gt;
&lt;br /&gt;
A prop that changes its texture illumination and connection state based on the light level around it. Presumably a leftover from Lux Tenebris, which featured light-based puzzles.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| LightLevelOnLimit || Float || 0.9 || Light level above this value turns the photocell on.&lt;br /&gt;
|-&lt;br /&gt;
| LightLevelOffLimit || Float || 0.1 || Light level below this value turns the photocell off.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MoveObject ==&lt;br /&gt;
&lt;br /&gt;
A MoveObject entity is an entity that can be specifically moved on a single axis through the use of scripting. It can be set to either Angular or Linear. Angular rotates the object around its own center point, unless otherwise specified by the use of an OffsetArea. Linear moves the object in a direction for a specified amount. Note that a linear move object can only move on one axis. You can pick X, Y, or Z in the entity and this cannot be changed mid-game. If you want the same object to move on more than 1 axis (for example left then forward) you can switch out the entity with an identical one that uses another axis. The script to move a MoveObject is &amp;lt;code&amp;gt;SetMoveObjectState&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;SetMoveObjectStateExt&amp;lt;/code&amp;gt; (see [[HPL2/Engine Scripts|Engine Scripts]]).&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MoveObjectType || String || Linear || The way the object moves. Linear means position changes and Angular means rotation changes.&amp;lt;br&amp;gt;Can be &amp;quot;Linear&amp;quot; or &amp;quot;Angular&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| OpenAmount || Float || 1.0 || Linear: How much of the MoveAxis size that will mean that it is open. Angular: 1=90 degrees. 0.5=45deg and 2=180deg (any numbers inbetween are okay of course)&lt;br /&gt;
|-&lt;br /&gt;
| MoveAxis || String || X || he axis that the movement is about. For angular it is rotation axis and for linear it is the position axis that is changed.&amp;lt;br&amp;gt;Can be &amp;quot;X&amp;quot;, &amp;quot;Y&amp;quot;, or &amp;quot;Z&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| OpenAcc || Float || 5.0 || The acceleration for reaching OpenSpeed&lt;br /&gt;
|-&lt;br /&gt;
| OpenSpeed || Float || 1.0 || The goal speed when opening.&lt;br /&gt;
|-&lt;br /&gt;
| CloseAcc || Float || 5.0 || The acceleration for reaching CloseSpeed&lt;br /&gt;
|-&lt;br /&gt;
| CloseSpeed || Float || 1.0 || The goal speed when closing.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMove || Bool || false || If the door should move towards some goal automatically.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveStateGoal || Float || 0.0 || The amount (relative to the what is considered open) that it shall move towards.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveAcc || Float || 9.0 || The acceleration when automoving&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveSpeed || Float || 5.0 || The goal speed when automoving&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveSlowdownDist || Float || 0.1 || The distance from state goal where it begins to slow down (in meters for linear and degrees for angular).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| AngularOffsetArea || String || || When mode is angular, this the point it rotates around. If empty, it rotates around its center.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Item ==&lt;br /&gt;
&lt;br /&gt;
Item entities become inventory items when interacted with. They glow when in pickup range.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| SubItemTypeName || String || || Determines its name and description by putting 'ItemDesc_' or 'ItemName_' as prefix for the lang file entry. Category is always Inventory&lt;br /&gt;
|-&lt;br /&gt;
| ImageFile || File (.tga/.dds/.jpg/.jpeg/.png) || || The icon shown in the inventory when picked up.&lt;br /&gt;
|-&lt;br /&gt;
| PickSound || String || Generic || The sound played when picked up.&amp;lt;br&amp;gt;Must match a sound file name in the &amp;quot;ui&amp;quot; folder, starting with &amp;quot;pick_&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CustomSubItemTypeName || String || || If not emtpy it overrides SubItemTypeName in entity file. Determines its name and description by putting 'ItemDesc_' or 'ItemName_' as prefix for the lang file entry. Category is always Inventory&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Puzzle ===&lt;br /&gt;
&lt;br /&gt;
A Puzzle subtype item is a general item with no extra properties. Use this if you only need an inventory item to be used to trigger a scripted action. Other subtypes have special properties, but Puzzle only has the ability to be collected and used from the inventory. When used, it's loaded onto the crosshair so the player can use it on objects.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| TempVar || Float || 0 || User specfic usage.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Coins ===&lt;br /&gt;
&lt;br /&gt;
Unused item type for the cut Thaler items. Thalers were once used to unlock Chests and use OilBarrels, with only the former functionality remaining.&lt;br /&gt;
&lt;br /&gt;
{{warning|You can create custom coin items, but there is a single language entry which is hardcoded into the engine and can't be changed. This means that even if all the others are changed, looking at Chests will always say &amp;quot;Locked. Costs X Thalers to open.&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CoinAmount || Int || 10 || The amount of coins it contains.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Note ===&lt;br /&gt;
&lt;br /&gt;
A Note item is an item that adds text to the player's journal. It displays itself when picked up. The note can be narrated, in which case it will automatically close once it's finished. If it isn't voiced, the player must close it. Use this if you want to make a Note item using a custom model or custom properties that differ from the main notes.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| NoteText || String || || The text and name of entry for note. Entry names for these are calculated: 'Note_'+NoteText+'_Name' and 'Note_'+NoteText+'_Text'&lt;br /&gt;
|-&lt;br /&gt;
| OpenNoteInJournal || Bool || true || If the journal should be opened when the note is picked up.&lt;br /&gt;
|-&lt;br /&gt;
| UseNarration || Bool || false || If the note has narration.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Diary ===&lt;br /&gt;
&lt;br /&gt;
A Diary item is nearly identical to the Note item. Instead, it adds itself to the Diary section of the player's journal, whereas the Note adds itself to the Notes section. Additionally, diary entries are grouped together, so that when one is split into multiple parts, the player will always read them in order, regardless of the specific Diary items that were picked up.&lt;br /&gt;
&lt;br /&gt;
Diaries are also always voice enabled, while Notes have the option for it. As such, a Diary without any voice files defined in its text will instantly close the journal on pickup.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| DiaryText || String || || The text and name of entry for diary. Entry name for these calculated: 'Diary_'+DiaryText+'_Name'+Idx and 'Diary_'+DiaryText+'_Text'+Idx. Idx starts at 1.&lt;br /&gt;
|-&lt;br /&gt;
| DiaryCallback || String || || A special callback for diary pickup. Syntax: &amp;lt;code&amp;gt;void Func(string &amp;amp;in asItem, int lDiaryIdx)&amp;lt;/code&amp;gt;. Call &amp;lt;code&amp;gt;ReturnOpenJournal(false)&amp;lt;/code&amp;gt; to not open diary in journal after callback.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Lantern ===&lt;br /&gt;
&lt;br /&gt;
A Lantern item can be picked up like a normal item, but is added as a lantern to the inventory. While having this item, the player can press F to toggle it, or click it in the inventory. Note: This is NOT the lantern model in the player's hands, only the item that gives it to the player. If you want a custom lantern model, you can follow [https://www.frictionalgames.com/forum/thread-12391.html this guide].&lt;br /&gt;
&lt;br /&gt;
=== Health ===&lt;br /&gt;
&lt;br /&gt;
A Health item acts like a health potion (Laudanum). When used, it increases the player's health by a specified amount.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| HealAmount || Float || 25 || How much health is regained when used.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sanity ===&lt;br /&gt;
&lt;br /&gt;
A Sanity item acts like a sanity potion. When used, it increases the player's sanity by a specified amount.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| HealAmount || Float || 25 || How much sanity is regained when used.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== LampOil ===&lt;br /&gt;
&lt;br /&gt;
A LampOil item acts like an oil potion. When used, it increases the player's lantern oil by a specified amount.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| OilAmount || Float || 25 || How much oil is regained when used.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Tinderbox ===&lt;br /&gt;
&lt;br /&gt;
A Tinderbox item adds itself to the player's tinderbox counter in the inventory. Tinderboxes can be used once to light a light source.&lt;br /&gt;
&lt;br /&gt;
=== HandObject ===&lt;br /&gt;
&lt;br /&gt;
Unused. Would have equipped the corresponding hand object on use.&lt;br /&gt;
&lt;br /&gt;
== Chest ==&lt;br /&gt;
&lt;br /&gt;
This is an unused feature, but it was kept in the engine and can be restored by making a custom entity. It is a object which can be opened using coins (or their replacements, if a custom Coin-type entity is made). Interacting with it brings up a text GUI. The text GUI can be changed in the base language file.&lt;br /&gt;
To make an entity of this type, just copy an existing entity file and change its entity type.&lt;br /&gt;
'''The chests that ended up in the game are actually just Levers.'''&lt;br /&gt;
&lt;br /&gt;
{{warning|In versions before 1.5, Chests did not write their CoinsNeeded instance var to save data, which caused the coin requirement of all Chests to default to 0 when loading a save.}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MoveMaxSpeed || Float || 13.5 || The maximum speed it can be moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSlowDownFactor || Float || 3.0 || Amount of slowdown applied to object when not moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSpeedFactor || Float || 1.0 || The higher value the more speed gain a mouse movement makes.&lt;br /&gt;
|-&lt;br /&gt;
| MoveThrowImpulse || Float || 6.0 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CoinsNeeded || Int || 200 || Coins required to open the chest.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== OilBarrel ==&lt;br /&gt;
&lt;br /&gt;
An OilBarrel entity simply adds some oil to the player's lantern upon interaction. The oil amount depends on the player's combined total oil stored in their lantern and as LampOil type items (the sum of the oil that the items would refill on use), determined when the player first looks at the OilBarrel. If the total oil is less than 100, the OilBarrel will contain exactly enough oil to bring it to 100. Otherwise (or if Hard Mode is enabled), it provides only 10 oil.&lt;br /&gt;
&lt;br /&gt;
If the FullGameSave instance var is not enabled, OilBarrels can be used again when leaving a level and returning to it.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| FillSound || File (.snt) || || Sound played when lantern is filled.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| EmptySound || File (.snt) || || Sound played when barrel is empty.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
== EmotionStone ==&lt;br /&gt;
&lt;br /&gt;
The memory capsule entities found in the game. Interacting with an EmotionStone causes an emotion flash effect to display, fading the screen to white and displaying a message.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| DescCat || String || || Category of text shown when in focus.&lt;br /&gt;
|-&lt;br /&gt;
| DescEntry || String || || Entry of text shown when in focus.&lt;br /&gt;
|-&lt;br /&gt;
| TextCat || String || || Category of text shown when interacted with.&amp;lt;br&amp;gt;Typically &amp;quot;EmotionStone&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry || String || || Entry of text shown when interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| Sound || File (.snt) || || Sound played when interacted with.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== NPC ==&lt;br /&gt;
&lt;br /&gt;
Non-Player Characters are non-enemy characters. Agrippa and Alexander as they appear in-game are NPCs. Their only purpose is to stand in place and look at the player (if you enable the option).&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MoveHeadBones || String || || List of bones that is rotated when the NPC rotates its head.&lt;br /&gt;
|-&lt;br /&gt;
| MoveHeadBoneMuls || String || || List of floats specifying how much each bone shall be rotated (-1 to 1).&lt;br /&gt;
|-&lt;br /&gt;
| HeadMoveSpeedMul || Float || 1 || Speed multiplier that that determines move speed based on distance to wanted angle.&lt;br /&gt;
|-&lt;br /&gt;
| HeadMoveMaxSpeed || Float || 1 || The max speed that the head moves in.&lt;br /&gt;
|-&lt;br /&gt;
| MaxHeadAngle || Float || 30 || The max angle that the head can turn when looking at the player.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| FollowPlayerArea || String || || When player is in this area, the NPC will look at him.&lt;br /&gt;
|-&lt;br /&gt;
| Awake || Bool || true || If the NPC is awake and looks at the player when in area.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== LevelDoor ==&lt;br /&gt;
&lt;br /&gt;
A LevelDoor transports the player to the specified level when interacted with. The locked sounds, text, and destination can be entered in the Level Editor itself.&lt;br /&gt;
&lt;br /&gt;
LevelDoors can also teleport the player (without a loading screen) if the same map is picked.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| EnterSound || File (.snt) || || Sound played when entering door.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| ExitSound || File (.snt) || || Sound played when entering new map after having interacted with door.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry || String || || The text shown when door is in focus. Category is always Levels&lt;br /&gt;
|-&lt;br /&gt;
| StartPos || String || || The start position of the next map that the player is transported to.&lt;br /&gt;
|-&lt;br /&gt;
| MapFile || File (.map) || || The file of the next map.&lt;br /&gt;
|-&lt;br /&gt;
| Locked || Bool || false || If the door is locked.&lt;br /&gt;
|-&lt;br /&gt;
| LockedSound || File (.snt) || || Sound heard if locked and interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| LockedTextCat || String || || Category of message shown if locked and interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| LockedTextEntry || String || || Entry of message shown if locked and interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| ShowStats || Bool || true || If stats of map it leads to should be shown (NOT IN USE)&amp;lt;br&amp;gt;Non-functional. Formerly used to display a completion percentage.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CritterBug ==&lt;br /&gt;
&lt;br /&gt;
Critters like rats, roaches, or fish on the ground (or in the case of fish, water). They move around the room they are placed in and run away from the player.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MeshOffsetRot || Vector3 || 0 0 0 || The mesh offset rotation.&lt;br /&gt;
|-&lt;br /&gt;
| MeshOffsetPos || Vector3 || 0 0 0 || The mesh offset position.&lt;br /&gt;
|-&lt;br /&gt;
| MaxSpeedNormal || Float || 0.5 || Max speed when in normal state&lt;br /&gt;
|-&lt;br /&gt;
| MaxSpeedAfraid || Float || 1.3 || Max speed when in the scared state&lt;br /&gt;
|-&lt;br /&gt;
| Gravity || Float || 9.8 || Amount of gravity applied.&lt;br /&gt;
|-&lt;br /&gt;
| HasRandomPauses || Bool || false || If the critter shall have random pauses&lt;br /&gt;
|-&lt;br /&gt;
| RandomPauseTimeMinMax || Vector2 || 1 3 || Random time length of pause&lt;br /&gt;
|-&lt;br /&gt;
| RandomMoveTimeMinMax || Vector2 || 2 6 || Random time length of movement (between pauses)&lt;br /&gt;
|-&lt;br /&gt;
| PlayerFleeDistance || Float || 3 || The distance from player which it begins to flee&lt;br /&gt;
|-&lt;br /&gt;
| FleeMul || Float || 2.1 || Factor for moving away from player (if fleeing)&lt;br /&gt;
|-&lt;br /&gt;
| BackToSpawnPointMul || Float || 0.1 || Factor for moving back to spawn point&lt;br /&gt;
|-&lt;br /&gt;
| WanderCircleRadius || Float || 4 || Picture a circle in front critter at a certain distance. A point inside the circle is randomly selected and then the vector from the critter to this point is the speed added. The larger the circle, the more random the walk.&lt;br /&gt;
|-&lt;br /&gt;
| WanderCircleDist || Float || 2 || The distance at which the wander circle is placed. The higher the distance, the more likely the critter is to move forward.&lt;br /&gt;
|-&lt;br /&gt;
| NormalSound || File (.snt) || || Sound made when in normal state&lt;br /&gt;
|-&lt;br /&gt;
| NormalSoundRandMinMax || Vector2 || 1 3 || Random time length between normal sounds. x=min, y=max&lt;br /&gt;
|-&lt;br /&gt;
| ScaredSound || File (.snt) || || Sound made when in afraid state&lt;br /&gt;
|-&lt;br /&gt;
| ScaredSoundRandMinMax || Vector2 || 1 3 || Random time length between afraid sounds. x=min, y=max&lt;br /&gt;
|-&lt;br /&gt;
| DeathEntity || File (.ent) || || Entity created when dead.&lt;br /&gt;
|-&lt;br /&gt;
| DeathPS || File (.ps) || || Particle created when dead.&lt;br /&gt;
|-&lt;br /&gt;
| DeathSound || File (.snt) || || Sound played when dead.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
== CritterSpider ==&lt;br /&gt;
&lt;br /&gt;
A unused critter similar to the spider enemies from [[wikipedia:Penumbra: Overture|Penumbra: Overture]]. Capable of climbing walls and ceilings, as well as attacking the player.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MaxIdleSpeed || Float || 0.5 ||&lt;br /&gt;
|-&lt;br /&gt;
| MaxHuntSpeed || Float || 0.75 ||&lt;br /&gt;
|-&lt;br /&gt;
| HitSound || File (.snt) || || Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| IdleSound || File (.snt) || || Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| IdleSoundRandMinMax || Vector2 || 1 3 ||&lt;br /&gt;
|-&lt;br /&gt;
| AttackSound || File (.snt) || || Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| AttackPlayerDistMinMax || Vector2 || 1 3 ||&lt;br /&gt;
|-&lt;br /&gt;
| HuntPlayerDist || Float || 8 ||&lt;br /&gt;
|-&lt;br /&gt;
| HuntTimeMinMax || Vector2 || 10 30 ||&lt;br /&gt;
|-&lt;br /&gt;
| MoveTimeMinMax || Vector2 || 4 8 ||&lt;br /&gt;
|-&lt;br /&gt;
| IdleTimeMinMax || Vector2 || 0.4 2 ||&lt;br /&gt;
|-&lt;br /&gt;
| DeathEntity || File (.ent) || || Entity created when dead.&lt;br /&gt;
|-&lt;br /&gt;
| DeathPS || File (.ps) || || Particle created when dead.&lt;br /&gt;
|-&lt;br /&gt;
| DeathSound || File (.snt) || || Sound played when dead.&lt;br /&gt;
|-&lt;br /&gt;
| AttackSizeRadius || Float || 0.3 ||&lt;br /&gt;
|-&lt;br /&gt;
| AttackOffset || Vector3 || 0 0 1 ||&lt;br /&gt;
|-&lt;br /&gt;
| AttackDamageMinMax || Vector2 || 5 15 ||&lt;br /&gt;
|-&lt;br /&gt;
| AttackForce || Vector2 || 5 1 ||&lt;br /&gt;
|-&lt;br /&gt;
| AttackStrength || Int || 1 ||&lt;br /&gt;
|-&lt;br /&gt;
| AttackHitSound || File (.snt) || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
== Enemy_Grunt ==&lt;br /&gt;
&lt;br /&gt;
An Enemy_Grunt entity is a standard enemy entity, used for the Grunt, Brute, and Suitor. Enemy entities require advanced setup, and should include animations added through Settings &amp;gt; Animations. Enemy properties can be modified in the entity type window, like certain sounds and music tracks playing, the enemy's awareness levels and damage, speed and other similar settings. An enemy does not use a collision box, but instead a skeleton and the aforementioned properties to determine how to collide/hit something.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Enemy}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| NoticeSound || File (.snt) || || Sound played when enemy notices that player is nearby&lt;br /&gt;
|-&lt;br /&gt;
| GiveUpNoticeSound || File (.snt) || || Sound played when enemy gives up investigation (after a notice)&lt;br /&gt;
|-&lt;br /&gt;
| EnabledSound || File (.snt) || || Sound played when enemy is enabled&lt;br /&gt;
|-&lt;br /&gt;
| GroggyDamageCount || Float || 15 || The accumulated amount of damage the enemy can take before getting groggy by the hit.&amp;lt;br&amp;gt;The enemy will flinch after taking this amount of damage.&lt;br /&gt;
|-&lt;br /&gt;
| AlertToHuntDistance || Float || 10 || If range is above this then enemy can go from alert to hunt&lt;br /&gt;
|-&lt;br /&gt;
| AlertToInstantHuntDistance || Float || 3.5 || If range is below this, enemy geos instantly to hunt.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMinTime || Float || 2.0 || Min time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMaxTime || Float || 4.5 || Max time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| IncreaseAlertSpeedDistance || Float || 6 || Distance at which the alert move speed increases.&lt;br /&gt;
|-&lt;br /&gt;
| IncreasedAlertSpeedMul || Float || 1.5 || The amount that move speed is multiplied by when alert.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsToHuntLimit || Float || 30 || The accumulated limit value when alert goes to hunt because of player running towards enemy.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsCheckDistance || Float || 5 || The distance where the move toward enemy check starts&lt;br /&gt;
|-&lt;br /&gt;
| IdleExtraTimeMin || Float || 2 || Min time between extra idle animations&lt;br /&gt;
|-&lt;br /&gt;
| IdleExtraTimeMax || Float || 6 || Max time between extra idle animations&lt;br /&gt;
|-&lt;br /&gt;
| IdleExtraNum || Int || 3 || Number of extra idle animations&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Enemy}}&lt;br /&gt;
&lt;br /&gt;
== Enemy_ManPig ==&lt;br /&gt;
{{clr}}&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
An enemy type ported from A Machine For Pigs. Compare to the [[HPL2/AMFP/NewEntities#Enemy_ManPig|AMFP version]] of the enemy.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Enemy}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Walk_ForwardSpeed || Float || 1.0 || Forward speed when walking on all fours, in meters per second.&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Walk_BackwardSpeed || Float || 1.0 || Backward speed when walking on all fours, in meters per second.&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Walk_ForwardAcc || Float || 2.0 || &lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Walk_ForwardDeacc || Float || 8.0 || &lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Run_ForwardSpeed || Float || 3.0 || Forward speed when running on all fours, in meters per second.&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Run_BackwardSpeed || Float || 2.0 || Backward speed when running on all fours, in meters per second.&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Run_ForwardAcc || Float || 4.0 || &lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Run_ForwardDeacc || Float || 8.0 || &lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_StoppedToWalkSpeed || Float || 0.05 || Speed at which the walk animation is played when on all fours&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_WalkToStoppedSpeed || Float || 0.02 || Speed at which walk goes to stopped when on all fours&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_WalkToRunSpeed || Float || 2.0 || Speed at which walk turns to run animation when on all fours&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_RunToWalkSpeed || Float || 0.9 || Speed at which run turns to walk when on all fours&lt;br /&gt;
|-&lt;br /&gt;
| NoticeSound || File (.snt) || || Sound played when enemy notices that player is nearby&lt;br /&gt;
|-&lt;br /&gt;
| GiveUpNoticeSound || File (.snt) || || Sound played when enemy gives up investigation (after a notice)&lt;br /&gt;
|-&lt;br /&gt;
| EnabledSound || File (.snt) || || Sound played when enemy is enabled&lt;br /&gt;
|-&lt;br /&gt;
| GroggyDamageCount || Float || 1 || The accumulated amount of damage the enemy can take before getting groggy by the hit.&amp;lt;br&amp;gt;The enemy will flinch after taking this amount of damage.&lt;br /&gt;
|-&lt;br /&gt;
| AlertToHuntDistance || Float || 6 || If range is above this then enemy can go from alert to hunt&lt;br /&gt;
|-&lt;br /&gt;
| AlertToInstantHuntDistance || Float || 2.5 || If range is below this, enemy geos instantly to hunt.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMinTime || Float || 0.5 || Min time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMaxTime || Float || 1.0 || Max time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| IncreaseAlertSpeedDistance || Float || 6 || Distance at which the alert move speed increases.&lt;br /&gt;
|-&lt;br /&gt;
| IncreasedAlertSpeedMul || Float || 1.25 || The amount that move speed is multiplied by when alert.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsToHuntLimit || Float || 30 || The accumulated limit value when alert goes to hunt because of player running towards enemy.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsCheckDistance || Float || 6 || The distance where the move toward enemy check starts&lt;br /&gt;
|-&lt;br /&gt;
| IsTelsa || Bool || false || If this is the tesla pig&lt;br /&gt;
|-&lt;br /&gt;
| TeslaSoundLoop || File (.snt) || || Sound file played when the tesla's proximity effects are active.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| ChaseSound || File (.snt) || || Played when the pig is chasing.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Enemy}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| Pose || String || Biped || The pose of the enemy to start with&amp;lt;br&amp;gt;Can be &amp;quot;Biped&amp;quot; or &amp;quot;Quadruped&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| ThreatenOnAlert || Bool || false || If the pig should stand still and threaten instead of walking towards player when in alert mode.&lt;br /&gt;
|-&lt;br /&gt;
| FleeFromPlayer || Bool || false || The pig will flee instead of hunting (threaten if ThreatenOnAlert). Disabled if far enough away. Will attack if cornered.&lt;br /&gt;
|-&lt;br /&gt;
| AutoDisableAfterFlee || Bool || false || If pig should be disabled after having fled (if possible)&lt;br /&gt;
|-&lt;br /&gt;
| LanternSensitivity || Float || 1 || A modifier for how quickly the pig reacts to being shined on by the lantern.&amp;lt;br&amp;gt;Not defined in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| IdleBehavior || String || None || The behavior used when there are no patrol nodes left to walk.&amp;lt;br&amp;gt;Can be &amp;quot;None&amp;quot;, &amp;quot;Stalk&amp;quot;, or &amp;quot;Track&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| PlayActivateSound || Bool || true || If the enemy can play its EnabledSound.&lt;br /&gt;
|-&lt;br /&gt;
| AllowZeroNodeWaitTimes || Bool || false || If set to true, path node wait times with value 0 actually mean no waiting&amp;lt;br&amp;gt;Normally, specifying a wait time of 0 in &amp;lt;code&amp;gt;AddEnemyPatrolNode&amp;lt;/code&amp;gt; results in a wait time of 1-3 seconds.&lt;br /&gt;
|-&lt;br /&gt;
| PatrolMoveSpeed || String || Walk || Whether this pig walks or runs along its patrol&amp;lt;br&amp;gt;Can be &amp;quot;Walk&amp;quot; or &amp;quot;Run&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| DamageMul || Float || 1 || Multiplier for the enemy's attack damage.&amp;lt;br&amp;gt;Not defined in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| RunSpeedMul || Float || 1 || Multiplier for the enemy's run speed.&amp;lt;br&amp;gt;Not defined in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseTimeMul || Float || 1 || Multiplier for wait time between attacks.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Enemy_Waterlurker ==&lt;br /&gt;
&lt;br /&gt;
Enemy type of the &amp;quot;water monster&amp;quot;. Since you can't assign animations to it, you might as well just use the normal waterlurker of the base game unless you want to change its properties (such as damage, movement speed, or music played).&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Enemy}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| PlayerDetectionHeight || Float || 0.6 || The y-distance from the enemy that the player is detected.&lt;br /&gt;
|-&lt;br /&gt;
| EatDamage || Float || 20 || The damage dealt to food being eaten&lt;br /&gt;
|-&lt;br /&gt;
| AfterAttackPauseTime || Float || 0 || The amount of timer lurker waits after an attack&lt;br /&gt;
|-&lt;br /&gt;
| SplashPS_Walk || File (.ps) || || Particle system created at surface when walking.&lt;br /&gt;
|-&lt;br /&gt;
| SplashPS_Run || File (.ps) || || Particle system created at surface when running.&lt;br /&gt;
|-&lt;br /&gt;
| SplashPS_Eat || File (.ps) || || Particle system created at surface when eating.&lt;br /&gt;
|-&lt;br /&gt;
| SplashPS_Attack || File (.ps) || || Particle system created at surface when attacking.&lt;br /&gt;
|-&lt;br /&gt;
| SplashSound_Walk || File (.snt) || || Sound played when walking.&lt;br /&gt;
|-&lt;br /&gt;
| SplashSound_Run || File (.snt) || || Sound played when running.&lt;br /&gt;
|-&lt;br /&gt;
| SplashSound_Eat || File (.snt) || || Sound played when eating.&lt;br /&gt;
|-&lt;br /&gt;
| SplashSound_Attack || File (.snt) || || Sound played when attacking.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Enemy}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| PlayerDetectionHeight || Float || 0 || If equal or below 0 the default in data file is used! The y-distance from the enemy that the player is detected.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== PlayerHands ==&lt;br /&gt;
&lt;br /&gt;
Player's hands. Unless you want to make a different looking hand for a full conversion mod, you don't have to worry about this.&lt;br /&gt;
&lt;br /&gt;
== HandObject ==&lt;br /&gt;
&lt;br /&gt;
The only available HandObject is the lantern. It is used in conjunction with a &amp;lt;code&amp;gt;.ho&amp;lt;/code&amp;gt; config file to place it properly in PlayerHands.&lt;br /&gt;
&lt;br /&gt;
Mostly a remnant of cut items that functioned as weapons, like in [[wikipedia:Penumbra: Overture|Penumbra: Overture]], including the pickaxe from that game.&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/TDD/Entity_Types&amp;diff=7014</id>
		<title>HPL2/TDD/Entity Types</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/TDD/Entity_Types&amp;diff=7014"/>
		<updated>2025-08-27T07:02:36Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Wheel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TocRight}}&lt;br /&gt;
&lt;br /&gt;
This page lists the different types of entities found within the HPL2 engine. The type determines how the entity will be set up, what kind it is, what it does under different circumstances etc. Using the Model Editor you can identify and specify which type an entity has and its type vars, in Settings &amp;gt; User defined variables. In the Level Editor, the different types have different settings applicable for them, known as instance vars. For example, a MoveObject type will have the OffsetArea box available in the Level Editor, and an Item (Note) type will have a NoteText box available.&lt;br /&gt;
&lt;br /&gt;
A list of all the types and subtypes can be found in the table of contents to the right.&lt;br /&gt;
&lt;br /&gt;
== StaticProp ==&lt;br /&gt;
&lt;br /&gt;
A StaticProp entity resembles a static object. They have no available type properties, but they can still use physics bodies (collision boxes) and have mass/gravity. Note that they cannot be interacted with in the game, and cannot be disabled. If you need this feature, use Object (Static) instead.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CastShadows || Bool || true || If entity casts shadows.&lt;br /&gt;
|-&lt;br /&gt;
| IsAffectedByDecal || Bool || true || If decals can be created on entity.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CommentaryIcon ==&lt;br /&gt;
&lt;br /&gt;
A CommentaryIcon entity is simply an object that can execute commentary sound files, as it was done in the main game. These only appear if the player has &amp;quot;Commentary&amp;quot; enabled in their settings.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| RotateSubMesh || String || || The name of the submesh that is to be rotated&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| File || File (.comment) || || The .comment file for the commentary.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Object ==&lt;br /&gt;
&lt;br /&gt;
Objects are entities that can be activated/deactivated, broken, and interact with physics.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| BreakActive || Bool || false || If entity is broken when hit hard enough or health is 0.&lt;br /&gt;
|-&lt;br /&gt;
| BreakDestroyJoints || Bool || false || If all physics joints should be destroyed when broken.&lt;br /&gt;
|-&lt;br /&gt;
| BreakMinEnergy || Float || 100 || The minimum energy needed for breakage. Energy = Object1Speed * Object1Mass + Object2Speed * Object2Mass. Speed = m/s. If Object 2 is floor or something static, its speed is always 0 and does not contribute to total energy!&lt;br /&gt;
|-&lt;br /&gt;
| BreakEntity || File (.ent) || || The entity this entity turns into when broken.&lt;br /&gt;
|-&lt;br /&gt;
| BreakEntityAlignBody || String || || The body BreakEntity uses to align itself when created. No entity is created if left empty.&lt;br /&gt;
|-&lt;br /&gt;
| BreakSound || File (.snt) || || The sound made when broken.&lt;br /&gt;
|-&lt;br /&gt;
| BreakParticleSystem || File (.ps) || || Particle system shown when broken.&lt;br /&gt;
|-&lt;br /&gt;
| BreakImpulse || Float || 4 || Impulse (speed in m/s really) added to all bodies in BreakEntity when created. The direction of impulse is outwards from center of entity.&lt;br /&gt;
|-&lt;br /&gt;
| HitDamageAmount || Float || 5 || The amount of damage made when hitting an enemy or player.&lt;br /&gt;
|-&lt;br /&gt;
| HitDamageStrength || Int || 1 || The strength of the damage.&lt;br /&gt;
|-&lt;br /&gt;
| MinHitDamageSpeed || Float || 3 || The minimum speed (m/s) needed for damage to be made.&lt;br /&gt;
|-&lt;br /&gt;
| LifeLength || Float || 0 || A time after which the entity automatically breaks. 0=lasts forever.&lt;br /&gt;
|-&lt;br /&gt;
| IsFood || Bool || false || If this is food for some enemies and can be used to lure them. Needs to have break active and health determines how long the food lasts.&amp;lt;br&amp;gt;Waterlurkers are the only enemy type that is lured by and eats food objects.&lt;br /&gt;
|-&lt;br /&gt;
| ShowHints || Bool || true || If a hint can be triggered by interacting with the prop.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| ContainedItem || String || None || An item that is created when entity breaks.&amp;lt;br&amp;gt;Must match an entity file name (extension .ent optional) in the &amp;quot;items&amp;quot; folder.&lt;br /&gt;
|-&lt;br /&gt;
| DisableBreakable || Bool || false || If the entity is breakable then having this true will make it unbreakable.&lt;br /&gt;
|-&lt;br /&gt;
| IsInsanityVision || Bool || false || If the prop is only shown when insanity is low enough.&lt;br /&gt;
|-&lt;br /&gt;
| VisionMaxSanity || Float || 30 || The max sanity the player can have for prop to show if it is an insanity vision.&amp;lt;br&amp;gt;The object will only be visible if the player's sanity is less than this value.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Static ===&lt;br /&gt;
&lt;br /&gt;
Not to be confused with an actual static object. This Object subtype is a generic object with common properties. The static subtype simply disables any additional properties from the other subtypes. An Object (Static) is similar in concept to a StaticProp type entity, however the Object (Static) can be deactivated, can break, has physics, and can have an interact callback set.&lt;br /&gt;
&lt;br /&gt;
=== Grab ===&lt;br /&gt;
&lt;br /&gt;
A Grab subtype is a normal Object entity with the ability to be grabbed by the player in the game. In order for this to work, the object must have a mass above 0.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| GrabUseDepth || Bool || false || If GrabDepth is used. If not the interaction distance is used.&lt;br /&gt;
|-&lt;br /&gt;
| GrabDepth || Float || 1.5 || The distance which a grabbed object is automatically placed at.&lt;br /&gt;
|-&lt;br /&gt;
| GrabDepthInc || Float || 0.15 || Steps that the entity will move in when moving the mouse scroll.&lt;br /&gt;
|-&lt;br /&gt;
| GrabMinDepth || Float || 1.0 || Minimum distance the entity can be from player when grabbed.&lt;br /&gt;
|-&lt;br /&gt;
| GrabMaxDepth || Float || 2.2 || Maximum distance the entity can be from player when grabbed.&lt;br /&gt;
|-&lt;br /&gt;
| GrabUseOffset || Bool || false || If rotation and position offset is used. If not offset will be relative to the interact position.&lt;br /&gt;
|-&lt;br /&gt;
| GrabPositionOffset || Vector3f || 0 || Positional offset of entity.&lt;br /&gt;
|-&lt;br /&gt;
| GrabRotationOffset || Vector3f || 0 || Rotational offset of entity. It will automatically rotate to this when grabbed.&lt;br /&gt;
|-&lt;br /&gt;
| GrabThrowImpulse || Float || 10 || The speed (m/s) at which the entity is thrown.&lt;br /&gt;
|-&lt;br /&gt;
| GrabMassMul || Float || 0.1 || How much the object will weight when grabbed. Useful for heavier objects since they can wreck mayhem otherwise. 0.5% means half (50%) of the original weight.&lt;br /&gt;
|-&lt;br /&gt;
| GrabForceMul || Float || 1 || Change how much force is added to grabbed object.&lt;br /&gt;
|-&lt;br /&gt;
| GrabTorqueMul || Float || 1 || Change how much torque is added to grabbed object.&lt;br /&gt;
|-&lt;br /&gt;
| GrabUseRotation || Bool || true || If rotation should be used on grabbed object&lt;br /&gt;
|-&lt;br /&gt;
| GrabSkipNonOuterBodies || Bool || false || If true, then bodies that are inside a chain (has two or more joints attached to it) will not be grabbed.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Push ===&lt;br /&gt;
&lt;br /&gt;
Similar to the Grab subtype, the Push subtype allows the player to push the object by taking hold of it and walking or right clicking. Examples include large rocks and the bed covering the hole in the floor in the Prison - Southern Block.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| PushAtPoint || Bool || false || If the push force should be applied to the point at the object where interaction took place.&lt;br /&gt;
|-&lt;br /&gt;
| PushForceMul || Float || 1 || Multiplier for force applied. Used to fine tune interaction.&lt;br /&gt;
|-&lt;br /&gt;
| PushImpulse || Float || 2 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Slide ===&lt;br /&gt;
&lt;br /&gt;
A Slide Object is similar to the Grab subtype, except it can only be slid in a single direction for a certain amount. An existing (but unused) entity that uses this is the secret floor carpet you can slide to the side.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| SlideMaxSpeed || Float || 10 || The maximum speed it can be moved.&lt;br /&gt;
|-&lt;br /&gt;
| SlideSlowDownFactor || Float || 1 || Amount of slowdown applied to object when not moved.&lt;br /&gt;
|-&lt;br /&gt;
| SlideSpeedFactor || Float || 1 || The higher value the more speed gain a mouse movement makes.&lt;br /&gt;
|-&lt;br /&gt;
| SlideThrowImpulse || Float || 3 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SwingDoor ==&lt;br /&gt;
&lt;br /&gt;
A SwingDoor entity is standard hinged door. Any door you can grab and swing open is considered a SwingDoor. To use a SwingDoor, you need to attach joints to where you want the door to swing around. These are usually placed by the hinges of the door. On the joint you can set the min and max values to limit how much the door can be opened. These are usually approximately 90 degrees apart in either positive or negative directions.&lt;br /&gt;
&lt;br /&gt;
If the FullGameSave instance var is not enabled, SwingDoors will reset to their initial open amount when leaving a level and returning to it.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MoveMaxSpeed || Float || 13.5 || The maximum speed it can be moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSlowDownFactor || Float || 3.0 || Amount of slowdown applied to object when not moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSpeedFactor || Float || 1.0 || The higher value the more speed gain a mouse movement makes.&lt;br /&gt;
|-&lt;br /&gt;
| MoveThrowImpulse || Float || 6.0 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
| CanInteractWithStaticBody || Bool || false || If by interacting with a static body in the entity, the door is interacted with. Meaning that interacting with any part of the entity will work.&lt;br /&gt;
|-&lt;br /&gt;
| CloseOnSound || File (.snt) || || Sound played when the door is closed.&lt;br /&gt;
|-&lt;br /&gt;
| CloseOffSound || File (.snt) || || Sound played when the door is opened.&lt;br /&gt;
|-&lt;br /&gt;
| LockOnSound || File (.snt) || || Sound played when the door is locked.&lt;br /&gt;
|-&lt;br /&gt;
| LockOffSound || File (.snt) || || Sound played when the door is unlocked.&lt;br /&gt;
|-&lt;br /&gt;
| InteractLockedSound || File (.snt) || || Sound made when player interacts with a locked door.&lt;br /&gt;
|-&lt;br /&gt;
| Breakable || Bool || false || Can the door be broken.&lt;br /&gt;
|-&lt;br /&gt;
| DamageMesh1 || File (.dae/.msh/.mesh) || || Mesh used when health is below HealthDamage1&lt;br /&gt;
|-&lt;br /&gt;
| DamageMesh2 || File (.dae/.msh/.mesh) || || Mesh used when health is below HealthDamage2&lt;br /&gt;
|-&lt;br /&gt;
| BrokenEntity || File (.ent) || || The entity this entity turns into when broken.&lt;br /&gt;
|-&lt;br /&gt;
| DamageSound || File (.snt) || || Sound made when a new damage mesh is used.&lt;br /&gt;
|-&lt;br /&gt;
| DamagePS || File (.ps) || || Particles created when a new damage mesh is used.&lt;br /&gt;
|-&lt;br /&gt;
| BreakSound || File (.snt) || || Sound made when broken.&lt;br /&gt;
|-&lt;br /&gt;
| BreakPS || File (.ps) || || Particles created when broken.&lt;br /&gt;
|-&lt;br /&gt;
| BreakImpulse || Float || 3 || Impulse set to objects in broken mesh.&amp;lt;br&amp;gt;Incorrectly defined as a sound file in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| HealthDamage1 || Float || 66 || Health when damage mesh 1 is used.&lt;br /&gt;
|-&lt;br /&gt;
| HealthDamage2 || Float || 33 || Health when damage mesh 2 is used.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| Locked || Bool || false || If the door is locked&lt;br /&gt;
|-&lt;br /&gt;
| OpenAmount || Float || 0 || The amount the door is open. 0 - 1.&lt;br /&gt;
|-&lt;br /&gt;
| DisableBreakable || Bool || false || If the entity is breakable then having this true will make it unbreakable.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Lever ==&lt;br /&gt;
&lt;br /&gt;
A Lever entity is an entity that can be swung between states to trigger callbacks. A lever requires a joint to swing around.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MoveMaxSpeed || Float || 13.5 || The maximum speed it can be moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSlowDownFactor || Float || 3.0 || Amount of slowdown applied to object when not moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSpeedFactor || Float || 1.0 || The higher value the more speed gain a mouse movement makes.&lt;br /&gt;
|-&lt;br /&gt;
| MoveThrowImpulse || Float || 6.0 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
| CanInteractWithStaticBody || Bool || false || If by interacting with a static body in the entity, the lever is interacted with. Meaning that interacting with any part of the entity will work.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitRange || Float || 5.0 || The distance from min the joint can be to be considered at min limit.&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitRange || Float || 5.0 || The distance from max the joint can be to be considered at max limit.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitSound || File (.snt) || || Sound played when at min limit&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitSound || File (.snt) || || Sound played when at max limit&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitStuck || Bool || false || If the lever becomes stuck when reaching min.&amp;lt;br&amp;gt;Missing from EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitStuck || Bool || false || If the lever becomes stuck when reaching max.&amp;lt;br&amp;gt;Missing from EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| StuckSound || File (.snt) || || Sound played when stuck&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| MiddleAngleAmount || Float || 0 || The amount between min and max that is considered middle. -1 to 1. -1=at min, 0=exactly between min and max, 1=at max&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveToAngle || Bool || True || If the lever should move to position when not interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveSpeedFactor || Float || 2 || Multiplier applied to speed to determine the speed it moves towards wanted position. The higher the faster it gets to the position.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveMaxSpeed || Float || 8 || Max speed it can move at to the wanted position&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveGoal || String || Middle || Where it should go when auto moving.&amp;lt;br&amp;gt;Can be &amp;quot;Middle&amp;quot;, &amp;quot;Min&amp;quot;, or &amp;quot;Max&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| StuckState || String || None || The initial stuck state for the lever.&amp;lt;br&amp;gt;Can be &amp;quot;None&amp;quot;, &amp;quot;Min&amp;quot;, or &amp;quot;Max&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| InteractionDisablesStuck || Bool || false || If stuck is disabled when player interacts.&lt;br /&gt;
|-&lt;br /&gt;
| OverrideDefaults || Bool || false || If normal settings, set in ent file, should be overridden by settings below.&lt;br /&gt;
|-&lt;br /&gt;
| MiddleAngleAmount || Float || 0 || The amount between min and max that is considered middle. -1 to 1. -1=at min, 0=exactly between min and max, 1=at max&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveToAngle || Bool || True || If the lever should move to position when not interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveGoal || String || Middle || Where it should go when auto moving.&amp;lt;br&amp;gt;Can be &amp;quot;Middle&amp;quot;, &amp;quot;Min&amp;quot;, or &amp;quot;Max&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Wheel ==&lt;br /&gt;
&lt;br /&gt;
A Wheel entity is a wheel that can be turned. They use states similar to the levers. Some wheels can be turned indefinitely and some (mostly valves) can be turned for a fixed amount in order to trigger an event. Wheels require a joint.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MoveMaxSpeed || Float || 13.5 || The maximum speed it can be moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSlowDownFactor || Float || 3.0 || Amount of slowdown applied to object when not moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSpeedFactor || Float || 1.0 || The higher value the more speed gain a mouse movement makes.&lt;br /&gt;
|-&lt;br /&gt;
| MoveThrowImpulse || Float || 6.0 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
| CanInteractWithStaticBody || Bool || false || If by interacting with a static body in the entity, the wheel is interacted with. Meaning that interacting with any part of the entity will work.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimit || Float || -180 || Min limit of the wheel, should be equal or below 0 but can be as low as wanted. Several revolutions are supported!&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimit || Float || 180 || Max limit of the wheel, should be equal or above 0 but can be as high as wanted. Several revolutions are supported!&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitRange || Float || 5.0 || The distance from min the joint can be to be considered at min limit.&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitRange || Float || 5.0 || The distance from max the joint can be to be considered at max limit.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitStuck || Bool || false || If the wheel becomes stuck when reaching min limit.&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitStuck || Bool || false || If the wheel becomes stuck when reaching max limit.&lt;br /&gt;
|-&lt;br /&gt;
| SpinDir || String || BothWays || The direction the wheel can be spun&amp;lt;br&amp;gt;Can be &amp;quot;BothWays&amp;quot;, &amp;quot;ToMin&amp;quot;, or &amp;quot;ToMax&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitSound || File (.snt) || || Sound played at min limit&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitSound || File (.snt) || || Sound played at max limit&lt;br /&gt;
|-&lt;br /&gt;
| StuckSound || File (.snt) || || Sound played when stuck.&lt;br /&gt;
|-&lt;br /&gt;
| SlowDownRotation || Bool || true || If rotation should be slowed to 0 when not interacting.&lt;br /&gt;
|-&lt;br /&gt;
| SkipMiddleState || Bool || true || If the middle state (when not in max or min) should be skipped by script and connections.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| StuckState || String || None || The stuck state for the wheel.&amp;lt;br&amp;gt;Can be &amp;quot;None&amp;quot;, &amp;quot;Min&amp;quot;, or &amp;quot;Max&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| InteractionDisablesStuck || Bool || false || If stuck is disabled when player interacts.&lt;br /&gt;
|-&lt;br /&gt;
| OverrideDefaults || Bool || false || If normal settings, set in ent file, should be overridden by settings below.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimit || Float || -180 || Min limit of the wheel, should be equal or below 0 but can be as low as wanted. Several revolutions are supported!&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimit || Float || 180 || Max limit of the wheel, should be equal or above 0 but can be as high as wanted. Several revolutions are supported!&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitStuck || Bool || false || If the wheel becomes stuck when reaching min limit.&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitStuck || Bool || false || If the wheel becomes stuck when reaching max limit.&lt;br /&gt;
|-&lt;br /&gt;
| SpinDir || String || BothWays || The direction the wheel can be spun&amp;lt;br&amp;gt;Can be &amp;quot;BothWays&amp;quot;, &amp;quot;ToMin&amp;quot;, or &amp;quot;ToMax&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MultiSlider ==&lt;br /&gt;
&lt;br /&gt;
A sliding-type lever that can be set to multiple states. Used for the gear levers in the Sewer.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| SlideMaxSpeed || Float || 10 || The maximum speed it can be moved.&lt;br /&gt;
|-&lt;br /&gt;
| SlideSlowDownFactor || Float || 1 || Amount of slowdown applied to object when not moved.&lt;br /&gt;
|-&lt;br /&gt;
| SlideSpeedFactor || Float || 1 || The higher value the more speed gain a mouse movement makes.&lt;br /&gt;
|-&lt;br /&gt;
| SlideThrowImpulse || Float || 3 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
| NumOfStates || Int || 3 || The number of states used.&lt;br /&gt;
|-&lt;br /&gt;
| StickToStateMaxDist || Float || 0.1 || The distance from a state that the slider sticks.&lt;br /&gt;
|-&lt;br /&gt;
| CanInteractWithStaticBody || Bool || false || If by interacting with a static body in the entity, the lever is interacted with. Meaning that interacting with any part of the entity will work.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveToCurrentState || Bool || true || If body should automove to current state when not interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveSpeedFactor || Float || 2 || Multiplier applied to speed to determine the speed it moves towards wanted position. The higher the faster it gets to the postion.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveMaxSpeed || Float || 8 || Max speed it can move at to the wanted position&lt;br /&gt;
|-&lt;br /&gt;
| ChangeStateSound || File (.snt) || || Sound played when state is changed&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| StuckSound || File (.snt) || || Sound played when stuck&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| StuckState || String || None || The stuck state for the wheel.&amp;lt;br&amp;gt;Can be &amp;quot;None&amp;quot;, &amp;quot;Min&amp;quot;, or &amp;quot;Max&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| InteractionDisablesStuck || Bool || false || If stuck is disabled when player interacts.&lt;br /&gt;
|-&lt;br /&gt;
| ChangeStateCallback || String || || Called when state changes Syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;Used instead of ConnectionStateChangeCallback, as this entity type can have more than two possible states.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Lamp ==&lt;br /&gt;
&lt;br /&gt;
A Lamp entity is a light source. If they are unlit, they can be lit by the player, consuming a tinderbox. Examples are torches and candles.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CanBeLitByPlayer || Bool || true || If the player can use a tinderbox on it to light it.&lt;br /&gt;
|-&lt;br /&gt;
| CanBeGrabbed || Bool || false || If it can be grabbed by the player.&amp;lt;br&amp;gt;No effect. Presumably intended to make the entity behave like a Grab Object, yet this is unimplemented.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| Lit || Bool || true || If the lamp is lit or not.&lt;br /&gt;
|-&lt;br /&gt;
| ConnectedLight || String || || Name of a light (that is not in an entity!) that will be connected to the this light and will increase/decrease in color as the lamp is turned on/off.&lt;br /&gt;
|-&lt;br /&gt;
| ConnectionLightAmount || Float || 1 || The amount to multiply the lamp's color by before adding it to the connected light's color.&lt;br /&gt;
|-&lt;br /&gt;
| ConnectionLightUseOnColor || Bool || true || If the on color should always be used. If false the light color (which might be flickering) is used.&lt;br /&gt;
|-&lt;br /&gt;
| ConnectionLightUseSpec || Bool || false || If the specular of the lamp color should be used.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Button ==&lt;br /&gt;
&lt;br /&gt;
A Button entity acts like a Lever, except it does not use a joint. It simply changes its connection state and toggles effects when interacted with.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| SwitchedOn || Bool || false || If the button starts as on or off&lt;br /&gt;
|-&lt;br /&gt;
| CanBeSwitchedOn || Bool || true || If player can switch it on.&lt;br /&gt;
|-&lt;br /&gt;
| CanBeSwitchedOff || Bool || false || If player can switch it off.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Photocell ==&lt;br /&gt;
&lt;br /&gt;
A prop that changes its texture illumination and connection state based on the light level around it. Presumably a leftover from Lux Tenebris, which featured light-based puzzles.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| LightLevelOnLimit || Float || 0.9 || Light level above this value turns the photocell on.&lt;br /&gt;
|-&lt;br /&gt;
| LightLevelOffLimit || Float || 0.1 || Light level below this value turns the photocell off.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MoveObject ==&lt;br /&gt;
&lt;br /&gt;
A MoveObject entity is an entity that can be specifically moved on a single axis through the use of scripting. It can be set to either Angular or Linear. Angular rotates the object around its own center point, unless otherwise specified by the use of an OffsetArea. Linear moves the object in a direction for a specified amount. Note that a linear move object can only move on one axis. You can pick X, Y, or Z in the entity and this cannot be changed mid-game. If you want the same object to move on more than 1 axis (for example left then forward) you can switch out the entity with an identical one that uses another axis. The script to move a MoveObject is &amp;lt;code&amp;gt;SetMoveObjectState&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;SetMoveObjectStateExt&amp;lt;/code&amp;gt; (see [[HPL2/Engine Scripts|Engine Scripts]]).&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MoveObjectType || String || Linear || The way the object moves. Linear means position changes and Angular means rotation changes.&amp;lt;br&amp;gt;Can be &amp;quot;Linear&amp;quot; or &amp;quot;Angular&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| OpenAmount || Float || 1.0 || Linear: How much of the MoveAxis size that will mean that it is open. Angular: 1=90 degrees. 0.5=45deg and 2=180deg (any numbers inbetween are okay of course)&lt;br /&gt;
|-&lt;br /&gt;
| MoveAxis || String || X || he axis that the movement is about. For angular it is rotation axis and for linear it is the position axis that is changed.&amp;lt;br&amp;gt;Can be &amp;quot;X&amp;quot;, &amp;quot;Y&amp;quot;, or &amp;quot;Z&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| OpenAcc || Float || 5.0 || The acceleration for reaching OpenSpeed&lt;br /&gt;
|-&lt;br /&gt;
| OpenSpeed || Float || 1.0 || The goal speed when opening.&lt;br /&gt;
|-&lt;br /&gt;
| CloseAcc || Float || 5.0 || The acceleration for reaching CloseSpeed&lt;br /&gt;
|-&lt;br /&gt;
| CloseSpeed || Float || 1.0 || The goal speed when closing.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMove || Bool || false || If the door should move towards some goal automatically.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveStateGoal || Float || 0.0 || The amount (relative to the what is considered open) that it shall move towards.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveAcc || Float || 9.0 || The acceleration when automoving&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveSpeed || Float || 5.0 || The goal speed when automoving&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveSlowdownDist || Float || 0.1 || The distance from state goal where it begins to slow down (in meters for linear and degrees for angular).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| AngularOffsetArea || String || || When mode is angular, this the point it rotates around. If empty, it rotates around its center.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Item ==&lt;br /&gt;
&lt;br /&gt;
Item entities become inventory items when interacted with. They glow when in pickup range.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| SubItemTypeName || String || || Determines its name and description by putting 'ItemDesc_' or 'ItemName_' as prefix for the lang file entry. Category is always Inventory&lt;br /&gt;
|-&lt;br /&gt;
| ImageFile || File (.tga/.dds/.jpg/.jpeg/.png) || || The icon shown in the inventory when picked up.&lt;br /&gt;
|-&lt;br /&gt;
| PickSound || String || Generic || The sound played when picked up.&amp;lt;br&amp;gt;Must match a sound file name in the &amp;quot;ui&amp;quot; folder, starting with &amp;quot;pick_&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CustomSubItemTypeName || String || || If not emtpy it overrides SubItemTypeName in entity file. Determines its name and description by putting 'ItemDesc_' or 'ItemName_' as prefix for the lang file entry. Category is always Inventory&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Puzzle ===&lt;br /&gt;
&lt;br /&gt;
A Puzzle subtype item is a general item with no extra properties. Use this if you only need an inventory item to be used to trigger a scripted action. Other subtypes have special properties, but Puzzle only has the ability to be collected and used from the inventory. When used, it's loaded onto the crosshair so the player can use it on objects.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| TempVar || Float || 0 || User specfic usage.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Coins ===&lt;br /&gt;
&lt;br /&gt;
Unused item type for the cut Thaler items. Thalers were once used to unlock Chests and use OilBarrels, with only the former functionality remaining.&lt;br /&gt;
&lt;br /&gt;
{{warning|You can create custom coin items, but there is a single language entry which is hardcoded into the engine and can't be changed. This means that even if all the others are changed, looking at Chests will always say &amp;quot;Locked. Costs X Thalers to open.&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CoinAmount || Int || 10 || The amount of coins it contains.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Note ===&lt;br /&gt;
&lt;br /&gt;
A Note item is an item that adds text to the player's journal. It displays itself when picked up. The note can be narrated, in which case it will automatically close once it's finished. If it isn't voiced, the player must close it. Use this if you want to make a Note item using a custom model or custom properties that differ from the main notes.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| NoteText || String || || The text and name of entry for note. Entry names for these are calculated: 'Note_'+NoteText+'_Name' and 'Note_'+NoteText+'_Text'&lt;br /&gt;
|-&lt;br /&gt;
| OpenNoteInJournal || Bool || true || If the journal should be opened when the note is picked up.&lt;br /&gt;
|-&lt;br /&gt;
| UseNarration || Bool || false || If the note has narration.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Diary ===&lt;br /&gt;
&lt;br /&gt;
A Diary item is nearly identical to the Note item. Instead, it adds itself to the Diary section of the player's journal, whereas the Note adds itself to the Notes section. Additionally, diary entries are grouped together, so that when one is split into multiple parts, the player will always read them in order, regardless of the specific Diary items that were picked up.&lt;br /&gt;
&lt;br /&gt;
Diaries are also always voice enabled, while Notes have the option for it. As such, a Diary without any voice files defined in its text will instantly close the journal on pickup.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| DiaryText || String || || The text and name of entry for diary. Entry name for these calculated: 'Diary_'+DiaryText+'_Name'+Idx and 'Diary_'+DiaryText+'_Text'+Idx. Idx starts at 1.&lt;br /&gt;
|-&lt;br /&gt;
| DiaryCallback || String || || A special callback for diary pickup. Syntax: &amp;lt;code&amp;gt;void Func(string &amp;amp;in asItem, int lDiaryIdx)&amp;lt;/code&amp;gt;. Call &amp;lt;code&amp;gt;ReturnOpenJournal(false)&amp;lt;/code&amp;gt; to not open diary in journal after callback.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Lantern ===&lt;br /&gt;
&lt;br /&gt;
A Lantern item can be picked up like a normal item, but is added as a lantern to the inventory. While having this item, the player can press F to toggle it, or click it in the inventory. Note: This is NOT the lantern model in the player's hands, only the item that gives it to the player. If you want a custom lantern model, you can follow [https://www.frictionalgames.com/forum/thread-12391.html this guide].&lt;br /&gt;
&lt;br /&gt;
=== Health ===&lt;br /&gt;
&lt;br /&gt;
A Health item acts like a health potion (Laudanum). It acts like a normal item, except when used it is consumed while increasing the player's health by a specified amount.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| HealAmount || Float || 25 || How much health is regained when used.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sanity ===&lt;br /&gt;
&lt;br /&gt;
A Sanity item acts like a sanity potion. While used, they increase the player's sanity by a fixed amount, and then consumed from the inventory.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| HealAmount || Float || 25 || How much sanity is regained when used.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== LampOil ===&lt;br /&gt;
&lt;br /&gt;
A LampOil item acts like an oil potion. When used, it increases the amount of oil for the lantern, and then consumed.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| OilAmount || Float || 25 || How much oil is regained when used.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Tinderbox ===&lt;br /&gt;
&lt;br /&gt;
A Tinderbox item adds itself to the player's tinderbox counter in the inventory. Tinderboxes can be used once to light a light source.&lt;br /&gt;
&lt;br /&gt;
=== HandObject ===&lt;br /&gt;
&lt;br /&gt;
Unused. Would have equipped the corresponding hand object on use.&lt;br /&gt;
&lt;br /&gt;
== Chest ==&lt;br /&gt;
&lt;br /&gt;
This is an unused feature, but it was kept in the engine and can be restored by making a custom entity. It is a object which can be opened using coins (or their replacements, if a custom Coin-type entity is made). Interacting with it brings up a text GUI. The text GUI can be changed in the base language file.&lt;br /&gt;
To make an entity of this type, just copy an existing entity file and change its entity type.&lt;br /&gt;
'''The chests that ended up in the game are actually just Levers.'''&lt;br /&gt;
&lt;br /&gt;
{{warning|In versions before 1.5, Chests did not write their CoinsNeeded instance var to save data, which caused the coin requirement of all Chests to default to 0 when loading a save.}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MoveMaxSpeed || Float || 13.5 || The maximum speed it can be moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSlowDownFactor || Float || 3.0 || Amount of slowdown applied to object when not moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSpeedFactor || Float || 1.0 || The higher value the more speed gain a mouse movement makes.&lt;br /&gt;
|-&lt;br /&gt;
| MoveThrowImpulse || Float || 6.0 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CoinsNeeded || Int || 200 || Coins required to open the chest.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== OilBarrel ==&lt;br /&gt;
&lt;br /&gt;
An OilBarrel entity simply adds some oil to the player's lantern upon interaction. The oil amount depends on the player's combined total oil stored in their lantern and as LampOil type items (the sum of the oil that the items would refill on use), determined when the player first looks at the OilBarrel. If the total oil is less than 100, the OilBarrel will contain exactly enough oil to bring it to 100. Otherwise (or if Hard Mode is enabled), it provides only 10 oil.&lt;br /&gt;
&lt;br /&gt;
If the FullGameSave instance var is not enabled, OilBarrels can be used again when leaving a level and returning to it.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| FillSound || File (.snt) || || Sound played when lantern is filled.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| EmptySound || File (.snt) || || Sound played when barrel is empty.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
== EmotionStone ==&lt;br /&gt;
&lt;br /&gt;
The memory capsule entities found in the game. Interacting with an EmotionStone causes an emotion flash effect to display, fading the screen to white and displaying a message.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| DescCat || String || || Category of text shown when in focus.&lt;br /&gt;
|-&lt;br /&gt;
| DescEntry || String || || Entry of text shown when in focus.&lt;br /&gt;
|-&lt;br /&gt;
| TextCat || String || || Category of text shown when interacted with.&amp;lt;br&amp;gt;Typically &amp;quot;EmotionStone&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry || String || || Entry of text shown when interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| Sound || File (.snt) || || Sound played when interacted with.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== NPC ==&lt;br /&gt;
&lt;br /&gt;
Non-Player Characters are non-enemy characters. Agrippa and Alexander as they appear in-game are NPCs. Their only purpose is to stand in place and look at the player (if you enable the option).&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MoveHeadBones || String || || List of bones that is rotated when the NPC rotates its head.&lt;br /&gt;
|-&lt;br /&gt;
| MoveHeadBoneMuls || String || || List of floats specifying how much each bone shall be rotated (-1 to 1).&lt;br /&gt;
|-&lt;br /&gt;
| HeadMoveSpeedMul || Float || 1 || Speed multiplier that that determines move speed based on distance to wanted angle.&lt;br /&gt;
|-&lt;br /&gt;
| HeadMoveMaxSpeed || Float || 1 || The max speed that the head moves in.&lt;br /&gt;
|-&lt;br /&gt;
| MaxHeadAngle || Float || 30 || The max angle that the head can turn when looking at the player.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| FollowPlayerArea || String || || When player is in this area, the NPC will look at him.&lt;br /&gt;
|-&lt;br /&gt;
| Awake || Bool || true || If the NPC is awake and looks at the player when in area.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== LevelDoor ==&lt;br /&gt;
&lt;br /&gt;
A LevelDoor transports the player to the specified level when interacted with. The locked sounds, text, and destination can be entered in the Level Editor itself.&lt;br /&gt;
&lt;br /&gt;
LevelDoors can also teleport the player (without a loading screen) if the same map is picked.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| EnterSound || File (.snt) || || Sound played when entering door.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| ExitSound || File (.snt) || || Sound played when entering new map after having interacted with door.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry || String || || The text shown when door is in focus. Category is always Levels&lt;br /&gt;
|-&lt;br /&gt;
| StartPos || String || || The start position of the next map that the player is transported to.&lt;br /&gt;
|-&lt;br /&gt;
| MapFile || File (.map) || || The file of the next map.&lt;br /&gt;
|-&lt;br /&gt;
| Locked || Bool || false || If the door is locked.&lt;br /&gt;
|-&lt;br /&gt;
| LockedSound || File (.snt) || || Sound heard if locked and interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| LockedTextCat || String || || Category of message shown if locked and interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| LockedTextEntry || String || || Entry of message shown if locked and interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| ShowStats || Bool || true || If stats of map it leads to should be shown (NOT IN USE)&amp;lt;br&amp;gt;Non-functional. Formerly used to display a completion percentage.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CritterBug ==&lt;br /&gt;
&lt;br /&gt;
Critters like rats, roaches, or fish on the ground (or in the case of fish, water). They move around the room they are placed in and run away from the player.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MeshOffsetRot || Vector3 || 0 0 0 || The mesh offset rotation.&lt;br /&gt;
|-&lt;br /&gt;
| MeshOffsetPos || Vector3 || 0 0 0 || The mesh offset position.&lt;br /&gt;
|-&lt;br /&gt;
| MaxSpeedNormal || Float || 0.5 || Max speed when in normal state&lt;br /&gt;
|-&lt;br /&gt;
| MaxSpeedAfraid || Float || 1.3 || Max speed when in the scared state&lt;br /&gt;
|-&lt;br /&gt;
| Gravity || Float || 9.8 || Amount of gravity applied.&lt;br /&gt;
|-&lt;br /&gt;
| HasRandomPauses || Bool || false || If the critter shall have random pauses&lt;br /&gt;
|-&lt;br /&gt;
| RandomPauseTimeMinMax || Vector2 || 1 3 || Random time length of pause&lt;br /&gt;
|-&lt;br /&gt;
| RandomMoveTimeMinMax || Vector2 || 2 6 || Random time length of movement (between pauses)&lt;br /&gt;
|-&lt;br /&gt;
| PlayerFleeDistance || Float || 3 || The distance from player which it begins to flee&lt;br /&gt;
|-&lt;br /&gt;
| FleeMul || Float || 2.1 || Factor for moving away from player (if fleeing)&lt;br /&gt;
|-&lt;br /&gt;
| BackToSpawnPointMul || Float || 0.1 || Factor for moving back to spawn point&lt;br /&gt;
|-&lt;br /&gt;
| WanderCircleRadius || Float || 4 || Picture a circle in front critter at a certain distance. A point inside the circle is randomly selected and then the vector from the critter to this point is the speed added. The larger the circle, the more random the walk.&lt;br /&gt;
|-&lt;br /&gt;
| WanderCircleDist || Float || 2 || The distance at which the wander circle is placed. The higher the distance, the more likely the critter is to move forward.&lt;br /&gt;
|-&lt;br /&gt;
| NormalSound || File (.snt) || || Sound made when in normal state&lt;br /&gt;
|-&lt;br /&gt;
| NormalSoundRandMinMax || Vector2 || 1 3 || Random time length between normal sounds. x=min, y=max&lt;br /&gt;
|-&lt;br /&gt;
| ScaredSound || File (.snt) || || Sound made when in afraid state&lt;br /&gt;
|-&lt;br /&gt;
| ScaredSoundRandMinMax || Vector2 || 1 3 || Random time length between afraid sounds. x=min, y=max&lt;br /&gt;
|-&lt;br /&gt;
| DeathEntity || File (.ent) || || Entity created when dead.&lt;br /&gt;
|-&lt;br /&gt;
| DeathPS || File (.ps) || || Particle created when dead.&lt;br /&gt;
|-&lt;br /&gt;
| DeathSound || File (.snt) || || Sound played when dead.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
== CritterSpider ==&lt;br /&gt;
&lt;br /&gt;
A unused critter similar to the spider enemies from [[wikipedia:Penumbra: Overture|Penumbra: Overture]]. Capable of climbing walls and ceilings, as well as attacking the player.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MaxIdleSpeed || Float || 0.5 ||&lt;br /&gt;
|-&lt;br /&gt;
| MaxHuntSpeed || Float || 0.75 ||&lt;br /&gt;
|-&lt;br /&gt;
| HitSound || File (.snt) || || Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| IdleSound || File (.snt) || || Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| IdleSoundRandMinMax || Vector2 || 1 3 ||&lt;br /&gt;
|-&lt;br /&gt;
| AttackSound || File (.snt) || || Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| AttackPlayerDistMinMax || Vector2 || 1 3 ||&lt;br /&gt;
|-&lt;br /&gt;
| HuntPlayerDist || Float || 8 ||&lt;br /&gt;
|-&lt;br /&gt;
| HuntTimeMinMax || Vector2 || 10 30 ||&lt;br /&gt;
|-&lt;br /&gt;
| MoveTimeMinMax || Vector2 || 4 8 ||&lt;br /&gt;
|-&lt;br /&gt;
| IdleTimeMinMax || Vector2 || 0.4 2 ||&lt;br /&gt;
|-&lt;br /&gt;
| DeathEntity || File (.ent) || || Entity created when dead.&lt;br /&gt;
|-&lt;br /&gt;
| DeathPS || File (.ps) || || Particle created when dead.&lt;br /&gt;
|-&lt;br /&gt;
| DeathSound || File (.snt) || || Sound played when dead.&lt;br /&gt;
|-&lt;br /&gt;
| AttackSizeRadius || Float || 0.3 ||&lt;br /&gt;
|-&lt;br /&gt;
| AttackOffset || Vector3 || 0 0 1 ||&lt;br /&gt;
|-&lt;br /&gt;
| AttackDamageMinMax || Vector2 || 5 15 ||&lt;br /&gt;
|-&lt;br /&gt;
| AttackForce || Vector2 || 5 1 ||&lt;br /&gt;
|-&lt;br /&gt;
| AttackStrength || Int || 1 ||&lt;br /&gt;
|-&lt;br /&gt;
| AttackHitSound || File (.snt) || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
== Enemy_Grunt ==&lt;br /&gt;
&lt;br /&gt;
An Enemy_Grunt entity is a standard enemy entity, used for the Grunt, Brute, and Suitor. Enemy entities require advanced setup, and should include animations added through Settings &amp;gt; Animations. Enemy properties can be modified in the entity type window, like certain sounds and music tracks playing, the enemy's awareness levels and damage, speed and other similar settings. An enemy does not use a collision box, but instead a skeleton and the aforementioned properties to determine how to collide/hit something.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Enemy}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| NoticeSound || File (.snt) || || Sound played when enemy notices that player is nearby&lt;br /&gt;
|-&lt;br /&gt;
| GiveUpNoticeSound || File (.snt) || || Sound played when enemy gives up investigation (after a notice)&lt;br /&gt;
|-&lt;br /&gt;
| EnabledSound || File (.snt) || || Sound played when enemy is enabled&lt;br /&gt;
|-&lt;br /&gt;
| GroggyDamageCount || Float || 15 || The accumulated amount of damage the enemy can take before getting groggy by the hit.&amp;lt;br&amp;gt;The enemy will flinch after taking this amount of damage.&lt;br /&gt;
|-&lt;br /&gt;
| AlertToHuntDistance || Float || 10 || If range is above this then enemy can go from alert to hunt&lt;br /&gt;
|-&lt;br /&gt;
| AlertToInstantHuntDistance || Float || 3.5 || If range is below this, enemy geos instantly to hunt.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMinTime || Float || 2.0 || Min time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMaxTime || Float || 4.5 || Max time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| IncreaseAlertSpeedDistance || Float || 6 || Distance at which the alert move speed increases.&lt;br /&gt;
|-&lt;br /&gt;
| IncreasedAlertSpeedMul || Float || 1.5 || The amount that move speed is multiplied by when alert.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsToHuntLimit || Float || 30 || The accumulated limit value when alert goes to hunt because of player running towards enemy.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsCheckDistance || Float || 5 || The distance where the move toward enemy check starts&lt;br /&gt;
|-&lt;br /&gt;
| IdleExtraTimeMin || Float || 2 || Min time between extra idle animations&lt;br /&gt;
|-&lt;br /&gt;
| IdleExtraTimeMax || Float || 6 || Max time between extra idle animations&lt;br /&gt;
|-&lt;br /&gt;
| IdleExtraNum || Int || 3 || Number of extra idle animations&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Enemy}}&lt;br /&gt;
&lt;br /&gt;
== Enemy_ManPig ==&lt;br /&gt;
{{clr}}&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
An enemy type ported from A Machine For Pigs. Compare to the [[HPL2/AMFP/NewEntities#Enemy_ManPig|AMFP version]] of the enemy.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Enemy}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Walk_ForwardSpeed || Float || 1.0 || Forward speed when walking on all fours, in meters per second.&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Walk_BackwardSpeed || Float || 1.0 || Backward speed when walking on all fours, in meters per second.&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Walk_ForwardAcc || Float || 2.0 || &lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Walk_ForwardDeacc || Float || 8.0 || &lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Run_ForwardSpeed || Float || 3.0 || Forward speed when running on all fours, in meters per second.&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Run_BackwardSpeed || Float || 2.0 || Backward speed when running on all fours, in meters per second.&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Run_ForwardAcc || Float || 4.0 || &lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Run_ForwardDeacc || Float || 8.0 || &lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_StoppedToWalkSpeed || Float || 0.05 || Speed at which the walk animation is played when on all fours&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_WalkToStoppedSpeed || Float || 0.02 || Speed at which walk goes to stopped when on all fours&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_WalkToRunSpeed || Float || 2.0 || Speed at which walk turns to run animation when on all fours&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_RunToWalkSpeed || Float || 0.9 || Speed at which run turns to walk when on all fours&lt;br /&gt;
|-&lt;br /&gt;
| NoticeSound || File (.snt) || || Sound played when enemy notices that player is nearby&lt;br /&gt;
|-&lt;br /&gt;
| GiveUpNoticeSound || File (.snt) || || Sound played when enemy gives up investigation (after a notice)&lt;br /&gt;
|-&lt;br /&gt;
| EnabledSound || File (.snt) || || Sound played when enemy is enabled&lt;br /&gt;
|-&lt;br /&gt;
| GroggyDamageCount || Float || 1 || The accumulated amount of damage the enemy can take before getting groggy by the hit.&amp;lt;br&amp;gt;The enemy will flinch after taking this amount of damage.&lt;br /&gt;
|-&lt;br /&gt;
| AlertToHuntDistance || Float || 6 || If range is above this then enemy can go from alert to hunt&lt;br /&gt;
|-&lt;br /&gt;
| AlertToInstantHuntDistance || Float || 2.5 || If range is below this, enemy geos instantly to hunt.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMinTime || Float || 0.5 || Min time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMaxTime || Float || 1.0 || Max time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| IncreaseAlertSpeedDistance || Float || 6 || Distance at which the alert move speed increases.&lt;br /&gt;
|-&lt;br /&gt;
| IncreasedAlertSpeedMul || Float || 1.25 || The amount that move speed is multiplied by when alert.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsToHuntLimit || Float || 30 || The accumulated limit value when alert goes to hunt because of player running towards enemy.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsCheckDistance || Float || 6 || The distance where the move toward enemy check starts&lt;br /&gt;
|-&lt;br /&gt;
| IsTelsa || Bool || false || If this is the tesla pig&lt;br /&gt;
|-&lt;br /&gt;
| TeslaSoundLoop || File (.snt) || || Sound file played when the tesla's proximity effects are active.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| ChaseSound || File (.snt) || || Played when the pig is chasing.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Enemy}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| Pose || String || Biped || The pose of the enemy to start with&amp;lt;br&amp;gt;Can be &amp;quot;Biped&amp;quot; or &amp;quot;Quadruped&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| ThreatenOnAlert || Bool || false || If the pig should stand still and threaten instead of walking towards player when in alert mode.&lt;br /&gt;
|-&lt;br /&gt;
| FleeFromPlayer || Bool || false || The pig will flee instead of hunting (threaten if ThreatenOnAlert). Disabled if far enough away. Will attack if cornered.&lt;br /&gt;
|-&lt;br /&gt;
| AutoDisableAfterFlee || Bool || false || If pig should be disabled after having fled (if possible)&lt;br /&gt;
|-&lt;br /&gt;
| LanternSensitivity || Float || 1 || A modifier for how quickly the pig reacts to being shined on by the lantern.&amp;lt;br&amp;gt;Not defined in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| IdleBehavior || String || None || The behavior used when there are no patrol nodes left to walk.&amp;lt;br&amp;gt;Can be &amp;quot;None&amp;quot;, &amp;quot;Stalk&amp;quot;, or &amp;quot;Track&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| PlayActivateSound || Bool || true || If the enemy can play its EnabledSound.&lt;br /&gt;
|-&lt;br /&gt;
| AllowZeroNodeWaitTimes || Bool || false || If set to true, path node wait times with value 0 actually mean no waiting&amp;lt;br&amp;gt;Normally, specifying a wait time of 0 in &amp;lt;code&amp;gt;AddEnemyPatrolNode&amp;lt;/code&amp;gt; results in a wait time of 1-3 seconds.&lt;br /&gt;
|-&lt;br /&gt;
| PatrolMoveSpeed || String || Walk || Whether this pig walks or runs along its patrol&amp;lt;br&amp;gt;Can be &amp;quot;Walk&amp;quot; or &amp;quot;Run&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| DamageMul || Float || 1 || Multiplier for the enemy's attack damage.&amp;lt;br&amp;gt;Not defined in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| RunSpeedMul || Float || 1 || Multiplier for the enemy's run speed.&amp;lt;br&amp;gt;Not defined in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseTimeMul || Float || 1 || Multiplier for wait time between attacks.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Enemy_Waterlurker ==&lt;br /&gt;
&lt;br /&gt;
Enemy type of the &amp;quot;water monster&amp;quot;. Since you can't assign animations to it, you might as well just use the normal waterlurker of the base game unless you want to change its properties (such as damage, movement speed, or music played).&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Enemy}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| PlayerDetectionHeight || Float || 0.6 || The y-distance from the enemy that the player is detected.&lt;br /&gt;
|-&lt;br /&gt;
| EatDamage || Float || 20 || The damage dealt to food being eaten&lt;br /&gt;
|-&lt;br /&gt;
| AfterAttackPauseTime || Float || 0 || The amount of timer lurker waits after an attack&lt;br /&gt;
|-&lt;br /&gt;
| SplashPS_Walk || File (.ps) || || Particle system created at surface when walking.&lt;br /&gt;
|-&lt;br /&gt;
| SplashPS_Run || File (.ps) || || Particle system created at surface when running.&lt;br /&gt;
|-&lt;br /&gt;
| SplashPS_Eat || File (.ps) || || Particle system created at surface when eating.&lt;br /&gt;
|-&lt;br /&gt;
| SplashPS_Attack || File (.ps) || || Particle system created at surface when attacking.&lt;br /&gt;
|-&lt;br /&gt;
| SplashSound_Walk || File (.snt) || || Sound played when walking.&lt;br /&gt;
|-&lt;br /&gt;
| SplashSound_Run || File (.snt) || || Sound played when running.&lt;br /&gt;
|-&lt;br /&gt;
| SplashSound_Eat || File (.snt) || || Sound played when eating.&lt;br /&gt;
|-&lt;br /&gt;
| SplashSound_Attack || File (.snt) || || Sound played when attacking.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Enemy}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| PlayerDetectionHeight || Float || 0 || If equal or below 0 the default in data file is used! The y-distance from the enemy that the player is detected.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== PlayerHands ==&lt;br /&gt;
&lt;br /&gt;
Player's hands. Unless you want to make a different looking hand for a full conversion mod, you don't have to worry about this.&lt;br /&gt;
&lt;br /&gt;
== HandObject ==&lt;br /&gt;
&lt;br /&gt;
The only available HandObject is the lantern. It is used in conjunction with a &amp;lt;code&amp;gt;.ho&amp;lt;/code&amp;gt; config file to place it properly in PlayerHands.&lt;br /&gt;
&lt;br /&gt;
Mostly a remnant of cut items that functioned as weapons, like in [[wikipedia:Penumbra: Overture|Penumbra: Overture]], including the pickaxe from that game.&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=7013</id>
		<title>HPL2/Engine Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=7013"/>
		<updated>2025-08-27T04:22:42Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Levers, wheels and buttons */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TocRight}}&lt;br /&gt;
&lt;br /&gt;
This page documents all scripts available in Amnesia: The Dark Descent.&lt;br /&gt;
&lt;br /&gt;
{{note|'''Note''': Some of the functions require the Amnesia 1.3 or 1.5 update. Steam and other online store copies should be automatically updated. Other copies can get 1.3 [http://www.frictionalgames.com/forum/thread-24334.html here].}}&lt;br /&gt;
&lt;br /&gt;
== Directives ==&lt;br /&gt;
&lt;br /&gt;
First off, &amp;lt;code&amp;gt;#include &amp;quot;file.hps&amp;quot;&amp;lt;/code&amp;gt; can be used to programmatically merge together multiple separate files to make organizing scripts easier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
==Engine scripts==&lt;br /&gt;
===Main===&lt;br /&gt;
&lt;br /&gt;
The following functions are the main hps functions that the HPL2 engine looks to run on certain events - similar to the C++ int main() function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void OnStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the map is loaded for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnEnter();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs whenever the player enters a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnLeave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the player leaves a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnGameStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is found in the global.hps file and the inventory.hps file, and is run when the game is first started by the player (ie via &amp;quot;Start New Game&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnUpdate(float afStep);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
This function is executed for every game update or &amp;quot;tick&amp;quot;. Can be used for rapid-firing updates instead of looping timers. Keep in mind that this can affect game performance if not used with care.&lt;br /&gt;
&lt;br /&gt;
#''afStep''- Time elapsed in seconds since the last frame. Multiply speeds, distances etc. by this argument to avoid framerate dependence issues (for example: if you move something in this function with constant speed, it will move faster on computers which run the game with high FPS and slower on computers with low FPS).&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float RandFloat(float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random float.&lt;br /&gt;
&lt;br /&gt;
#''afMin ''- minimum value&lt;br /&gt;
#''afMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int RandInt(int alMin, int alMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random int. Note: the maximum value is ''inclusive''  - the RandInt() function may return this value.&lt;br /&gt;
&lt;br /&gt;
#''alMin ''- minimum value&lt;br /&gt;
#''alMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringContains(string &amp;amp;in asString, string &amp;amp;in asSubString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a string contains the specified string. &amp;lt;br /&amp;gt;Example: searching for &amp;quot;hello&amp;quot; in &amp;quot;hello world&amp;quot; would return '''true'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to check&lt;br /&gt;
#''asSubString ''- the string to search for&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; StringSub(string &amp;amp;in asString, int alStart, int alCount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the substring in a string. &amp;lt;br /&amp;gt;Example: in the string &amp;quot;frictional games rocks&amp;quot;, using 4 as ''alStart''  and 6 as ''alCount''  would return '''&amp;quot;tional&amp;quot;'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string&lt;br /&gt;
#''alStart ''- start position in the string&lt;br /&gt;
#''alCount ''- amount of characters&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int StringToInt(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns an integer converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float StringToFloat(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a float converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringToBool(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a boolean converted from a string, else returns false.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&lt;br /&gt;
===Mathematical Operations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathCos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathTan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAsin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAcos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan2(float afX, float afY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Calculates and returns the arc tangent of the specified values.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - First value to operate.&lt;br /&gt;
#''afY''  - Second value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSqrt(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the square root of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathPow(float afBase, float afExp);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the value of afBase raised to the power of afExp.&lt;br /&gt;
&lt;br /&gt;
#''afBase''  - The base value.&lt;br /&gt;
#''afExp''  - Value to calculate the base with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMin(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the lowest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMax(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the highest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathClamp(float afX, float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns afX clamped between afMin and afMax. If afX &amp;lt; afMin, returns afMin, and if afX &amp;gt; afMax, returns afMax.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - The value to clamp.&lt;br /&gt;
#''afMin''  - The minimum value to clamp afX with.&lt;br /&gt;
#''afMax''  - The maximum value to clamp afX with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAbs(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the absolute value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&lt;br /&gt;
===Debugging===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void Print(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a string to the log file (''hpl.log'').&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDebugMessage(string &amp;amp;in asString, bool abCheckForDuplicates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a line of text to the debug console at the bottom left of the screen. Debug mode must be enabled for the console messages to be visible.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to print&lt;br /&gt;
#''abCheckForDuplicates ''- if true, the string won't be printed more than once on screen until it disappears&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ProgLog(string &amp;amp;in asLevel, string &amp;amp;in asMessage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints an entry to the ProgLog (progression log). &amp;lt;br /&amp;gt;ProgLog is a file created in Documents/Amnesia/main (or an FC folder if one is being used). It logs certain events, such us opening the menu or picking up the lantern, as well as the player's state (Health, Sanity, Oil, Tinderboxes, Coins), for the purpose of documenting a tester's playstyle. &amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt;This function allows to log custom messages.The messages in the ProgLog file are sorted by time elapsed since a map was loaded.&lt;br /&gt;
&lt;br /&gt;
ProgLog has to be enabled for a player profile in ''user_settings.cfg''  before it starts working.&lt;br /&gt;
&lt;br /&gt;
#''asLevel ''- can be &amp;quot;Low&amp;quot;, &amp;quot;Medium&amp;quot; or &amp;quot;High&amp;quot;. It's a tag which appears in each log entry, for event prioritising.&lt;br /&gt;
#''asMessage ''- The custom message to be printed to the log.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool ScriptDebugOn();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the debug mode is enabled. &amp;lt;br /&amp;gt;See [[HPL2/Development_Environment|&amp;quot;Setting up Development Environment&amp;quot;]] to setup debug mode on your own computer.&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
{{warning|Regular variables (int, float, etc.) are '''not''' saved by the game. Using them in important parts of yor script will break it upon loading a game save. In HPL, those variables should only be used for disposable counters, like spawning objects in a &amp;quot;for&amp;quot; loop. For variables which need to be saved, use the wrappers as described below.}}&lt;br /&gt;
&lt;br /&gt;
====Local====&lt;br /&gt;
&lt;br /&gt;
Local variables can be used throughout the same script file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetLocalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetLocalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddLocalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetLocalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Global====&lt;br /&gt;
&lt;br /&gt;
Global variables can be used throughout several maps and can be accessed by several script files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetGlobalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetGlobalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddGlobalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetGlobalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Particle Systems===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadParticleSystem(string &amp;amp;in asPSFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asPSFile''  - The particle system file to load. Extension: .ps&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntity(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntityExt(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS,&lt;br /&gt;
float afR, float afG, float afB, float afA, bool abFadeAtDistance, float afFadeMinEnd, float afFadeMinStart,&lt;br /&gt;
float afFadeMaxStart, float afFadeMaxEnd);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity, extended method with more options.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''abFadeAtDistance ''- determines whether a particle system fades from a certain distance on&lt;br /&gt;
#''afFadeMinEnd ''- minimum distance at which the particle system stops fading&lt;br /&gt;
#''afFadeMinStart ''- minimum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxStart ''- maximum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxEnd ''- maximum distance at which the particle system stops fading&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DestroyParticleSystem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Destroys a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - The internal name of the particle system&lt;br /&gt;
&lt;br /&gt;
===Sounds &amp;amp; Music===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadSound(string &amp;amp;in asSoundFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile''  - The sound file to load (extension .snt optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayGuiSound(string &amp;amp;in asSoundFile, float afVolume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays a sound, not using 3D.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile ''- the sound to play (extension .snt/.ogg optional)&lt;br /&gt;
#''afVolume ''- the volume of the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaySoundAtEntity(string &amp;amp;in asSoundName, string &amp;amp;in asSoundFile, string &amp;amp;in asEntity, float afFadeTime, bool abSaveSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a sound at an entity.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''asSoundFile ''- the sound to use (extension .snt optional)&lt;br /&gt;
#''asEntity ''- the entity to create the sound at. Using &amp;quot;Player&amp;quot; is effectively the same as &amp;lt;code&amp;gt;PlayGuiSound&amp;lt;/code&amp;gt;, yet this function allows a looping sound to be saved&lt;br /&gt;
#''afFadeTime ''- time in seconds the sound needs to fade. Avoids enemies hearing the sound if afFadeTime is at least 0.1f&lt;br /&gt;
#''abSaveSound ''- if ''true'', a looping sound will &amp;quot;remember&amp;quot; its playback state (currently playing/stopped), and that state will be restored the next time the level is entered. If ''true'', the sound is never attached to the entity! Note that saving should only be used on ''looping sounds''!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeInSound(string &amp;amp;in asSoundName, float afFadeTime, bool abPlayStart);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades in a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds&lt;br /&gt;
#''abPlayStart ''- Play the sound defined in the &amp;lt;code&amp;gt;&amp;lt;Start&amp;gt;&amp;lt;/code&amp;gt; section of the .snt before playing the main sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopSound(string &amp;amp;in asSoundName, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades out a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds, use 0 to immediately stop the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayMusic(string &amp;amp;in asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays music.&lt;br /&gt;
&lt;br /&gt;
#''asMusicFile ''- the music file to play (extension .ogg optional)&lt;br /&gt;
#''abLoop ''- determines whether a music track should loop&lt;br /&gt;
#''afVolume ''- volume of the music&lt;br /&gt;
#''afFadeTime ''- time in seconds until music reaches full volume&lt;br /&gt;
#''alPrio ''- priority of the music. Note that only the music with the highest priority can be heard! 0 - lowest, 1 - higher, etc.&lt;br /&gt;
#''abResume''  - if ''true'', playback will be continued from where the track stopped after the call to &amp;lt;code&amp;gt;StopMusic()&amp;lt;/code&amp;gt;. If ''false'', the track will be restarted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopMusic(float afFadeTime, int alPrio);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops music.&lt;br /&gt;
&lt;br /&gt;
#''afFadeTime ''- time in seconds until music stops&lt;br /&gt;
#''alPrio ''- the priority of the music that should stop&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice(string &amp;amp;in asVoiceFile, string &amp;amp;in asEffectFile, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry,&lt;br /&gt;
bool abUsePosition, string &amp;amp;in asPosEntity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This adds a voice and an additional sound effect to be played. It is okay to call this many times in order to play many voices in a row. The EffectVoiceOverCallback is not called until ALL voices have finished.&lt;br /&gt;
&lt;br /&gt;
#''asVoiceFile ''- the voice to play&lt;br /&gt;
#''asEffectFile ''- the sound effect to play&lt;br /&gt;
#''asTextCat ''- the category in the .lang file, usually &amp;quot;Voice&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''abUsePosition ''- plays using 3D from the entity, or without 3D&lt;br /&gt;
#''asPosEntity ''- the entity at which the voice and sound are played from&lt;br /&gt;
#''afMinDistance ''- minimum distance the voice and sound are heard&lt;br /&gt;
#''afMaxDistance ''- maximum distance the voice and sound are heard&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopAllEffectVoices(float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all voices and calls the EffectVoiceOverCallback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEffectVoiceActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether EffectVoices are still active.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetEffectVoiceOverCallback(string &amp;amp;in asFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to be called when the EffectVoices are finished. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundVolume(float afDestVolume, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound volume, that means everything you can hear '''from the world'''. This does not affect music of GUI sounds.&lt;br /&gt;
&lt;br /&gt;
#''afDestVolume ''- desired volume&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired volume&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundSpeed(float afDestSpeed, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound speed.&lt;br /&gt;
&lt;br /&gt;
#''afDestSpeed ''- desired speed&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired speed&lt;br /&gt;
&lt;br /&gt;
===Lights===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightVisible(string &amp;amp;in asLightName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables lights.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''abVisible ''- determines the state of the light&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeLightTo(string &amp;amp;in asLightName, float afR, float afG, float afB, float afA, float afRadius, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the properties of a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''afRadius ''- radius of the light. -1 means keeping the radius&lt;br /&gt;
#''afTime ''- time in seconds until change is done&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightFlickerActive(string &amp;amp;in asLightName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates flickering on a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName'' - The internal light name&lt;br /&gt;
#''abActive'' - true = active, false = inactive&lt;br /&gt;
&lt;br /&gt;
==Game scripts==&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartCredits(string &amp;amp;in asMusic, bool abLoopMusic, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alEndNum);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts the end credits screen.&lt;br /&gt;
&lt;br /&gt;
#''asMusic ''- the music to play (including .ogg)&lt;br /&gt;
#''abLoopMusic ''- determines whether the music should loop&lt;br /&gt;
#''asTextCat ''- the category to be used in the .lang file, usually &amp;quot;Ending&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alEndNum ''- Amnesia has 3 different endings and displays a code at the bottom. Determines which code is displayed. 0-2 will display codes, any other integer will not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartDemoEnd();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shows the demo end screen. The background and UI elements are defined in demo.cfg, with the text using the entries in the &amp;quot;Demo&amp;quot; category of the .lang file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AutoSave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an auto save file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CheckPoint(string &amp;amp;in asName, string &amp;amp;in asStartPos, string &amp;amp;in asCallback, string &amp;amp;in asDeathHintCat, string &amp;amp;in asDeathHintEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a checkpoint at which the player will respawn in case he dies. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asName, int alCount)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;Count is 0 on the first checkpoint load!&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the editor&lt;br /&gt;
#''asCallback ''- the function to call when the player dies/respawns&lt;br /&gt;
#''asDeathHintCat ''- the category of the death hint message to be used in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asDeathHintEntry ''- the entry in the .lang file&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeMap(string &amp;amp;in asMapName, string &amp;amp;in asStartPos, string &amp;amp;in asStartSound, string &amp;amp;in asEndSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Loads another map after a 1.5 second fade out.&lt;br /&gt;
&lt;br /&gt;
#''asMapName ''- the file to load&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the next map&lt;br /&gt;
#''asStartSound ''- the sound that is played when the change starts&lt;br /&gt;
#''asEndSound ''- the sound that is played when the new map is loaded&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ClearSavedMaps();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the &amp;quot;history&amp;quot; of the save, useful to do when you know the player will not be able to go back anymore. Makes the next save much smaller in size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateDataCache();&lt;br /&gt;
void DestroyDataCache();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This caches all current textures and models and they are not released until destroy is called. If there is already cached data it is destroyed.&lt;br /&gt;
Create caches to enable faster loading when going back to a map. Destroy the cache if you know the player won't go back to that map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMapDisplayNameEntry(string &amp;amp;in asNameEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the map name shown in save file names. If none is set NULL is assumed.&lt;br /&gt;
&lt;br /&gt;
#''asNameEntry ''- the entry to display, category must be &amp;quot;Levels&amp;quot;!&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the skybox.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxTexture(string &amp;amp;in asTexture);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the texture of the skybox.&lt;br /&gt;
&lt;br /&gt;
#''asTexture''  - The texture file to set. Extension: .dds&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the solid color of the skybox rather than a texture.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the global fog.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the color to use for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogProperties(float afStart, float afEnd, float afFalloffExp, bool abCulling);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the properties for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afStart ''- how many meters from the camera should the fog begin&lt;br /&gt;
#''afEnd ''- how many meters from the camera should the fog reach full thickness&lt;br /&gt;
#''afFalloffExp ''- the amount by which the thinkness increases&lt;br /&gt;
#''abCulling ''- whether occlusion culling is active for the fog; this prevents objects behind the fog from being loaded&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetupLoadScreen(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alRandomNum, string &amp;amp;in asImageFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which loading screen will be shown when changing maps.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category of the loading text in the .lang file to be shown on the loading screen, usually &amp;quot;LoadingText&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alRandomNum ''- if greater 1, then it will randomize between 1 and alRandom for each LoadScreen giving entry the suffix XX (eg 01). If &amp;lt; =1 then no suffix is added&lt;br /&gt;
#''asImageFile ''- the image to be shown (optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void UnlockAchievement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlocks the specified achievement. Only able to be used for the ending achievements.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the achievement. Only the following strings are valid:&lt;br /&gt;
::* Benefactor&lt;br /&gt;
::* Survivor&lt;br /&gt;
::* Sacrifice&lt;br /&gt;
::* Quitter&lt;br /&gt;
::* Egotist&lt;br /&gt;
::* Altruist&lt;br /&gt;
::* Vacillator&lt;br /&gt;
&lt;br /&gt;
===Game Timer===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddTimer(string &amp;amp;in asName, float afTime, string &amp;amp;in asFunction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a timer which calls a function when it expires. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asTimer)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the name of the timer&lt;br /&gt;
#''afTime ''- time in seconds&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveTimer(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a timer, no matter how much time is left.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the timer.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetTimerTimeLeft(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the time left on a timer.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - the internal name of the timer.&lt;br /&gt;
&lt;br /&gt;
===Screen Effects===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeOut(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to black.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen is completly black&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeIn(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen back to normal.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeImageTrailTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies the image trail effect to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeSepiaColorTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the screen go dark red.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0) &lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeRadialBlurTo(float afSize, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies radial blur effects to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afSize ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetRadialBlurStartDist(float afStartDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines at which distance the radial blur effects appear.&lt;br /&gt;
&lt;br /&gt;
#''afStartDist ''- the distance at which the effect starts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectFlash(float afFadeIn, float afWhite, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white.&lt;br /&gt;
&lt;br /&gt;
#''afFadeIn ''- time in seconds until screen is white&lt;br /&gt;
#''afWhite ''- determines to which percentage the screen fades to white (1.0 = completly white)&lt;br /&gt;
#''afFadeOut ''- time in seconds until screen is back to normal again&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectEmotionFlash(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white and shows a text message.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''asSound ''- the sound to play while fading&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetFlashbackIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a flashback is still in effect.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerSpawnPS(string &amp;amp;in asSPSFile);&lt;br /&gt;
void StopPlayerSpawnPS();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Continuously spawn regular particle systems (''.ps'') around the player. Particles created by this script carry over from map to map.&lt;br /&gt;
&lt;br /&gt;
#''asSPSFile''  - the ''.sps''  file to use. Example ''.sps''  files are located in the ''/misc''  folder in the main game directory.&amp;lt;br&amp;gt;Custom ''.sps''  files can be created by hand in a text editor (see existing ones and mimic how those are written). &amp;lt;br /&amp;gt;Since ''StopPlayerSpawnPS()''  doesn't seem to work, to stop an SPS you must create an ''.sps''  file with an empty particle field field and override the old SPS by calling ''StartPlayerSpawnPS''  again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shakes the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity of the shake&lt;br /&gt;
#''afTime ''- duration of the shake&lt;br /&gt;
#''afFadeInTime ''- time in seconds until full intensity is reached&lt;br /&gt;
#''afFadeOutTime ''- time until screen is back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInDarknessEffectsActive(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the sanity drain and night vision effects while in the darkness.&lt;br /&gt;
&lt;br /&gt;
''bool abX''  - Enable/disable effects.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowScreenImage(string &amp;amp;in asImageName, float afX, float afY, float afScale, bool abUseRelativeCoordinates, float afDuration, float afFadeIn, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
Displays an image file directly onto the screen. See [[HPL2/Tutorials/ShowScreenImage()|ShowScreenImage()]] in the tutorials section for more information.&lt;br /&gt;
&lt;br /&gt;
# ''asImageName'' - The image file to render (.jpg, .png, .tga, .dds)&lt;br /&gt;
# ''afX'' - The X position of the image&lt;br /&gt;
# ''afY'' - The Y position of the image&lt;br /&gt;
# ''afScale'' - The size of the image in pixels (not scale), or original image size if negative&lt;br /&gt;
# ''abUseRelativeCoordinates'' - Whether X and Y are relative to the screen resoltion, or pixel co-ordinates if not&lt;br /&gt;
# ''afDuration'' - The duration that the image is displayed for&lt;br /&gt;
# ''afFadeIn'' - The time, in seconds, to fade in the image&lt;br /&gt;
# ''afFadeOut'' - The time, in seconds, to fade out the image&lt;br /&gt;
&lt;br /&gt;
===Insanity===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInsanitySetEnabled(string &amp;amp;in asSet, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which InsanitySets are enabled.&lt;br /&gt;
&lt;br /&gt;
#''asSet ''- the set&lt;br /&gt;
#''abX ''- enabled or not&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartInsanityEvent(string &amp;amp;in asEventName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Starts a specified insanity event.&lt;br /&gt;
&lt;br /&gt;
#''asEventName ''- Insanity event to play.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartRandomInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts a random insanity event from the available sets.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopCurrentInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Stops the currently playing insanity event.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void InsanityEventIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an insanity event is currently in effect.&amp;lt;br&amp;gt;Not useful at all due to having a return type of &amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; when it should be &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Player===&lt;br /&gt;
&lt;br /&gt;
Note that the player's maximum health and sanity is 100.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enabled/Disable player controlled movement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangePlayerStateToNormal();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets the player's state, forcing them to stop interacting with objects. It also clears the inventory item to be used (as if it was double-clicked on in the inventory again) and dismounts the player from ladders.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerCrouching(bool abCrouch);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddPlayerBodyForce(float afX, float afY, float afZ, bool abUseLocalCoords);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pushes the player into a certain direction. Note that you need values above ~2000 to see any effects.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- amount along the X-axis&lt;br /&gt;
#''afY ''- amount along the Y-axis&lt;br /&gt;
#''afZ ''- amount along the Z-axis&lt;br /&gt;
#''abUseLocalCoords ''- If true, axes are based on where the player is facing, not the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowPlayerCrossHairIcons(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the icons when a player has something in focus.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerSanity(float afSanity);&lt;br /&gt;
void AddPlayerSanity(float afSanity);&lt;br /&gt;
float GetPlayerSanity();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerHealth(float afHealth);&lt;br /&gt;
void AddPlayerHealth(float afHealth);&lt;br /&gt;
float GetPlayerHealth();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerLampOil(float afOil);&lt;br /&gt;
void AddPlayerLampOil(float afOil);&lt;br /&gt;
float GetPlayerLampOil();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the lamp oil of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerSpeed();&lt;br /&gt;
float GetPlayerYSpeed();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current speed of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSanityDrainDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables sanity drain from darkness.&lt;br /&gt;
{{bug|Sanity drain is reenabled on loading a save, as the game is unable to load the value properly from the save data.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoost();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a large amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! New Sanity&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || 100&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || 90&lt;br /&gt;
|-&lt;br /&gt;
| 50-74 || 80&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoostSmall();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a small amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! Sanity Bonus&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || +20&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || +15&lt;br /&gt;
|-&lt;br /&gt;
| 50-75 || +10&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityDamage(float afAmount, bool abUseEffect);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- amount of sanity damage done&lt;br /&gt;
#''abUseEffect ''- determines whether an effect is played when the sanity damage is dealt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GivePlayerDamage(float afAmount, string &amp;amp;in asType, bool abSpinHead, bool abLethal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the health of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- amount of damage done to health&lt;br /&gt;
#''asType ''- plays a certain effect on the screen when the damage is dealt (BloodSplat, Claws, or Slash) &lt;br /&gt;
#''abSpinHead ''- changes the camera view when damage is dealt&lt;br /&gt;
#''abLethal ''- set to true if player can die from given damage. If ''false'' and the damage would have left the player with less than 10 health, health is set to 10.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerFOVMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the field of view of the player. A shorter FOV will create a zoom effect.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- multiplier of default FOV (1 is default)&lt;br /&gt;
#''afSpeed ''- the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerAspectMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the aspect ratio of the player. Basically stretches or narrows the screen horizontally.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- multiplier of default aspect (default is 1)&lt;br /&gt;
#''afSpeed ''- the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- angle of rotation of head, positive being counter-clockwise&lt;br /&gt;
#''afSpeedMul ''- speed (possibly acceleration) multiplier of the rotation (default 1, which is really slow)&lt;br /&gt;
#''afMaxSpeed ''- maximum speed of rotation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerForward(float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Moves the player forward. It needs to be called in a timer that updates 60 times / second.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- amount along the X-axis&lt;br /&gt;
#''afY ''- amount along the Y-axis&lt;br /&gt;
#''afZ ''- amount along the Z-axis&lt;br /&gt;
#''afSpeed ''- speed at which the change happens&lt;br /&gt;
#''afSlowDownDist ''- distance at which to start slowing down (prevents the head from abruptly stopping)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerLookAt(string &amp;amp;in asEntityName, float afSpeedMul, float afMaxSpeed, string &amp;amp;in asAtTargetCallback);&lt;br /&gt;
void StopPlayerLookAt();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to look at a certain entity until StopPlayerLookAt is used.&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- the entity to look at &lt;br /&gt;
#''afSpeedMul ''- how fast should the player look at the entity&lt;br /&gt;
#''afMaxSpeed ''- maximum speed allowed&lt;br /&gt;
#''asAtTargetCallback ''- function to call when player looks at target&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerMoveSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerRunSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerLookSpeedMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the player's move/run/look speed. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpForceMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the player's jump multiplier. Higher values = higher jumps. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpDisabled(bool abX);&lt;br /&gt;
void SetPlayerCrouchDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to jump/crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportPlayer(string &amp;amp;in asStartPosName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly teleports the player to the target StartPos.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternActive(bool abX, bool abUseEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the player use his lantern.&lt;br /&gt;
&lt;br /&gt;
# ''abX'' - Set lantern to be active (true) or inactive (false)&lt;br /&gt;
# ''abUseEffects'' - Play on/off sounds&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetLanternActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player currently uses his lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to use his lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternLitCallback(string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to call when the player uses his lantern. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;MyFunc(bool abLit)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message on the screen.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTime ''- determines how long the message is displayed. If time is &amp;lt; =0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetDeathHint(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the message that appears when the player dies.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DisableDeathStartSound();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the death sound when the player dies. This must be called directly before player is killed! The variable as soon as player dies too.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPermaDeathSound(string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Sets the sound played after the player dies when permadeath is active. Permadeath is only active when the game is launched with the &amp;lt;code&amp;gt;ptest&amp;lt;/code&amp;gt; command line parameter. Only used for the post-death Suitor lines in ''Justine''.&lt;br /&gt;
&lt;br /&gt;
#''asSound'' - The sound to be played after death. Expects a voice-type sound.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerFallDamageDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the player's ability to take fall damage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPos(float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the player's position within the level.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - X co-ordinate position.&lt;br /&gt;
#''afY''  - Y co-ordinate position.&lt;br /&gt;
#''afZ''  - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerPosX();&lt;br /&gt;
float GetPlayerPosY();&lt;br /&gt;
float GetPlayerPosZ();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the player's position within the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
===Journal===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddNote(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a note to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _Name and _Text and be in category &amp;quot;Journal&amp;quot;!&lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDiary(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a diary to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _NameX and _TextY whereas X and Y are numbers of the parts (_Name1: first diary, _Text1: first page) and be in category &amp;quot;Journal&amp;quot;! &lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ReturnOpenJournal(bool abOpenJournal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Only called in the pickup diary callback! If true the journal displays the entry else not.&lt;br /&gt;
&lt;br /&gt;
===Quests===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a quest to the player's journal under mementos. Completed quests cannot be readded.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name to be used&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot;Quest_&amp;lt;texthere&amp;gt;_Text”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CompleteQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Completes a quest. If the quest has not been added, it's marked as complete anyway, preventing it from being added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot; Quest_&amp;lt;texthere&amp;gt;_Text ”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool QuestIsCompleted(string &amp;amp;in asName);&lt;br /&gt;
bool QuestIsAdded(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a quest is completed/added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetNumberOfQuestsInMap(int alNumberOfQuests);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the number of quests in the map. Obsolete; formerly used to calculate a completion percentage when looking at a level door.&lt;br /&gt;
&lt;br /&gt;
#''alNumberOfQuests ''- Amount of quests&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveHint(string &amp;amp;in asName, string &amp;amp;in asMessageCat, string &amp;amp;in asMessageEntry, float afTimeShown);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a hint on the player's screen.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asMessageCat ''- the category in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asMessageEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTimeShown ''- time in seconds until the message disappears. If time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void BlockHint(string &amp;amp;in asName);&lt;br /&gt;
void UnBlockHint(string &amp;amp;in asName);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Blocking a hint prevents it from being shown. Blocked hints are included in savefiles, so they should persist between levels. Unblocking a hint allows it to be shown.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; blocks the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveHint(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes the hint from the list of already shown hints, allowing it to appear again.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; reenables the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
===Inventory===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ExitInventory();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Exits the inventory by force.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the player's ability to open his inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a message on the inventory screen. Used for feedback messages when failing to combine items.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory ''- the category in the .lang file, usually &amp;quot;Inventory&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTime ''- time in seconds until the message disappears. If life time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItem(string &amp;amp;in asName, string &amp;amp;in asType, string &amp;amp;in asSubTypeName, string &amp;amp;in asImageName, float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds an item to the inventory of the player. Note that the item does not have to exist as entity in the world to be able to do this.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asType ''- item type to give, Available types are:&lt;br /&gt;
::*Puzzle&lt;br /&gt;
::*Lantern&lt;br /&gt;
::*Health&lt;br /&gt;
::*Sanity&lt;br /&gt;
::*LampOil&lt;br /&gt;
::*Tinderbox&lt;br /&gt;
#''asSubTypeName ''- item name for .lang file&lt;br /&gt;
#''asImageName ''- the image which will appear in inventory. For example: &amp;lt;code&amp;gt;void GiveItem(&amp;quot;chemical_container_full_1&amp;quot;, &amp;quot;Puzzle&amp;quot;, &amp;quot;chemical_container_full&amp;quot;, &amp;quot;chemical_container_full.tga&amp;quot;, 1);&amp;lt;/code&amp;gt; will use the image from &amp;lt;code&amp;gt;graphics/item/chemical_container_full.tga&amp;lt;/code&amp;gt; &lt;br /&gt;
#''afAmount ''- amount the item gives, - For example: Oil potions will fill the oil meter by this amount, Health potions will heal by this amount, etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item from the player's inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool HasItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player has an item in his inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItemFromFile(string &amp;amp;in asName, string &amp;amp;in asFileName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a single item to the player's inventory. This is meant to be used for debug mostly as it creates the actual item and then destroys it.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asFileName ''- item to give + extension (.ent)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddCombineCallback(string &amp;amp;in asName, string &amp;amp;in asItemA, string &amp;amp;in asItemB, string &amp;amp;in asFunction, bool abAutoRemove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to combine items in his inventory. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItemA, string &amp;amp;in asItemB)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name for the callback&lt;br /&gt;
#''asItemA ''- internal name of first item&lt;br /&gt;
#''asItemB ''- internal name of second item&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
#''abAutoRemove ''- determines whether the callback should be removed when the items are combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveCombineCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a combine callback.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the callback to be removed (as specified in AddCombineCallback)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddUseItemCallback(string &amp;amp;in asName, string &amp;amp;in asItem, string &amp;amp;in asEntity, string &amp;amp;in asFunction, bool abAutoDestroy);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to use items on the world. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItem, string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
#''asItem ''- internal name of the item&lt;br /&gt;
#''asEntity ''- entity to be able to use the item on&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abAutoDestroy ''- determines whether the callback should be removed when the item is used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveUseItemCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item callback.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
&lt;br /&gt;
===Entities===&lt;br /&gt;
&lt;br /&gt;
====General====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityActive(string &amp;amp;in asName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityVisible(string &amp;amp;in asName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity's visual mesh. The collision body remains.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the entity.&lt;br /&gt;
#''abActive''  - Activate/deactivate mesh.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntityExists(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an entity exists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCustomFocusCrossHair(string &amp;amp;in asName, string&amp;amp; asCrossHair);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the crosshair that is used when focusing an entity.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCrossHair ''- desired crosshair, can be: &lt;br /&gt;
::*Default (no crosshair)&lt;br /&gt;
::*Grab&lt;br /&gt;
::*Push&lt;br /&gt;
::*Ignite&lt;br /&gt;
::*Pick&lt;br /&gt;
::*LevelDoor&lt;br /&gt;
::*Ladder&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void CreateEntityAtArea(string &amp;amp;in asEntityName, string &amp;amp;in asEntityFile, string &amp;amp;in asAreaName, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an entity at an area. When creating an enemy though, it cannot chase properly along PathNodes (using for example &amp;lt;code&amp;gt;ShowEnemyPlayerPosition&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- internal name&lt;br /&gt;
#''asEntityFile ''- entity to be used extension .ent&lt;br /&gt;
#''asAreaName ''- the area to create the entity at&lt;br /&gt;
#''abFullGameSave ''- determines whether an entity &amp;quot;remembers&amp;quot; its state&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ReplaceEntity(string &amp;amp;in asName, string &amp;amp;in asBodyName, string &amp;amp;in asNewEntityName, string &amp;amp;in asNewEntityFile, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Removes an entity and places a new one in its place.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to replace.&lt;br /&gt;
#''asBodyName'' - Name of the body of the entity to place the new entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''asNewEntityName'' - Name of the new entity.&lt;br /&gt;
#''asNewEntityFile'' - Name of the new entity file. Extension .ent. &lt;br /&gt;
#''abFullGameSave'' - Whether ALL properties of this entity should be saved throughout levels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaceEntityAtEntity(string &amp;amp;in asName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBodyName, bool abUseRotation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Places an entity at the position of another entity. Does not work for enemies, use TeleportEnemyToEntity instead.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to place.&lt;br /&gt;
#''asTargetEntity'' - Name of the other entity to place the first entity at.&lt;br /&gt;
#''asTargetBodyName'' - Name of the body of the entity to place the first entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''abUseRotation'' - Whether the entity should be rotated like the target entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPos(string &amp;amp;in asName, float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Moves an entity to a position in the level.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to move.&lt;br /&gt;
#''afX'' - X co-ordinate position.&lt;br /&gt;
#''afY'' - Y co-ordinate position.&lt;br /&gt;
#''afZ'' - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetEntityPosX(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosY(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosZ(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns an entity's position in the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerLookAtCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveWhenLookedAt);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player looks at a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = looking, -1 = not looking&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveWhenLookedAt ''- determines whether the callback should be removed when the player looked at the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerInteractCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveOnInteraction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player interacts with a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveOnInteraction ''- determines whether the callback should be removed when the player interacts with the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCallbackFunc(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when certain events occur with an entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, string &amp;amp;in asType)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;asType&amp;lt;/code&amp;gt; values depend on entity type:&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! asType Value&lt;br /&gt;
|-&lt;br /&gt;
| Object || Break&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || OnIgnite&lt;br /&gt;
|-&lt;br /&gt;
| Item || OnPickup&lt;br /&gt;
|-&lt;br /&gt;
| Enemy || OnDeath&lt;br /&gt;
|-&lt;br /&gt;
| Enemy_Grunt&amp;lt;br&amp;gt;Enemy_Manpig || OnAutoDisabled&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityConnectionStateChangeCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A callback called when ever the connection state changes (button being switched on, lever switched, etc). &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void Func(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: -1 = off, 0 = between, 1 = on&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityInteractionDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disallows interaction with an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void BreakJoint (string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Breaks a joint. Do not use this on joints in SwingDoors, Levers, Wheels, etc. where the joint is part of an interaction. That will make the game crash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void AddEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName, string &amp;amp;in asFunction, bool abDeleteOnCollide, int alStates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when two entities collide. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asParent, string &amp;amp;in asChild, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = enter, -1 = leave&lt;br /&gt;
&lt;br /&gt;
#''asParentName ''- internal name of main object&lt;br /&gt;
#''asChildName ''- internal name of object that collides with main object (asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) NOT supported!)&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abDeleteOnCollide ''- determines whether the callback after it was called&lt;br /&gt;
#''alStates ''- 1 = only enter, -1 = only leave, 0 = both&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an EntityCollideCallback. Asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) not supported in ''asChildName''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntitiesCollide(string &amp;amp;in asEntityA, string &amp;amp;in asEntityB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether two entities collide. This function does NOT support asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) or &amp;quot;Player&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetBodyMass(string &amp;amp;in asName, float afMass);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName.&lt;br /&gt;
#''afMass''  - The mass to set.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetBodyMass(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName. &lt;br /&gt;
#''afMass''  - The mass to get.&lt;br /&gt;
&lt;br /&gt;
====Props====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropEffectActive(string &amp;amp;in asName, bool abActive, bool abFadeAndPlaySounds);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Can be used on coal to give it the black color it should have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropActiveAndFade(string &amp;amp;in asName, bool abActive, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates a prop.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''abActive ''- nothing to add&lt;br /&gt;
#''afFadeTime ''- time in seconds until prop fully fades&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropStaticPhysics(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates the physics of a prop, setting the mass to 0. Setting as true will make entities static in midair.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetPropIsInteractedWith(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a prop is interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RotatePropToSpeed(string &amp;amp;in asName, float afAcc, float afGoalSpeed, float afAxisX, float afAxisY, float afAxisZ, bool abResetSpeed, string &amp;amp;in asOffsetArea);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the prop up to a set speed.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afGoalSpeed ''- desired speed &lt;br /&gt;
#''afAxisX ''- rotation around X axis&lt;br /&gt;
#''afAxisY ''- rotation around Y axis&lt;br /&gt;
#''afAxisZ ''- rotation around Z axis&lt;br /&gt;
#''abResetSpeed ''- determines whether the speed is resetted after goal speed is reached&lt;br /&gt;
#''asOffsetArea ''- the area to rotate around, if empty, then the center of the body is used Note: The entity you want to rotate MUST be a &amp;quot;StaticObject&amp;quot; entity!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void StopPropMovement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all movement of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddAttachedPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop.&lt;br /&gt;
&lt;br /&gt;
#''asPropName''- the prop to attach another prop at &lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop&lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
{{bug|''afRotZ '' is used for both the ZX rotation and the Z position of the attached prop. Unwanted rotation can be avoided by using: &amp;lt;br /&amp;gt;''AddAttachedPropToProp(asPropName, asAttachName, asAttachFile, afPosX, afPosY, '''0''', afPosZ, '''90.0f''', afPosZ)''}}&lt;br /&gt;
&lt;br /&gt;
{{bug|Attaching a breakable prop to a physically active prop, and then breaking the attached prop, will cause the game to crash, should the parent object be moved or reset.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop. Fixed version of &amp;lt;code&amp;gt;AddAttachedPropToProp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
#''asPropName ''- the prop to attach another prop at&lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop &lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveAttachedPropFromProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches a prop from a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
void AddPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
float GetPropHealth(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ResetProp(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets a prop's state to the original one when the map was loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void PlayPropAnimation(string &amp;amp;in asProp, string &amp;amp;in asAnimation, float afFadeTime, bool abLoop, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the prop play an animation and calls a function. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asProp)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asProp ''- internal name of the prop&lt;br /&gt;
#''asAnimation ''- animation to play&lt;br /&gt;
#''afFadeTime ''- Fade time between current and new animations&lt;br /&gt;
#''abLoop ''- determines whether the animation loops &lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddPropForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddPropImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These functions push objects. Note that rather high values are needed when applying ''forces''  (on the order of ~100 (weak) to ~10000 (strong)), but not impulses (values less than 10 can be appropriate). Forces are external influences, and will have different effect depending on the mass of the object they are being applied to; impulses disregard mass, and can cause objects to break, as if hit. A &amp;quot;Body&amp;quot; is a physics-related helper object, to which a force or an impulse can be applied. Entities can consist of several bodies, interconnected in various ways (you can create/examine bodies in the model editor).&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the object to push; for bodies, use this format: &amp;quot;''entityName''_''bodyName''&amp;quot;&lt;br /&gt;
#''afX ''- magnitude along the X-axis&lt;br /&gt;
#''afY ''- magnitude along the Y-axis&lt;br /&gt;
#''afZ ''- magnitude along the Z-axis&lt;br /&gt;
#''asCoordSystem ''- determines which coordinate system is used, &amp;quot;local&amp;quot; or &amp;quot;world&amp;quot;&lt;br /&gt;
&lt;br /&gt;
All of these functions are ''additive''  - when called consecutively, for each call, the vectors defined by (afX, afY, afZ) will be added together, and a resultant force/impulse will be calculated ''before''  any physics simulation is applied to the target object.&lt;br /&gt;
&lt;br /&gt;
====Connections====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithRope(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asRopeName, bool abInteractOnly, float afSpeedMul, float afToMinSpeed, float afToMaxSpeed, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects a prop with the movement of a rope (i.e. turn a wheel to move a rope). For Levers, the rope only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName''- The name of the connection&lt;br /&gt;
#''asPropName'' - The name of the prop; can be a Lever or Wheel&lt;br /&gt;
#''asRopeName'' - The name of the rope&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''afSpeedMul'' - Speed multiplier of how quickly the rope moves&lt;br /&gt;
#''afToMinSpeed'' - The slowest the rope can move&lt;br /&gt;
#''afToMaxSpeed'' - The fastest the rope can move&lt;br /&gt;
#''abInvert'' - Whether to invert the direction the rope moves&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithMoveObject(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asMoveObjectName, bool abInteractOnly, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This one should only be used if there must be an exact correspondence to prop &amp;quot;amount&amp;quot; and the MoveObject open amount. It is best used for Wheel-door connections, where the MoveObject moves continuously along with the Wheel. For Levers, the MoveObject only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asPropName'' - The entity that controls the movement; can be a Lever or Wheel&lt;br /&gt;
#''asMoveObject'' - The MoveObject to move&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''abInvert'' - If the state is inverted, making the MoveObject move in the opposite direction&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ConnectEntities(string &amp;amp;in asName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, bool abInvertStateSent, int alStatesUsed, string &amp;amp;in asCallbackFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects two entities together so that changing the state of the main entity changes the state of the connected entity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! Max State (1) !! Min State (-1)&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || Lit || Unlit&lt;br /&gt;
|-&lt;br /&gt;
| MoveObject || Open || Close&lt;br /&gt;
|-&lt;br /&gt;
| SwingDoor&lt;br /&gt;
|rowspan=2| Locked&lt;br /&gt;
|rowspan=2| Unlocked&lt;br /&gt;
|-&lt;br /&gt;
| Chest&lt;br /&gt;
|-&lt;br /&gt;
| Button || Switched on || Switched off&lt;br /&gt;
|-&lt;br /&gt;
| Lever&lt;br /&gt;
|rowspan=2| Unstuck&lt;br /&gt;
|rowspan=2| Stuck (at min)&lt;br /&gt;
|-&lt;br /&gt;
| Wheel&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asMainEntity'' - The entity that causes the change; can be a Lever, Wheel, Button, or Photocell&lt;br /&gt;
#''asConnectEntity'' - The entity that is affected by the change&lt;br /&gt;
#''abInvertStateSent'' - If the state is inverted, making the connected entity change to the opposite state&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
#''asCallbackFunc'' - The name of the connection callback&lt;br /&gt;
&lt;br /&gt;
Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asConnectionName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, int alState)&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;alState is what is sent to connection entity and will be inverted if abInvertStateSent = true!&lt;br /&gt;
&lt;br /&gt;
====Lamps====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLampLit(string &amp;amp;in asName, bool abLit, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Turns a lamp on or off.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the lamp&lt;br /&gt;
#''abLit ''- Set true if you want the lamp to be lit, set to false if you want the lamp to be unlit&lt;br /&gt;
#''abEffects ''- If you want to have the lamp fade in/out when it gets lit/unlit&lt;br /&gt;
&lt;br /&gt;
====Doors====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorLocked(string &amp;amp;in asName, bool abLocked, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abLocked'' - Locked/unlocked&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is locked/unlocked&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorClosed(string &amp;amp;in asName, bool abClosed, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abClosed'' - Closed/open&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is closed/opened&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
bool GetSwingDoorLocked(string &amp;amp;in asName);&lt;br /&gt;
bool GetSwingDoorClosed(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a swing door is locked/closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorDisableAutoClose(string &amp;amp;in asName, bool abDisableAutoClose);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deactivates the &amp;quot;auto-close&amp;quot; when a door is nearly closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetSwingDoorState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns an integer depending on how far the door is opened. &amp;lt;br /&amp;gt;-1 = angle is close to 0°, 1 = angle is 70% or higher of max, 0 = inbetween -1 and 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLocked(string &amp;amp;in asName, bool abLocked);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a level door. Note that level doors are NOT swing doors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedSound(string &amp;amp;in asName, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which sound is played when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedText(string &amp;amp;in asName, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectState(string &amp;amp;in asName, float afState);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween (and above, for example, the bridge_metal_vert) are valid too!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectStateExt(string &amp;amp;in asName, float afState, float afAcc, float afMaxSpeed, float afSlowdownDist, bool abResetSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state, extended method.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween are valid too!&lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afMaxSpeed ''- maximum speed&lt;br /&gt;
#''afSlowdownDist ''- Distance to the target state before deceleration occurs.&lt;br /&gt;
#''abResetSpeed ''- Set to ''true'' if the prop's speed should be reset before performing the movement, else the prop will accelerate from its current speed to afMaxSpeed.&lt;br /&gt;
&lt;br /&gt;
====Levers, wheels and buttons====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropObjectStuckState(string &amp;amp;in asName, int alState);&lt;br /&gt;
void SetWheelStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
void SetLeverStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes an object/wheel/lever stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name&lt;br /&gt;
#''alState'' - 0 = not stuck, 1 = at max, -1 = at min &lt;br /&gt;
#''abEffects'' - play sound effects&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelAngle(string &amp;amp;in asName, float afAngle, bool abAutoMove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves a wheel to a certain angle.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - internal name&lt;br /&gt;
#''afAngle'' - angle&lt;br /&gt;
#''abAutoMove'' - determines whether the wheel should move on its own&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
void SetLeverInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to make a wheel/lever unstuck when interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetLeverState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the state of the lever. &amp;lt;br /&amp;gt;0 = not stuck, 1 = at max, -1 = at min&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderStuckState(string &amp;amp;in asName, int alStuckState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes a MultiSlider stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when state changes. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetButtonSwitchedOn(string &amp;amp;in asName, bool abSwitchedOn, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Sticky areas====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetAllowStickyAreaAttachment(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows entities to stick to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asProp);&lt;br /&gt;
void AttachBodyToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asBody);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop/body to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void DetachFromStickyArea(string &amp;amp;in asAreaName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches everything from a StickyArea.&lt;br /&gt;
&lt;br /&gt;
====NPCs====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCAwake(string &amp;amp;in asName, bool abAwake, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wakes/sleeps a NPC.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the NPC&lt;br /&gt;
#''abAwake'' - ''true'' to awaken, ''false'' to sleep&lt;br /&gt;
#''abEffects'' - Play the &amp;quot;Awake&amp;quot; or &amp;quot;Sleep&amp;quot; animations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCFollowPlayer(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a NPC's head to follow the player's movements.&lt;br /&gt;
&lt;br /&gt;
====Enemies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables an enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyIsHallucination(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes an enemy a hallucination. Hallucinations fade to smoke when they get near the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void FadeEnemyToSmoke(string &amp;amp;in asName, bool abPlaySound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly fades an enemy to smoke.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ShowEnemyPlayerPosition(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the enemy run to the player, no matter where he is.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AlertEnemyOfPlayerPresence(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gives the specified enemy the player's current position and makes it search the area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisableTriggers(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables or disables enemy triggers. If disabled, enemy will not react to player or attack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddEnemyPatrolNode(string &amp;amp;in asName, string &amp;amp;in asNodeName, float afWaitTime, string &amp;amp;in asAnimation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a patrol node to the enemy's path.&lt;br /&gt;
&lt;br /&gt;
#''asName''- Internal name of the enemy &lt;br /&gt;
#''asNodeName'' - Path node &lt;br /&gt;
#''afWaitTime'' - Time in seconds that the enemy waits at the path node before continuing. If 0, randomized between 1-3.&lt;br /&gt;
#''asAnimation'' - The animation the enemy uses when reaching the path node&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ClearEnemyPatrolNodes(string &amp;amp;in asEnemyName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the current path of patrol nodes of the enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemySanityDecreaseActive(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether an enemy activates the player's sanity drain when stared at.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy &lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToNode(string &amp;amp;in asEnemyName, string &amp;amp;in asNodeName, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific PathNode.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asNodeName'' - Internal name of the node to teleport to &lt;br /&gt;
#''abChangeY'' - Whether the Y position of the node will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToEntity(string &amp;amp;in asEnemyName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBody, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific entity.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asTargetEntity'' - Internal name of the entity to teleport to&lt;br /&gt;
#''asTargetBody'' - Internal name of the entity's body name to teleport to. If empty, the first body will be used (might be unstable, recommended to input a body anyway)&lt;br /&gt;
#''abChangeY'' - Whether the Y position of the entity will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeManPigPose(string &amp;amp;in asName, string &amp;amp;in asPoseType);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the pose a specified ManPig.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''asPoseType'' - Name of the ManPig pose to use. Can be &amp;quot;Biped&amp;quot; or &amp;quot;Quadruped&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigFadeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should fade the player's view in and out.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigSoundDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should play the proximity sounds.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigEasyEscapeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should be easier to escape from when hunted. If not disabled, easy escape is activated if the player is more than 12.35 meters away, the enemy can't see the player, and the player has less than 75 health. When this occurs, the enemy is forced to stop hunting and wait for half a second.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ForceTeslaPigSighting(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Forces a Tesla ManPig to be visible for a short time.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; GetEnemyStateName(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the name of the state a specified enemy is current in.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
Possible states for all enemies:&lt;br /&gt;
*Idle&lt;br /&gt;
*Wait&lt;br /&gt;
*Patrol&lt;br /&gt;
*Investigate&lt;br /&gt;
*Alert&lt;br /&gt;
*Search&lt;br /&gt;
*Hurt&lt;br /&gt;
*Hunt&lt;br /&gt;
*HuntPause&lt;br /&gt;
*HuntWander&lt;br /&gt;
*AttackMeleeShort&lt;br /&gt;
*AttackMeleeLong&lt;br /&gt;
*BreakDoor&lt;br /&gt;
*Dead&lt;br /&gt;
&lt;br /&gt;
Waterlurker-only states:&lt;br /&gt;
*GoHome&lt;br /&gt;
*Eat&lt;br /&gt;
&lt;br /&gt;
ManPig-only states: &lt;br /&gt;
*Flee&lt;br /&gt;
*Stalk&lt;br /&gt;
*Track&lt;br /&gt;
&lt;br /&gt;
Unused states:&lt;br /&gt;
*AttackRange&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/TDD/Entity_Types&amp;diff=7010</id>
		<title>HPL2/TDD/Entity Types</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/TDD/Entity_Types&amp;diff=7010"/>
		<updated>2025-04-15T18:50:33Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* MoveObject */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TocRight}}&lt;br /&gt;
&lt;br /&gt;
This page lists the different types of entities found within the HPL2 engine. The type determines how the entity will be set up, what kind it is, what it does under different circumstances etc. Using the Model Editor you can identify and specify which type an entity has and its type vars, in Settings &amp;gt; User defined variables. In the Level Editor, the different types have different settings applicable for them, known as instance vars. For example, a MoveObject type will have the OffsetArea box available in the Level Editor, and an Item (Note) type will have a NoteText box available.&lt;br /&gt;
&lt;br /&gt;
A list of all the types and subtypes can be found in the table of contents to the right.&lt;br /&gt;
&lt;br /&gt;
== StaticProp ==&lt;br /&gt;
&lt;br /&gt;
A StaticProp entity resembles a static object. They have no available type properties, but they can still use physics bodies (collision boxes) and have mass/gravity. Note that they cannot be interacted with in the game, and cannot be disabled. If you need this feature, use Object (Static) instead.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CastShadows || Bool || true || If entity casts shadows.&lt;br /&gt;
|-&lt;br /&gt;
| IsAffectedByDecal || Bool || true || If decals can be created on entity.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CommentaryIcon ==&lt;br /&gt;
&lt;br /&gt;
A CommentaryIcon entity is simply an object that can execute commentary sound files, as it was done in the main game. These only appear if the player has &amp;quot;Commentary&amp;quot; enabled in their settings.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| RotateSubMesh || String || || The name of the submesh that is to be rotated&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| File || File (.comment) || || The .comment file for the commentary.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Object ==&lt;br /&gt;
&lt;br /&gt;
Objects are entities that can be activated/deactivated, broken, and interact with physics.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| BreakActive || Bool || false || If entity is broken when hit hard enough or health is 0.&lt;br /&gt;
|-&lt;br /&gt;
| BreakDestroyJoints || Bool || false || If all physics joints should be destroyed when broken.&lt;br /&gt;
|-&lt;br /&gt;
| BreakMinEnergy || Float || 100 || The minimum energy needed for breakage. Energy = Object1Speed * Object1Mass + Object2Speed * Object2Mass. Speed = m/s. If Object 2 is floor or something static, its speed is always 0 and does not contribute to total energy!&lt;br /&gt;
|-&lt;br /&gt;
| BreakEntity || File (.ent) || || The entity this entity turns into when broken.&lt;br /&gt;
|-&lt;br /&gt;
| BreakEntityAlignBody || String || || The body BreakEntity uses to align itself when created. No entity is created if left empty.&lt;br /&gt;
|-&lt;br /&gt;
| BreakSound || File (.snt) || || The sound made when broken.&lt;br /&gt;
|-&lt;br /&gt;
| BreakParticleSystem || File (.ps) || || Particle system shown when broken.&lt;br /&gt;
|-&lt;br /&gt;
| BreakImpulse || Float || 4 || Impulse (speed in m/s really) added to all bodies in BreakEntity when created. The direction of impulse is outwards from center of entity.&lt;br /&gt;
|-&lt;br /&gt;
| HitDamageAmount || Float || 5 || The amount of damage made when hitting an enemy or player.&lt;br /&gt;
|-&lt;br /&gt;
| HitDamageStrength || Int || 1 || The strength of the damage.&lt;br /&gt;
|-&lt;br /&gt;
| MinHitDamageSpeed || Float || 3 || The minimum speed (m/s) needed for damage to be made.&lt;br /&gt;
|-&lt;br /&gt;
| LifeLength || Float || 0 || A time after which the entity automatically breaks. 0=lasts forever.&lt;br /&gt;
|-&lt;br /&gt;
| IsFood || Bool || false || If this is food for some enemies and can be used to lure them. Needs to have break active and health determines how long the food lasts.&amp;lt;br&amp;gt;Waterlurkers are the only enemy type that is lured by and eats food objects.&lt;br /&gt;
|-&lt;br /&gt;
| ShowHints || Bool || true || If a hint can be triggered by interacting with the prop.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| ContainedItem || String || None || An item that is created when entity breaks.&amp;lt;br&amp;gt;Must match an entity file name (extension .ent optional) in the &amp;quot;items&amp;quot; folder.&lt;br /&gt;
|-&lt;br /&gt;
| DisableBreakable || Bool || false || If the entity is breakable then having this true will make it unbreakable.&lt;br /&gt;
|-&lt;br /&gt;
| IsInsanityVision || Bool || false || If the prop is only shown when insanity is low enough.&lt;br /&gt;
|-&lt;br /&gt;
| VisionMaxSanity || Float || 30 || The max sanity the player can have for prop to show if it is an insanity vision.&amp;lt;br&amp;gt;The object will only be visible if the player's sanity is less than this value.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Static ===&lt;br /&gt;
&lt;br /&gt;
Not to be confused with an actual static object. This Object subtype is a generic object with common properties. The static subtype simply disables any additional properties from the other subtypes. An Object (Static) is similar in concept to a StaticProp type entity, however the Object (Static) can be deactivated, can break, has physics, and can have an interact callback set.&lt;br /&gt;
&lt;br /&gt;
=== Grab ===&lt;br /&gt;
&lt;br /&gt;
A Grab subtype is a normal Object entity with the ability to be grabbed by the player in the game. In order for this to work, the object must have a mass above 0.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| GrabUseDepth || Bool || false || If GrabDepth is used. If not the interaction distance is used.&lt;br /&gt;
|-&lt;br /&gt;
| GrabDepth || Float || 1.5 || The distance which a grabbed object is automatically placed at.&lt;br /&gt;
|-&lt;br /&gt;
| GrabDepthInc || Float || 0.15 || Steps that the entity will move in when moving the mouse scroll.&lt;br /&gt;
|-&lt;br /&gt;
| GrabMinDepth || Float || 1.0 || Minimum distance the entity can be from player when grabbed.&lt;br /&gt;
|-&lt;br /&gt;
| GrabMaxDepth || Float || 2.2 || Maximum distance the entity can be from player when grabbed.&lt;br /&gt;
|-&lt;br /&gt;
| GrabUseOffset || Bool || false || If rotation and position offset is used. If not offset will be relative to the interact position.&lt;br /&gt;
|-&lt;br /&gt;
| GrabPositionOffset || Vector3f || 0 || Positional offset of entity.&lt;br /&gt;
|-&lt;br /&gt;
| GrabRotationOffset || Vector3f || 0 || Rotational offset of entity. It will automatically rotate to this when grabbed.&lt;br /&gt;
|-&lt;br /&gt;
| GrabThrowImpulse || Float || 10 || The speed (m/s) at which the entity is thrown.&lt;br /&gt;
|-&lt;br /&gt;
| GrabMassMul || Float || 0.1 || How much the object will weight when grabbed. Useful for heavier objects since they can wreck mayhem otherwise. 0.5% means half (50%) of the original weight.&lt;br /&gt;
|-&lt;br /&gt;
| GrabForceMul || Float || 1 || Change how much force is added to grabbed object.&lt;br /&gt;
|-&lt;br /&gt;
| GrabTorqueMul || Float || 1 || Change how much torque is added to grabbed object.&lt;br /&gt;
|-&lt;br /&gt;
| GrabUseRotation || Bool || true || If rotation should be used on grabbed object&lt;br /&gt;
|-&lt;br /&gt;
| GrabSkipNonOuterBodies || Bool || false || If true, then bodies that are inside a chain (has two or more joints attached to it) will not be grabbed.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Push ===&lt;br /&gt;
&lt;br /&gt;
Similar to the Grab subtype, the Push subtype allows the player to push the object by taking hold of it and walking or right clicking. Examples include large rocks and the bed covering the hole in the floor in the Prison - Southern Block.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| PushAtPoint || Bool || false || If the push force should be applied to the point at the object where interaction took place.&lt;br /&gt;
|-&lt;br /&gt;
| PushForceMul || Float || 1 || Multiplier for force applied. Used to fine tune interaction.&lt;br /&gt;
|-&lt;br /&gt;
| PushImpulse || Float || 2 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Slide ===&lt;br /&gt;
&lt;br /&gt;
A Slide Object is similar to the Grab subtype, except it can only be slid in a single direction for a certain amount. An existing (but unused) entity that uses this is the secret floor carpet you can slide to the side.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| SlideMaxSpeed || Float || 10 || The maximum speed it can be moved.&lt;br /&gt;
|-&lt;br /&gt;
| SlideSlowDownFactor || Float || 1 || Amount of slowdown applied to object when not moved.&lt;br /&gt;
|-&lt;br /&gt;
| SlideSpeedFactor || Float || 1 || The higher value the more speed gain a mouse movement makes.&lt;br /&gt;
|-&lt;br /&gt;
| SlideThrowImpulse || Float || 3 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SwingDoor ==&lt;br /&gt;
&lt;br /&gt;
A SwingDoor entity is standard hinged door. Any door you can grab and swing open is considered a SwingDoor. To use a SwingDoor, you need to attach joints to where you want the door to swing around. These are usually placed by the hinges of the door. On the joint you can set the min and max values to limit how much the door can be opened. These are usually approximately 90 degrees apart in either positive or negative directions.&lt;br /&gt;
&lt;br /&gt;
If the FullGameSave instance var is not enabled, SwingDoors will reset to their initial open amount when leaving a level and returning to it.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MoveMaxSpeed || Float || 13.5 || The maximum speed it can be moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSlowDownFactor || Float || 3.0 || Amount of slowdown applied to object when not moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSpeedFactor || Float || 1.0 || The higher value the more speed gain a mouse movement makes.&lt;br /&gt;
|-&lt;br /&gt;
| MoveThrowImpulse || Float || 6.0 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
| CanInteractWithStaticBody || Bool || false || If by interacting with a static body in the entity, the door is interacted with. Meaning that interacting with any part of the entity will work.&lt;br /&gt;
|-&lt;br /&gt;
| CloseOnSound || File (.snt) || || Sound played when the door is closed.&lt;br /&gt;
|-&lt;br /&gt;
| CloseOffSound || File (.snt) || || Sound played when the door is opened.&lt;br /&gt;
|-&lt;br /&gt;
| LockOnSound || File (.snt) || || Sound played when the door is locked.&lt;br /&gt;
|-&lt;br /&gt;
| LockOffSound || File (.snt) || || Sound played when the door is unlocked.&lt;br /&gt;
|-&lt;br /&gt;
| InteractLockedSound || File (.snt) || || Sound made when player interacts with a locked door.&lt;br /&gt;
|-&lt;br /&gt;
| Breakable || Bool || false || Can the door be broken.&lt;br /&gt;
|-&lt;br /&gt;
| DamageMesh1 || File (.dae/.msh/.mesh) || || Mesh used when health is below HealthDamage1&lt;br /&gt;
|-&lt;br /&gt;
| DamageMesh2 || File (.dae/.msh/.mesh) || || Mesh used when health is below HealthDamage2&lt;br /&gt;
|-&lt;br /&gt;
| BrokenEntity || File (.ent) || || The entity this entity turns into when broken.&lt;br /&gt;
|-&lt;br /&gt;
| DamageSound || File (.snt) || || Sound made when a new damage mesh is used.&lt;br /&gt;
|-&lt;br /&gt;
| DamagePS || File (.ps) || || Particles created when a new damage mesh is used.&lt;br /&gt;
|-&lt;br /&gt;
| BreakSound || File (.snt) || || Sound made when broken.&lt;br /&gt;
|-&lt;br /&gt;
| BreakPS || File (.ps) || || Particles created when broken.&lt;br /&gt;
|-&lt;br /&gt;
| BreakImpulse || Float || 3 || Impulse set to objects in broken mesh.&amp;lt;br&amp;gt;Incorrectly defined as a sound file in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| HealthDamage1 || Float || 66 || Health when damage mesh 1 is used.&lt;br /&gt;
|-&lt;br /&gt;
| HealthDamage2 || Float || 33 || Health when damage mesh 2 is used.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| Locked || Bool || false || If the door is locked&lt;br /&gt;
|-&lt;br /&gt;
| OpenAmount || Float || 0 || The amount the door is open. 0 - 1.&lt;br /&gt;
|-&lt;br /&gt;
| DisableBreakable || Bool || false || If the entity is breakable then having this true will make it unbreakable.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Lever ==&lt;br /&gt;
&lt;br /&gt;
A Lever entity is an entity that can be swung between states to trigger callbacks. A lever requires a joint to swing around.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MoveMaxSpeed || Float || 13.5 || The maximum speed it can be moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSlowDownFactor || Float || 3.0 || Amount of slowdown applied to object when not moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSpeedFactor || Float || 1.0 || The higher value the more speed gain a mouse movement makes.&lt;br /&gt;
|-&lt;br /&gt;
| MoveThrowImpulse || Float || 6.0 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
| CanInteractWithStaticBody || Bool || false || If by interacting with a static body in the entity, the lever is interacted with. Meaning that interacting with any part of the entity will work.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitRange || Float || 5.0 || The distance from min the joint can be to be considered at min limit.&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitRange || Float || 5.0 || The distance from max the joint can be to be considered at max limit.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitSound || File (.snt) || || Sound played when at min limit&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitSound || File (.snt) || || Sound played when at max limit&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitStuck || Bool || false || If the lever becomes stuck when reaching min.&amp;lt;br&amp;gt;Missing from EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitStuck || Bool || false || If the lever becomes stuck when reaching max.&amp;lt;br&amp;gt;Missing from EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| StuckSound || File (.snt) || || Sound played when stuck&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| MiddleAngleAmount || Float || 0 || The amount between min and max that is considered middle. -1 to 1. -1=at min, 0=exactly between min and max, 1=at max&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveToAngle || Bool || True || If the lever should move to position when not interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveSpeedFactor || Float || 2 || Multiplier applied to speed to determine the speed it moves towards wanted position. The higher the faster it gets to the position.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveMaxSpeed || Float || 8 || Max speed it can move at to the wanted position&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveGoal || String || Middle || Where it should go when auto moving.&amp;lt;br&amp;gt;Can be &amp;quot;Middle&amp;quot;, &amp;quot;Min&amp;quot;, or &amp;quot;Max&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| StuckState || String || None || The initial stuck state for the lever.&amp;lt;br&amp;gt;Can be &amp;quot;None&amp;quot;, &amp;quot;Min&amp;quot;, or &amp;quot;Max&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| InteractionDisablesStuck || Bool || false || If stuck is disabled when player interacts.&lt;br /&gt;
|-&lt;br /&gt;
| OverrideDefaults || Bool || false || If normal settings, set in ent file, should be overridden by settings below.&lt;br /&gt;
|-&lt;br /&gt;
| MiddleAngleAmount || Float || 0 || The amount between min and max that is considered middle. -1 to 1. -1=at min, 0=exactly between min and max, 1=at max&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveToAngle || Bool || True || If the lever should move to position when not interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveGoal || String || Middle || Where it should go when auto moving.&amp;lt;br&amp;gt;Can be &amp;quot;Middle&amp;quot;, &amp;quot;Min&amp;quot;, or &amp;quot;Max&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Wheel ==&lt;br /&gt;
&lt;br /&gt;
A Wheel entity is a wheel that can be turned. They use states similar to the levers. Some wheels can be turned indefinitely and some (mostly valves) can be turned for a fixed amount in order to trigger an event. Wheels require a joint.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MoveMaxSpeed || Float || 13.5 || The maximum speed it can be moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSlowDownFactor || Float || 3.0 || Amount of slowdown applied to object when not moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSpeedFactor || Float || 1.0 || The higher value the more speed gain a mouse movement makes.&lt;br /&gt;
|-&lt;br /&gt;
| MoveThrowImpulse || Float || 6.0 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
| CanInteractWithStaticBody || Bool || false || If by interacting with a static body in the entity, the wheel is interacted with. Meaning that interacting with any part of the entity will work.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimit || Float || -180 || Min limit of the wheel, should be equal or below 0 but can be as low as wanted. Several revolutions are supported!&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimit || Float || 180 || Max limit of the wheel, should be equal or above 0 but can be as high as wanted. Several revolutions are supported!&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitRange || Float || 5.0 || The distance from min the joint can be to be considered at min limit.&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitRange || Float || 5.0 || The distance from max the joint can be to be considered at max limit.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitStuck || Bool || false || If the wheel becomes stuck when reaching min limit.&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitStuck || Bool || false || If the wheel becomes stuck when reaching max limit.&lt;br /&gt;
|-&lt;br /&gt;
| SpinDir || String || BothWays || The direction the wheel can be spun&amp;lt;br&amp;gt;Can be &amp;quot;BothWays&amp;quot;, &amp;quot;ToMin&amp;quot;, or &amp;quot;ToMax&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitSound || File (.snt) || || Sound played at min limit&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitSound || File (.snt) || || Sound played at max limit&lt;br /&gt;
|-&lt;br /&gt;
| StuckSound || File (.snt) || || Sound played when stuck.&lt;br /&gt;
|-&lt;br /&gt;
| SlowDownRotation || Bool || true || If rotation should be slowed to 0 when not interacting.&lt;br /&gt;
|-&lt;br /&gt;
| SkipMiddleState || Bool || true || If the middle state (when not in max or min) should be skipped by script and connections.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| StuckState || String || None || The stuck state for the wheel.&amp;lt;br&amp;gt;Can be &amp;quot;None&amp;quot;, &amp;quot;Min&amp;quot;, or &amp;quot;Max&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| InteractionDisablesStuck || Bool || false || If stuck is disabled when player interacts.&lt;br /&gt;
|-&lt;br /&gt;
| OverrideDefaults || Bool || false || If normal settings, set in ent file, should be overridden by settings below.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimit || Float || -180 || Min limit of the wheel, should be equal or below 0 but can be as low as wanted. Several revolutions are supported!&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimit || Float || 180 || Max limit of the wheel, should be equal or above 0 but can be as high as wanted. Several revolutions are supported!&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitStuck || Bool || false || If stuck at min limit&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitStuck || Bool || false || If stuck at max limit&lt;br /&gt;
|-&lt;br /&gt;
| SpinDir || String || BothWays || The direction the wheel can be spun&amp;lt;br&amp;gt;Can be &amp;quot;BothWays&amp;quot;, &amp;quot;ToMin&amp;quot;, or &amp;quot;ToMax&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MultiSlider ==&lt;br /&gt;
&lt;br /&gt;
A sliding-type lever that can be set to multiple states. Used for the gear levers in the Sewer.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| SlideMaxSpeed || Float || 10 || The maximum speed it can be moved.&lt;br /&gt;
|-&lt;br /&gt;
| SlideSlowDownFactor || Float || 1 || Amount of slowdown applied to object when not moved.&lt;br /&gt;
|-&lt;br /&gt;
| SlideSpeedFactor || Float || 1 || The higher value the more speed gain a mouse movement makes.&lt;br /&gt;
|-&lt;br /&gt;
| SlideThrowImpulse || Float || 3 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
| NumOfStates || Int || 3 || The number of states used.&lt;br /&gt;
|-&lt;br /&gt;
| StickToStateMaxDist || Float || 0.1 || The distance from a state that the slider sticks.&lt;br /&gt;
|-&lt;br /&gt;
| CanInteractWithStaticBody || Bool || false || If by interacting with a static body in the entity, the lever is interacted with. Meaning that interacting with any part of the entity will work.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveToCurrentState || Bool || true || If body should automove to current state when not interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveSpeedFactor || Float || 2 || Multiplier applied to speed to determine the speed it moves towards wanted position. The higher the faster it gets to the postion.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveMaxSpeed || Float || 8 || Max speed it can move at to the wanted position&lt;br /&gt;
|-&lt;br /&gt;
| ChangeStateSound || File (.snt) || || Sound played when state is changed&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| StuckSound || File (.snt) || || Sound played when stuck&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| StuckState || String || None || The stuck state for the wheel.&amp;lt;br&amp;gt;Can be &amp;quot;None&amp;quot;, &amp;quot;Min&amp;quot;, or &amp;quot;Max&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| InteractionDisablesStuck || Bool || false || If stuck is disabled when player interacts.&lt;br /&gt;
|-&lt;br /&gt;
| ChangeStateCallback || String || || Called when state changes Syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;Used instead of ConnectionStateChangeCallback, as this entity type can have more than two possible states.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Lamp ==&lt;br /&gt;
&lt;br /&gt;
A Lamp entity is a light source. If they are unlit, they can be lit by the player, consuming a tinderbox. Examples are torches and candles.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CanBeLitByPlayer || Bool || true || If the player can use a tinderbox on it to light it.&lt;br /&gt;
|-&lt;br /&gt;
| CanBeGrabbed || Bool || false || If it can be grabbed by the player.&amp;lt;br&amp;gt;No effect. Presumably intended to make the entity behave like a Grab Object, yet this is unimplemented.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| Lit || Bool || true || If the lamp is lit or not.&lt;br /&gt;
|-&lt;br /&gt;
| ConnectedLight || String || || Name of a light (that is not in an entity!) that will be connected to the this light and will increase/decrease in color as the lamp is turned on/off.&lt;br /&gt;
|-&lt;br /&gt;
| ConnectionLightAmount || Float || 1 || The amount to multiply the lamp's color by before adding it to the connected light's color.&lt;br /&gt;
|-&lt;br /&gt;
| ConnectionLightUseOnColor || Bool || true || If the on color should always be used. If false the light color (which might be flickering) is used.&lt;br /&gt;
|-&lt;br /&gt;
| ConnectionLightUseSpec || Bool || false || If the specular of the lamp color should be used.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Button ==&lt;br /&gt;
&lt;br /&gt;
A Button entity acts like a Lever, except it does not use a joint. It simply changes its connection state and toggles effects when interacted with.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| SwitchedOn || Bool || false || If the button starts as on or off&lt;br /&gt;
|-&lt;br /&gt;
| CanBeSwitchedOn || Bool || true || If player can switch it on.&lt;br /&gt;
|-&lt;br /&gt;
| CanBeSwitchedOff || Bool || false || If player can switch it off.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Photocell ==&lt;br /&gt;
&lt;br /&gt;
A prop that changes its texture illumination and connection state based on the light level around it. Presumably a leftover from Lux Tenebris, which featured light-based puzzles.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| LightLevelOnLimit || Float || 0.9 || Light level above this value turns the photocell on.&lt;br /&gt;
|-&lt;br /&gt;
| LightLevelOffLimit || Float || 0.1 || Light level below this value turns the photocell off.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MoveObject ==&lt;br /&gt;
&lt;br /&gt;
A MoveObject entity is an entity that can be specifically moved on a single axis through the use of scripting. It can be set to either Angular or Linear. Angular rotates the object around its own center point, unless otherwise specified by the use of an OffsetArea. Linear moves the object in a direction for a specified amount. Note that a linear move object can only move on one axis. You can pick X, Y, or Z in the entity and this cannot be changed mid-game. If you want the same object to move on more than 1 axis (for example left then forward) you can switch out the entity with an identical one that uses another axis. The script to move a MoveObject is &amp;lt;code&amp;gt;SetMoveObjectState&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;SetMoveObjectStateExt&amp;lt;/code&amp;gt; (see [[HPL2/Engine Scripts|Engine Scripts]]).&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MoveObjectType || String || Linear || The way the object moves. Linear means position changes and Angular means rotation changes.&amp;lt;br&amp;gt;Can be &amp;quot;Linear&amp;quot; or &amp;quot;Angular&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| OpenAmount || Float || 1.0 || Linear: How much of the MoveAxis size that will mean that it is open. Angular: 1=90 degrees. 0.5=45deg and 2=180deg (any numbers inbetween are okay of course)&lt;br /&gt;
|-&lt;br /&gt;
| MoveAxis || String || X || he axis that the movement is about. For angular it is rotation axis and for linear it is the position axis that is changed.&amp;lt;br&amp;gt;Can be &amp;quot;X&amp;quot;, &amp;quot;Y&amp;quot;, or &amp;quot;Z&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| OpenAcc || Float || 5.0 || The acceleration for reaching OpenSpeed&lt;br /&gt;
|-&lt;br /&gt;
| OpenSpeed || Float || 1.0 || The goal speed when opening.&lt;br /&gt;
|-&lt;br /&gt;
| CloseAcc || Float || 5.0 || The acceleration for reaching CloseSpeed&lt;br /&gt;
|-&lt;br /&gt;
| CloseSpeed || Float || 1.0 || The goal speed when closing.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMove || Bool || false || If the door should move towards some goal automatically.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveStateGoal || Float || 0.0 || The amount (relative to the what is considered open) that it shall move towards.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveAcc || Float || 9.0 || The acceleration when automoving&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveSpeed || Float || 5.0 || The goal speed when automoving&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveSlowdownDist || Float || 0.1 || The distance from state goal where it begins to slow down (in meters for linear and degrees for angular).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| AngularOffsetArea || String || || When mode is angular, this the point it rotates around. If empty, it rotates around its center.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Item ==&lt;br /&gt;
&lt;br /&gt;
Item entities become inventory items when interacted with. They glow when in pickup range.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| SubItemTypeName || String || || Determines its name and description by putting 'ItemDesc_' or 'ItemName_' as prefix for the lang file entry. Category is always Inventory&lt;br /&gt;
|-&lt;br /&gt;
| ImageFile || File (.tga/.dds/.jpg/.jpeg/.png) || || The icon shown in the inventory when picked up.&lt;br /&gt;
|-&lt;br /&gt;
| PickSound || String || Generic || The sound played when picked up.&amp;lt;br&amp;gt;Must match a sound file name in the &amp;quot;ui&amp;quot; folder, starting with &amp;quot;pick_&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CustomSubItemTypeName || String || || If not emtpy it overrides SubItemTypeName in entity file. Determines its name and description by putting 'ItemDesc_' or 'ItemName_' as prefix for the lang file entry. Category is always Inventory&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Puzzle ===&lt;br /&gt;
&lt;br /&gt;
A Puzzle subtype item is a general item with no extra properties. Use this if you only need an inventory item to be used to trigger a scripted action. Other subtypes have special properties, but Puzzle only has the ability to be collected and used from the inventory. When used, it's loaded onto the crosshair so the player can use it on objects.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| TempVar || Float || 0 || User specfic usage.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Coins ===&lt;br /&gt;
&lt;br /&gt;
Unused item type for the cut Thaler items. Thalers were once used to unlock Chests and use OilBarrels, with only the former functionality remaining.&lt;br /&gt;
&lt;br /&gt;
{{warning|You can create custom coin items, but there is a single language entry which is hardcoded into the engine and can't be changed. This means that even if all the others are changed, looking at Chests will always say &amp;quot;Locked. Costs X Thalers to open.&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CoinAmount || Int || 10 || The amount of coins it contains.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Note ===&lt;br /&gt;
&lt;br /&gt;
A Note item is an item that adds text to the player's journal. It displays itself when picked up. The note can be narrated, in which case it will automatically close once it's finished. If it isn't voiced, the player must close it. Use this if you want to make a Note item using a custom model or custom properties that differ from the main notes.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| NoteText || String || || The text and name of entry for note. Entry names for these are calculated: 'Note_'+NoteText+'_Name' and 'Note_'+NoteText+'_Text'&lt;br /&gt;
|-&lt;br /&gt;
| OpenNoteInJournal || Bool || true || If the journal should be opened when the note is picked up.&lt;br /&gt;
|-&lt;br /&gt;
| UseNarration || Bool || false || If the note has narration.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Diary ===&lt;br /&gt;
&lt;br /&gt;
A Diary item is nearly identical to the Note item. Instead, it adds itself to the Diary section of the player's journal, whereas the Note adds itself to the Notes section. Additionally, diary entries are grouped together, so that when one is split into multiple parts, the player will always read them in order, regardless of the specific Diary items that were picked up.&lt;br /&gt;
&lt;br /&gt;
Diaries are also always voice enabled, while Notes have the option for it. As such, a Diary without any voice files defined in its text will instantly close the journal on pickup.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| DiaryText || String || || The text and name of entry for diary. Entry name for these calculated: 'Diary_'+DiaryText+'_Name'+Idx and 'Diary_'+DiaryText+'_Text'+Idx. Idx starts at 1.&lt;br /&gt;
|-&lt;br /&gt;
| DiaryCallback || String || || A special callback for diary pickup. Syntax: &amp;lt;code&amp;gt;void Func(string &amp;amp;in asItem, int lDiaryIdx)&amp;lt;/code&amp;gt;. Call &amp;lt;code&amp;gt;ReturnOpenJournal(false)&amp;lt;/code&amp;gt; to not open diary in journal after callback.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Lantern ===&lt;br /&gt;
&lt;br /&gt;
A Lantern item can be picked up like a normal item, but is added as a lantern to the inventory. While having this item, the player can press F to toggle it, or click it in the inventory. Note: This is NOT the lantern model in the player's hands, only the item that gives it to the player. If you want a custom lantern model, you can follow [https://www.frictionalgames.com/forum/thread-12391.html this guide].&lt;br /&gt;
&lt;br /&gt;
=== Health ===&lt;br /&gt;
&lt;br /&gt;
A Health item acts like a health potion (Laudanum). It acts like a normal item, except when used it is consumed while increasing the player's health by a specified amount.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| HealAmount || Float || 25 || How much health is regained when used.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sanity ===&lt;br /&gt;
&lt;br /&gt;
A Sanity item acts like a sanity potion. While used, they increase the player's sanity by a fixed amount, and then consumed from the inventory.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| HealAmount || Float || 25 || How much sanity is regained when used.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== LampOil ===&lt;br /&gt;
&lt;br /&gt;
A LampOil item acts like an oil potion. When used, it increases the amount of oil for the lantern, and then consumed.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| OilAmount || Float || 25 || How much oil is regained when used.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Tinderbox ===&lt;br /&gt;
&lt;br /&gt;
A Tinderbox item adds itself to the player's tinderbox counter in the inventory. Tinderboxes can be used once to light a light source.&lt;br /&gt;
&lt;br /&gt;
=== HandObject ===&lt;br /&gt;
&lt;br /&gt;
Unused. Would have equipped the corresponding hand object on use.&lt;br /&gt;
&lt;br /&gt;
== Chest ==&lt;br /&gt;
&lt;br /&gt;
This is an unused feature, but it was kept in the engine and can be restored by making a custom entity. It is a object which can be opened using coins (or their replacements, if a custom Coin-type entity is made). Interacting with it brings up a text GUI. The text GUI can be changed in the base language file.&lt;br /&gt;
To make an entity of this type, just copy an existing entity file and change its entity type.&lt;br /&gt;
'''The chests that ended up in the game are actually just Levers.'''&lt;br /&gt;
&lt;br /&gt;
{{warning|In versions before 1.5, Chests did not write their CoinsNeeded instance var to save data, which caused the coin requirement of all Chests to default to 0 when loading a save.}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MoveMaxSpeed || Float || 13.5 || The maximum speed it can be moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSlowDownFactor || Float || 3.0 || Amount of slowdown applied to object when not moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSpeedFactor || Float || 1.0 || The higher value the more speed gain a mouse movement makes.&lt;br /&gt;
|-&lt;br /&gt;
| MoveThrowImpulse || Float || 6.0 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CoinsNeeded || Int || 200 || Coins required to open the chest.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== OilBarrel ==&lt;br /&gt;
&lt;br /&gt;
An OilBarrel entity simply adds some oil to the player's lantern upon interaction. The oil amount depends on the player's combined total oil stored in their lantern and as LampOil type items (the sum of the oil that the items would refill on use), determined when the player first looks at the OilBarrel. If the total oil is less than 100, the OilBarrel will contain exactly enough oil to bring it to 100. Otherwise (or if Hard Mode is enabled), it provides only 10 oil.&lt;br /&gt;
&lt;br /&gt;
If the FullGameSave instance var is not enabled, OilBarrels can be used again when leaving a level and returning to it.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| FillSound || File (.snt) || || Sound played when lantern is filled.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| EmptySound || File (.snt) || || Sound played when barrel is empty.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
== EmotionStone ==&lt;br /&gt;
&lt;br /&gt;
The memory capsule entities found in the game. Interacting with an EmotionStone causes an emotion flash effect to display, fading the screen to white and displaying a message.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| DescCat || String || || Category of text shown when in focus.&lt;br /&gt;
|-&lt;br /&gt;
| DescEntry || String || || Entry of text shown when in focus.&lt;br /&gt;
|-&lt;br /&gt;
| TextCat || String || || Category of text shown when interacted with.&amp;lt;br&amp;gt;Typically &amp;quot;EmotionStone&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry || String || || Entry of text shown when interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| Sound || File (.snt) || || Sound played when interacted with.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== NPC ==&lt;br /&gt;
&lt;br /&gt;
Non-Player Characters are non-enemy characters. Agrippa and Alexander as they appear in-game are NPCs. Their only purpose is to stand in place and look at the player (if you enable the option).&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MoveHeadBones || String || || List of bones that is rotated when the NPC rotates its head.&lt;br /&gt;
|-&lt;br /&gt;
| MoveHeadBoneMuls || String || || List of floats specifying how much each bone shall be rotated (-1 to 1).&lt;br /&gt;
|-&lt;br /&gt;
| HeadMoveSpeedMul || Float || 1 || Speed multiplier that that determines move speed based on distance to wanted angle.&lt;br /&gt;
|-&lt;br /&gt;
| HeadMoveMaxSpeed || Float || 1 || The max speed that the head moves in.&lt;br /&gt;
|-&lt;br /&gt;
| MaxHeadAngle || Float || 30 || The max angle that the head can turn when looking at the player.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| FollowPlayerArea || String || || When player is in this area, the NPC will look at him.&lt;br /&gt;
|-&lt;br /&gt;
| Awake || Bool || true || If the NPC is awake and looks at the player when in area.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== LevelDoor ==&lt;br /&gt;
&lt;br /&gt;
A LevelDoor transports the player to the specified level when interacted with. The locked sounds, text, and destination can be entered in the Level Editor itself.&lt;br /&gt;
&lt;br /&gt;
LevelDoors can also teleport the player (without a loading screen) if the same map is picked.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| EnterSound || File (.snt) || || Sound played when entering door.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| ExitSound || File (.snt) || || Sound played when entering new map after having interacted with door.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry || String || || The text shown when door is in focus. Category is always Levels&lt;br /&gt;
|-&lt;br /&gt;
| StartPos || String || || The start position of the next map that the player is transported to.&lt;br /&gt;
|-&lt;br /&gt;
| MapFile || File (.map) || || The file of the next map.&lt;br /&gt;
|-&lt;br /&gt;
| Locked || Bool || false || If the door is locked.&lt;br /&gt;
|-&lt;br /&gt;
| LockedSound || File (.snt) || || Sound heard if locked and interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| LockedTextCat || String || || Category of message shown if locked and interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| LockedTextEntry || String || || Entry of message shown if locked and interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| ShowStats || Bool || true || If stats of map it leads to should be shown (NOT IN USE)&amp;lt;br&amp;gt;Non-functional. Formerly used to display a completion percentage.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CritterBug ==&lt;br /&gt;
&lt;br /&gt;
Critters like rats, roaches, or fish on the ground (or in the case of fish, water). They move around the room they are placed in and run away from the player.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MeshOffsetRot || Vector3 || 0 0 0 || The mesh offset rotation.&lt;br /&gt;
|-&lt;br /&gt;
| MeshOffsetPos || Vector3 || 0 0 0 || The mesh offset position.&lt;br /&gt;
|-&lt;br /&gt;
| MaxSpeedNormal || Float || 0.5 || Max speed when in normal state&lt;br /&gt;
|-&lt;br /&gt;
| MaxSpeedAfraid || Float || 1.3 || Max speed when in the scared state&lt;br /&gt;
|-&lt;br /&gt;
| Gravity || Float || 9.8 || Amount of gravity applied.&lt;br /&gt;
|-&lt;br /&gt;
| HasRandomPauses || Bool || false || If the critter shall have random pauses&lt;br /&gt;
|-&lt;br /&gt;
| RandomPauseTimeMinMax || Vector2 || 1 3 || Random time length of pause&lt;br /&gt;
|-&lt;br /&gt;
| RandomMoveTimeMinMax || Vector2 || 2 6 || Random time length of movement (between pauses)&lt;br /&gt;
|-&lt;br /&gt;
| PlayerFleeDistance || Float || 3 || The distance from player which it begins to flee&lt;br /&gt;
|-&lt;br /&gt;
| FleeMul || Float || 2.1 || Factor for moving away from player (if fleeing)&lt;br /&gt;
|-&lt;br /&gt;
| BackToSpawnPointMul || Float || 0.1 || Factor for moving back to spawn point&lt;br /&gt;
|-&lt;br /&gt;
| WanderCircleRadius || Float || 4 || Picture a circle in front critter at a certain distance. A point inside the circle is randomly selected and then the vector from the critter to this point is the speed added. The larger the circle, the more random the walk.&lt;br /&gt;
|-&lt;br /&gt;
| WanderCircleDist || Float || 2 || The distance at which the wander circle is placed. The higher the distance, the more likely the critter is to move forward.&lt;br /&gt;
|-&lt;br /&gt;
| NormalSound || File (.snt) || || Sound made when in normal state&lt;br /&gt;
|-&lt;br /&gt;
| NormalSoundRandMinMax || Vector2 || 1 3 || Random time length between normal sounds. x=min, y=max&lt;br /&gt;
|-&lt;br /&gt;
| ScaredSound || File (.snt) || || Sound made when in afraid state&lt;br /&gt;
|-&lt;br /&gt;
| ScaredSoundRandMinMax || Vector2 || 1 3 || Random time length between afraid sounds. x=min, y=max&lt;br /&gt;
|-&lt;br /&gt;
| DeathEntity || File (.ent) || || Entity created when dead.&lt;br /&gt;
|-&lt;br /&gt;
| DeathPS || File (.ps) || || Particle created when dead.&lt;br /&gt;
|-&lt;br /&gt;
| DeathSound || File (.snt) || || Sound played when dead.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
== CritterSpider ==&lt;br /&gt;
&lt;br /&gt;
A unused critter similar to the spider enemies from [[wikipedia:Penumbra: Overture|Penumbra: Overture]]. Capable of climbing walls and ceilings, as well as attacking the player.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MaxIdleSpeed || Float || 0.5 ||&lt;br /&gt;
|-&lt;br /&gt;
| MaxHuntSpeed || Float || 0.75 ||&lt;br /&gt;
|-&lt;br /&gt;
| HitSound || File (.snt) || || Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| IdleSound || File (.snt) || || Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| IdleSoundRandMinMax || Vector2 || 1 3 ||&lt;br /&gt;
|-&lt;br /&gt;
| AttackSound || File (.snt) || || Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| AttackPlayerDistMinMax || Vector2 || 1 3 ||&lt;br /&gt;
|-&lt;br /&gt;
| HuntPlayerDist || Float || 8 ||&lt;br /&gt;
|-&lt;br /&gt;
| HuntTimeMinMax || Vector2 || 10 30 ||&lt;br /&gt;
|-&lt;br /&gt;
| MoveTimeMinMax || Vector2 || 4 8 ||&lt;br /&gt;
|-&lt;br /&gt;
| IdleTimeMinMax || Vector2 || 0.4 2 ||&lt;br /&gt;
|-&lt;br /&gt;
| DeathEntity || File (.ent) || || Entity created when dead.&lt;br /&gt;
|-&lt;br /&gt;
| DeathPS || File (.ps) || || Particle created when dead.&lt;br /&gt;
|-&lt;br /&gt;
| DeathSound || File (.snt) || || Sound played when dead.&lt;br /&gt;
|-&lt;br /&gt;
| AttackSizeRadius || Float || 0.3 ||&lt;br /&gt;
|-&lt;br /&gt;
| AttackOffset || Vector3 || 0 0 1 ||&lt;br /&gt;
|-&lt;br /&gt;
| AttackDamageMinMax || Vector2 || 5 15 ||&lt;br /&gt;
|-&lt;br /&gt;
| AttackForce || Vector2 || 5 1 ||&lt;br /&gt;
|-&lt;br /&gt;
| AttackStrength || Int || 1 ||&lt;br /&gt;
|-&lt;br /&gt;
| AttackHitSound || File (.snt) || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
== Enemy_Grunt ==&lt;br /&gt;
&lt;br /&gt;
An Enemy_Grunt entity is a standard enemy entity, used for the Grunt, Brute, and Suitor. Enemy entities require advanced setup, and should include animations added through Settings &amp;gt; Animations. Enemy properties can be modified in the entity type window, like certain sounds and music tracks playing, the enemy's awareness levels and damage, speed and other similar settings. An enemy does not use a collision box, but instead a skeleton and the aforementioned properties to determine how to collide/hit something.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Enemy}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| NoticeSound || File (.snt) || || Sound played when enemy notices that player is nearby&lt;br /&gt;
|-&lt;br /&gt;
| GiveUpNoticeSound || File (.snt) || || Sound played when enemy gives up investigation (after a notice)&lt;br /&gt;
|-&lt;br /&gt;
| EnabledSound || File (.snt) || || Sound played when enemy is enabled&lt;br /&gt;
|-&lt;br /&gt;
| GroggyDamageCount || Float || 15 || The accumulated amount of damage the enemy can take before getting groggy by the hit.&amp;lt;br&amp;gt;The enemy will flinch after taking this amount of damage.&lt;br /&gt;
|-&lt;br /&gt;
| AlertToHuntDistance || Float || 10 || If range is above this then enemy can go from alert to hunt&lt;br /&gt;
|-&lt;br /&gt;
| AlertToInstantHuntDistance || Float || 3.5 || If range is below this, enemy geos instantly to hunt.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMinTime || Float || 2.0 || Min time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMaxTime || Float || 4.5 || Max time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| IncreaseAlertSpeedDistance || Float || 6 || Distance at which the alert move speed increases.&lt;br /&gt;
|-&lt;br /&gt;
| IncreasedAlertSpeedMul || Float || 1.5 || The amount that move speed is multiplied by when alert.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsToHuntLimit || Float || 30 || The accumulated limit value when alert goes to hunt because of player running towards enemy.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsCheckDistance || Float || 5 || The distance where the move toward enemy check starts&lt;br /&gt;
|-&lt;br /&gt;
| IdleExtraTimeMin || Float || 2 || Min time between extra idle animations&lt;br /&gt;
|-&lt;br /&gt;
| IdleExtraTimeMax || Float || 6 || Max time between extra idle animations&lt;br /&gt;
|-&lt;br /&gt;
| IdleExtraNum || Int || 3 || Number of extra idle animations&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Enemy}}&lt;br /&gt;
&lt;br /&gt;
== Enemy_ManPig ==&lt;br /&gt;
{{clr}}&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
An enemy type ported from A Machine For Pigs. Compare to the [[HPL2/AMFP/NewEntities#Enemy_ManPig|AMFP version]] of the enemy.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Enemy}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Walk_ForwardSpeed || Float || 1.0 || Forward speed when walking on all fours, in meters per second.&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Walk_BackwardSpeed || Float || 1.0 || Backward speed when walking on all fours, in meters per second.&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Walk_ForwardAcc || Float || 2.0 || &lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Walk_ForwardDeacc || Float || 8.0 || &lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Run_ForwardSpeed || Float || 3.0 || Forward speed when running on all fours, in meters per second.&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Run_BackwardSpeed || Float || 2.0 || Backward speed when running on all fours, in meters per second.&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Run_ForwardAcc || Float || 4.0 || &lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Run_ForwardDeacc || Float || 8.0 || &lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_StoppedToWalkSpeed || Float || 0.05 || Speed at which the walk animation is played when on all fours&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_WalkToStoppedSpeed || Float || 0.02 || Speed at which walk goes to stopped when on all fours&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_WalkToRunSpeed || Float || 2.0 || Speed at which walk turns to run animation when on all fours&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_RunToWalkSpeed || Float || 0.9 || Speed at which run turns to walk when on all fours&lt;br /&gt;
|-&lt;br /&gt;
| NoticeSound || File (.snt) || || Sound played when enemy notices that player is nearby&lt;br /&gt;
|-&lt;br /&gt;
| GiveUpNoticeSound || File (.snt) || || Sound played when enemy gives up investigation (after a notice)&lt;br /&gt;
|-&lt;br /&gt;
| EnabledSound || File (.snt) || || Sound played when enemy is enabled&lt;br /&gt;
|-&lt;br /&gt;
| GroggyDamageCount || Float || 1 || The accumulated amount of damage the enemy can take before getting groggy by the hit.&amp;lt;br&amp;gt;The enemy will flinch after taking this amount of damage.&lt;br /&gt;
|-&lt;br /&gt;
| AlertToHuntDistance || Float || 6 || If range is above this then enemy can go from alert to hunt&lt;br /&gt;
|-&lt;br /&gt;
| AlertToInstantHuntDistance || Float || 2.5 || If range is below this, enemy geos instantly to hunt.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMinTime || Float || 0.5 || Min time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMaxTime || Float || 1.0 || Max time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| IncreaseAlertSpeedDistance || Float || 6 || Distance at which the alert move speed increases.&lt;br /&gt;
|-&lt;br /&gt;
| IncreasedAlertSpeedMul || Float || 1.25 || The amount that move speed is multiplied by when alert.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsToHuntLimit || Float || 30 || The accumulated limit value when alert goes to hunt because of player running towards enemy.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsCheckDistance || Float || 6 || The distance where the move toward enemy check starts&lt;br /&gt;
|-&lt;br /&gt;
| IsTelsa || Bool || false || If this is the tesla pig&lt;br /&gt;
|-&lt;br /&gt;
| TeslaSoundLoop || File (.snt) || || Sound file played when the tesla's proximity effects are active.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| ChaseSound || File (.snt) || || Played when the pig is chasing.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Enemy}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| Pose || String || Biped || The pose of the enemy to start with&amp;lt;br&amp;gt;Can be &amp;quot;Biped&amp;quot; or &amp;quot;Quadruped&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| ThreatenOnAlert || Bool || false || If the pig should stand still and threaten instead of walking towards player when in alert mode.&lt;br /&gt;
|-&lt;br /&gt;
| FleeFromPlayer || Bool || false || The pig will flee instead of hunting (threaten if ThreatenOnAlert). Disabled if far enough away. Will attack if cornered.&lt;br /&gt;
|-&lt;br /&gt;
| AutoDisableAfterFlee || Bool || false || If pig should be disabled after having fled (if possible)&lt;br /&gt;
|-&lt;br /&gt;
| LanternSensitivity || Float || 1 || A modifier for how quickly the pig reacts to being shined on by the lantern.&amp;lt;br&amp;gt;Not defined in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| IdleBehavior || String || None || The behavior used when there are no patrol nodes left to walk.&amp;lt;br&amp;gt;Can be &amp;quot;None&amp;quot;, &amp;quot;Stalk&amp;quot;, or &amp;quot;Track&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| PlayActivateSound || Bool || true || If the enemy can play its EnabledSound.&lt;br /&gt;
|-&lt;br /&gt;
| AllowZeroNodeWaitTimes || Bool || false || If set to true, path node wait times with value 0 actually mean no waiting&amp;lt;br&amp;gt;Normally, specifying a wait time of 0 in &amp;lt;code&amp;gt;AddEnemyPatrolNode&amp;lt;/code&amp;gt; results in a wait time of 1-3 seconds.&lt;br /&gt;
|-&lt;br /&gt;
| PatrolMoveSpeed || String || Walk || Whether this pig walks or runs along its patrol&amp;lt;br&amp;gt;Can be &amp;quot;Walk&amp;quot; or &amp;quot;Run&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| DamageMul || Float || 1 || Multiplier for the enemy's attack damage.&amp;lt;br&amp;gt;Not defined in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| RunSpeedMul || Float || 1 || Multiplier for the enemy's run speed.&amp;lt;br&amp;gt;Not defined in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseTimeMul || Float || 1 || Multiplier for wait time between attacks.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Enemy_Waterlurker ==&lt;br /&gt;
&lt;br /&gt;
Enemy type of the &amp;quot;water monster&amp;quot;. Since you can't assign animations to it, you might as well just use the normal waterlurker of the base game unless you want to change its properties (such as damage, movement speed, or music played).&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Enemy}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| PlayerDetectionHeight || Float || 0.6 || The y-distance from the enemy that the player is detected.&lt;br /&gt;
|-&lt;br /&gt;
| EatDamage || Float || 20 || The damage dealt to food being eaten&lt;br /&gt;
|-&lt;br /&gt;
| AfterAttackPauseTime || Float || 0 || The amount of timer lurker waits after an attack&lt;br /&gt;
|-&lt;br /&gt;
| SplashPS_Walk || File (.ps) || || Particle system created at surface when walking.&lt;br /&gt;
|-&lt;br /&gt;
| SplashPS_Run || File (.ps) || || Particle system created at surface when running.&lt;br /&gt;
|-&lt;br /&gt;
| SplashPS_Eat || File (.ps) || || Particle system created at surface when eating.&lt;br /&gt;
|-&lt;br /&gt;
| SplashPS_Attack || File (.ps) || || Particle system created at surface when attacking.&lt;br /&gt;
|-&lt;br /&gt;
| SplashSound_Walk || File (.snt) || || Sound played when walking.&lt;br /&gt;
|-&lt;br /&gt;
| SplashSound_Run || File (.snt) || || Sound played when running.&lt;br /&gt;
|-&lt;br /&gt;
| SplashSound_Eat || File (.snt) || || Sound played when eating.&lt;br /&gt;
|-&lt;br /&gt;
| SplashSound_Attack || File (.snt) || || Sound played when attacking.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Enemy}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| PlayerDetectionHeight || Float || 0 || If equal or below 0 the default in data file is used! The y-distance from the enemy that the player is detected.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== PlayerHands ==&lt;br /&gt;
&lt;br /&gt;
Player's hands. Unless you want to make a different looking hand for a full conversion mod, you don't have to worry about this.&lt;br /&gt;
&lt;br /&gt;
== HandObject ==&lt;br /&gt;
&lt;br /&gt;
The only available HandObject is the lantern. It is used in conjunction with a &amp;lt;code&amp;gt;.ho&amp;lt;/code&amp;gt; config file to place it properly in PlayerHands.&lt;br /&gt;
&lt;br /&gt;
Mostly a remnant of cut items that functioned as weapons, like in [[wikipedia:Penumbra: Overture|Penumbra: Overture]], including the pickaxe from that game.&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=7009</id>
		<title>HPL2/Engine Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=7009"/>
		<updated>2025-03-15T20:19:13Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Player */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TocRight}}&lt;br /&gt;
&lt;br /&gt;
This page documents all scripts available in Amnesia: The Dark Descent.&lt;br /&gt;
&lt;br /&gt;
{{note|'''Note''': Some of the functions require the Amnesia 1.3 or 1.5 update. Steam and other online store copies should be automatically updated. Other copies can get 1.3 [http://www.frictionalgames.com/forum/thread-24334.html here].}}&lt;br /&gt;
&lt;br /&gt;
== Directives ==&lt;br /&gt;
&lt;br /&gt;
First off, &amp;lt;code&amp;gt;#include &amp;quot;file.hps&amp;quot;&amp;lt;/code&amp;gt; can be used to programmatically merge together multiple separate files to make organizing scripts easier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
==Engine scripts==&lt;br /&gt;
===Main===&lt;br /&gt;
&lt;br /&gt;
The following functions are the main hps functions that the HPL2 engine looks to run on certain events - similar to the C++ int main() function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void OnStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the map is loaded for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnEnter();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs whenever the player enters a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnLeave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the player leaves a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnGameStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is found in the global.hps file and the inventory.hps file, and is run when the game is first started by the player (ie via &amp;quot;Start New Game&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnUpdate(float afStep);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
This function is executed for every game update or &amp;quot;tick&amp;quot;. Can be used for rapid-firing updates instead of looping timers. Keep in mind that this can affect game performance if not used with care.&lt;br /&gt;
&lt;br /&gt;
#''afStep''- Time elapsed in seconds since the last frame. Multiply speeds, distances etc. by this argument to avoid framerate dependence issues (for example: if you move something in this function with constant speed, it will move faster on computers which run the game with high FPS and slower on computers with low FPS).&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float RandFloat(float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random float.&lt;br /&gt;
&lt;br /&gt;
#''afMin ''- minimum value&lt;br /&gt;
#''afMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int RandInt(int alMin, int alMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random int. Note: the maximum value is ''inclusive''  - the RandInt() function may return this value.&lt;br /&gt;
&lt;br /&gt;
#''alMin ''- minimum value&lt;br /&gt;
#''alMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringContains(string &amp;amp;in asString, string &amp;amp;in asSubString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a string contains the specified string. &amp;lt;br /&amp;gt;Example: searching for &amp;quot;hello&amp;quot; in &amp;quot;hello world&amp;quot; would return '''true'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to check&lt;br /&gt;
#''asSubString ''- the string to search for&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; StringSub(string &amp;amp;in asString, int alStart, int alCount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the substring in a string. &amp;lt;br /&amp;gt;Example: in the string &amp;quot;frictional games rocks&amp;quot;, using 4 as ''alStart''  and 6 as ''alCount''  would return '''&amp;quot;tional&amp;quot;'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string&lt;br /&gt;
#''alStart ''- start position in the string&lt;br /&gt;
#''alCount ''- amount of characters&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int StringToInt(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns an integer converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float StringToFloat(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a float converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringToBool(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a boolean converted from a string, else returns false.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&lt;br /&gt;
===Mathematical Operations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathCos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathTan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAsin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAcos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan2(float afX, float afY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Calculates and returns the arc tangent of the specified values.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - First value to operate.&lt;br /&gt;
#''afY''  - Second value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSqrt(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the square root of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathPow(float afBase, float afExp);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the value of afBase raised to the power of afExp.&lt;br /&gt;
&lt;br /&gt;
#''afBase''  - The base value.&lt;br /&gt;
#''afExp''  - Value to calculate the base with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMin(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the lowest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMax(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the highest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathClamp(float afX, float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns afX clamped between afMin and afMax. If afX &amp;lt; afMin, returns afMin, and if afX &amp;gt; afMax, returns afMax.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - The value to clamp.&lt;br /&gt;
#''afMin''  - The minimum value to clamp afX with.&lt;br /&gt;
#''afMax''  - The maximum value to clamp afX with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAbs(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the absolute value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&lt;br /&gt;
===Debugging===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void Print(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a string to the log file (''hpl.log'').&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDebugMessage(string &amp;amp;in asString, bool abCheckForDuplicates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a line of text to the debug console at the bottom left of the screen. Debug mode must be enabled for the console messages to be visible.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to print&lt;br /&gt;
#''abCheckForDuplicates ''- if true, the string won't be printed more than once on screen until it disappears&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ProgLog(string &amp;amp;in asLevel, string &amp;amp;in asMessage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints an entry to the ProgLog (progression log). &amp;lt;br /&amp;gt;ProgLog is a file created in Documents/Amnesia/main (or an FC folder if one is being used). It logs certain events, such us opening the menu or picking up the lantern, as well as the player's state (Health, Sanity, Oil, Tinderboxes, Coins), for the purpose of documenting a tester's playstyle. &amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt;This function allows to log custom messages.The messages in the ProgLog file are sorted by time elapsed since a map was loaded.&lt;br /&gt;
&lt;br /&gt;
ProgLog has to be enabled for a player profile in ''user_settings.cfg''  before it starts working.&lt;br /&gt;
&lt;br /&gt;
#''asLevel ''- can be &amp;quot;Low&amp;quot;, &amp;quot;Medium&amp;quot; or &amp;quot;High&amp;quot;. It's a tag which appears in each log entry, for event prioritising.&lt;br /&gt;
#''asMessage ''- The custom message to be printed to the log.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool ScriptDebugOn();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the debug mode is enabled. &amp;lt;br /&amp;gt;See [[HPL2/Development_Environment|&amp;quot;Setting up Development Environment&amp;quot;]] to setup debug mode on your own computer.&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
{{warning|Regular variables (int, float, etc.) are '''not''' saved by the game. Using them in important parts of yor script will break it upon loading a game save. In HPL, those variables should only be used for disposable counters, like spawning objects in a &amp;quot;for&amp;quot; loop. For variables which need to be saved, use the wrappers as described below.}}&lt;br /&gt;
&lt;br /&gt;
====Local====&lt;br /&gt;
&lt;br /&gt;
Local variables can be used throughout the same script file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetLocalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetLocalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddLocalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetLocalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Global====&lt;br /&gt;
&lt;br /&gt;
Global variables can be used throughout several maps and can be accessed by several script files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetGlobalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetGlobalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddGlobalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetGlobalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Particle Systems===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadParticleSystem(string &amp;amp;in asPSFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asPSFile''  - The particle system file to load. Extension: .ps&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntity(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntityExt(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS,&lt;br /&gt;
float afR, float afG, float afB, float afA, bool abFadeAtDistance, float afFadeMinEnd, float afFadeMinStart,&lt;br /&gt;
float afFadeMaxStart, float afFadeMaxEnd);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity, extended method with more options.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''abFadeAtDistance ''- determines whether a particle system fades from a certain distance on&lt;br /&gt;
#''afFadeMinEnd ''- minimum distance at which the particle system stops fading&lt;br /&gt;
#''afFadeMinStart ''- minimum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxStart ''- maximum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxEnd ''- maximum distance at which the particle system stops fading&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DestroyParticleSystem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Destroys a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - The internal name of the particle system&lt;br /&gt;
&lt;br /&gt;
===Sounds &amp;amp; Music===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadSound(string &amp;amp;in asSoundFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile''  - The sound file to load (extension .snt optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayGuiSound(string &amp;amp;in asSoundFile, float afVolume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays a sound, not using 3D.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile ''- the sound to play (extension .snt/.ogg optional)&lt;br /&gt;
#''afVolume ''- the volume of the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaySoundAtEntity(string &amp;amp;in asSoundName, string &amp;amp;in asSoundFile, string &amp;amp;in asEntity, float afFadeTime, bool abSaveSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a sound at an entity.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''asSoundFile ''- the sound to use (extension .snt optional)&lt;br /&gt;
#''asEntity ''- the entity to create the sound at. Using &amp;quot;Player&amp;quot; is effectively the same as &amp;lt;code&amp;gt;PlayGuiSound&amp;lt;/code&amp;gt;, yet this function allows a looping sound to be saved&lt;br /&gt;
#''afFadeTime ''- time in seconds the sound needs to fade. Avoids enemies hearing the sound if afFadeTime is at least 0.1f&lt;br /&gt;
#''abSaveSound ''- if ''true'', a looping sound will &amp;quot;remember&amp;quot; its playback state (currently playing/stopped), and that state will be restored the next time the level is entered. If ''true'', the sound is never attached to the entity! Note that saving should only be used on ''looping sounds''!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeInSound(string &amp;amp;in asSoundName, float afFadeTime, bool abPlayStart);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades in a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds&lt;br /&gt;
#''abPlayStart ''- Play the sound defined in the &amp;lt;code&amp;gt;&amp;lt;Start&amp;gt;&amp;lt;/code&amp;gt; section of the .snt before playing the main sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopSound(string &amp;amp;in asSoundName, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades out a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds, use 0 to immediately stop the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayMusic(string &amp;amp;in asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays music.&lt;br /&gt;
&lt;br /&gt;
#''asMusicFile ''- the music file to play (extension .ogg optional)&lt;br /&gt;
#''abLoop ''- determines whether a music track should loop&lt;br /&gt;
#''afVolume ''- volume of the music&lt;br /&gt;
#''afFadeTime ''- time in seconds until music reaches full volume&lt;br /&gt;
#''alPrio ''- priority of the music. Note that only the music with the highest priority can be heard! 0 - lowest, 1 - higher, etc.&lt;br /&gt;
#''abResume''  - if ''true'', playback will be continued from where the track stopped after the call to &amp;lt;code&amp;gt;StopMusic()&amp;lt;/code&amp;gt;. If ''false'', the track will be restarted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopMusic(float afFadeTime, int alPrio);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops music.&lt;br /&gt;
&lt;br /&gt;
#''afFadeTime ''- time in seconds until music stops&lt;br /&gt;
#''alPrio ''- the priority of the music that should stop&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice(string &amp;amp;in asVoiceFile, string &amp;amp;in asEffectFile, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry,&lt;br /&gt;
bool abUsePosition, string &amp;amp;in asPosEntity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This adds a voice and an additional sound effect to be played. It is okay to call this many times in order to play many voices in a row. The EffectVoiceOverCallback is not called until ALL voices have finished.&lt;br /&gt;
&lt;br /&gt;
#''asVoiceFile ''- the voice to play&lt;br /&gt;
#''asEffectFile ''- the sound effect to play&lt;br /&gt;
#''asTextCat ''- the category in the .lang file, usually &amp;quot;Voice&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''abUsePosition ''- plays using 3D from the entity, or without 3D&lt;br /&gt;
#''asPosEntity ''- the entity at which the voice and sound are played from&lt;br /&gt;
#''afMinDistance ''- minimum distance the voice and sound are heard&lt;br /&gt;
#''afMaxDistance ''- maximum distance the voice and sound are heard&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopAllEffectVoices(float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all voices and calls the EffectVoiceOverCallback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEffectVoiceActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether EffectVoices are still active.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetEffectVoiceOverCallback(string &amp;amp;in asFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to be called when the EffectVoices are finished. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundVolume(float afDestVolume, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound volume, that means everything you can hear '''from the world'''. This does not affect music of GUI sounds.&lt;br /&gt;
&lt;br /&gt;
#''afDestVolume ''- desired volume&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired volume&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundSpeed(float afDestSpeed, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound speed.&lt;br /&gt;
&lt;br /&gt;
#''afDestSpeed ''- desired speed&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired speed&lt;br /&gt;
&lt;br /&gt;
===Lights===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightVisible(string &amp;amp;in asLightName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables lights.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''abVisible ''- determines the state of the light&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeLightTo(string &amp;amp;in asLightName, float afR, float afG, float afB, float afA, float afRadius, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the properties of a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''afRadius ''- radius of the light. -1 means keeping the radius&lt;br /&gt;
#''afTime ''- time in seconds until change is done&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightFlickerActive(string &amp;amp;in asLightName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates flickering on a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName'' - The internal light name&lt;br /&gt;
#''abActive'' - true = active, false = inactive&lt;br /&gt;
&lt;br /&gt;
==Game scripts==&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartCredits(string &amp;amp;in asMusic, bool abLoopMusic, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alEndNum);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts the end credits screen.&lt;br /&gt;
&lt;br /&gt;
#''asMusic ''- the music to play (including .ogg)&lt;br /&gt;
#''abLoopMusic ''- determines whether the music should loop&lt;br /&gt;
#''asTextCat ''- the category to be used in the .lang file, usually &amp;quot;Ending&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alEndNum ''- Amnesia has 3 different endings and displays a code at the bottom. Determines which code is displayed. 0-2 will display codes, any other integer will not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartDemoEnd();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shows the demo end screen. The background and UI elements are defined in demo.cfg, with the text using the entries in the &amp;quot;Demo&amp;quot; category of the .lang file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AutoSave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an auto save file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CheckPoint(string &amp;amp;in asName, string &amp;amp;in asStartPos, string &amp;amp;in asCallback, string &amp;amp;in asDeathHintCat, string &amp;amp;in asDeathHintEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a checkpoint at which the player will respawn in case he dies. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asName, int alCount)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;Count is 0 on the first checkpoint load!&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the editor&lt;br /&gt;
#''asCallback ''- the function to call when the player dies/respawns&lt;br /&gt;
#''asDeathHintCat ''- the category of the death hint message to be used in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asDeathHintEntry ''- the entry in the .lang file&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeMap(string &amp;amp;in asMapName, string &amp;amp;in asStartPos, string &amp;amp;in asStartSound, string &amp;amp;in asEndSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Loads another map after a 1.5 second fade out.&lt;br /&gt;
&lt;br /&gt;
#''asMapName ''- the file to load&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the next map&lt;br /&gt;
#''asStartSound ''- the sound that is played when the change starts&lt;br /&gt;
#''asEndSound ''- the sound that is played when the new map is loaded&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ClearSavedMaps();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the &amp;quot;history&amp;quot; of the save, useful to do when you know the player will not be able to go back anymore. Makes the next save much smaller in size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateDataCache();&lt;br /&gt;
void DestroyDataCache();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This caches all current textures and models and they are not released until destroy is called. If there is already cached data it is destroyed.&lt;br /&gt;
Create caches to enable faster loading when going back to a map. Destroy the cache if you know the player won't go back to that map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMapDisplayNameEntry(string &amp;amp;in asNameEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the map name shown in save file names. If none is set NULL is assumed.&lt;br /&gt;
&lt;br /&gt;
#''asNameEntry ''- the entry to display, category must be &amp;quot;Levels&amp;quot;!&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the skybox.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxTexture(string &amp;amp;in asTexture);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the texture of the skybox.&lt;br /&gt;
&lt;br /&gt;
#''asTexture''  - The texture file to set. Extension: .dds&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the solid color of the skybox rather than a texture.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the global fog.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the color to use for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogProperties(float afStart, float afEnd, float afFalloffExp, bool abCulling);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the properties for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afStart ''- how many meters from the camera should the fog begin&lt;br /&gt;
#''afEnd ''- how many meters from the camera should the fog reach full thickness&lt;br /&gt;
#''afFalloffExp ''- the amount by which the thinkness increases&lt;br /&gt;
#''abCulling ''- whether occlusion culling is active for the fog; this prevents objects behind the fog from being loaded&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetupLoadScreen(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alRandomNum, string &amp;amp;in asImageFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which loading screen will be shown when changing maps.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category of the loading text in the .lang file to be shown on the loading screen, usually &amp;quot;LoadingText&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alRandomNum ''- if greater 1, then it will randomize between 1 and alRandom for each LoadScreen giving entry the suffix XX (eg 01). If &amp;lt; =1 then no suffix is added&lt;br /&gt;
#''asImageFile ''- the image to be shown (optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void UnlockAchievement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlocks the specified achievement. Only able to be used for the ending achievements.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the achievement. Only the following strings are valid:&lt;br /&gt;
::* Benefactor&lt;br /&gt;
::* Survivor&lt;br /&gt;
::* Sacrifice&lt;br /&gt;
::* Quitter&lt;br /&gt;
::* Egotist&lt;br /&gt;
::* Altruist&lt;br /&gt;
::* Vacillator&lt;br /&gt;
&lt;br /&gt;
===Game Timer===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddTimer(string &amp;amp;in asName, float afTime, string &amp;amp;in asFunction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a timer which calls a function when it expires. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asTimer)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the name of the timer&lt;br /&gt;
#''afTime ''- time in seconds&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveTimer(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a timer, no matter how much time is left.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the timer.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetTimerTimeLeft(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the time left on a timer.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - the internal name of the timer.&lt;br /&gt;
&lt;br /&gt;
===Screen Effects===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeOut(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to black.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen is completly black&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeIn(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen back to normal.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeImageTrailTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies the image trail effect to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeSepiaColorTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the screen go dark red.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0) &lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeRadialBlurTo(float afSize, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies radial blur effects to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afSize ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetRadialBlurStartDist(float afStartDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines at which distance the radial blur effects appear.&lt;br /&gt;
&lt;br /&gt;
#''afStartDist ''- the distance at which the effect starts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectFlash(float afFadeIn, float afWhite, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white.&lt;br /&gt;
&lt;br /&gt;
#''afFadeIn ''- time in seconds until screen is white&lt;br /&gt;
#''afWhite ''- determines to which percentage the screen fades to white (1.0 = completly white)&lt;br /&gt;
#''afFadeOut ''- time in seconds until screen is back to normal again&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectEmotionFlash(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white and shows a text message.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''asSound ''- the sound to play while fading&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetFlashbackIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a flashback is still in effect.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerSpawnPS(string &amp;amp;in asSPSFile);&lt;br /&gt;
void StopPlayerSpawnPS();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Continuously spawn regular particle systems (''.ps'') around the player. Particles created by this script carry over from map to map.&lt;br /&gt;
&lt;br /&gt;
#''asSPSFile''  - the ''.sps''  file to use. Example ''.sps''  files are located in the ''/misc''  folder in the main game directory.&amp;lt;br&amp;gt;Custom ''.sps''  files can be created by hand in a text editor (see existing ones and mimic how those are written). &amp;lt;br /&amp;gt;Since ''StopPlayerSpawnPS()''  doesn't seem to work, to stop an SPS you must create an ''.sps''  file with an empty particle field field and override the old SPS by calling ''StartPlayerSpawnPS''  again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shakes the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity of the shake&lt;br /&gt;
#''afTime ''- duration of the shake&lt;br /&gt;
#''afFadeInTime ''- time in seconds until full intensity is reached&lt;br /&gt;
#''afFadeOutTime ''- time until screen is back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInDarknessEffectsActive(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the sanity drain and night vision effects while in the darkness.&lt;br /&gt;
&lt;br /&gt;
''bool abX''  - Enable/disable effects.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowScreenImage(string &amp;amp;in asImageName, float afX, float afY, float afScale, bool abUseRelativeCoordinates, float afDuration, float afFadeIn, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
Displays an image file directly onto the screen. See [[HPL2/Tutorials/ShowScreenImage()|ShowScreenImage()]] in the tutorials section for more information.&lt;br /&gt;
&lt;br /&gt;
# ''asImageName'' - The image file to render (.jpg, .png, .tga, .dds)&lt;br /&gt;
# ''afX'' - The X position of the image&lt;br /&gt;
# ''afY'' - The Y position of the image&lt;br /&gt;
# ''afScale'' - The size of the image in pixels (not scale), or original image size if negative&lt;br /&gt;
# ''abUseRelativeCoordinates'' - Whether X and Y are relative to the screen resoltion, or pixel co-ordinates if not&lt;br /&gt;
# ''afDuration'' - The duration that the image is displayed for&lt;br /&gt;
# ''afFadeIn'' - The time, in seconds, to fade in the image&lt;br /&gt;
# ''afFadeOut'' - The time, in seconds, to fade out the image&lt;br /&gt;
&lt;br /&gt;
===Insanity===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInsanitySetEnabled(string &amp;amp;in asSet, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which InsanitySets are enabled.&lt;br /&gt;
&lt;br /&gt;
#''asSet ''- the set&lt;br /&gt;
#''abX ''- enabled or not&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartInsanityEvent(string &amp;amp;in asEventName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Starts a specified insanity event.&lt;br /&gt;
&lt;br /&gt;
#''asEventName ''- Insanity event to play.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartRandomInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts a random insanity event from the available sets.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopCurrentInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Stops the currently playing insanity event.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void InsanityEventIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an insanity event is currently in effect.&amp;lt;br&amp;gt;Not useful at all due to having a return type of &amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; when it should be &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Player===&lt;br /&gt;
&lt;br /&gt;
Note that the player's maximum health and sanity is 100.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enabled/Disable player controlled movement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangePlayerStateToNormal();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets the player's state, forcing them to stop interacting with objects. It also clears the inventory item to be used (as if it was double-clicked on in the inventory again) and dismounts the player from ladders.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerCrouching(bool abCrouch);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddPlayerBodyForce(float afX, float afY, float afZ, bool abUseLocalCoords);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pushes the player into a certain direction. Note that you need values above ~2000 to see any effects.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- amount along the X-axis&lt;br /&gt;
#''afY ''- amount along the Y-axis&lt;br /&gt;
#''afZ ''- amount along the Z-axis&lt;br /&gt;
#''abUseLocalCoords ''- If true, axes are based on where the player is facing, not the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowPlayerCrossHairIcons(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the icons when a player has something in focus.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerSanity(float afSanity);&lt;br /&gt;
void AddPlayerSanity(float afSanity);&lt;br /&gt;
float GetPlayerSanity();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerHealth(float afHealth);&lt;br /&gt;
void AddPlayerHealth(float afHealth);&lt;br /&gt;
float GetPlayerHealth();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerLampOil(float afOil);&lt;br /&gt;
void AddPlayerLampOil(float afOil);&lt;br /&gt;
float GetPlayerLampOil();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the lamp oil of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerSpeed();&lt;br /&gt;
float GetPlayerYSpeed();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current speed of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSanityDrainDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables sanity drain from darkness.&lt;br /&gt;
{{bug|Sanity drain is reenabled on loading a save, as the game is unable to load the value properly from the save data.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoost();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a large amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! New Sanity&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || 100&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || 90&lt;br /&gt;
|-&lt;br /&gt;
| 50-74 || 80&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoostSmall();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a small amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! Sanity Bonus&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || +20&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || +15&lt;br /&gt;
|-&lt;br /&gt;
| 50-75 || +10&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityDamage(float afAmount, bool abUseEffect);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- amount of sanity damage done&lt;br /&gt;
#''abUseEffect ''- determines whether an effect is played when the sanity damage is dealt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GivePlayerDamage(float afAmount, string &amp;amp;in asType, bool abSpinHead, bool abLethal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the health of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- amount of damage done to health&lt;br /&gt;
#''asType ''- plays a certain effect on the screen when the damage is dealt (BloodSplat, Claws, or Slash) &lt;br /&gt;
#''abSpinHead ''- changes the camera view when damage is dealt&lt;br /&gt;
#''abLethal ''- set to true if player can die from given damage. If ''false'' and the damage would have left the player with less than 10 health, health is set to 10.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerFOVMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the field of view of the player. A shorter FOV will create a zoom effect.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- multiplier of default FOV (1 is default)&lt;br /&gt;
#''afSpeed ''- the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerAspectMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the aspect ratio of the player. Basically stretches or narrows the screen horizontally.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- multiplier of default aspect (default is 1)&lt;br /&gt;
#''afSpeed ''- the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- angle of rotation of head, positive being counter-clockwise&lt;br /&gt;
#''afSpeedMul ''- speed (possibly acceleration) multiplier of the rotation (default 1, which is really slow)&lt;br /&gt;
#''afMaxSpeed ''- maximum speed of rotation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerForward(float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Moves the player forward. It needs to be called in a timer that updates 60 times / second.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- amount along the X-axis&lt;br /&gt;
#''afY ''- amount along the Y-axis&lt;br /&gt;
#''afZ ''- amount along the Z-axis&lt;br /&gt;
#''afSpeed ''- speed at which the change happens&lt;br /&gt;
#''afSlowDownDist ''- distance at which to start slowing down (prevents the head from abruptly stopping)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerLookAt(string &amp;amp;in asEntityName, float afSpeedMul, float afMaxSpeed, string &amp;amp;in asAtTargetCallback);&lt;br /&gt;
void StopPlayerLookAt();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to look at a certain entity until StopPlayerLookAt is used.&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- the entity to look at &lt;br /&gt;
#''afSpeedMul ''- how fast should the player look at the entity&lt;br /&gt;
#''afMaxSpeed ''- maximum speed allowed&lt;br /&gt;
#''asAtTargetCallback ''- function to call when player looks at target&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerMoveSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerRunSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerLookSpeedMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the player's move/run/look speed. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpForceMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the player's jump multiplier. Higher values = higher jumps. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpDisabled(bool abX);&lt;br /&gt;
void SetPlayerCrouchDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to jump/crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportPlayer(string &amp;amp;in asStartPosName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly teleports the player to the target StartPos.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternActive(bool abX, bool abUseEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the player use his lantern.&lt;br /&gt;
&lt;br /&gt;
# ''abX'' - Set lantern to be active (true) or inactive (false)&lt;br /&gt;
# ''abUseEffects'' - Play on/off sounds&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetLanternActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player currently uses his lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to use his lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternLitCallback(string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to call when the player uses his lantern. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;MyFunc(bool abLit)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message on the screen.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTime ''- determines how long the message is displayed. If time is &amp;lt; =0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetDeathHint(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the message that appears when the player dies.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DisableDeathStartSound();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the death sound when the player dies. This must be called directly before player is killed! The variable as soon as player dies too.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPermaDeathSound(string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Sets the sound played after the player dies when permadeath is active. Permadeath is only active when the game is launched with the &amp;lt;code&amp;gt;ptest&amp;lt;/code&amp;gt; command line parameter. Only used for the post-death Suitor lines in ''Justine''.&lt;br /&gt;
&lt;br /&gt;
#''asSound'' - The sound to be played after death. Expects a voice-type sound.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerFallDamageDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the player's ability to take fall damage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPos(float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the player's position within the level.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - X co-ordinate position.&lt;br /&gt;
#''afY''  - Y co-ordinate position.&lt;br /&gt;
#''afZ''  - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerPosX();&lt;br /&gt;
float GetPlayerPosY();&lt;br /&gt;
float GetPlayerPosZ();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the player's position within the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
===Journal===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddNote(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a note to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _Name and _Text and be in category &amp;quot;Journal&amp;quot;!&lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDiary(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a diary to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _NameX and _TextY whereas X and Y are numbers of the parts (_Name1: first diary, _Text1: first page) and be in category &amp;quot;Journal&amp;quot;! &lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ReturnOpenJournal(bool abOpenJournal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Only called in the pickup diary callback! If true the journal displays the entry else not.&lt;br /&gt;
&lt;br /&gt;
===Quests===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a quest to the player's journal under mementos. Completed quests cannot be readded.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name to be used&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot;Quest_&amp;lt;texthere&amp;gt;_Text”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CompleteQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Completes a quest. If the quest has not been added, it's marked as complete anyway, preventing it from being added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot; Quest_&amp;lt;texthere&amp;gt;_Text ”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool QuestIsCompleted(string &amp;amp;in asName);&lt;br /&gt;
bool QuestIsAdded(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a quest is completed/added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetNumberOfQuestsInMap(int alNumberOfQuests);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the number of quests in the map. Obsolete; formerly used to calculate a completion percentage when looking at a level door.&lt;br /&gt;
&lt;br /&gt;
#''alNumberOfQuests ''- Amount of quests&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveHint(string &amp;amp;in asName, string &amp;amp;in asMessageCat, string &amp;amp;in asMessageEntry, float afTimeShown);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a hint on the player's screen.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asMessageCat ''- the category in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asMessageEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTimeShown ''- time in seconds until the message disappears. If time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void BlockHint(string &amp;amp;in asName);&lt;br /&gt;
void UnBlockHint(string &amp;amp;in asName);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Blocking a hint prevents it from being shown. Blocked hints are included in savefiles, so they should persist between levels. Unblocking a hint allows it to be shown.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; blocks the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveHint(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes the hint from the list of already shown hints, allowing it to appear again.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; reenables the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
===Inventory===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ExitInventory();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Exits the inventory by force.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the player's ability to open his inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a message on the inventory screen. Used for feedback messages when failing to combine items.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory ''- the category in the .lang file, usually &amp;quot;Inventory&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTime ''- time in seconds until the message disappears. If life time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItem(string &amp;amp;in asName, string &amp;amp;in asType, string &amp;amp;in asSubTypeName, string &amp;amp;in asImageName, float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds an item to the inventory of the player. Note that the item does not have to exist as entity in the world to be able to do this.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asType ''- item type to give, Available types are:&lt;br /&gt;
::*Puzzle&lt;br /&gt;
::*Lantern&lt;br /&gt;
::*Health&lt;br /&gt;
::*Sanity&lt;br /&gt;
::*LampOil&lt;br /&gt;
::*Tinderbox&lt;br /&gt;
#''asSubTypeName ''- item name for .lang file&lt;br /&gt;
#''asImageName ''- the image which will appear in inventory. For example: &amp;lt;code&amp;gt;void GiveItem(&amp;quot;chemical_container_full_1&amp;quot;, &amp;quot;Puzzle&amp;quot;, &amp;quot;chemical_container_full&amp;quot;, &amp;quot;chemical_container_full.tga&amp;quot;, 1);&amp;lt;/code&amp;gt; will use the image from &amp;lt;code&amp;gt;graphics/item/chemical_container_full.tga&amp;lt;/code&amp;gt; &lt;br /&gt;
#''afAmount ''- amount the item gives, - For example: Oil potions will fill the oil meter by this amount, Health potions will heal by this amount, etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item from the player's inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool HasItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player has an item in his inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItemFromFile(string &amp;amp;in asName, string &amp;amp;in asFileName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a single item to the player's inventory. This is meant to be used for debug mostly as it creates the actual item and then destroys it.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asFileName ''- item to give + extension (.ent)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddCombineCallback(string &amp;amp;in asName, string &amp;amp;in asItemA, string &amp;amp;in asItemB, string &amp;amp;in asFunction, bool abAutoRemove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to combine items in his inventory. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItemA, string &amp;amp;in asItemB)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name for the callback&lt;br /&gt;
#''asItemA ''- internal name of first item&lt;br /&gt;
#''asItemB ''- internal name of second item&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
#''abAutoRemove ''- determines whether the callback should be removed when the items are combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveCombineCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a combine callback.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the callback to be removed (as specified in AddCombineCallback)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddUseItemCallback(string &amp;amp;in asName, string &amp;amp;in asItem, string &amp;amp;in asEntity, string &amp;amp;in asFunction, bool abAutoDestroy);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to use items on the world. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItem, string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
#''asItem ''- internal name of the item&lt;br /&gt;
#''asEntity ''- entity to be able to use the item on&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abAutoDestroy ''- determines whether the callback should be removed when the item is used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveUseItemCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item callback.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
&lt;br /&gt;
===Entities===&lt;br /&gt;
&lt;br /&gt;
====General====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityActive(string &amp;amp;in asName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityVisible(string &amp;amp;in asName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity's visual mesh. The collision body remains.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the entity.&lt;br /&gt;
#''abActive''  - Activate/deactivate mesh.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntityExists(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an entity exists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCustomFocusCrossHair(string &amp;amp;in asName, string&amp;amp; asCrossHair);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the crosshair that is used when focusing an entity.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCrossHair ''- desired crosshair, can be: &lt;br /&gt;
::*Default (no crosshair)&lt;br /&gt;
::*Grab&lt;br /&gt;
::*Push&lt;br /&gt;
::*Ignite&lt;br /&gt;
::*Pick&lt;br /&gt;
::*LevelDoor&lt;br /&gt;
::*Ladder&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void CreateEntityAtArea(string &amp;amp;in asEntityName, string &amp;amp;in asEntityFile, string &amp;amp;in asAreaName, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an entity at an area. When creating an enemy though, it cannot chase properly along PathNodes (using for example &amp;lt;code&amp;gt;ShowEnemyPlayerPosition&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- internal name&lt;br /&gt;
#''asEntityFile ''- entity to be used extension .ent&lt;br /&gt;
#''asAreaName ''- the area to create the entity at&lt;br /&gt;
#''abFullGameSave ''- determines whether an entity &amp;quot;remembers&amp;quot; its state&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ReplaceEntity(string &amp;amp;in asName, string &amp;amp;in asBodyName, string &amp;amp;in asNewEntityName, string &amp;amp;in asNewEntityFile, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Removes an entity and places a new one in its place.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to replace.&lt;br /&gt;
#''asBodyName'' - Name of the body of the entity to place the new entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''asNewEntityName'' - Name of the new entity.&lt;br /&gt;
#''asNewEntityFile'' - Name of the new entity file. Extension .ent. &lt;br /&gt;
#''abFullGameSave'' - Whether ALL properties of this entity should be saved throughout levels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaceEntityAtEntity(string &amp;amp;in asName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBodyName, bool abUseRotation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Places an entity at the position of another entity. Does not work for enemies, use TeleportEnemyToEntity instead.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to place.&lt;br /&gt;
#''asTargetEntity'' - Name of the other entity to place the first entity at.&lt;br /&gt;
#''asTargetBodyName'' - Name of the body of the entity to place the first entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''abUseRotation'' - Whether the entity should be rotated like the target entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPos(string &amp;amp;in asName, float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Moves an entity to a position in the level.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to move.&lt;br /&gt;
#''afX'' - X co-ordinate position.&lt;br /&gt;
#''afY'' - Y co-ordinate position.&lt;br /&gt;
#''afZ'' - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetEntityPosX(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosY(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosZ(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns an entity's position in the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerLookAtCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveWhenLookedAt);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player looks at a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = looking, -1 = not looking&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveWhenLookedAt ''- determines whether the callback should be removed when the player looked at the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerInteractCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveOnInteraction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player interacts with a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveOnInteraction ''- determines whether the callback should be removed when the player interacts with the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCallbackFunc(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when certain events occur with an entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, string &amp;amp;in asType)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;asType&amp;lt;/code&amp;gt; values depend on entity type:&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! asType Value&lt;br /&gt;
|-&lt;br /&gt;
| Object || Break&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || OnIgnite&lt;br /&gt;
|-&lt;br /&gt;
| Item || OnPickup&lt;br /&gt;
|-&lt;br /&gt;
| Enemy || OnDeath&lt;br /&gt;
|-&lt;br /&gt;
| Enemy_Grunt&amp;lt;br&amp;gt;Enemy_Manpig || OnAutoDisabled&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityConnectionStateChangeCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A callback called when ever the connection state changes (button being switched on, lever switched, etc). &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void Func(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: -1 = off, 0 = between, 1 = on&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityInteractionDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disallows interaction with an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void BreakJoint (string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Breaks a joint. Do not use this on joints in SwingDoors, Levers, Wheels, etc. where the joint is part of an interaction. That will make the game crash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void AddEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName, string &amp;amp;in asFunction, bool abDeleteOnCollide, int alStates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when two entities collide. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asParent, string &amp;amp;in asChild, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = enter, -1 = leave&lt;br /&gt;
&lt;br /&gt;
#''asParentName ''- internal name of main object&lt;br /&gt;
#''asChildName ''- internal name of object that collides with main object (asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) NOT supported!)&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abDeleteOnCollide ''- determines whether the callback after it was called&lt;br /&gt;
#''alStates ''- 1 = only enter, -1 = only leave, 0 = both&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an EntityCollideCallback. Asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) not supported in ''asChildName''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntitiesCollide(string &amp;amp;in asEntityA, string &amp;amp;in asEntityB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether two entities collide. This function does NOT support asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) or &amp;quot;Player&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetBodyMass(string &amp;amp;in asName, float afMass);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName.&lt;br /&gt;
#''afMass''  - The mass to set.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetBodyMass(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName. &lt;br /&gt;
#''afMass''  - The mass to get.&lt;br /&gt;
&lt;br /&gt;
====Props====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropEffectActive(string &amp;amp;in asName, bool abActive, bool abFadeAndPlaySounds);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Can be used on coal to give it the black color it should have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropActiveAndFade(string &amp;amp;in asName, bool abActive, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates a prop.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''abActive ''- nothing to add&lt;br /&gt;
#''afFadeTime ''- time in seconds until prop fully fades&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropStaticPhysics(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates the physics of a prop, setting the mass to 0. Setting as true will make entities static in midair.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetPropIsInteractedWith(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a prop is interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RotatePropToSpeed(string &amp;amp;in asName, float afAcc, float afGoalSpeed, float afAxisX, float afAxisY, float afAxisZ, bool abResetSpeed, string &amp;amp;in asOffsetArea);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the prop up to a set speed.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afGoalSpeed ''- desired speed &lt;br /&gt;
#''afAxisX ''- rotation around X axis&lt;br /&gt;
#''afAxisY ''- rotation around Y axis&lt;br /&gt;
#''afAxisZ ''- rotation around Z axis&lt;br /&gt;
#''abResetSpeed ''- determines whether the speed is resetted after goal speed is reached&lt;br /&gt;
#''asOffsetArea ''- the area to rotate around, if empty, then the center of the body is used Note: The entity you want to rotate MUST be a &amp;quot;StaticObject&amp;quot; entity!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void StopPropMovement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all movement of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddAttachedPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop.&lt;br /&gt;
&lt;br /&gt;
#''asPropName''- the prop to attach another prop at &lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop&lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
{{bug|''afRotZ '' is used for both the ZX rotation and the Z position of the attached prop. Unwanted rotation can be avoided by using: &amp;lt;br /&amp;gt;''AddAttachedPropToProp(asPropName, asAttachName, asAttachFile, afPosX, afPosY, '''0''', afPosZ, '''90.0f''', afPosZ)''}}&lt;br /&gt;
&lt;br /&gt;
{{bug|Attaching a breakable prop to a physically active prop, and then breaking the attached prop, will cause the game to crash, should the parent object be moved or reset.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop. Fixed version of &amp;lt;code&amp;gt;AddAttachedPropToProp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
#''asPropName ''- the prop to attach another prop at&lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop &lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveAttachedPropFromProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches a prop from a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
void AddPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
float GetPropHealth(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ResetProp(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets a prop's state to the original one when the map was loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void PlayPropAnimation(string &amp;amp;in asProp, string &amp;amp;in asAnimation, float afFadeTime, bool abLoop, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the prop play an animation and calls a function. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asProp)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asProp ''- internal name of the prop&lt;br /&gt;
#''asAnimation ''- animation to play&lt;br /&gt;
#''afFadeTime ''- Fade time between current and new animations&lt;br /&gt;
#''abLoop ''- determines whether the animation loops &lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddPropForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddPropImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These functions push objects. Note that rather high values are needed when applying ''forces''  (on the order of ~100 (weak) to ~10000 (strong)), but not impulses (values less than 10 can be appropriate). Forces are external influences, and will have different effect depending on the mass of the object they are being applied to; impulses disregard mass, and can cause objects to break, as if hit. A &amp;quot;Body&amp;quot; is a physics-related helper object, to which a force or an impulse can be applied. Entities can consist of several bodies, interconnected in various ways (you can create/examine bodies in the model editor).&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the object to push; for bodies, use this format: &amp;quot;''entityName''_''bodyName''&amp;quot;&lt;br /&gt;
#''afX ''- magnitude along the X-axis&lt;br /&gt;
#''afY ''- magnitude along the Y-axis&lt;br /&gt;
#''afZ ''- magnitude along the Z-axis&lt;br /&gt;
#''asCoordSystem ''- determines which coordinate system is used, &amp;quot;local&amp;quot; or &amp;quot;world&amp;quot;&lt;br /&gt;
&lt;br /&gt;
All of these functions are ''additive''  - when called consecutively, for each call, the vectors defined by (afX, afY, afZ) will be added together, and a resultant force/impulse will be calculated ''before''  any physics simulation is applied to the target object.&lt;br /&gt;
&lt;br /&gt;
====Connections====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithRope(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asRopeName, bool abInteractOnly, float afSpeedMul, float afToMinSpeed, float afToMaxSpeed, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects a prop with the movement of a rope (i.e. turn a wheel to move a rope). For Levers, the rope only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName''- The name of the connection&lt;br /&gt;
#''asPropName'' - The name of the prop; can be a Lever or Wheel&lt;br /&gt;
#''asRopeName'' - The name of the rope&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''afSpeedMul'' - Speed multiplier of how quickly the rope moves&lt;br /&gt;
#''afToMinSpeed'' - The slowest the rope can move&lt;br /&gt;
#''afToMaxSpeed'' - The fastest the rope can move&lt;br /&gt;
#''abInvert'' - Whether to invert the direction the rope moves&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithMoveObject(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asMoveObjectName, bool abInteractOnly, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This one should only be used if there must be an exact correspondence to prop &amp;quot;amount&amp;quot; and the MoveObject open amount. It is best used for Wheel-door connections, where the MoveObject moves continuously along with the Wheel. For Levers, the MoveObject only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asPropName'' - The entity that controls the movement; can be a Lever or Wheel&lt;br /&gt;
#''asMoveObject'' - The MoveObject to move&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''abInvert'' - If the state is inverted, making the MoveObject move in the opposite direction&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ConnectEntities(string &amp;amp;in asName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, bool abInvertStateSent, int alStatesUsed, string &amp;amp;in asCallbackFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects two entities together so that changing the state of the main entity changes the state of the connected entity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! Max State (1) !! Min State (-1)&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || Lit || Unlit&lt;br /&gt;
|-&lt;br /&gt;
| MoveObject || Open || Close&lt;br /&gt;
|-&lt;br /&gt;
| SwingDoor&lt;br /&gt;
|rowspan=2| Locked&lt;br /&gt;
|rowspan=2| Unlocked&lt;br /&gt;
|-&lt;br /&gt;
| Chest&lt;br /&gt;
|-&lt;br /&gt;
| Button || Switched on || Switched off&lt;br /&gt;
|-&lt;br /&gt;
| Lever&lt;br /&gt;
|rowspan=2| Unstuck&lt;br /&gt;
|rowspan=2| Stuck (at min)&lt;br /&gt;
|-&lt;br /&gt;
| Wheel&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asMainEntity'' - The entity that causes the change; can be a Lever, Wheel, Button, or Photocell&lt;br /&gt;
#''asConnectEntity'' - The entity that is affected by the change&lt;br /&gt;
#''abInvertStateSent'' - If the state is inverted, making the connected entity change to the opposite state&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
#''asCallbackFunc'' - The name of the connection callback&lt;br /&gt;
&lt;br /&gt;
Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asConnectionName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, int alState)&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;alState is what is sent to connection entity and will be inverted if abInvertStateSent = true!&lt;br /&gt;
&lt;br /&gt;
====Lamps====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLampLit(string &amp;amp;in asName, bool abLit, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Turns a lamp on or off.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the lamp&lt;br /&gt;
#''abLit ''- Set true if you want the lamp to be lit, set to false if you want the lamp to be unlit&lt;br /&gt;
#''abEffects ''- If you want to have the lamp fade in/out when it gets lit/unlit&lt;br /&gt;
&lt;br /&gt;
====Doors====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorLocked(string &amp;amp;in asName, bool abLocked, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abLocked'' - Locked/unlocked&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is locked/unlocked&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorClosed(string &amp;amp;in asName, bool abClosed, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abClosed'' - Closed/open&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is closed/opened&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
bool GetSwingDoorLocked(string &amp;amp;in asName);&lt;br /&gt;
bool GetSwingDoorClosed(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a swing door is locked/closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorDisableAutoClose(string &amp;amp;in asName, bool abDisableAutoClose);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deactivates the &amp;quot;auto-close&amp;quot; when a door is nearly closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetSwingDoorState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns an integer depending on how far the door is opened. &amp;lt;br /&amp;gt;-1 = angle is close to 0°, 1 = angle is 70% or higher of max, 0 = inbetween -1 and 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLocked(string &amp;amp;in asName, bool abLocked);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a level door. Note that level doors are NOT swing doors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedSound(string &amp;amp;in asName, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which sound is played when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedText(string &amp;amp;in asName, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectState(string &amp;amp;in asName, float afState);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween (and above, for example, the bridge_metal_vert) are valid too!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectStateExt(string &amp;amp;in asName, float afState, float afAcc, float afMaxSpeed, float afSlowdownDist, bool abResetSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state, extended method.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween are valid too!&lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afMaxSpeed ''- maximum speed&lt;br /&gt;
#''afSlowdownDist ''- Distance to the target state before deceleration occurs.&lt;br /&gt;
#''abResetSpeed ''- Set to ''true'' if the prop's speed should be reset before performing the movement, else the prop will accelerate from its current speed to afMaxSpeed.&lt;br /&gt;
&lt;br /&gt;
====Levers, wheels and buttons====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropObjectStuckState(string &amp;amp;in asName, int alState);&lt;br /&gt;
void SetWheelStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
void SetLeverStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes a prop&amp;lt;nowiki&amp;gt;\&amp;lt;/nowiki&amp;gt;wheel&amp;lt;nowiki&amp;gt;\&amp;lt;/nowiki&amp;gt;lever stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''alState ''- 0 = not stuck, 1 = at max, -1 = at min &lt;br /&gt;
#''abEffects ''- use effects&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelAngle(string &amp;amp;in asName, float afAngle, bool abAutoMove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves a wheel to a certain angle.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''afAngle ''- angle&lt;br /&gt;
#''abAutoMove ''- determines whether the wheel should move on its own&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
void SetLeverInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to make a wheel/lever unstuck when interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetLeverState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the state of the lever. &amp;lt;br /&amp;gt;0 = not stuck, 1 = at max, -1 = at min&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderStuckState(string &amp;amp;in asName, int alStuckState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes a MultiSlider stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when state changes. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetButtonSwitchedOn(string &amp;amp;in asName, bool abSwitchedOn, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Sticky areas====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetAllowStickyAreaAttachment(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows entities to stick to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asProp);&lt;br /&gt;
void AttachBodyToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asBody);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop/body to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void DetachFromStickyArea(string &amp;amp;in asAreaName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches everything from a StickyArea.&lt;br /&gt;
&lt;br /&gt;
====NPCs====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCAwake(string &amp;amp;in asName, bool abAwake, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wakes/sleeps a NPC.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the NPC&lt;br /&gt;
#''abAwake'' - ''true'' to awaken, ''false'' to sleep&lt;br /&gt;
#''abEffects'' - Play the &amp;quot;Awake&amp;quot; or &amp;quot;Sleep&amp;quot; animations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCFollowPlayer(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a NPC's head to follow the player's movements.&lt;br /&gt;
&lt;br /&gt;
====Enemies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables an enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyIsHallucination(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes an enemy a hallucination. Hallucinations fade to smoke when they get near the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void FadeEnemyToSmoke(string &amp;amp;in asName, bool abPlaySound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly fades an enemy to smoke.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ShowEnemyPlayerPosition(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the enemy run to the player, no matter where he is.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AlertEnemyOfPlayerPresence(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gives the specified enemy the player's current position and makes it search the area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisableTriggers(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables or disables enemy triggers. If disabled, enemy will not react to player or attack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddEnemyPatrolNode(string &amp;amp;in asName, string &amp;amp;in asNodeName, float afWaitTime, string &amp;amp;in asAnimation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a patrol node to the enemy's path.&lt;br /&gt;
&lt;br /&gt;
#''asName''- Internal name of the enemy &lt;br /&gt;
#''asNodeName'' - Path node &lt;br /&gt;
#''afWaitTime'' - Time in seconds that the enemy waits at the path node before continuing. If 0, randomized between 1-3.&lt;br /&gt;
#''asAnimation'' - The animation the enemy uses when reaching the path node&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ClearEnemyPatrolNodes(string &amp;amp;in asEnemyName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the current path of patrol nodes of the enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemySanityDecreaseActive(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether an enemy activates the player's sanity drain when stared at.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy &lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToNode(string &amp;amp;in asEnemyName, string &amp;amp;in asNodeName, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific PathNode.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asNodeName'' - Internal name of the node to teleport to &lt;br /&gt;
#''abChangeY'' - Whether the Y position of the node will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToEntity(string &amp;amp;in asEnemyName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBody, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific entity.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asTargetEntity'' - Internal name of the entity to teleport to&lt;br /&gt;
#''asTargetBody'' - Internal name of the entity's body name to teleport to. If empty, the first body will be used (might be unstable, recommended to input a body anyway)&lt;br /&gt;
#''abChangeY'' - Whether the Y position of the entity will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeManPigPose(string &amp;amp;in asName, string &amp;amp;in asPoseType);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the pose a specified ManPig.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''asPoseType'' - Name of the ManPig pose to use. Can be &amp;quot;Biped&amp;quot; or &amp;quot;Quadruped&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigFadeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should fade the player's view in and out.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigSoundDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should play the proximity sounds.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigEasyEscapeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should be easier to escape from when hunted. If not disabled, easy escape is activated if the player is more than 12.35 meters away, the enemy can't see the player, and the player has less than 75 health. When this occurs, the enemy is forced to stop hunting and wait for half a second.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ForceTeslaPigSighting(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Forces a Tesla ManPig to be visible for a short time.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; GetEnemyStateName(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the name of the state a specified enemy is current in.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
Possible states for all enemies:&lt;br /&gt;
*Idle&lt;br /&gt;
*Wait&lt;br /&gt;
*Patrol&lt;br /&gt;
*Investigate&lt;br /&gt;
*Alert&lt;br /&gt;
*Search&lt;br /&gt;
*Hurt&lt;br /&gt;
*Hunt&lt;br /&gt;
*HuntPause&lt;br /&gt;
*HuntWander&lt;br /&gt;
*AttackMeleeShort&lt;br /&gt;
*AttackMeleeLong&lt;br /&gt;
*BreakDoor&lt;br /&gt;
*Dead&lt;br /&gt;
&lt;br /&gt;
Waterlurker-only states:&lt;br /&gt;
*GoHome&lt;br /&gt;
*Eat&lt;br /&gt;
&lt;br /&gt;
ManPig-only states: &lt;br /&gt;
*Flee&lt;br /&gt;
*Stalk&lt;br /&gt;
*Track&lt;br /&gt;
&lt;br /&gt;
Unused states:&lt;br /&gt;
*AttackRange&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=7008</id>
		<title>HPL2/Engine Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=7008"/>
		<updated>2025-03-02T05:05:25Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Enemies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TocRight}}&lt;br /&gt;
&lt;br /&gt;
This page documents all scripts available in Amnesia: The Dark Descent.&lt;br /&gt;
&lt;br /&gt;
{{note|'''Note''': Some of the functions require the Amnesia 1.3 or 1.5 update. Steam and other online store copies should be automatically updated. Other copies can get 1.3 [http://www.frictionalgames.com/forum/thread-24334.html here].}}&lt;br /&gt;
&lt;br /&gt;
== Directives ==&lt;br /&gt;
&lt;br /&gt;
First off, &amp;lt;code&amp;gt;#include &amp;quot;file.hps&amp;quot;&amp;lt;/code&amp;gt; can be used to programmatically merge together multiple separate files to make organizing scripts easier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
==Engine scripts==&lt;br /&gt;
===Main===&lt;br /&gt;
&lt;br /&gt;
The following functions are the main hps functions that the HPL2 engine looks to run on certain events - similar to the C++ int main() function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void OnStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the map is loaded for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnEnter();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs whenever the player enters a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnLeave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the player leaves a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnGameStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is found in the global.hps file and the inventory.hps file, and is run when the game is first started by the player (ie via &amp;quot;Start New Game&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnUpdate(float afStep);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
This function is executed for every game update or &amp;quot;tick&amp;quot;. Can be used for rapid-firing updates instead of looping timers. Keep in mind that this can affect game performance if not used with care.&lt;br /&gt;
&lt;br /&gt;
#''afStep''- Time elapsed in seconds since the last frame. Multiply speeds, distances etc. by this argument to avoid framerate dependence issues (for example: if you move something in this function with constant speed, it will move faster on computers which run the game with high FPS and slower on computers with low FPS).&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float RandFloat(float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random float.&lt;br /&gt;
&lt;br /&gt;
#''afMin ''- minimum value&lt;br /&gt;
#''afMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int RandInt(int alMin, int alMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random int. Note: the maximum value is ''inclusive''  - the RandInt() function may return this value.&lt;br /&gt;
&lt;br /&gt;
#''alMin ''- minimum value&lt;br /&gt;
#''alMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringContains(string &amp;amp;in asString, string &amp;amp;in asSubString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a string contains the specified string. &amp;lt;br /&amp;gt;Example: searching for &amp;quot;hello&amp;quot; in &amp;quot;hello world&amp;quot; would return '''true'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to check&lt;br /&gt;
#''asSubString ''- the string to search for&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; StringSub(string &amp;amp;in asString, int alStart, int alCount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the substring in a string. &amp;lt;br /&amp;gt;Example: in the string &amp;quot;frictional games rocks&amp;quot;, using 4 as ''alStart''  and 6 as ''alCount''  would return '''&amp;quot;tional&amp;quot;'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string&lt;br /&gt;
#''alStart ''- start position in the string&lt;br /&gt;
#''alCount ''- amount of characters&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int StringToInt(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns an integer converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float StringToFloat(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a float converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringToBool(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a boolean converted from a string, else returns false.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&lt;br /&gt;
===Mathematical Operations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathCos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathTan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAsin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAcos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan2(float afX, float afY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Calculates and returns the arc tangent of the specified values.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - First value to operate.&lt;br /&gt;
#''afY''  - Second value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSqrt(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the square root of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathPow(float afBase, float afExp);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the value of afBase raised to the power of afExp.&lt;br /&gt;
&lt;br /&gt;
#''afBase''  - The base value.&lt;br /&gt;
#''afExp''  - Value to calculate the base with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMin(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the lowest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMax(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the highest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathClamp(float afX, float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns afX clamped between afMin and afMax. If afX &amp;lt; afMin, returns afMin, and if afX &amp;gt; afMax, returns afMax.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - The value to clamp.&lt;br /&gt;
#''afMin''  - The minimum value to clamp afX with.&lt;br /&gt;
#''afMax''  - The maximum value to clamp afX with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAbs(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the absolute value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&lt;br /&gt;
===Debugging===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void Print(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a string to the log file (''hpl.log'').&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDebugMessage(string &amp;amp;in asString, bool abCheckForDuplicates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a line of text to the debug console at the bottom left of the screen. Debug mode must be enabled for the console messages to be visible.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to print&lt;br /&gt;
#''abCheckForDuplicates ''- if true, the string won't be printed more than once on screen until it disappears&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ProgLog(string &amp;amp;in asLevel, string &amp;amp;in asMessage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints an entry to the ProgLog (progression log). &amp;lt;br /&amp;gt;ProgLog is a file created in Documents/Amnesia/main (or an FC folder if one is being used). It logs certain events, such us opening the menu or picking up the lantern, as well as the player's state (Health, Sanity, Oil, Tinderboxes, Coins), for the purpose of documenting a tester's playstyle. &amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt;This function allows to log custom messages.The messages in the ProgLog file are sorted by time elapsed since a map was loaded.&lt;br /&gt;
&lt;br /&gt;
ProgLog has to be enabled for a player profile in ''user_settings.cfg''  before it starts working.&lt;br /&gt;
&lt;br /&gt;
#''asLevel ''- can be &amp;quot;Low&amp;quot;, &amp;quot;Medium&amp;quot; or &amp;quot;High&amp;quot;. It's a tag which appears in each log entry, for event prioritising.&lt;br /&gt;
#''asMessage ''- The custom message to be printed to the log.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool ScriptDebugOn();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the debug mode is enabled. &amp;lt;br /&amp;gt;See [[HPL2/Development_Environment|&amp;quot;Setting up Development Environment&amp;quot;]] to setup debug mode on your own computer.&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
{{warning|Regular variables (int, float, etc.) are '''not''' saved by the game. Using them in important parts of yor script will break it upon loading a game save. In HPL, those variables should only be used for disposable counters, like spawning objects in a &amp;quot;for&amp;quot; loop. For variables which need to be saved, use the wrappers as described below.}}&lt;br /&gt;
&lt;br /&gt;
====Local====&lt;br /&gt;
&lt;br /&gt;
Local variables can be used throughout the same script file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetLocalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetLocalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddLocalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetLocalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Global====&lt;br /&gt;
&lt;br /&gt;
Global variables can be used throughout several maps and can be accessed by several script files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetGlobalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetGlobalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddGlobalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetGlobalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Particle Systems===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadParticleSystem(string &amp;amp;in asPSFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asPSFile''  - The particle system file to load. Extension: .ps&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntity(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntityExt(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS,&lt;br /&gt;
float afR, float afG, float afB, float afA, bool abFadeAtDistance, float afFadeMinEnd, float afFadeMinStart,&lt;br /&gt;
float afFadeMaxStart, float afFadeMaxEnd);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity, extended method with more options.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''abFadeAtDistance ''- determines whether a particle system fades from a certain distance on&lt;br /&gt;
#''afFadeMinEnd ''- minimum distance at which the particle system stops fading&lt;br /&gt;
#''afFadeMinStart ''- minimum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxStart ''- maximum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxEnd ''- maximum distance at which the particle system stops fading&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DestroyParticleSystem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Destroys a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - The internal name of the particle system&lt;br /&gt;
&lt;br /&gt;
===Sounds &amp;amp; Music===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadSound(string &amp;amp;in asSoundFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile''  - The sound file to load (extension .snt optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayGuiSound(string &amp;amp;in asSoundFile, float afVolume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays a sound, not using 3D.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile ''- the sound to play (extension .snt/.ogg optional)&lt;br /&gt;
#''afVolume ''- the volume of the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaySoundAtEntity(string &amp;amp;in asSoundName, string &amp;amp;in asSoundFile, string &amp;amp;in asEntity, float afFadeTime, bool abSaveSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a sound at an entity.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''asSoundFile ''- the sound to use (extension .snt optional)&lt;br /&gt;
#''asEntity ''- the entity to create the sound at. Using &amp;quot;Player&amp;quot; is effectively the same as &amp;lt;code&amp;gt;PlayGuiSound&amp;lt;/code&amp;gt;, yet this function allows a looping sound to be saved&lt;br /&gt;
#''afFadeTime ''- time in seconds the sound needs to fade. Avoids enemies hearing the sound if afFadeTime is at least 0.1f&lt;br /&gt;
#''abSaveSound ''- if ''true'', a looping sound will &amp;quot;remember&amp;quot; its playback state (currently playing/stopped), and that state will be restored the next time the level is entered. If ''true'', the sound is never attached to the entity! Note that saving should only be used on ''looping sounds''!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeInSound(string &amp;amp;in asSoundName, float afFadeTime, bool abPlayStart);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades in a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds&lt;br /&gt;
#''abPlayStart ''- Play the sound defined in the &amp;lt;code&amp;gt;&amp;lt;Start&amp;gt;&amp;lt;/code&amp;gt; section of the .snt before playing the main sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopSound(string &amp;amp;in asSoundName, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades out a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds, use 0 to immediately stop the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayMusic(string &amp;amp;in asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays music.&lt;br /&gt;
&lt;br /&gt;
#''asMusicFile ''- the music file to play (extension .ogg optional)&lt;br /&gt;
#''abLoop ''- determines whether a music track should loop&lt;br /&gt;
#''afVolume ''- volume of the music&lt;br /&gt;
#''afFadeTime ''- time in seconds until music reaches full volume&lt;br /&gt;
#''alPrio ''- priority of the music. Note that only the music with the highest priority can be heard! 0 - lowest, 1 - higher, etc.&lt;br /&gt;
#''abResume''  - if ''true'', playback will be continued from where the track stopped after the call to &amp;lt;code&amp;gt;StopMusic()&amp;lt;/code&amp;gt;. If ''false'', the track will be restarted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopMusic(float afFadeTime, int alPrio);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops music.&lt;br /&gt;
&lt;br /&gt;
#''afFadeTime ''- time in seconds until music stops&lt;br /&gt;
#''alPrio ''- the priority of the music that should stop&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice(string &amp;amp;in asVoiceFile, string &amp;amp;in asEffectFile, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry,&lt;br /&gt;
bool abUsePosition, string &amp;amp;in asPosEntity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This adds a voice and an additional sound effect to be played. It is okay to call this many times in order to play many voices in a row. The EffectVoiceOverCallback is not called until ALL voices have finished.&lt;br /&gt;
&lt;br /&gt;
#''asVoiceFile ''- the voice to play&lt;br /&gt;
#''asEffectFile ''- the sound effect to play&lt;br /&gt;
#''asTextCat ''- the category in the .lang file, usually &amp;quot;Voice&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''abUsePosition ''- plays using 3D from the entity, or without 3D&lt;br /&gt;
#''asPosEntity ''- the entity at which the voice and sound are played from&lt;br /&gt;
#''afMinDistance ''- minimum distance the voice and sound are heard&lt;br /&gt;
#''afMaxDistance ''- maximum distance the voice and sound are heard&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopAllEffectVoices(float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all voices and calls the EffectVoiceOverCallback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEffectVoiceActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether EffectVoices are still active.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetEffectVoiceOverCallback(string &amp;amp;in asFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to be called when the EffectVoices are finished. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundVolume(float afDestVolume, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound volume, that means everything you can hear '''from the world'''. This does not affect music of GUI sounds.&lt;br /&gt;
&lt;br /&gt;
#''afDestVolume ''- desired volume&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired volume&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundSpeed(float afDestSpeed, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound speed.&lt;br /&gt;
&lt;br /&gt;
#''afDestSpeed ''- desired speed&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired speed&lt;br /&gt;
&lt;br /&gt;
===Lights===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightVisible(string &amp;amp;in asLightName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables lights.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''abVisible ''- determines the state of the light&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeLightTo(string &amp;amp;in asLightName, float afR, float afG, float afB, float afA, float afRadius, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the properties of a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''afRadius ''- radius of the light. -1 means keeping the radius&lt;br /&gt;
#''afTime ''- time in seconds until change is done&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightFlickerActive(string &amp;amp;in asLightName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates flickering on a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName'' - The internal light name&lt;br /&gt;
#''abActive'' - true = active, false = inactive&lt;br /&gt;
&lt;br /&gt;
==Game scripts==&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartCredits(string &amp;amp;in asMusic, bool abLoopMusic, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alEndNum);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts the end credits screen.&lt;br /&gt;
&lt;br /&gt;
#''asMusic ''- the music to play (including .ogg)&lt;br /&gt;
#''abLoopMusic ''- determines whether the music should loop&lt;br /&gt;
#''asTextCat ''- the category to be used in the .lang file, usually &amp;quot;Ending&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alEndNum ''- Amnesia has 3 different endings and displays a code at the bottom. Determines which code is displayed. 0-2 will display codes, any other integer will not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartDemoEnd();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shows the demo end screen. The background and UI elements are defined in demo.cfg, with the text using the entries in the &amp;quot;Demo&amp;quot; category of the .lang file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AutoSave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an auto save file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CheckPoint(string &amp;amp;in asName, string &amp;amp;in asStartPos, string &amp;amp;in asCallback, string &amp;amp;in asDeathHintCat, string &amp;amp;in asDeathHintEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a checkpoint at which the player will respawn in case he dies. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asName, int alCount)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;Count is 0 on the first checkpoint load!&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the editor&lt;br /&gt;
#''asCallback ''- the function to call when the player dies/respawns&lt;br /&gt;
#''asDeathHintCat ''- the category of the death hint message to be used in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asDeathHintEntry ''- the entry in the .lang file&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeMap(string &amp;amp;in asMapName, string &amp;amp;in asStartPos, string &amp;amp;in asStartSound, string &amp;amp;in asEndSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Loads another map after a 1.5 second fade out.&lt;br /&gt;
&lt;br /&gt;
#''asMapName ''- the file to load&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the next map&lt;br /&gt;
#''asStartSound ''- the sound that is played when the change starts&lt;br /&gt;
#''asEndSound ''- the sound that is played when the new map is loaded&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ClearSavedMaps();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the &amp;quot;history&amp;quot; of the save, useful to do when you know the player will not be able to go back anymore. Makes the next save much smaller in size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateDataCache();&lt;br /&gt;
void DestroyDataCache();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This caches all current textures and models and they are not released until destroy is called. If there is already cached data it is destroyed.&lt;br /&gt;
Create caches to enable faster loading when going back to a map. Destroy the cache if you know the player won't go back to that map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMapDisplayNameEntry(string &amp;amp;in asNameEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the map name shown in save file names. If none is set NULL is assumed.&lt;br /&gt;
&lt;br /&gt;
#''asNameEntry ''- the entry to display, category must be &amp;quot;Levels&amp;quot;!&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the skybox.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxTexture(string &amp;amp;in asTexture);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the texture of the skybox.&lt;br /&gt;
&lt;br /&gt;
#''asTexture''  - The texture file to set. Extension: .dds&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the solid color of the skybox rather than a texture.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the global fog.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the color to use for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogProperties(float afStart, float afEnd, float afFalloffExp, bool abCulling);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the properties for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afStart ''- how many meters from the camera should the fog begin&lt;br /&gt;
#''afEnd ''- how many meters from the camera should the fog reach full thickness&lt;br /&gt;
#''afFalloffExp ''- the amount by which the thinkness increases&lt;br /&gt;
#''abCulling ''- whether occlusion culling is active for the fog; this prevents objects behind the fog from being loaded&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetupLoadScreen(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alRandomNum, string &amp;amp;in asImageFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which loading screen will be shown when changing maps.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category of the loading text in the .lang file to be shown on the loading screen, usually &amp;quot;LoadingText&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alRandomNum ''- if greater 1, then it will randomize between 1 and alRandom for each LoadScreen giving entry the suffix XX (eg 01). If &amp;lt; =1 then no suffix is added&lt;br /&gt;
#''asImageFile ''- the image to be shown (optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void UnlockAchievement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlocks the specified achievement. Only able to be used for the ending achievements.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the achievement. Only the following strings are valid:&lt;br /&gt;
::* Benefactor&lt;br /&gt;
::* Survivor&lt;br /&gt;
::* Sacrifice&lt;br /&gt;
::* Quitter&lt;br /&gt;
::* Egotist&lt;br /&gt;
::* Altruist&lt;br /&gt;
::* Vacillator&lt;br /&gt;
&lt;br /&gt;
===Game Timer===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddTimer(string &amp;amp;in asName, float afTime, string &amp;amp;in asFunction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a timer which calls a function when it expires. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asTimer)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the name of the timer&lt;br /&gt;
#''afTime ''- time in seconds&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveTimer(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a timer, no matter how much time is left.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the timer.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetTimerTimeLeft(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the time left on a timer.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - the internal name of the timer.&lt;br /&gt;
&lt;br /&gt;
===Screen Effects===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeOut(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to black.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen is completly black&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeIn(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen back to normal.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeImageTrailTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies the image trail effect to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeSepiaColorTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the screen go dark red.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0) &lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeRadialBlurTo(float afSize, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies radial blur effects to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afSize ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetRadialBlurStartDist(float afStartDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines at which distance the radial blur effects appear.&lt;br /&gt;
&lt;br /&gt;
#''afStartDist ''- the distance at which the effect starts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectFlash(float afFadeIn, float afWhite, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white.&lt;br /&gt;
&lt;br /&gt;
#''afFadeIn ''- time in seconds until screen is white&lt;br /&gt;
#''afWhite ''- determines to which percentage the screen fades to white (1.0 = completly white)&lt;br /&gt;
#''afFadeOut ''- time in seconds until screen is back to normal again&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectEmotionFlash(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white and shows a text message.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''asSound ''- the sound to play while fading&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetFlashbackIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a flashback is still in effect.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerSpawnPS(string &amp;amp;in asSPSFile);&lt;br /&gt;
void StopPlayerSpawnPS();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Continuously spawn regular particle systems (''.ps'') around the player. Particles created by this script carry over from map to map.&lt;br /&gt;
&lt;br /&gt;
#''asSPSFile''  - the ''.sps''  file to use. Example ''.sps''  files are located in the ''/misc''  folder in the main game directory.&amp;lt;br&amp;gt;Custom ''.sps''  files can be created by hand in a text editor (see existing ones and mimic how those are written). &amp;lt;br /&amp;gt;Since ''StopPlayerSpawnPS()''  doesn't seem to work, to stop an SPS you must create an ''.sps''  file with an empty particle field field and override the old SPS by calling ''StartPlayerSpawnPS''  again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shakes the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity of the shake&lt;br /&gt;
#''afTime ''- duration of the shake&lt;br /&gt;
#''afFadeInTime ''- time in seconds until full intensity is reached&lt;br /&gt;
#''afFadeOutTime ''- time until screen is back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInDarknessEffectsActive(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the sanity drain and night vision effects while in the darkness.&lt;br /&gt;
&lt;br /&gt;
''bool abX''  - Enable/disable effects.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowScreenImage(string &amp;amp;in asImageName, float afX, float afY, float afScale, bool abUseRelativeCoordinates, float afDuration, float afFadeIn, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
Displays an image file directly onto the screen. See [[HPL2/Tutorials/ShowScreenImage()|ShowScreenImage()]] in the tutorials section for more information.&lt;br /&gt;
&lt;br /&gt;
# ''asImageName'' - The image file to render (.jpg, .png, .tga, .dds)&lt;br /&gt;
# ''afX'' - The X position of the image&lt;br /&gt;
# ''afY'' - The Y position of the image&lt;br /&gt;
# ''afScale'' - The size of the image in pixels (not scale), or original image size if negative&lt;br /&gt;
# ''abUseRelativeCoordinates'' - Whether X and Y are relative to the screen resoltion, or pixel co-ordinates if not&lt;br /&gt;
# ''afDuration'' - The duration that the image is displayed for&lt;br /&gt;
# ''afFadeIn'' - The time, in seconds, to fade in the image&lt;br /&gt;
# ''afFadeOut'' - The time, in seconds, to fade out the image&lt;br /&gt;
&lt;br /&gt;
===Insanity===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInsanitySetEnabled(string &amp;amp;in asSet, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which InsanitySets are enabled.&lt;br /&gt;
&lt;br /&gt;
#''asSet ''- the set&lt;br /&gt;
#''abX ''- enabled or not&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartInsanityEvent(string &amp;amp;in asEventName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Starts a specified insanity event.&lt;br /&gt;
&lt;br /&gt;
#''asEventName ''- Insanity event to play.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartRandomInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts a random insanity event from the available sets.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopCurrentInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Stops the currently playing insanity event.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void InsanityEventIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an insanity event is currently in effect.&amp;lt;br&amp;gt;Not useful at all due to having a return type of &amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; when it should be &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Player===&lt;br /&gt;
&lt;br /&gt;
Note that the player's maximum health and sanity is 100.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enabled/Disable player controlled movement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangePlayerStateToNormal();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets the player's state, forcing them to stop interacting with objects. It also clears the inventory item to be used (as if it was double-clicked on in the inventory again) and dismounts the player from ladders.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerCrouching(bool abCrouch);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddPlayerBodyForce(float afX, float afY, float afZ, bool abUseLocalCoords);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pushes the player into a certain direction. Note that you need values above ~2000 to see any effects.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- amount along the X-axis&lt;br /&gt;
#''afY ''- amount along the Y-axis&lt;br /&gt;
#''afZ ''- amount along the Z-axis&lt;br /&gt;
#''abUseLocalCoords ''- If true, axes are based on where the player is facing, not the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowPlayerCrossHairIcons(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the icons when a player has something in focus.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerSanity(float afSanity);&lt;br /&gt;
void AddPlayerSanity(float afSanity);&lt;br /&gt;
float GetPlayerSanity();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerHealth(float afHealth);&lt;br /&gt;
void AddPlayerHealth(float afHealth);&lt;br /&gt;
float GetPlayerHealth();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerLampOil(float afOil);&lt;br /&gt;
void AddPlayerLampOil(float afOil);&lt;br /&gt;
float GetPlayerLampOil();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the lamp oil of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerSpeed();&lt;br /&gt;
float GetPlayerYSpeed();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current speed of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSanityDrainDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables sanity drain from darkness.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoost();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a large amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! New Sanity&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || 100&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || 90&lt;br /&gt;
|-&lt;br /&gt;
| 50-74 || 80&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoostSmall();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a small amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! Sanity Bonus&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || +20&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || +15&lt;br /&gt;
|-&lt;br /&gt;
| 50-75 || +10&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityDamage(float afAmount, bool abUseEffect);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- amount of sanity damage done&lt;br /&gt;
#''abUseEffect ''- determines whether an effect is played when the sanity damage is dealt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GivePlayerDamage(float afAmount, string &amp;amp;in asType, bool abSpinHead, bool abLethal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the health of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- amount of damage done to health&lt;br /&gt;
#''asType ''- plays a certain effect on the screen when the damage is dealt (BloodSplat, Claws, or Slash) &lt;br /&gt;
#''abSpinHead ''- changes the camera view when damage is dealt&lt;br /&gt;
#''abLethal ''- set to true if player can die from given damage. If ''false'' and the damage would have left the player with less than 10 health, health is set to 10.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerFOVMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the field of view of the player. A shorter FOV will create a zoom effect.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- multiplier of default FOV (1 is default)&lt;br /&gt;
#''afSpeed ''- the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerAspectMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the aspect ratio of the player. Basically stretches or narrows the screen horizontally.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- multiplier of default aspect (default is 1)&lt;br /&gt;
#''afSpeed ''- the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- angle of rotation of head, positive being counter-clockwise&lt;br /&gt;
#''afSpeedMul ''- speed (possibly acceleration) multiplier of the rotation (default 1, which is really slow)&lt;br /&gt;
#''afMaxSpeed ''- maximum speed of rotation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerForward(float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Moves the player forward. It needs to be called in a timer that updates 60 times / second.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- amount along the X-axis&lt;br /&gt;
#''afY ''- amount along the Y-axis&lt;br /&gt;
#''afZ ''- amount along the Z-axis&lt;br /&gt;
#''afSpeed ''- speed at which the change happens&lt;br /&gt;
#''afSlowDownDist ''- distance at which to start slowing down (prevents the head from abruptly stopping)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerLookAt(string &amp;amp;in asEntityName, float afSpeedMul, float afMaxSpeed, string &amp;amp;in asAtTargetCallback);&lt;br /&gt;
void StopPlayerLookAt();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to look at a certain entity until StopPlayerLookAt is used.&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- the entity to look at &lt;br /&gt;
#''afSpeedMul ''- how fast should the player look at the entity&lt;br /&gt;
#''afMaxSpeed ''- maximum speed allowed&lt;br /&gt;
#''asAtTargetCallback ''- function to call when player looks at target&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerMoveSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerRunSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerLookSpeedMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the player's move/run/look speed. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpForceMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the player's jump multiplier. Higher values = higher jumps. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpDisabled(bool abX);&lt;br /&gt;
void SetPlayerCrouchDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to jump/crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportPlayer(string &amp;amp;in asStartPosName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly teleports the player to the target StartPos.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternActive(bool abX, bool abUseEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the player use his lantern.&lt;br /&gt;
&lt;br /&gt;
# ''abX'' - Set lantern to be active (true) or inactive (false)&lt;br /&gt;
# ''abUseEffects'' - Play on/off sounds&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetLanternActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player currently uses his lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to use his lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternLitCallback(string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to call when the player uses his lantern. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;MyFunc(bool abLit)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message on the screen.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTime ''- determines how long the message is displayed. If time is &amp;lt; =0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetDeathHint(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the message that appears when the player dies.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DisableDeathStartSound();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the death sound when the player dies. This must be called directly before player is killed! The variable as soon as player dies too.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPermaDeathSound(string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Sets the sound played after the player dies when permadeath is active. Permadeath is only active when the game is launched with the &amp;lt;code&amp;gt;ptest&amp;lt;/code&amp;gt; command line parameter. Only used for the post-death Suitor lines in ''Justine''.&lt;br /&gt;
&lt;br /&gt;
#''asSound'' - The sound to be played after death. Expects a voice-type sound.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerFallDamageDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the player's ability to take fall damage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPos(float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the player's position within the level.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - X co-ordinate position.&lt;br /&gt;
#''afY''  - Y co-ordinate position.&lt;br /&gt;
#''afZ''  - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerPosX();&lt;br /&gt;
float GetPlayerPosY();&lt;br /&gt;
float GetPlayerPosZ();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the player's position within the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
===Journal===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddNote(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a note to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _Name and _Text and be in category &amp;quot;Journal&amp;quot;!&lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDiary(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a diary to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _NameX and _TextY whereas X and Y are numbers of the parts (_Name1: first diary, _Text1: first page) and be in category &amp;quot;Journal&amp;quot;! &lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ReturnOpenJournal(bool abOpenJournal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Only called in the pickup diary callback! If true the journal displays the entry else not.&lt;br /&gt;
&lt;br /&gt;
===Quests===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a quest to the player's journal under mementos. Completed quests cannot be readded.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name to be used&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot;Quest_&amp;lt;texthere&amp;gt;_Text”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CompleteQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Completes a quest. If the quest has not been added, it's marked as complete anyway, preventing it from being added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot; Quest_&amp;lt;texthere&amp;gt;_Text ”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool QuestIsCompleted(string &amp;amp;in asName);&lt;br /&gt;
bool QuestIsAdded(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a quest is completed/added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetNumberOfQuestsInMap(int alNumberOfQuests);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the number of quests in the map. Obsolete; formerly used to calculate a completion percentage when looking at a level door.&lt;br /&gt;
&lt;br /&gt;
#''alNumberOfQuests ''- Amount of quests&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveHint(string &amp;amp;in asName, string &amp;amp;in asMessageCat, string &amp;amp;in asMessageEntry, float afTimeShown);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a hint on the player's screen.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asMessageCat ''- the category in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asMessageEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTimeShown ''- time in seconds until the message disappears. If time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void BlockHint(string &amp;amp;in asName);&lt;br /&gt;
void UnBlockHint(string &amp;amp;in asName);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Blocking a hint prevents it from being shown. Blocked hints are included in savefiles, so they should persist between levels. Unblocking a hint allows it to be shown.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; blocks the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveHint(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes the hint from the list of already shown hints, allowing it to appear again.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; reenables the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
===Inventory===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ExitInventory();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Exits the inventory by force.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the player's ability to open his inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a message on the inventory screen. Used for feedback messages when failing to combine items.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory ''- the category in the .lang file, usually &amp;quot;Inventory&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTime ''- time in seconds until the message disappears. If life time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItem(string &amp;amp;in asName, string &amp;amp;in asType, string &amp;amp;in asSubTypeName, string &amp;amp;in asImageName, float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds an item to the inventory of the player. Note that the item does not have to exist as entity in the world to be able to do this.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asType ''- item type to give, Available types are:&lt;br /&gt;
::*Puzzle&lt;br /&gt;
::*Lantern&lt;br /&gt;
::*Health&lt;br /&gt;
::*Sanity&lt;br /&gt;
::*LampOil&lt;br /&gt;
::*Tinderbox&lt;br /&gt;
#''asSubTypeName ''- item name for .lang file&lt;br /&gt;
#''asImageName ''- the image which will appear in inventory. For example: &amp;lt;code&amp;gt;void GiveItem(&amp;quot;chemical_container_full_1&amp;quot;, &amp;quot;Puzzle&amp;quot;, &amp;quot;chemical_container_full&amp;quot;, &amp;quot;chemical_container_full.tga&amp;quot;, 1);&amp;lt;/code&amp;gt; will use the image from &amp;lt;code&amp;gt;graphics/item/chemical_container_full.tga&amp;lt;/code&amp;gt; &lt;br /&gt;
#''afAmount ''- amount the item gives, - For example: Oil potions will fill the oil meter by this amount, Health potions will heal by this amount, etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item from the player's inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool HasItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player has an item in his inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItemFromFile(string &amp;amp;in asName, string &amp;amp;in asFileName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a single item to the player's inventory. This is meant to be used for debug mostly as it creates the actual item and then destroys it.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asFileName ''- item to give + extension (.ent)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddCombineCallback(string &amp;amp;in asName, string &amp;amp;in asItemA, string &amp;amp;in asItemB, string &amp;amp;in asFunction, bool abAutoRemove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to combine items in his inventory. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItemA, string &amp;amp;in asItemB)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name for the callback&lt;br /&gt;
#''asItemA ''- internal name of first item&lt;br /&gt;
#''asItemB ''- internal name of second item&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
#''abAutoRemove ''- determines whether the callback should be removed when the items are combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveCombineCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a combine callback.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the callback to be removed (as specified in AddCombineCallback)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddUseItemCallback(string &amp;amp;in asName, string &amp;amp;in asItem, string &amp;amp;in asEntity, string &amp;amp;in asFunction, bool abAutoDestroy);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to use items on the world. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItem, string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
#''asItem ''- internal name of the item&lt;br /&gt;
#''asEntity ''- entity to be able to use the item on&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abAutoDestroy ''- determines whether the callback should be removed when the item is used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveUseItemCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item callback.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
&lt;br /&gt;
===Entities===&lt;br /&gt;
&lt;br /&gt;
====General====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityActive(string &amp;amp;in asName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityVisible(string &amp;amp;in asName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity's visual mesh. The collision body remains.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the entity.&lt;br /&gt;
#''abActive''  - Activate/deactivate mesh.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntityExists(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an entity exists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCustomFocusCrossHair(string &amp;amp;in asName, string&amp;amp; asCrossHair);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the crosshair that is used when focusing an entity.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCrossHair ''- desired crosshair, can be: &lt;br /&gt;
::*Default (no crosshair)&lt;br /&gt;
::*Grab&lt;br /&gt;
::*Push&lt;br /&gt;
::*Ignite&lt;br /&gt;
::*Pick&lt;br /&gt;
::*LevelDoor&lt;br /&gt;
::*Ladder&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void CreateEntityAtArea(string &amp;amp;in asEntityName, string &amp;amp;in asEntityFile, string &amp;amp;in asAreaName, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an entity at an area. When creating an enemy though, it cannot chase properly along PathNodes (using for example &amp;lt;code&amp;gt;ShowEnemyPlayerPosition&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- internal name&lt;br /&gt;
#''asEntityFile ''- entity to be used extension .ent&lt;br /&gt;
#''asAreaName ''- the area to create the entity at&lt;br /&gt;
#''abFullGameSave ''- determines whether an entity &amp;quot;remembers&amp;quot; its state&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ReplaceEntity(string &amp;amp;in asName, string &amp;amp;in asBodyName, string &amp;amp;in asNewEntityName, string &amp;amp;in asNewEntityFile, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Removes an entity and places a new one in its place.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to replace.&lt;br /&gt;
#''asBodyName'' - Name of the body of the entity to place the new entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''asNewEntityName'' - Name of the new entity.&lt;br /&gt;
#''asNewEntityFile'' - Name of the new entity file. Extension .ent. &lt;br /&gt;
#''abFullGameSave'' - Whether ALL properties of this entity should be saved throughout levels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaceEntityAtEntity(string &amp;amp;in asName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBodyName, bool abUseRotation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Places an entity at the position of another entity. Does not work for enemies, use TeleportEnemyToEntity instead.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to place.&lt;br /&gt;
#''asTargetEntity'' - Name of the other entity to place the first entity at.&lt;br /&gt;
#''asTargetBodyName'' - Name of the body of the entity to place the first entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''abUseRotation'' - Whether the entity should be rotated like the target entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPos(string &amp;amp;in asName, float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Moves an entity to a position in the level.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to move.&lt;br /&gt;
#''afX'' - X co-ordinate position.&lt;br /&gt;
#''afY'' - Y co-ordinate position.&lt;br /&gt;
#''afZ'' - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetEntityPosX(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosY(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosZ(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns an entity's position in the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerLookAtCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveWhenLookedAt);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player looks at a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = looking, -1 = not looking&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveWhenLookedAt ''- determines whether the callback should be removed when the player looked at the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerInteractCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveOnInteraction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player interacts with a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveOnInteraction ''- determines whether the callback should be removed when the player interacts with the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCallbackFunc(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when certain events occur with an entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, string &amp;amp;in asType)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;asType&amp;lt;/code&amp;gt; values depend on entity type:&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! asType Value&lt;br /&gt;
|-&lt;br /&gt;
| Object || Break&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || OnIgnite&lt;br /&gt;
|-&lt;br /&gt;
| Item || OnPickup&lt;br /&gt;
|-&lt;br /&gt;
| Enemy || OnDeath&lt;br /&gt;
|-&lt;br /&gt;
| Enemy_Grunt&amp;lt;br&amp;gt;Enemy_Manpig || OnAutoDisabled&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityConnectionStateChangeCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A callback called when ever the connection state changes (button being switched on, lever switched, etc). &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void Func(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: -1 = off, 0 = between, 1 = on&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityInteractionDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disallows interaction with an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void BreakJoint (string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Breaks a joint. Do not use this on joints in SwingDoors, Levers, Wheels, etc. where the joint is part of an interaction. That will make the game crash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void AddEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName, string &amp;amp;in asFunction, bool abDeleteOnCollide, int alStates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when two entities collide. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asParent, string &amp;amp;in asChild, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = enter, -1 = leave&lt;br /&gt;
&lt;br /&gt;
#''asParentName ''- internal name of main object&lt;br /&gt;
#''asChildName ''- internal name of object that collides with main object (asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) NOT supported!)&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abDeleteOnCollide ''- determines whether the callback after it was called&lt;br /&gt;
#''alStates ''- 1 = only enter, -1 = only leave, 0 = both&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an EntityCollideCallback. Asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) not supported in ''asChildName''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntitiesCollide(string &amp;amp;in asEntityA, string &amp;amp;in asEntityB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether two entities collide. This function does NOT support asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) or &amp;quot;Player&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetBodyMass(string &amp;amp;in asName, float afMass);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName.&lt;br /&gt;
#''afMass''  - The mass to set.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetBodyMass(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName. &lt;br /&gt;
#''afMass''  - The mass to get.&lt;br /&gt;
&lt;br /&gt;
====Props====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropEffectActive(string &amp;amp;in asName, bool abActive, bool abFadeAndPlaySounds);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Can be used on coal to give it the black color it should have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropActiveAndFade(string &amp;amp;in asName, bool abActive, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates a prop.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''abActive ''- nothing to add&lt;br /&gt;
#''afFadeTime ''- time in seconds until prop fully fades&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropStaticPhysics(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates the physics of a prop, setting the mass to 0. Setting as true will make entities static in midair.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetPropIsInteractedWith(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a prop is interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RotatePropToSpeed(string &amp;amp;in asName, float afAcc, float afGoalSpeed, float afAxisX, float afAxisY, float afAxisZ, bool abResetSpeed, string &amp;amp;in asOffsetArea);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the prop up to a set speed.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afGoalSpeed ''- desired speed &lt;br /&gt;
#''afAxisX ''- rotation around X axis&lt;br /&gt;
#''afAxisY ''- rotation around Y axis&lt;br /&gt;
#''afAxisZ ''- rotation around Z axis&lt;br /&gt;
#''abResetSpeed ''- determines whether the speed is resetted after goal speed is reached&lt;br /&gt;
#''asOffsetArea ''- the area to rotate around, if empty, then the center of the body is used Note: The entity you want to rotate MUST be a &amp;quot;StaticObject&amp;quot; entity!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void StopPropMovement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all movement of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddAttachedPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop.&lt;br /&gt;
&lt;br /&gt;
#''asPropName''- the prop to attach another prop at &lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop&lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
{{bug|''afRotZ '' is used for both the ZX rotation and the Z position of the attached prop. Unwanted rotation can be avoided by using: &amp;lt;br /&amp;gt;''AddAttachedPropToProp(asPropName, asAttachName, asAttachFile, afPosX, afPosY, '''0''', afPosZ, '''90.0f''', afPosZ)''}}&lt;br /&gt;
&lt;br /&gt;
{{bug|Attaching a breakable prop to a physically active prop, and then breaking the attached prop, will cause the game to crash, should the parent object be moved or reset.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop. Fixed version of &amp;lt;code&amp;gt;AddAttachedPropToProp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
#''asPropName ''- the prop to attach another prop at&lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop &lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveAttachedPropFromProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches a prop from a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
void AddPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
float GetPropHealth(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ResetProp(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets a prop's state to the original one when the map was loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void PlayPropAnimation(string &amp;amp;in asProp, string &amp;amp;in asAnimation, float afFadeTime, bool abLoop, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the prop play an animation and calls a function. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asProp)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asProp ''- internal name of the prop&lt;br /&gt;
#''asAnimation ''- animation to play&lt;br /&gt;
#''afFadeTime ''- Fade time between current and new animations&lt;br /&gt;
#''abLoop ''- determines whether the animation loops &lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddPropForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddPropImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These functions push objects. Note that rather high values are needed when applying ''forces''  (on the order of ~100 (weak) to ~10000 (strong)), but not impulses (values less than 10 can be appropriate). Forces are external influences, and will have different effect depending on the mass of the object they are being applied to; impulses disregard mass, and can cause objects to break, as if hit. A &amp;quot;Body&amp;quot; is a physics-related helper object, to which a force or an impulse can be applied. Entities can consist of several bodies, interconnected in various ways (you can create/examine bodies in the model editor).&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the object to push; for bodies, use this format: &amp;quot;''entityName''_''bodyName''&amp;quot;&lt;br /&gt;
#''afX ''- magnitude along the X-axis&lt;br /&gt;
#''afY ''- magnitude along the Y-axis&lt;br /&gt;
#''afZ ''- magnitude along the Z-axis&lt;br /&gt;
#''asCoordSystem ''- determines which coordinate system is used, &amp;quot;local&amp;quot; or &amp;quot;world&amp;quot;&lt;br /&gt;
&lt;br /&gt;
All of these functions are ''additive''  - when called consecutively, for each call, the vectors defined by (afX, afY, afZ) will be added together, and a resultant force/impulse will be calculated ''before''  any physics simulation is applied to the target object.&lt;br /&gt;
&lt;br /&gt;
====Connections====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithRope(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asRopeName, bool abInteractOnly, float afSpeedMul, float afToMinSpeed, float afToMaxSpeed, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects a prop with the movement of a rope (i.e. turn a wheel to move a rope). For Levers, the rope only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName''- The name of the connection&lt;br /&gt;
#''asPropName'' - The name of the prop; can be a Lever or Wheel&lt;br /&gt;
#''asRopeName'' - The name of the rope&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''afSpeedMul'' - Speed multiplier of how quickly the rope moves&lt;br /&gt;
#''afToMinSpeed'' - The slowest the rope can move&lt;br /&gt;
#''afToMaxSpeed'' - The fastest the rope can move&lt;br /&gt;
#''abInvert'' - Whether to invert the direction the rope moves&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithMoveObject(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asMoveObjectName, bool abInteractOnly, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This one should only be used if there must be an exact correspondence to prop &amp;quot;amount&amp;quot; and the MoveObject open amount. It is best used for Wheel-door connections, where the MoveObject moves continuously along with the Wheel. For Levers, the MoveObject only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asPropName'' - The entity that controls the movement; can be a Lever or Wheel&lt;br /&gt;
#''asMoveObject'' - The MoveObject to move&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''abInvert'' - If the state is inverted, making the MoveObject move in the opposite direction&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ConnectEntities(string &amp;amp;in asName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, bool abInvertStateSent, int alStatesUsed, string &amp;amp;in asCallbackFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects two entities together so that changing the state of the main entity changes the state of the connected entity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! Max State (1) !! Min State (-1)&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || Lit || Unlit&lt;br /&gt;
|-&lt;br /&gt;
| MoveObject || Open || Close&lt;br /&gt;
|-&lt;br /&gt;
| SwingDoor&lt;br /&gt;
|rowspan=2| Locked&lt;br /&gt;
|rowspan=2| Unlocked&lt;br /&gt;
|-&lt;br /&gt;
| Chest&lt;br /&gt;
|-&lt;br /&gt;
| Button || Switched on || Switched off&lt;br /&gt;
|-&lt;br /&gt;
| Lever&lt;br /&gt;
|rowspan=2| Unstuck&lt;br /&gt;
|rowspan=2| Stuck (at min)&lt;br /&gt;
|-&lt;br /&gt;
| Wheel&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asMainEntity'' - The entity that causes the change; can be a Lever, Wheel, Button, or Photocell&lt;br /&gt;
#''asConnectEntity'' - The entity that is affected by the change&lt;br /&gt;
#''abInvertStateSent'' - If the state is inverted, making the connected entity change to the opposite state&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
#''asCallbackFunc'' - The name of the connection callback&lt;br /&gt;
&lt;br /&gt;
Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asConnectionName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, int alState)&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;alState is what is sent to connection entity and will be inverted if abInvertStateSent = true!&lt;br /&gt;
&lt;br /&gt;
====Lamps====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLampLit(string &amp;amp;in asName, bool abLit, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Turns a lamp on or off.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the lamp&lt;br /&gt;
#''abLit ''- Set true if you want the lamp to be lit, set to false if you want the lamp to be unlit&lt;br /&gt;
#''abEffects ''- If you want to have the lamp fade in/out when it gets lit/unlit&lt;br /&gt;
&lt;br /&gt;
====Doors====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorLocked(string &amp;amp;in asName, bool abLocked, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abLocked'' - Locked/unlocked&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is locked/unlocked&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorClosed(string &amp;amp;in asName, bool abClosed, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abClosed'' - Closed/open&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is closed/opened&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
bool GetSwingDoorLocked(string &amp;amp;in asName);&lt;br /&gt;
bool GetSwingDoorClosed(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a swing door is locked/closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorDisableAutoClose(string &amp;amp;in asName, bool abDisableAutoClose);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deactivates the &amp;quot;auto-close&amp;quot; when a door is nearly closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetSwingDoorState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns an integer depending on how far the door is opened. &amp;lt;br /&amp;gt;-1 = angle is close to 0°, 1 = angle is 70% or higher of max, 0 = inbetween -1 and 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLocked(string &amp;amp;in asName, bool abLocked);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a level door. Note that level doors are NOT swing doors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedSound(string &amp;amp;in asName, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which sound is played when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedText(string &amp;amp;in asName, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectState(string &amp;amp;in asName, float afState);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween (and above, for example, the bridge_metal_vert) are valid too!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectStateExt(string &amp;amp;in asName, float afState, float afAcc, float afMaxSpeed, float afSlowdownDist, bool abResetSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state, extended method.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween are valid too!&lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afMaxSpeed ''- maximum speed&lt;br /&gt;
#''afSlowdownDist ''- Distance to the target state before deceleration occurs.&lt;br /&gt;
#''abResetSpeed ''- Set to ''true'' if the prop's speed should be reset before performing the movement, else the prop will accelerate from its current speed to afMaxSpeed.&lt;br /&gt;
&lt;br /&gt;
====Levers, wheels and buttons====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropObjectStuckState(string &amp;amp;in asName, int alState);&lt;br /&gt;
void SetWheelStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
void SetLeverStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes a prop&amp;lt;nowiki&amp;gt;\&amp;lt;/nowiki&amp;gt;wheel&amp;lt;nowiki&amp;gt;\&amp;lt;/nowiki&amp;gt;lever stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''alState ''- 0 = not stuck, 1 = at max, -1 = at min &lt;br /&gt;
#''abEffects ''- use effects&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelAngle(string &amp;amp;in asName, float afAngle, bool abAutoMove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves a wheel to a certain angle.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''afAngle ''- angle&lt;br /&gt;
#''abAutoMove ''- determines whether the wheel should move on its own&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
void SetLeverInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to make a wheel/lever unstuck when interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetLeverState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the state of the lever. &amp;lt;br /&amp;gt;0 = not stuck, 1 = at max, -1 = at min&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderStuckState(string &amp;amp;in asName, int alStuckState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes a MultiSlider stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when state changes. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetButtonSwitchedOn(string &amp;amp;in asName, bool abSwitchedOn, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Sticky areas====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetAllowStickyAreaAttachment(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows entities to stick to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asProp);&lt;br /&gt;
void AttachBodyToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asBody);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop/body to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void DetachFromStickyArea(string &amp;amp;in asAreaName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches everything from a StickyArea.&lt;br /&gt;
&lt;br /&gt;
====NPCs====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCAwake(string &amp;amp;in asName, bool abAwake, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wakes/sleeps a NPC.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the NPC&lt;br /&gt;
#''abAwake'' - ''true'' to awaken, ''false'' to sleep&lt;br /&gt;
#''abEffects'' - Play the &amp;quot;Awake&amp;quot; or &amp;quot;Sleep&amp;quot; animations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCFollowPlayer(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a NPC's head to follow the player's movements.&lt;br /&gt;
&lt;br /&gt;
====Enemies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables an enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyIsHallucination(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes an enemy a hallucination. Hallucinations fade to smoke when they get near the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void FadeEnemyToSmoke(string &amp;amp;in asName, bool abPlaySound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly fades an enemy to smoke.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ShowEnemyPlayerPosition(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the enemy run to the player, no matter where he is.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AlertEnemyOfPlayerPresence(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gives the specified enemy the player's current position and makes it search the area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisableTriggers(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables or disables enemy triggers. If disabled, enemy will not react to player or attack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddEnemyPatrolNode(string &amp;amp;in asName, string &amp;amp;in asNodeName, float afWaitTime, string &amp;amp;in asAnimation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a patrol node to the enemy's path.&lt;br /&gt;
&lt;br /&gt;
#''asName''- Internal name of the enemy &lt;br /&gt;
#''asNodeName'' - Path node &lt;br /&gt;
#''afWaitTime'' - Time in seconds that the enemy waits at the path node before continuing. If 0, randomized between 1-3.&lt;br /&gt;
#''asAnimation'' - The animation the enemy uses when reaching the path node&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ClearEnemyPatrolNodes(string &amp;amp;in asEnemyName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the current path of patrol nodes of the enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemySanityDecreaseActive(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether an enemy activates the player's sanity drain when stared at.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy &lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToNode(string &amp;amp;in asEnemyName, string &amp;amp;in asNodeName, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific PathNode.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asNodeName'' - Internal name of the node to teleport to &lt;br /&gt;
#''abChangeY'' - Whether the Y position of the node will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToEntity(string &amp;amp;in asEnemyName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBody, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific entity.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asTargetEntity'' - Internal name of the entity to teleport to&lt;br /&gt;
#''asTargetBody'' - Internal name of the entity's body name to teleport to. If empty, the first body will be used (might be unstable, recommended to input a body anyway)&lt;br /&gt;
#''abChangeY'' - Whether the Y position of the entity will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeManPigPose(string &amp;amp;in asName, string &amp;amp;in asPoseType);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the pose a specified ManPig.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''asPoseType'' - Name of the ManPig pose to use. Can be &amp;quot;Biped&amp;quot; or &amp;quot;Quadruped&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigFadeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should fade the player's view in and out.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigSoundDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should play the proximity sounds.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigEasyEscapeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should be easier to escape from when hunted. If not disabled, easy escape is activated if the player is more than 12.35 meters away, the enemy can't see the player, and the player has less than 75 health. When this occurs, the enemy is forced to stop hunting and wait for half a second.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ForceTeslaPigSighting(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Forces a Tesla ManPig to be visible for a short time.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; GetEnemyStateName(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the name of the state a specified enemy is current in.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
Possible states for all enemies:&lt;br /&gt;
*Idle&lt;br /&gt;
*Wait&lt;br /&gt;
*Patrol&lt;br /&gt;
*Investigate&lt;br /&gt;
*Alert&lt;br /&gt;
*Search&lt;br /&gt;
*Hurt&lt;br /&gt;
*Hunt&lt;br /&gt;
*HuntPause&lt;br /&gt;
*HuntWander&lt;br /&gt;
*AttackMeleeShort&lt;br /&gt;
*AttackMeleeLong&lt;br /&gt;
*BreakDoor&lt;br /&gt;
*Dead&lt;br /&gt;
&lt;br /&gt;
Waterlurker-only states:&lt;br /&gt;
*GoHome&lt;br /&gt;
*Eat&lt;br /&gt;
&lt;br /&gt;
ManPig-only states: &lt;br /&gt;
*Flee&lt;br /&gt;
*Stalk&lt;br /&gt;
*Track&lt;br /&gt;
&lt;br /&gt;
Unused states:&lt;br /&gt;
*AttackRange&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/TDD/Change_Custom_Story_into_Full_Conversion_Mod&amp;diff=7007</id>
		<title>HPL2/TDD/Change Custom Story into Full Conversion Mod</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/TDD/Change_Custom_Story_into_Full_Conversion_Mod&amp;diff=7007"/>
		<updated>2025-01-25T17:20:34Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{constructionNotice|This page is still being written and is currently incomplete}}&lt;br /&gt;
&lt;br /&gt;
Since version 1.5 of Amnesia The Dark Descent (release in July 2023), a new field has been added to the custom_story_settings.cfg file. This field allows you to specify a main_init.cfg file, which is the main file that [[HPL2/TDD/Full Conversion Mod|full conversion mods]] use to launch. This means you can now create full conversion mods from a custom story, and they will still show up in the main game menu. This unlocks all the power of full conversion mods, while maintaining most of the simplicity of a custom story.&lt;br /&gt;
&lt;br /&gt;
==Setup==&lt;br /&gt;
If you have a custom story that you want to transform into a full conversion mod, start by adding the new field to your custom_story_settings.cfg:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;Main&lt;br /&gt;
  Name = &amp;quot;My story&amp;quot;&lt;br /&gt;
  Author = &amp;quot;Me&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  ...&lt;br /&gt;
&lt;br /&gt;
  InitCfgFile = &amp;quot;config/main_init.cfg&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Specifying this field will disable &amp;lt;code&amp;gt;MapsFolder&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StartMap&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;StartPos&amp;lt;/code&amp;gt;, as these fields will instead be read from the main_init.cfg file. It will also disable &amp;lt;code&amp;gt;ExtraLangFilePrefix&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;DefaultExtraLangFile&amp;lt;/code&amp;gt;, as the game will instead use the primary lang files specified in main_init.cfg. The description of your custom story will instead be located in said lang file, in the &amp;lt;code&amp;gt;CustomStoryMain&amp;lt;/code&amp;gt; category.&lt;br /&gt;
&lt;br /&gt;
From this point on, you can follow tutorials for full conversion mods. Your mod folder will remain &amp;lt;code&amp;gt;custom_stories/&amp;lt;your story&amp;gt;&amp;lt;/code&amp;gt;. For example, if your story folder is named &amp;quot;Ascent&amp;quot;, your main init file should exist at &amp;lt;code&amp;gt;custom_stories/Ascent/config/main_init.cfg&amp;lt;/code&amp;gt; (reflecting what you put in the &amp;lt;code&amp;gt;InitCfgFile&amp;lt;/code&amp;gt; above). Create the &amp;quot;config&amp;quot; folder and the &amp;quot;main_init.cfg&amp;quot; file. The contents of your main_init.cfg file can start as such (Remember to change the references to &amp;quot;Ascent&amp;quot; to reflect your own mod, such as MainSaveFolder and GameName):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;ConfigFiles&lt;br /&gt;
	Resources = &amp;quot;resources.cfg&amp;quot;&lt;br /&gt;
	Materials = &amp;quot;materials.cfg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	Game	= &amp;quot;config/game.cfg&amp;quot;&lt;br /&gt;
	Menu	= &amp;quot;config/menu.cfg&amp;quot;&lt;br /&gt;
	PreMenu	= &amp;quot;config/pre_menu.cfg&amp;quot;&lt;br /&gt;
	Demo	= &amp;quot;config/demo.cfg&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	DefaultMainSettings	= &amp;quot;config/default_main_settings.cfg&amp;quot;&lt;br /&gt;
	DefaultMainSettingsSDL2	= &amp;quot;config/default_main_settings_sdl2.cfg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	DefaultMainSettingsLow		= &amp;quot;launcher/default_main_settings_low.cfg&amp;quot;&lt;br /&gt;
	DefaultMainSettingsMedium	= &amp;quot;launcher/default_main_settings_medium.cfg&amp;quot;&lt;br /&gt;
	DefaultMainSettingsHigh		= &amp;quot;launcher/default_main_settings_high.cfg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	DefaultUserSettings	= &amp;quot;config/default_user_settings.cfg&amp;quot;&lt;br /&gt;
	DefaultUserKeys		= &amp;quot;config/default_user_keys.cfg&amp;quot;&lt;br /&gt;
	DefaultUserKeysSDL2	= &amp;quot;config/default_user_keys_sdl2.cfg&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	DefaultBaseLanguage	= &amp;quot;base_english.lang&amp;quot;&lt;br /&gt;
	DefaultGameLanguage	= &amp;quot;english.lang&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Directories&lt;br /&gt;
	MainSaveFolder 	 	 = &amp;quot;Ascent&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	BaseLanguageFolder 	 = &amp;quot;config/&amp;quot;&lt;br /&gt;
	GameLanguageFolder 	 = &amp;quot;config/lang_main/&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	CustomStoryPath 	 = &amp;quot;custom_stories&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Variables&lt;br /&gt;
	GameName = &amp;quot;Ascent, an Amnesia mod&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;StartMap&lt;br /&gt;
	File	= &amp;quot;level_01.map&amp;quot;&lt;br /&gt;
	Folder	= &amp;quot;maps/&amp;quot;&lt;br /&gt;
	Pos	= &amp;quot;PlayerStartArea_1&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paths specified in this file are relative paths starting from the custom story's main folder, eg: &amp;quot;custom_stories/Ascent&amp;quot;. For example, leaving Resources as &amp;quot;resources.cfg&amp;quot; means it should exist at &amp;quot;custom_stories/Ascent/resources.cfg&amp;quot;. If a file is not found here, it will fall back to using the file specified in the base game main_init.cfg.&lt;br /&gt;
&lt;br /&gt;
{{note|resources.cfg is required for your full conversion to load '''any''' files contained in your custom story's folder, including maps!}}&lt;br /&gt;
Simply copying the original resources.cfg and placing it in your custom story's folder is sufficient. Unlike the base game, full conversions will not automatically read from the &amp;quot;lang&amp;quot; folder, so you will have to add it to resources.cfg. Your custom story can now override base game assets with its own.&lt;br /&gt;
&lt;br /&gt;
==Additional notes==&lt;br /&gt;
&lt;br /&gt;
When it comes to file loading, lang files are a special case; they operate on a per-entry basis, meaning any entries not found in your custom story's lang file will load from the base game's lang file instead. This means you can override any existing lang entry as well as add your own, but you can also use any entry from the base game without needing to add it to your file.&lt;br /&gt;
&lt;br /&gt;
Because of the way total conversions work, custom stories cannot load the Justine config and lang files (referred to as &amp;quot;ptest&amp;quot; internally). For example, attempting to specify &amp;quot;ptest_materials.cfg&amp;quot; in your main_init.cfg will not work. Instead, you will have to copy the file to your custom story's folder, which you can rename to materials.cfg because full conversions can load only one config. Similarly, a full conversion won't be able to load any files from &amp;lt;code&amp;gt;config/lang_ptest&amp;lt;/code&amp;gt;, so you will need to copy over any entries to your own lang file. However, Justine assets can be loaded without issue, as they exist in subfolders that are loaded by the base resources.cfg.&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/TDD/Change_Custom_Story_into_Full_Conversion_Mod&amp;diff=7006</id>
		<title>HPL2/TDD/Change Custom Story into Full Conversion Mod</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/TDD/Change_Custom_Story_into_Full_Conversion_Mod&amp;diff=7006"/>
		<updated>2025-01-25T17:19:58Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{constructionNotice|This page is still being written and is currently incomplete}}&lt;br /&gt;
&lt;br /&gt;
Since version 1.5 of Amnesia The Dark Descent (release in July 2023), a new field has been added to the custom_story_settings.cfg file. This field allows you to specify a main_init.cfg file, which is the main file that full conversion mods use to launch. This means you can now create [[HPL2/TDD/Full Conversion Mod|full conversion mods]] from a custom story, and they will still show up in the main game menu. This unlocks all the power of full conversion mods, while maintaining most of the simplicity of a custom story.&lt;br /&gt;
&lt;br /&gt;
==Setup==&lt;br /&gt;
If you have a custom story that you want to transform into a full conversion mod, start by adding the new field to your custom_story_settings.cfg:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;Main&lt;br /&gt;
  Name = &amp;quot;My story&amp;quot;&lt;br /&gt;
  Author = &amp;quot;Me&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  ...&lt;br /&gt;
&lt;br /&gt;
  InitCfgFile = &amp;quot;config/main_init.cfg&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Specifying this field will disable &amp;lt;code&amp;gt;MapsFolder&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StartMap&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;StartPos&amp;lt;/code&amp;gt;, as these fields will instead be read from the main_init.cfg file. It will also disable &amp;lt;code&amp;gt;ExtraLangFilePrefix&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;DefaultExtraLangFile&amp;lt;/code&amp;gt;, as the game will instead use the primary lang files specified in main_init.cfg. The description of your custom story will instead be located in said lang file, in the &amp;lt;code&amp;gt;CustomStoryMain&amp;lt;/code&amp;gt; category.&lt;br /&gt;
&lt;br /&gt;
From this point on, you can follow tutorials for full conversion mods. Your mod folder will remain &amp;lt;code&amp;gt;custom_stories/&amp;lt;your story&amp;gt;&amp;lt;/code&amp;gt;. For example, if your story folder is named &amp;quot;Ascent&amp;quot;, your main init file should exist at &amp;lt;code&amp;gt;custom_stories/Ascent/config/main_init.cfg&amp;lt;/code&amp;gt; (reflecting what you put in the &amp;lt;code&amp;gt;InitCfgFile&amp;lt;/code&amp;gt; above). Create the &amp;quot;config&amp;quot; folder and the &amp;quot;main_init.cfg&amp;quot; file. The contents of your main_init.cfg file can start as such (Remember to change the references to &amp;quot;Ascent&amp;quot; to reflect your own mod, such as MainSaveFolder and GameName):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;ConfigFiles&lt;br /&gt;
	Resources = &amp;quot;resources.cfg&amp;quot;&lt;br /&gt;
	Materials = &amp;quot;materials.cfg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	Game	= &amp;quot;config/game.cfg&amp;quot;&lt;br /&gt;
	Menu	= &amp;quot;config/menu.cfg&amp;quot;&lt;br /&gt;
	PreMenu	= &amp;quot;config/pre_menu.cfg&amp;quot;&lt;br /&gt;
	Demo	= &amp;quot;config/demo.cfg&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	DefaultMainSettings	= &amp;quot;config/default_main_settings.cfg&amp;quot;&lt;br /&gt;
	DefaultMainSettingsSDL2	= &amp;quot;config/default_main_settings_sdl2.cfg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	DefaultMainSettingsLow		= &amp;quot;launcher/default_main_settings_low.cfg&amp;quot;&lt;br /&gt;
	DefaultMainSettingsMedium	= &amp;quot;launcher/default_main_settings_medium.cfg&amp;quot;&lt;br /&gt;
	DefaultMainSettingsHigh		= &amp;quot;launcher/default_main_settings_high.cfg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	DefaultUserSettings	= &amp;quot;config/default_user_settings.cfg&amp;quot;&lt;br /&gt;
	DefaultUserKeys		= &amp;quot;config/default_user_keys.cfg&amp;quot;&lt;br /&gt;
	DefaultUserKeysSDL2	= &amp;quot;config/default_user_keys_sdl2.cfg&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	DefaultBaseLanguage	= &amp;quot;base_english.lang&amp;quot;&lt;br /&gt;
	DefaultGameLanguage	= &amp;quot;english.lang&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Directories&lt;br /&gt;
	MainSaveFolder 	 	 = &amp;quot;Ascent&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	BaseLanguageFolder 	 = &amp;quot;config/&amp;quot;&lt;br /&gt;
	GameLanguageFolder 	 = &amp;quot;config/lang_main/&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	CustomStoryPath 	 = &amp;quot;custom_stories&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Variables&lt;br /&gt;
	GameName = &amp;quot;Ascent, an Amnesia mod&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;StartMap&lt;br /&gt;
	File	= &amp;quot;level_01.map&amp;quot;&lt;br /&gt;
	Folder	= &amp;quot;maps/&amp;quot;&lt;br /&gt;
	Pos	= &amp;quot;PlayerStartArea_1&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paths specified in this file are relative paths starting from the custom story's main folder, eg: &amp;quot;custom_stories/Ascent&amp;quot;. For example, leaving Resources as &amp;quot;resources.cfg&amp;quot; means it should exist at &amp;quot;custom_stories/Ascent/resources.cfg&amp;quot;. If a file is not found here, it will fall back to using the file specified in the base game main_init.cfg.&lt;br /&gt;
&lt;br /&gt;
{{note|resources.cfg is required for your full conversion to load '''any''' files contained in your custom story's folder, including maps!}}&lt;br /&gt;
Simply copying the original resources.cfg and placing it in your custom story's folder is sufficient. Unlike the base game, full conversions will not automatically read from the &amp;quot;lang&amp;quot; folder, so you will have to add it to resources.cfg. Your custom story can now override base game assets with its own.&lt;br /&gt;
&lt;br /&gt;
==Additional notes==&lt;br /&gt;
&lt;br /&gt;
When it comes to file loading, lang files are a special case; they operate on a per-entry basis, meaning any entries not found in your custom story's lang file will load from the base game's lang file instead. This means you can override any existing lang entry as well as add your own, but you can also use any entry from the base game without needing to add it to your file.&lt;br /&gt;
&lt;br /&gt;
Because of the way total conversions work, custom stories cannot load the Justine config and lang files (referred to as &amp;quot;ptest&amp;quot; internally). For example, attempting to specify &amp;quot;ptest_materials.cfg&amp;quot; in your main_init.cfg will not work. Instead, you will have to copy the file to your custom story's folder, which you can rename to materials.cfg because full conversions can load only one config. Similarly, a full conversion won't be able to load any files from &amp;lt;code&amp;gt;config/lang_ptest&amp;lt;/code&amp;gt;, so you will need to copy over any entries to your own lang file. However, Justine assets can be loaded without issue, as they exist in subfolders that are loaded by the base resources.cfg.&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/TDD/Change_Custom_Story_into_Full_Conversion_Mod&amp;diff=7005</id>
		<title>HPL2/TDD/Change Custom Story into Full Conversion Mod</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/TDD/Change_Custom_Story_into_Full_Conversion_Mod&amp;diff=7005"/>
		<updated>2025-01-25T17:15:48Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{constructionNotice|This page is still being written and is currently incomplete}}&lt;br /&gt;
&lt;br /&gt;
Since version 1.5 of Amnesia The Dark Descent (release in July 2023), a new field has been added to the custom_story_settings.cfg file. This field allows you to specify a main_init.cfg file, which is the main file that full conversion mods use to launch. This means you can now create full conversion mods from a custom story, and they will still show up in the main game menu. This unlocks all the power of full conversion mods, while maintaining most of the simplicity of a custom story.&lt;br /&gt;
&lt;br /&gt;
==Setup==&lt;br /&gt;
If you have a custom story that you want to transform into a full conversion mod, start by adding the new field to your custom_story_settings.cfg:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;Main&lt;br /&gt;
  Name = &amp;quot;My story&amp;quot;&lt;br /&gt;
  Author = &amp;quot;Me&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  ...&lt;br /&gt;
&lt;br /&gt;
  InitCfgFile = &amp;quot;config/main_init.cfg&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Specifying this field will disable &amp;lt;code&amp;gt;MapsFolder&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StartMap&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;StartPos&amp;lt;/code&amp;gt;, as these fields will instead be read from the main_init.cfg file. It will also disable &amp;lt;code&amp;gt;ExtraLangFilePrefix&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;DefaultExtraLangFile&amp;lt;/code&amp;gt;, as the game will instead use the primary lang files specified in main_init.cfg. The description of your custom story will instead be located in said lang file, in the &amp;lt;code&amp;gt;CustomStoryMain&amp;lt;/code&amp;gt; category.&lt;br /&gt;
&lt;br /&gt;
From this point on, you can follow tutorials for full conversion mods. Your mod folder will remain &amp;lt;code&amp;gt;custom_stories/&amp;lt;your story&amp;gt;&amp;lt;/code&amp;gt;. For example, if your story folder is named &amp;quot;Ascent&amp;quot;, your main init file should exist at &amp;lt;code&amp;gt;custom_stories/Ascent/config/main_init.cfg&amp;lt;/code&amp;gt; (reflecting what you put in the &amp;lt;code&amp;gt;InitCfgFile&amp;lt;/code&amp;gt; above). Create the &amp;quot;config&amp;quot; folder and the &amp;quot;main_init.cfg&amp;quot; file. The contents of your main_init.cfg file can start as such (Remember to change the references to &amp;quot;Ascent&amp;quot; to reflect your own mod, such as MainSaveFolder and GameName):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;ConfigFiles&lt;br /&gt;
	Resources = &amp;quot;resources.cfg&amp;quot;&lt;br /&gt;
	Materials = &amp;quot;materials.cfg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	Game	= &amp;quot;config/game.cfg&amp;quot;&lt;br /&gt;
	Menu	= &amp;quot;config/menu.cfg&amp;quot;&lt;br /&gt;
	PreMenu	= &amp;quot;config/pre_menu.cfg&amp;quot;&lt;br /&gt;
	Demo	= &amp;quot;config/demo.cfg&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	DefaultMainSettings	= &amp;quot;config/default_main_settings.cfg&amp;quot;&lt;br /&gt;
	DefaultMainSettingsSDL2	= &amp;quot;config/default_main_settings_sdl2.cfg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	DefaultMainSettingsLow		= &amp;quot;launcher/default_main_settings_low.cfg&amp;quot;&lt;br /&gt;
	DefaultMainSettingsMedium	= &amp;quot;launcher/default_main_settings_medium.cfg&amp;quot;&lt;br /&gt;
	DefaultMainSettingsHigh		= &amp;quot;launcher/default_main_settings_high.cfg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	DefaultUserSettings	= &amp;quot;config/default_user_settings.cfg&amp;quot;&lt;br /&gt;
	DefaultUserKeys		= &amp;quot;config/default_user_keys.cfg&amp;quot;&lt;br /&gt;
	DefaultUserKeysSDL2	= &amp;quot;config/default_user_keys_sdl2.cfg&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	DefaultBaseLanguage	= &amp;quot;base_english.lang&amp;quot;&lt;br /&gt;
	DefaultGameLanguage	= &amp;quot;english.lang&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Directories&lt;br /&gt;
	MainSaveFolder 	 	 = &amp;quot;Ascent&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	BaseLanguageFolder 	 = &amp;quot;config/&amp;quot;&lt;br /&gt;
	GameLanguageFolder 	 = &amp;quot;config/lang_main/&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	CustomStoryPath 	 = &amp;quot;custom_stories&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Variables&lt;br /&gt;
	GameName = &amp;quot;Ascent, an Amnesia mod&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;StartMap&lt;br /&gt;
	File	= &amp;quot;level_01.map&amp;quot;&lt;br /&gt;
	Folder	= &amp;quot;maps/&amp;quot;&lt;br /&gt;
	Pos	= &amp;quot;PlayerStartArea_1&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paths specified in this file are relative paths starting from the custom story's main folder, eg: &amp;quot;custom_stories/Ascent&amp;quot;. For example, leaving Resources as &amp;quot;resources.cfg&amp;quot; means it should exist at &amp;quot;custom_stories/Ascent/resources.cfg&amp;quot;. If a file is not found here, it will fall back to using the file specified in the base game main_init.cfg.&lt;br /&gt;
&lt;br /&gt;
{{note|resources.cfg is required for your full conversion to load '''any''' files contained in your custom story's folder, including maps!}}&lt;br /&gt;
Simply copying the original resources.cfg and placing it in your custom story's folder is sufficient. Unlike the base game, full conversions will not automatically read from the &amp;quot;lang&amp;quot; folder, so you will have to add it to resources.cfg. Your custom story can now override base game assets with its own.&lt;br /&gt;
&lt;br /&gt;
==Additional notes==&lt;br /&gt;
&lt;br /&gt;
When it comes to file loading, lang files are a special case; they operate on a per-entry basis, meaning any entries not found in your custom story's lang file will load from the base game's lang file instead. This means you can override any existing lang entry as well as add your own, but you can also use any entry from the base game without needing to add it to your file.&lt;br /&gt;
&lt;br /&gt;
Because of the way total conversions work, custom stories cannot load the Justine config and lang files (referred to as &amp;quot;ptest&amp;quot; internally). For example, attempting to specify &amp;quot;ptest_materials.cfg&amp;quot; in your main_init.cfg will not work. Instead, you will have to copy the file to your custom story's folder, which you can rename to materials.cfg because full conversions can load only one config. Similarly, a full conversion won't be able to load any files from &amp;lt;code&amp;gt;config/lang_ptest&amp;lt;/code&amp;gt;, so you will need to copy over any entries to your own lang file. However, Justine assets can be loaded without issue, as they exist in subfolders that are loaded by the base resources.cfg.&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=7004</id>
		<title>HPL2/Engine Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=7004"/>
		<updated>2025-01-19T23:54:43Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Sounds &amp;amp; Music */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TocRight}}&lt;br /&gt;
&lt;br /&gt;
This page documents all scripts available in Amnesia: The Dark Descent.&lt;br /&gt;
&lt;br /&gt;
{{note|'''Note''': Some of the functions require the Amnesia 1.3 or 1.5 update. Steam and other online store copies should be automatically updated. Other copies can get 1.3 [http://www.frictionalgames.com/forum/thread-24334.html here].}}&lt;br /&gt;
&lt;br /&gt;
== Directives ==&lt;br /&gt;
&lt;br /&gt;
First off, &amp;lt;code&amp;gt;#include &amp;quot;file.hps&amp;quot;&amp;lt;/code&amp;gt; can be used to programmatically merge together multiple separate files to make organizing scripts easier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
==Engine scripts==&lt;br /&gt;
===Main===&lt;br /&gt;
&lt;br /&gt;
The following functions are the main hps functions that the HPL2 engine looks to run on certain events - similar to the C++ int main() function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void OnStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the map is loaded for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnEnter();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs whenever the player enters a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnLeave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the player leaves a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnGameStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is found in the global.hps file and the inventory.hps file, and is run when the game is first started by the player (ie via &amp;quot;Start New Game&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnUpdate(float afStep);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
This function is executed for every game update or &amp;quot;tick&amp;quot;. Can be used for rapid-firing updates instead of looping timers. Keep in mind that this can affect game performance if not used with care.&lt;br /&gt;
&lt;br /&gt;
#''afStep''- Time elapsed in seconds since the last frame. Multiply speeds, distances etc. by this argument to avoid framerate dependence issues (for example: if you move something in this function with constant speed, it will move faster on computers which run the game with high FPS and slower on computers with low FPS).&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float RandFloat(float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random float.&lt;br /&gt;
&lt;br /&gt;
#''afMin ''- minimum value&lt;br /&gt;
#''afMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int RandInt(int alMin, int alMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random int. Note: the maximum value is ''inclusive''  - the RandInt() function may return this value.&lt;br /&gt;
&lt;br /&gt;
#''alMin ''- minimum value&lt;br /&gt;
#''alMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringContains(string &amp;amp;in asString, string &amp;amp;in asSubString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a string contains the specified string. &amp;lt;br /&amp;gt;Example: searching for &amp;quot;hello&amp;quot; in &amp;quot;hello world&amp;quot; would return '''true'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to check&lt;br /&gt;
#''asSubString ''- the string to search for&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; StringSub(string &amp;amp;in asString, int alStart, int alCount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the substring in a string. &amp;lt;br /&amp;gt;Example: in the string &amp;quot;frictional games rocks&amp;quot;, using 4 as ''alStart''  and 6 as ''alCount''  would return '''&amp;quot;tional&amp;quot;'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string&lt;br /&gt;
#''alStart ''- start position in the string&lt;br /&gt;
#''alCount ''- amount of characters&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int StringToInt(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns an integer converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float StringToFloat(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a float converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringToBool(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a boolean converted from a string, else returns false.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&lt;br /&gt;
===Mathematical Operations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathCos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathTan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAsin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAcos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan2(float afX, float afY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Calculates and returns the arc tangent of the specified values.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - First value to operate.&lt;br /&gt;
#''afY''  - Second value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSqrt(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the square root of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathPow(float afBase, float afExp);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the value of afBase raised to the power of afExp.&lt;br /&gt;
&lt;br /&gt;
#''afBase''  - The base value.&lt;br /&gt;
#''afExp''  - Value to calculate the base with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMin(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the lowest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMax(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the highest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathClamp(float afX, float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns afX clamped between afMin and afMax. If afX &amp;lt; afMin, returns afMin, and if afX &amp;gt; afMax, returns afMax.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - The value to clamp.&lt;br /&gt;
#''afMin''  - The minimum value to clamp afX with.&lt;br /&gt;
#''afMax''  - The maximum value to clamp afX with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAbs(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the absolute value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&lt;br /&gt;
===Debugging===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void Print(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a string to the log file (''hpl.log'').&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDebugMessage(string &amp;amp;in asString, bool abCheckForDuplicates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a line of text to the debug console at the bottom left of the screen. Debug mode must be enabled for the console messages to be visible.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to print&lt;br /&gt;
#''abCheckForDuplicates ''- if true, the string won't be printed more than once on screen until it disappears&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ProgLog(string &amp;amp;in asLevel, string &amp;amp;in asMessage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints an entry to the ProgLog (progression log). &amp;lt;br /&amp;gt;ProgLog is a file created in Documents/Amnesia/main (or an FC folder if one is being used). It logs certain events, such us opening the menu or picking up the lantern, as well as the player's state (Health, Sanity, Oil, Tinderboxes, Coins), for the purpose of documenting a tester's playstyle. &amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt;This function allows to log custom messages.The messages in the ProgLog file are sorted by time elapsed since a map was loaded.&lt;br /&gt;
&lt;br /&gt;
ProgLog has to be enabled for a player profile in ''user_settings.cfg''  before it starts working.&lt;br /&gt;
&lt;br /&gt;
#''asLevel ''- can be &amp;quot;Low&amp;quot;, &amp;quot;Medium&amp;quot; or &amp;quot;High&amp;quot;. It's a tag which appears in each log entry, for event prioritising.&lt;br /&gt;
#''asMessage ''- The custom message to be printed to the log.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool ScriptDebugOn();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the debug mode is enabled. &amp;lt;br /&amp;gt;See [[HPL2/Development_Environment|&amp;quot;Setting up Development Environment&amp;quot;]] to setup debug mode on your own computer.&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
{{warning|Regular variables (int, float, etc.) are '''not''' saved by the game. Using them in important parts of yor script will break it upon loading a game save. In HPL, those variables should only be used for disposable counters, like spawning objects in a &amp;quot;for&amp;quot; loop. For variables which need to be saved, use the wrappers as described below.}}&lt;br /&gt;
&lt;br /&gt;
====Local====&lt;br /&gt;
&lt;br /&gt;
Local variables can be used throughout the same script file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetLocalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetLocalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddLocalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetLocalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Global====&lt;br /&gt;
&lt;br /&gt;
Global variables can be used throughout several maps and can be accessed by several script files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetGlobalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetGlobalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddGlobalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetGlobalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Particle Systems===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadParticleSystem(string &amp;amp;in asPSFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asPSFile''  - The particle system file to load. Extension: .ps&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntity(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntityExt(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS,&lt;br /&gt;
float afR, float afG, float afB, float afA, bool abFadeAtDistance, float afFadeMinEnd, float afFadeMinStart,&lt;br /&gt;
float afFadeMaxStart, float afFadeMaxEnd);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity, extended method with more options.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''abFadeAtDistance ''- determines whether a particle system fades from a certain distance on&lt;br /&gt;
#''afFadeMinEnd ''- minimum distance at which the particle system stops fading&lt;br /&gt;
#''afFadeMinStart ''- minimum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxStart ''- maximum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxEnd ''- maximum distance at which the particle system stops fading&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DestroyParticleSystem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Destroys a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - The internal name of the particle system&lt;br /&gt;
&lt;br /&gt;
===Sounds &amp;amp; Music===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadSound(string &amp;amp;in asSoundFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile''  - The sound file to load (extension .snt optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayGuiSound(string &amp;amp;in asSoundFile, float afVolume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays a sound, not using 3D.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile ''- the sound to play (extension .snt/.ogg optional)&lt;br /&gt;
#''afVolume ''- the volume of the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaySoundAtEntity(string &amp;amp;in asSoundName, string &amp;amp;in asSoundFile, string &amp;amp;in asEntity, float afFadeTime, bool abSaveSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a sound at an entity.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''asSoundFile ''- the sound to use (extension .snt optional)&lt;br /&gt;
#''asEntity ''- the entity to create the sound at. Using &amp;quot;Player&amp;quot; is effectively the same as &amp;lt;code&amp;gt;PlayGuiSound&amp;lt;/code&amp;gt;, yet this function allows a looping sound to be saved&lt;br /&gt;
#''afFadeTime ''- time in seconds the sound needs to fade. Avoids enemies hearing the sound if afFadeTime is at least 0.1f&lt;br /&gt;
#''abSaveSound ''- if ''true'', a looping sound will &amp;quot;remember&amp;quot; its playback state (currently playing/stopped), and that state will be restored the next time the level is entered. If ''true'', the sound is never attached to the entity! Note that saving should only be used on ''looping sounds''!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeInSound(string &amp;amp;in asSoundName, float afFadeTime, bool abPlayStart);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades in a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds&lt;br /&gt;
#''abPlayStart ''- Play the sound defined in the &amp;lt;code&amp;gt;&amp;lt;Start&amp;gt;&amp;lt;/code&amp;gt; section of the .snt before playing the main sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopSound(string &amp;amp;in asSoundName, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades out a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds, use 0 to immediately stop the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayMusic(string &amp;amp;in asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays music.&lt;br /&gt;
&lt;br /&gt;
#''asMusicFile ''- the music file to play (extension .ogg optional)&lt;br /&gt;
#''abLoop ''- determines whether a music track should loop&lt;br /&gt;
#''afVolume ''- volume of the music&lt;br /&gt;
#''afFadeTime ''- time in seconds until music reaches full volume&lt;br /&gt;
#''alPrio ''- priority of the music. Note that only the music with the highest priority can be heard! 0 - lowest, 1 - higher, etc.&lt;br /&gt;
#''abResume''  - if ''true'', playback will be continued from where the track stopped after the call to &amp;lt;code&amp;gt;StopMusic()&amp;lt;/code&amp;gt;. If ''false'', the track will be restarted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopMusic(float afFadeTime, int alPrio);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops music.&lt;br /&gt;
&lt;br /&gt;
#''afFadeTime ''- time in seconds until music stops&lt;br /&gt;
#''alPrio ''- the priority of the music that should stop&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice(string &amp;amp;in asVoiceFile, string &amp;amp;in asEffectFile, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry,&lt;br /&gt;
bool abUsePosition, string &amp;amp;in asPosEntity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This adds a voice and an additional sound effect to be played. It is okay to call this many times in order to play many voices in a row. The EffectVoiceOverCallback is not called until ALL voices have finished.&lt;br /&gt;
&lt;br /&gt;
#''asVoiceFile ''- the voice to play&lt;br /&gt;
#''asEffectFile ''- the sound effect to play&lt;br /&gt;
#''asTextCat ''- the category in the .lang file, usually &amp;quot;Voice&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''abUsePosition ''- plays using 3D from the entity, or without 3D&lt;br /&gt;
#''asPosEntity ''- the entity at which the voice and sound are played from&lt;br /&gt;
#''afMinDistance ''- minimum distance the voice and sound are heard&lt;br /&gt;
#''afMaxDistance ''- maximum distance the voice and sound are heard&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopAllEffectVoices(float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all voices and calls the EffectVoiceOverCallback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEffectVoiceActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether EffectVoices are still active.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetEffectVoiceOverCallback(string &amp;amp;in asFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to be called when the EffectVoices are finished. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundVolume(float afDestVolume, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound volume, that means everything you can hear '''from the world'''. This does not affect music of GUI sounds.&lt;br /&gt;
&lt;br /&gt;
#''afDestVolume ''- desired volume&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired volume&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundSpeed(float afDestSpeed, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound speed.&lt;br /&gt;
&lt;br /&gt;
#''afDestSpeed ''- desired speed&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired speed&lt;br /&gt;
&lt;br /&gt;
===Lights===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightVisible(string &amp;amp;in asLightName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables lights.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''abVisible ''- determines the state of the light&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeLightTo(string &amp;amp;in asLightName, float afR, float afG, float afB, float afA, float afRadius, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the properties of a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''afRadius ''- radius of the light. -1 means keeping the radius&lt;br /&gt;
#''afTime ''- time in seconds until change is done&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightFlickerActive(string &amp;amp;in asLightName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates flickering on a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName'' - The internal light name&lt;br /&gt;
#''abActive'' - true = active, false = inactive&lt;br /&gt;
&lt;br /&gt;
==Game scripts==&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartCredits(string &amp;amp;in asMusic, bool abLoopMusic, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alEndNum);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts the end credits screen.&lt;br /&gt;
&lt;br /&gt;
#''asMusic ''- the music to play (including .ogg)&lt;br /&gt;
#''abLoopMusic ''- determines whether the music should loop&lt;br /&gt;
#''asTextCat ''- the category to be used in the .lang file, usually &amp;quot;Ending&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alEndNum ''- Amnesia has 3 different endings and displays a code at the bottom. Determines which code is displayed. 0-2 will display codes, any other integer will not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartDemoEnd();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shows the demo end screen. The background and UI elements are defined in demo.cfg, with the text using the entries in the &amp;quot;Demo&amp;quot; category of the .lang file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AutoSave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an auto save file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CheckPoint(string &amp;amp;in asName, string &amp;amp;in asStartPos, string &amp;amp;in asCallback, string &amp;amp;in asDeathHintCat, string &amp;amp;in asDeathHintEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a checkpoint at which the player will respawn in case he dies. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asName, int alCount)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;Count is 0 on the first checkpoint load!&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the editor&lt;br /&gt;
#''asCallback ''- the function to call when the player dies/respawns&lt;br /&gt;
#''asDeathHintCat ''- the category of the death hint message to be used in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asDeathHintEntry ''- the entry in the .lang file&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeMap(string &amp;amp;in asMapName, string &amp;amp;in asStartPos, string &amp;amp;in asStartSound, string &amp;amp;in asEndSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Loads another map after a 1.5 second fade out.&lt;br /&gt;
&lt;br /&gt;
#''asMapName ''- the file to load&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the next map&lt;br /&gt;
#''asStartSound ''- the sound that is played when the change starts&lt;br /&gt;
#''asEndSound ''- the sound that is played when the new map is loaded&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ClearSavedMaps();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the &amp;quot;history&amp;quot; of the save, useful to do when you know the player will not be able to go back anymore. Makes the next save much smaller in size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateDataCache();&lt;br /&gt;
void DestroyDataCache();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This caches all current textures and models and they are not released until destroy is called. If there is already cached data it is destroyed.&lt;br /&gt;
Create caches to enable faster loading when going back to a map. Destroy the cache if you know the player won't go back to that map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMapDisplayNameEntry(string &amp;amp;in asNameEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the map name shown in save file names. If none is set NULL is assumed.&lt;br /&gt;
&lt;br /&gt;
#''asNameEntry ''- the entry to display, category must be &amp;quot;Levels&amp;quot;!&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the skybox.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxTexture(string &amp;amp;in asTexture);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the texture of the skybox.&lt;br /&gt;
&lt;br /&gt;
#''asTexture''  - The texture file to set. Extension: .dds&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the solid color of the skybox rather than a texture.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the global fog.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the color to use for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogProperties(float afStart, float afEnd, float afFalloffExp, bool abCulling);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the properties for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afStart ''- how many meters from the camera should the fog begin&lt;br /&gt;
#''afEnd ''- how many meters from the camera should the fog reach full thickness&lt;br /&gt;
#''afFalloffExp ''- the amount by which the thinkness increases&lt;br /&gt;
#''abCulling ''- whether occlusion culling is active for the fog; this prevents objects behind the fog from being loaded&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetupLoadScreen(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alRandomNum, string &amp;amp;in asImageFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which loading screen will be shown when changing maps.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category of the loading text in the .lang file to be shown on the loading screen, usually &amp;quot;LoadingText&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alRandomNum ''- if greater 1, then it will randomize between 1 and alRandom for each LoadScreen giving entry the suffix XX (eg 01). If &amp;lt; =1 then no suffix is added&lt;br /&gt;
#''asImageFile ''- the image to be shown (optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void UnlockAchievement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlocks the specified achievement. Only able to be used for the ending achievements.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the achievement. Only the following strings are valid:&lt;br /&gt;
::* Benefactor&lt;br /&gt;
::* Survivor&lt;br /&gt;
::* Sacrifice&lt;br /&gt;
::* Quitter&lt;br /&gt;
::* Egotist&lt;br /&gt;
::* Altruist&lt;br /&gt;
::* Vacillator&lt;br /&gt;
&lt;br /&gt;
===Game Timer===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddTimer(string &amp;amp;in asName, float afTime, string &amp;amp;in asFunction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a timer which calls a function when it expires. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asTimer)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the name of the timer&lt;br /&gt;
#''afTime ''- time in seconds&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveTimer(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a timer, no matter how much time is left.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the timer.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetTimerTimeLeft(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the time left on a timer.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - the internal name of the timer.&lt;br /&gt;
&lt;br /&gt;
===Screen Effects===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeOut(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to black.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen is completly black&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeIn(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen back to normal.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeImageTrailTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies the image trail effect to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeSepiaColorTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the screen go dark red.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0) &lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeRadialBlurTo(float afSize, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies radial blur effects to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afSize ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetRadialBlurStartDist(float afStartDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines at which distance the radial blur effects appear.&lt;br /&gt;
&lt;br /&gt;
#''afStartDist ''- the distance at which the effect starts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectFlash(float afFadeIn, float afWhite, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white.&lt;br /&gt;
&lt;br /&gt;
#''afFadeIn ''- time in seconds until screen is white&lt;br /&gt;
#''afWhite ''- determines to which percentage the screen fades to white (1.0 = completly white)&lt;br /&gt;
#''afFadeOut ''- time in seconds until screen is back to normal again&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectEmotionFlash(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white and shows a text message.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''asSound ''- the sound to play while fading&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetFlashbackIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a flashback is still in effect.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerSpawnPS(string &amp;amp;in asSPSFile);&lt;br /&gt;
void StopPlayerSpawnPS();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Continuously spawn regular particle systems (''.ps'') around the player. Particles created by this script carry over from map to map.&lt;br /&gt;
&lt;br /&gt;
#''asSPSFile''  - the ''.sps''  file to use. Example ''.sps''  files are located in the ''/misc''  folder in the main game directory.&amp;lt;br&amp;gt;Custom ''.sps''  files can be created by hand in a text editor (see existing ones and mimic how those are written). &amp;lt;br /&amp;gt;Since ''StopPlayerSpawnPS()''  doesn't seem to work, to stop an SPS you must create an ''.sps''  file with an empty particle field field and override the old SPS by calling ''StartPlayerSpawnPS''  again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shakes the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity of the shake&lt;br /&gt;
#''afTime ''- duration of the shake&lt;br /&gt;
#''afFadeInTime ''- time in seconds until full intensity is reached&lt;br /&gt;
#''afFadeOutTime ''- time until screen is back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInDarknessEffectsActive(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the sanity drain and night vision effects while in the darkness.&lt;br /&gt;
&lt;br /&gt;
''bool abX''  - Enable/disable effects.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowScreenImage(string &amp;amp;in asImageName, float afX, float afY, float afScale, bool abUseRelativeCoordinates, float afDuration, float afFadeIn, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
Displays an image file directly onto the screen. See [[HPL2/Tutorials/ShowScreenImage()|ShowScreenImage()]] in the tutorials section for more information.&lt;br /&gt;
&lt;br /&gt;
# ''asImageName'' - The image file to render (.jpg, .png, .tga, .dds)&lt;br /&gt;
# ''afX'' - The X position of the image&lt;br /&gt;
# ''afY'' - The Y position of the image&lt;br /&gt;
# ''afScale'' - The size of the image in pixels (not scale), or original image size if negative&lt;br /&gt;
# ''abUseRelativeCoordinates'' - Whether X and Y are relative to the screen resoltion, or pixel co-ordinates if not&lt;br /&gt;
# ''afDuration'' - The duration that the image is displayed for&lt;br /&gt;
# ''afFadeIn'' - The time, in seconds, to fade in the image&lt;br /&gt;
# ''afFadeOut'' - The time, in seconds, to fade out the image&lt;br /&gt;
&lt;br /&gt;
===Insanity===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInsanitySetEnabled(string &amp;amp;in asSet, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which InsanitySets are enabled.&lt;br /&gt;
&lt;br /&gt;
#''asSet ''- the set&lt;br /&gt;
#''abX ''- enabled or not&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartInsanityEvent(string &amp;amp;in asEventName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Starts a specified insanity event.&lt;br /&gt;
&lt;br /&gt;
#''asEventName ''- Insanity event to play.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartRandomInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts a random insanity event from the available sets.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopCurrentInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Stops the currently playing insanity event.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void InsanityEventIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an insanity event is currently in effect.&amp;lt;br&amp;gt;Not useful at all due to having a return type of &amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; when it should be &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Player===&lt;br /&gt;
&lt;br /&gt;
Note that the player's maximum health and sanity is 100.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enabled/Disable player controlled movement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangePlayerStateToNormal();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets the player's state, forcing them to stop interacting with objects. It also clears the inventory item to be used (as if it was double-clicked on in the inventory again) and dismounts the player from ladders.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerCrouching(bool abCrouch);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddPlayerBodyForce(float afX, float afY, float afZ, bool abUseLocalCoords);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pushes the player into a certain direction. Note that you need values above ~2000 to see any effects.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- amount along the X-axis&lt;br /&gt;
#''afY ''- amount along the Y-axis&lt;br /&gt;
#''afZ ''- amount along the Z-axis&lt;br /&gt;
#''abUseLocalCoords ''- If true, axes are based on where the player is facing, not the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowPlayerCrossHairIcons(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the icons when a player has something in focus.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerSanity(float afSanity);&lt;br /&gt;
void AddPlayerSanity(float afSanity);&lt;br /&gt;
float GetPlayerSanity();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerHealth(float afHealth);&lt;br /&gt;
void AddPlayerHealth(float afHealth);&lt;br /&gt;
float GetPlayerHealth();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerLampOil(float afOil);&lt;br /&gt;
void AddPlayerLampOil(float afOil);&lt;br /&gt;
float GetPlayerLampOil();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the lamp oil of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerSpeed();&lt;br /&gt;
float GetPlayerYSpeed();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current speed of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSanityDrainDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables sanity drain from darkness.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoost();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a large amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! New Sanity&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || 100&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || 90&lt;br /&gt;
|-&lt;br /&gt;
| 50-74 || 80&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoostSmall();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a small amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! Sanity Bonus&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || +20&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || +15&lt;br /&gt;
|-&lt;br /&gt;
| 50-75 || +10&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityDamage(float afAmount, bool abUseEffect);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- amount of sanity damage done&lt;br /&gt;
#''abUseEffect ''- determines whether an effect is played when the sanity damage is dealt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GivePlayerDamage(float afAmount, string &amp;amp;in asType, bool abSpinHead, bool abLethal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the health of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- amount of damage done to health&lt;br /&gt;
#''asType ''- plays a certain effect on the screen when the damage is dealt (BloodSplat, Claws, or Slash) &lt;br /&gt;
#''abSpinHead ''- changes the camera view when damage is dealt&lt;br /&gt;
#''abLethal ''- set to true if player can die from given damage. If ''false'' and the damage would have left the player with less than 10 health, health is set to 10.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerFOVMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the field of view of the player. A shorter FOV will create a zoom effect.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- multiplier of default FOV (1 is default)&lt;br /&gt;
#''afSpeed ''- the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerAspectMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the aspect ratio of the player. Basically stretches or narrows the screen horizontally.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- multiplier of default aspect (default is 1)&lt;br /&gt;
#''afSpeed ''- the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- angle of rotation of head, positive being counter-clockwise&lt;br /&gt;
#''afSpeedMul ''- speed (possibly acceleration) multiplier of the rotation (default 1, which is really slow)&lt;br /&gt;
#''afMaxSpeed ''- maximum speed of rotation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerForward(float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Moves the player forward. It needs to be called in a timer that updates 60 times / second.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- amount along the X-axis&lt;br /&gt;
#''afY ''- amount along the Y-axis&lt;br /&gt;
#''afZ ''- amount along the Z-axis&lt;br /&gt;
#''afSpeed ''- speed at which the change happens&lt;br /&gt;
#''afSlowDownDist ''- distance at which to start slowing down (prevents the head from abruptly stopping)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerLookAt(string &amp;amp;in asEntityName, float afSpeedMul, float afMaxSpeed, string &amp;amp;in asAtTargetCallback);&lt;br /&gt;
void StopPlayerLookAt();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to look at a certain entity until StopPlayerLookAt is used.&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- the entity to look at &lt;br /&gt;
#''afSpeedMul ''- how fast should the player look at the entity&lt;br /&gt;
#''afMaxSpeed ''- maximum speed allowed&lt;br /&gt;
#''asAtTargetCallback ''- function to call when player looks at target&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerMoveSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerRunSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerLookSpeedMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the player's move/run/look speed. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpForceMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the player's jump multiplier. Higher values = higher jumps. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpDisabled(bool abX);&lt;br /&gt;
void SetPlayerCrouchDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to jump/crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportPlayer(string &amp;amp;in asStartPosName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly teleports the player to the target StartPos.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternActive(bool abX, bool abUseEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the player use his lantern.&lt;br /&gt;
&lt;br /&gt;
# ''abX'' - Set lantern to be active (true) or inactive (false)&lt;br /&gt;
# ''abUseEffects'' - Play on/off sounds&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetLanternActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player currently uses his lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to use his lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternLitCallback(string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to call when the player uses his lantern. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;MyFunc(bool abLit)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message on the screen.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTime ''- determines how long the message is displayed. If time is &amp;lt; =0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetDeathHint(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the message that appears when the player dies.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DisableDeathStartSound();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the death sound when the player dies. This must be called directly before player is killed! The variable as soon as player dies too.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPermaDeathSound(string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Sets the sound played after the player dies when permadeath is active. Permadeath is only active when the game is launched with the &amp;lt;code&amp;gt;ptest&amp;lt;/code&amp;gt; command line parameter. Only used for the post-death Suitor lines in ''Justine''.&lt;br /&gt;
&lt;br /&gt;
#''asSound'' - The sound to be played after death. Expects a voice-type sound.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerFallDamageDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the player's ability to take fall damage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPos(float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the player's position within the level.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - X co-ordinate position.&lt;br /&gt;
#''afY''  - Y co-ordinate position.&lt;br /&gt;
#''afZ''  - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerPosX();&lt;br /&gt;
float GetPlayerPosY();&lt;br /&gt;
float GetPlayerPosZ();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the player's position within the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
===Journal===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddNote(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a note to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _Name and _Text and be in category &amp;quot;Journal&amp;quot;!&lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDiary(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a diary to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _NameX and _TextY whereas X and Y are numbers of the parts (_Name1: first diary, _Text1: first page) and be in category &amp;quot;Journal&amp;quot;! &lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ReturnOpenJournal(bool abOpenJournal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Only called in the pickup diary callback! If true the journal displays the entry else not.&lt;br /&gt;
&lt;br /&gt;
===Quests===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a quest to the player's journal under mementos. Completed quests cannot be readded.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name to be used&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot;Quest_&amp;lt;texthere&amp;gt;_Text”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CompleteQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Completes a quest. If the quest has not been added, it's marked as complete anyway, preventing it from being added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot; Quest_&amp;lt;texthere&amp;gt;_Text ”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool QuestIsCompleted(string &amp;amp;in asName);&lt;br /&gt;
bool QuestIsAdded(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a quest is completed/added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetNumberOfQuestsInMap(int alNumberOfQuests);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the number of quests in the map. Obsolete; formerly used to calculate a completion percentage when looking at a level door.&lt;br /&gt;
&lt;br /&gt;
#''alNumberOfQuests ''- Amount of quests&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveHint(string &amp;amp;in asName, string &amp;amp;in asMessageCat, string &amp;amp;in asMessageEntry, float afTimeShown);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a hint on the player's screen.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asMessageCat ''- the category in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asMessageEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTimeShown ''- time in seconds until the message disappears. If time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void BlockHint(string &amp;amp;in asName);&lt;br /&gt;
void UnBlockHint(string &amp;amp;in asName);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Blocking a hint prevents it from being shown. Blocked hints are included in savefiles, so they should persist between levels. Unblocking a hint allows it to be shown.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; blocks the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveHint(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes the hint from the list of already shown hints, allowing it to appear again.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; reenables the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
===Inventory===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ExitInventory();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Exits the inventory by force.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the player's ability to open his inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a message on the inventory screen. Used for feedback messages when failing to combine items.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory ''- the category in the .lang file, usually &amp;quot;Inventory&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTime ''- time in seconds until the message disappears. If life time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItem(string &amp;amp;in asName, string &amp;amp;in asType, string &amp;amp;in asSubTypeName, string &amp;amp;in asImageName, float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds an item to the inventory of the player. Note that the item does not have to exist as entity in the world to be able to do this.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asType ''- item type to give, Available types are:&lt;br /&gt;
::*Puzzle&lt;br /&gt;
::*Lantern&lt;br /&gt;
::*Health&lt;br /&gt;
::*Sanity&lt;br /&gt;
::*LampOil&lt;br /&gt;
::*Tinderbox&lt;br /&gt;
#''asSubTypeName ''- item name for .lang file&lt;br /&gt;
#''asImageName ''- the image which will appear in inventory. For example: &amp;lt;code&amp;gt;void GiveItem(&amp;quot;chemical_container_full_1&amp;quot;, &amp;quot;Puzzle&amp;quot;, &amp;quot;chemical_container_full&amp;quot;, &amp;quot;chemical_container_full.tga&amp;quot;, 1);&amp;lt;/code&amp;gt; will use the image from &amp;lt;code&amp;gt;graphics/item/chemical_container_full.tga&amp;lt;/code&amp;gt; &lt;br /&gt;
#''afAmount ''- amount the item gives, - For example: Oil potions will fill the oil meter by this amount, Health potions will heal by this amount, etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item from the player's inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool HasItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player has an item in his inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItemFromFile(string &amp;amp;in asName, string &amp;amp;in asFileName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a single item to the player's inventory. This is meant to be used for debug mostly as it creates the actual item and then destroys it.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asFileName ''- item to give + extension (.ent)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddCombineCallback(string &amp;amp;in asName, string &amp;amp;in asItemA, string &amp;amp;in asItemB, string &amp;amp;in asFunction, bool abAutoRemove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to combine items in his inventory. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItemA, string &amp;amp;in asItemB)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name for the callback&lt;br /&gt;
#''asItemA ''- internal name of first item&lt;br /&gt;
#''asItemB ''- internal name of second item&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
#''abAutoRemove ''- determines whether the callback should be removed when the items are combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveCombineCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a combine callback.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the callback to be removed (as specified in AddCombineCallback)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddUseItemCallback(string &amp;amp;in asName, string &amp;amp;in asItem, string &amp;amp;in asEntity, string &amp;amp;in asFunction, bool abAutoDestroy);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to use items on the world. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItem, string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
#''asItem ''- internal name of the item&lt;br /&gt;
#''asEntity ''- entity to be able to use the item on&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abAutoDestroy ''- determines whether the callback should be removed when the item is used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveUseItemCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item callback.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
&lt;br /&gt;
===Entities===&lt;br /&gt;
&lt;br /&gt;
====General====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityActive(string &amp;amp;in asName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityVisible(string &amp;amp;in asName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity's visual mesh. The collision body remains.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the entity.&lt;br /&gt;
#''abActive''  - Activate/deactivate mesh.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntityExists(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an entity exists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCustomFocusCrossHair(string &amp;amp;in asName, string&amp;amp; asCrossHair);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the crosshair that is used when focusing an entity.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCrossHair ''- desired crosshair, can be: &lt;br /&gt;
::*Default (no crosshair)&lt;br /&gt;
::*Grab&lt;br /&gt;
::*Push&lt;br /&gt;
::*Ignite&lt;br /&gt;
::*Pick&lt;br /&gt;
::*LevelDoor&lt;br /&gt;
::*Ladder&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void CreateEntityAtArea(string &amp;amp;in asEntityName, string &amp;amp;in asEntityFile, string &amp;amp;in asAreaName, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an entity at an area. When creating an enemy though, it cannot chase properly along PathNodes (using for example &amp;lt;code&amp;gt;ShowEnemyPlayerPosition&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- internal name&lt;br /&gt;
#''asEntityFile ''- entity to be used extension .ent&lt;br /&gt;
#''asAreaName ''- the area to create the entity at&lt;br /&gt;
#''abFullGameSave ''- determines whether an entity &amp;quot;remembers&amp;quot; its state&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ReplaceEntity(string &amp;amp;in asName, string &amp;amp;in asBodyName, string &amp;amp;in asNewEntityName, string &amp;amp;in asNewEntityFile, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Removes an entity and places a new one in its place.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to replace.&lt;br /&gt;
#''asBodyName'' - Name of the body of the entity to place the new entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''asNewEntityName'' - Name of the new entity.&lt;br /&gt;
#''asNewEntityFile'' - Name of the new entity file. Extension .ent. &lt;br /&gt;
#''abFullGameSave'' - Whether ALL properties of this entity should be saved throughout levels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaceEntityAtEntity(string &amp;amp;in asName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBodyName, bool abUseRotation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Places an entity at the position of another entity. Does not work for enemies, use TeleportEnemyToEntity instead.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to place.&lt;br /&gt;
#''asTargetEntity'' - Name of the other entity to place the first entity at.&lt;br /&gt;
#''asTargetBodyName'' - Name of the body of the entity to place the first entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''abUseRotation'' - Whether the entity should be rotated like the target entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPos(string &amp;amp;in asName, float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Moves an entity to a position in the level.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to move.&lt;br /&gt;
#''afX'' - X co-ordinate position.&lt;br /&gt;
#''afY'' - Y co-ordinate position.&lt;br /&gt;
#''afZ'' - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetEntityPosX(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosY(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosZ(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns an entity's position in the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerLookAtCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveWhenLookedAt);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player looks at a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = looking, -1 = not looking&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveWhenLookedAt ''- determines whether the callback should be removed when the player looked at the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerInteractCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveOnInteraction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player interacts with a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveOnInteraction ''- determines whether the callback should be removed when the player interacts with the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCallbackFunc(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when certain events occur with an entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, string &amp;amp;in asType)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;asType&amp;lt;/code&amp;gt; values depend on entity type:&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! asType Value&lt;br /&gt;
|-&lt;br /&gt;
| Object || Break&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || OnIgnite&lt;br /&gt;
|-&lt;br /&gt;
| Item || OnPickup&lt;br /&gt;
|-&lt;br /&gt;
| Enemy || OnDeath&lt;br /&gt;
|-&lt;br /&gt;
| Enemy_Grunt&amp;lt;br&amp;gt;Enemy_Manpig || OnAutoDisabled&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityConnectionStateChangeCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A callback called when ever the connection state changes (button being switched on, lever switched, etc). &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void Func(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: -1 = off, 0 = between, 1 = on&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityInteractionDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disallows interaction with an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void BreakJoint (string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Breaks a joint. Do not use this on joints in SwingDoors, Levers, Wheels, etc. where the joint is part of an interaction. That will make the game crash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void AddEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName, string &amp;amp;in asFunction, bool abDeleteOnCollide, int alStates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when two entities collide. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asParent, string &amp;amp;in asChild, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = enter, -1 = leave&lt;br /&gt;
&lt;br /&gt;
#''asParentName ''- internal name of main object&lt;br /&gt;
#''asChildName ''- internal name of object that collides with main object (asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) NOT supported!)&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abDeleteOnCollide ''- determines whether the callback after it was called&lt;br /&gt;
#''alStates ''- 1 = only enter, -1 = only leave, 0 = both&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an EntityCollideCallback. Asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) not supported in ''asChildName''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntitiesCollide(string &amp;amp;in asEntityA, string &amp;amp;in asEntityB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether two entities collide. This function does NOT support asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) or &amp;quot;Player&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetBodyMass(string &amp;amp;in asName, float afMass);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName.&lt;br /&gt;
#''afMass''  - The mass to set.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetBodyMass(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName. &lt;br /&gt;
#''afMass''  - The mass to get.&lt;br /&gt;
&lt;br /&gt;
====Props====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropEffectActive(string &amp;amp;in asName, bool abActive, bool abFadeAndPlaySounds);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Can be used on coal to give it the black color it should have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropActiveAndFade(string &amp;amp;in asName, bool abActive, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates a prop.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''abActive ''- nothing to add&lt;br /&gt;
#''afFadeTime ''- time in seconds until prop fully fades&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropStaticPhysics(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates the physics of a prop, setting the mass to 0. Setting as true will make entities static in midair.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetPropIsInteractedWith(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a prop is interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RotatePropToSpeed(string &amp;amp;in asName, float afAcc, float afGoalSpeed, float afAxisX, float afAxisY, float afAxisZ, bool abResetSpeed, string &amp;amp;in asOffsetArea);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the prop up to a set speed.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afGoalSpeed ''- desired speed &lt;br /&gt;
#''afAxisX ''- rotation around X axis&lt;br /&gt;
#''afAxisY ''- rotation around Y axis&lt;br /&gt;
#''afAxisZ ''- rotation around Z axis&lt;br /&gt;
#''abResetSpeed ''- determines whether the speed is resetted after goal speed is reached&lt;br /&gt;
#''asOffsetArea ''- the area to rotate around, if empty, then the center of the body is used Note: The entity you want to rotate MUST be a &amp;quot;StaticObject&amp;quot; entity!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void StopPropMovement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all movement of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddAttachedPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop.&lt;br /&gt;
&lt;br /&gt;
#''asPropName''- the prop to attach another prop at &lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop&lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
{{bug|''afRotZ '' is used for both the ZX rotation and the Z position of the attached prop. Unwanted rotation can be avoided by using: &amp;lt;br /&amp;gt;''AddAttachedPropToProp(asPropName, asAttachName, asAttachFile, afPosX, afPosY, '''0''', afPosZ, '''90.0f''', afPosZ)''}}&lt;br /&gt;
&lt;br /&gt;
{{bug|Attaching a breakable prop to a physically active prop, and then breaking the attached prop, will cause the game to crash, should the parent object be moved or reset.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop. Fixed version of &amp;lt;code&amp;gt;AddAttachedPropToProp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
#''asPropName ''- the prop to attach another prop at&lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop &lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveAttachedPropFromProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches a prop from a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
void AddPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
float GetPropHealth(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ResetProp(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets a prop's state to the original one when the map was loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void PlayPropAnimation(string &amp;amp;in asProp, string &amp;amp;in asAnimation, float afFadeTime, bool abLoop, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the prop play an animation and calls a function. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asProp)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asProp ''- internal name of the prop&lt;br /&gt;
#''asAnimation ''- animation to play&lt;br /&gt;
#''afFadeTime ''- Fade time between current and new animations&lt;br /&gt;
#''abLoop ''- determines whether the animation loops &lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddPropForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddPropImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These functions push objects. Note that rather high values are needed when applying ''forces''  (on the order of ~100 (weak) to ~10000 (strong)), but not impulses (values less than 10 can be appropriate). Forces are external influences, and will have different effect depending on the mass of the object they are being applied to; impulses disregard mass, and can cause objects to break, as if hit. A &amp;quot;Body&amp;quot; is a physics-related helper object, to which a force or an impulse can be applied. Entities can consist of several bodies, interconnected in various ways (you can create/examine bodies in the model editor).&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the object to push; for bodies, use this format: &amp;quot;''entityName''_''bodyName''&amp;quot;&lt;br /&gt;
#''afX ''- magnitude along the X-axis&lt;br /&gt;
#''afY ''- magnitude along the Y-axis&lt;br /&gt;
#''afZ ''- magnitude along the Z-axis&lt;br /&gt;
#''asCoordSystem ''- determines which coordinate system is used, &amp;quot;local&amp;quot; or &amp;quot;world&amp;quot;&lt;br /&gt;
&lt;br /&gt;
All of these functions are ''additive''  - when called consecutively, for each call, the vectors defined by (afX, afY, afZ) will be added together, and a resultant force/impulse will be calculated ''before''  any physics simulation is applied to the target object.&lt;br /&gt;
&lt;br /&gt;
====Connections====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithRope(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asRopeName, bool abInteractOnly, float afSpeedMul, float afToMinSpeed, float afToMaxSpeed, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects a prop with the movement of a rope (i.e. turn a wheel to move a rope). For Levers, the rope only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName''- The name of the connection&lt;br /&gt;
#''asPropName'' - The name of the prop; can be a Lever or Wheel&lt;br /&gt;
#''asRopeName'' - The name of the rope&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''afSpeedMul'' - Speed multiplier of how quickly the rope moves&lt;br /&gt;
#''afToMinSpeed'' - The slowest the rope can move&lt;br /&gt;
#''afToMaxSpeed'' - The fastest the rope can move&lt;br /&gt;
#''abInvert'' - Whether to invert the direction the rope moves&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithMoveObject(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asMoveObjectName, bool abInteractOnly, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This one should only be used if there must be an exact correspondence to prop &amp;quot;amount&amp;quot; and the MoveObject open amount. It is best used for Wheel-door connections, where the MoveObject moves continuously along with the Wheel. For Levers, the MoveObject only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asPropName'' - The entity that controls the movement; can be a Lever or Wheel&lt;br /&gt;
#''asMoveObject'' - The MoveObject to move&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''abInvert'' - If the state is inverted, making the MoveObject move in the opposite direction&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ConnectEntities(string &amp;amp;in asName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, bool abInvertStateSent, int alStatesUsed, string &amp;amp;in asCallbackFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects two entities together so that changing the state of the main entity changes the state of the connected entity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! Max State (1) !! Min State (-1)&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || Lit || Unlit&lt;br /&gt;
|-&lt;br /&gt;
| MoveObject || Open || Close&lt;br /&gt;
|-&lt;br /&gt;
| SwingDoor&lt;br /&gt;
|rowspan=2| Locked&lt;br /&gt;
|rowspan=2| Unlocked&lt;br /&gt;
|-&lt;br /&gt;
| Chest&lt;br /&gt;
|-&lt;br /&gt;
| Button || Switched on || Switched off&lt;br /&gt;
|-&lt;br /&gt;
| Lever&lt;br /&gt;
|rowspan=2| Unstuck&lt;br /&gt;
|rowspan=2| Stuck (at min)&lt;br /&gt;
|-&lt;br /&gt;
| Wheel&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asMainEntity'' - The entity that causes the change; can be a Lever, Wheel, Button, or Photocell&lt;br /&gt;
#''asConnectEntity'' - The entity that is affected by the change&lt;br /&gt;
#''abInvertStateSent'' - If the state is inverted, making the connected entity change to the opposite state&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
#''asCallbackFunc'' - The name of the connection callback&lt;br /&gt;
&lt;br /&gt;
Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asConnectionName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, int alState)&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;alState is what is sent to connection entity and will be inverted if abInvertStateSent = true!&lt;br /&gt;
&lt;br /&gt;
====Lamps====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLampLit(string &amp;amp;in asName, bool abLit, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Turns a lamp on or off.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the lamp&lt;br /&gt;
#''abLit ''- Set true if you want the lamp to be lit, set to false if you want the lamp to be unlit&lt;br /&gt;
#''abEffects ''- If you want to have the lamp fade in/out when it gets lit/unlit&lt;br /&gt;
&lt;br /&gt;
====Doors====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorLocked(string &amp;amp;in asName, bool abLocked, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abLocked'' - Locked/unlocked&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is locked/unlocked&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorClosed(string &amp;amp;in asName, bool abClosed, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abClosed'' - Closed/open&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is closed/opened&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
bool GetSwingDoorLocked(string &amp;amp;in asName);&lt;br /&gt;
bool GetSwingDoorClosed(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a swing door is locked/closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorDisableAutoClose(string &amp;amp;in asName, bool abDisableAutoClose);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deactivates the &amp;quot;auto-close&amp;quot; when a door is nearly closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetSwingDoorState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns an integer depending on how far the door is opened. &amp;lt;br /&amp;gt;-1 = angle is close to 0°, 1 = angle is 70% or higher of max, 0 = inbetween -1 and 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLocked(string &amp;amp;in asName, bool abLocked);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a level door. Note that level doors are NOT swing doors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedSound(string &amp;amp;in asName, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which sound is played when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedText(string &amp;amp;in asName, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectState(string &amp;amp;in asName, float afState);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween (and above, for example, the bridge_metal_vert) are valid too!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectStateExt(string &amp;amp;in asName, float afState, float afAcc, float afMaxSpeed, float afSlowdownDist, bool abResetSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state, extended method.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween are valid too!&lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afMaxSpeed ''- maximum speed&lt;br /&gt;
#''afSlowdownDist ''- Distance to the target state before deceleration occurs.&lt;br /&gt;
#''abResetSpeed ''- Set to ''true'' if the prop's speed should be reset before performing the movement, else the prop will accelerate from its current speed to afMaxSpeed.&lt;br /&gt;
&lt;br /&gt;
====Levers, wheels and buttons====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropObjectStuckState(string &amp;amp;in asName, int alState);&lt;br /&gt;
void SetWheelStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
void SetLeverStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes a prop&amp;lt;nowiki&amp;gt;\&amp;lt;/nowiki&amp;gt;wheel&amp;lt;nowiki&amp;gt;\&amp;lt;/nowiki&amp;gt;lever stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''alState ''- 0 = not stuck, 1 = at max, -1 = at min &lt;br /&gt;
#''abEffects ''- use effects&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelAngle(string &amp;amp;in asName, float afAngle, bool abAutoMove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves a wheel to a certain angle.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''afAngle ''- angle&lt;br /&gt;
#''abAutoMove ''- determines whether the wheel should move on its own&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
void SetLeverInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to make a wheel/lever unstuck when interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetLeverState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the state of the lever. &amp;lt;br /&amp;gt;0 = not stuck, 1 = at max, -1 = at min&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderStuckState(string &amp;amp;in asName, int alStuckState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes a MultiSlider stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when state changes. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetButtonSwitchedOn(string &amp;amp;in asName, bool abSwitchedOn, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Sticky areas====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetAllowStickyAreaAttachment(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows entities to stick to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asProp);&lt;br /&gt;
void AttachBodyToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asBody);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop/body to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void DetachFromStickyArea(string &amp;amp;in asAreaName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches everything from a StickyArea.&lt;br /&gt;
&lt;br /&gt;
====NPCs====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCAwake(string &amp;amp;in asName, bool abAwake, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wakes/sleeps a NPC.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the NPC&lt;br /&gt;
#''abAwake'' - ''true'' to awaken, ''false'' to sleep&lt;br /&gt;
#''abEffects'' - Play the &amp;quot;Awake&amp;quot; or &amp;quot;Sleep&amp;quot; animations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCFollowPlayer(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a NPC's head to follow the player's movements.&lt;br /&gt;
&lt;br /&gt;
====Enemies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables an enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyIsHallucination(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes an enemy a hallucination. Hallucinations fade to smoke when they get near the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void FadeEnemyToSmoke(string &amp;amp;in asName, bool abPlaySound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly fades an enemy to smoke.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ShowEnemyPlayerPosition(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the enemy run to the player, no matter where he is.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AlertEnemyOfPlayerPresence(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gives the specified enemy the player's current position and makes it search the area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisableTriggers(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables or disables enemy triggers. If disabled, enemy will not react to player or attack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddEnemyPatrolNode(string &amp;amp;in asName, string &amp;amp;in asNodeName, float afWaitTime, string &amp;amp;in asAnimation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a patrol node to the enemy's path.&lt;br /&gt;
&lt;br /&gt;
#''asName''- Internal name of the enemy &lt;br /&gt;
#''asNodeName'' - Path node &lt;br /&gt;
#''afWaitTime'' - Time in seconds that the enemy waits at the path node before continuing. If 0, randomized between 1-3.&lt;br /&gt;
#''asAnimation'' - The animation the enemy uses when reaching the path node&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ClearEnemyPatrolNodes(string &amp;amp;in asEnemyName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the current path of patrol nodes of the enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemySanityDecreaseActive(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether an enemy activates the player's sanity drain when stared at.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy &lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToNode(string &amp;amp;in asEnemyName, string &amp;amp;in asNodeName, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific PathNode.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asNodeName'' - Internal name of the node to teleport to &lt;br /&gt;
#''abChangeY'' - Whether the Y position of the node will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToEntity(string &amp;amp;in asEnemyName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBody, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific entity.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asTargetEntity'' - Internal name of the entity to teleport to&lt;br /&gt;
#''asTargetBody'' - Internal name of the entity's body name to teleport to. If empty, the first body will be used (might be unstable, recommended to input a body anyway)&lt;br /&gt;
#''abChangeY'' - Whether the Y position of the node will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeManPigPose(string &amp;amp;in asName, string &amp;amp;in asPoseType);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the pose a specified ManPig.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''asPoseType'' - Name of the ManPig pose to use. Can be &amp;quot;Biped&amp;quot; or &amp;quot;Quadruped&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigFadeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should fade the player's view in and out.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigSoundDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should play the proximity sounds.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigEasyEscapeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should be easier to escape from when hunted. If not disabled, easy escape is activated if the player is more than 12.35 meters away, the enemy can't see the player, and the player has less than 75 health. When this occurs, the enemy is forced to stop hunting and wait for half a second.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ForceTeslaPigSighting(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Forces a Tesla ManPig to be visible for a short time.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; GetEnemyStateName(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the name of the state a specified enemy is current in.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
Possible states for all enemies:&lt;br /&gt;
*Idle&lt;br /&gt;
*Wait&lt;br /&gt;
*Patrol&lt;br /&gt;
*Investigate&lt;br /&gt;
*Alert&lt;br /&gt;
*Search&lt;br /&gt;
*Hurt&lt;br /&gt;
*Hunt&lt;br /&gt;
*HuntPause&lt;br /&gt;
*HuntWander&lt;br /&gt;
*AttackMeleeShort&lt;br /&gt;
*AttackMeleeLong&lt;br /&gt;
*BreakDoor&lt;br /&gt;
*Dead&lt;br /&gt;
&lt;br /&gt;
Waterlurker-only states:&lt;br /&gt;
*GoHome&lt;br /&gt;
*Eat&lt;br /&gt;
&lt;br /&gt;
ManPig-only states: &lt;br /&gt;
*Flee&lt;br /&gt;
*Stalk&lt;br /&gt;
*Track&lt;br /&gt;
&lt;br /&gt;
Unused states:&lt;br /&gt;
*AttackRange&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/TDD/Change_Custom_Story_into_Full_Conversion_Mod&amp;diff=7003</id>
		<title>HPL2/TDD/Change Custom Story into Full Conversion Mod</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/TDD/Change_Custom_Story_into_Full_Conversion_Mod&amp;diff=7003"/>
		<updated>2025-01-19T22:47:34Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{constructionNotice|This page is still being written and is currently incomplete}}&lt;br /&gt;
&lt;br /&gt;
Since version 1.5 of Amnesia The Dark Descent (release in July 2023), a new field has been added to the custom_story_settings.cfg file. This field allows you to specify a main_init.cfg file, which is the main file that full conversion mods use to launch. This means you can now create full conversion mods from a custom story, and they will still show up in the main game menu. This unlocks all the power of full conversion mods, while maintaining most of the simplicity of a custom story.&lt;br /&gt;
&lt;br /&gt;
If you have a custom story that you want to transform into a full conversion mod, start by adding the new field to your custom_story_settings.cfg:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;Main&lt;br /&gt;
  Name = &amp;quot;My story&amp;quot;&lt;br /&gt;
  Author = &amp;quot;Me&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  ...&lt;br /&gt;
&lt;br /&gt;
  InitCfgFile = &amp;quot;config/main_init.cfg&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Specifying this field will disable &amp;lt;code&amp;gt;MapsFolder&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StartMap&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;StartPos&amp;lt;/code&amp;gt;, as these fields will instead be read from the main_init.cfg file. It will also disable &amp;lt;code&amp;gt;ExtraLangFilePrefix&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;DefaultExtraLangFile&amp;lt;/code&amp;gt;, as the game will instead use the primary lang files specified in main_init.cfg. The description of your custom story will instead be located in said lang file, in the &amp;lt;code&amp;gt;CustomStoryMain&amp;lt;/code&amp;gt; category.&lt;br /&gt;
&lt;br /&gt;
From this point on, you can follow tutorials for full conversion mods. Your mod folder will remain &amp;lt;code&amp;gt;custom_stories/&amp;lt;your story&amp;gt;&amp;lt;/code&amp;gt;. For example, if your story folder is named &amp;quot;Ascent&amp;quot;, your main init file should exist at &amp;lt;code&amp;gt;custom_stories/Ascent/config/main_init.cfg&amp;lt;/code&amp;gt; (reflecting what you put in the &amp;lt;code&amp;gt;InitCfgFile&amp;lt;/code&amp;gt; above). Create the &amp;quot;config&amp;quot; folder and the &amp;quot;main_init.cfg&amp;quot; file. The contents of your main_init.cfg file can start as such (Remember to change the references to &amp;quot;Ascent&amp;quot; to reflect your own mod, such as MainSaveFolder and GameName):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;ConfigFiles&lt;br /&gt;
	Resources = &amp;quot;resources.cfg&amp;quot;&lt;br /&gt;
	Materials = &amp;quot;materials.cfg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	Game	= &amp;quot;config/game.cfg&amp;quot;&lt;br /&gt;
	Menu	= &amp;quot;config/menu.cfg&amp;quot;&lt;br /&gt;
	PreMenu	= &amp;quot;config/pre_menu.cfg&amp;quot;&lt;br /&gt;
	Demo	= &amp;quot;config/demo.cfg&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	DefaultMainSettings	= &amp;quot;config/default_main_settings.cfg&amp;quot;&lt;br /&gt;
	DefaultMainSettingsSDL2	= &amp;quot;config/default_main_settings_sdl2.cfg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	DefaultMainSettingsLow		= &amp;quot;launcher/default_main_settings_low.cfg&amp;quot;&lt;br /&gt;
	DefaultMainSettingsMedium	= &amp;quot;launcher/default_main_settings_medium.cfg&amp;quot;&lt;br /&gt;
	DefaultMainSettingsHigh		= &amp;quot;launcher/default_main_settings_high.cfg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	DefaultUserSettings	= &amp;quot;config/default_user_settings.cfg&amp;quot;&lt;br /&gt;
	DefaultUserKeys		= &amp;quot;config/default_user_keys.cfg&amp;quot;&lt;br /&gt;
	DefaultUserKeysSDL2	= &amp;quot;config/default_user_keys_sdl2.cfg&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	DefaultBaseLanguage	= &amp;quot;base_english.lang&amp;quot;&lt;br /&gt;
	DefaultGameLanguage	= &amp;quot;english.lang&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Directories&lt;br /&gt;
	MainSaveFolder 	 	 = &amp;quot;Ascent&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	BaseLanguageFolder 	 = &amp;quot;config/&amp;quot;&lt;br /&gt;
	GameLanguageFolder 	 = &amp;quot;config/lang_main/&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	CustomStoryPath 	 = &amp;quot;custom_stories&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Variables&lt;br /&gt;
	GameName = &amp;quot;Ascent, an Amnesia mod&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;StartMap&lt;br /&gt;
	File	= &amp;quot;level_01.map&amp;quot;&lt;br /&gt;
	Folder	= &amp;quot;maps/&amp;quot;&lt;br /&gt;
	Pos	= &amp;quot;PlayerStartArea_1&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: Paths specified in this file are relative paths starting from the custom story's main folder, eg: &amp;quot;custom_stories/Ascent&amp;quot;. For example, leaving Resources as &amp;quot;resources.cfg&amp;quot; means it should exist at &amp;quot;custom_stories/Ascent/resources.cfg&amp;quot;. If a file is not found here, it will fall back to using the file specified in the base game main_init.cfg.&lt;br /&gt;
&lt;br /&gt;
'''resources.cfg is required for your full conversion to load any files contained in your custom story's folder!''' Simply copying the original resources.cfg and placing it in your custom story's folder is sufficient. Note that unlike the base game, full conversions will not automatically read from the &amp;quot;lang&amp;quot; folder, so you will have to add it to resources.cfg. Your custom story can now override base game assets with its own.&lt;br /&gt;
&lt;br /&gt;
Lang files are a special case: they operate on a per-entry basis, meaning any entries not found in your custom story's lang file will load from the base game's lang file instead. This means you can override any existing lang entry as well as add your own, but you can also use any entry from the base game without needing to add it to your file.&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/TDD/Change_Custom_Story_into_Full_Conversion_Mod&amp;diff=7002</id>
		<title>HPL2/TDD/Change Custom Story into Full Conversion Mod</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/TDD/Change_Custom_Story_into_Full_Conversion_Mod&amp;diff=7002"/>
		<updated>2025-01-19T22:16:37Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{constructionNotice|This page is still being written and is currently incomplete}}&lt;br /&gt;
&lt;br /&gt;
Since version 1.5 of Amnesia The Dark Descent (release in July 2023), a new field has been added to the custom_story_settings.cfg file. This field allows you to specify a main_init.cfg file, which is the main file that full conversion mods use to launch. This means you can now create full conversion mods from a custom story, and they will still show up in the main game menu. This unlocks all the power of full conversion mods, while maintaining most of the simplicity of a custom story.&lt;br /&gt;
&lt;br /&gt;
If you have a custom story that you want to transform into a full conversion mod, start by adding the new field to your custom_story_settings.cfg:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;Main&lt;br /&gt;
  Name = &amp;quot;My story&amp;quot;&lt;br /&gt;
  Author = &amp;quot;Me&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  ...&lt;br /&gt;
&lt;br /&gt;
  InitCfgFile = &amp;quot;config/main_init.cfg&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Specifying this field will disable &amp;lt;code&amp;gt;MapsFolder&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StartMap&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;StartPos&amp;lt;/code&amp;gt;, as these fields will instead be read from the main_init.cfg file. It will also disable &amp;lt;code&amp;gt;ExtraLangFilePrefix&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;DefaultExtraLangFile&amp;lt;/code&amp;gt;, as the game will instead use the primary lang files specified in main_init.cfg. The description of your custom story will instead be located in said lang file, in the &amp;lt;code&amp;gt;CustomStoryMain&amp;lt;/code&amp;gt; category.&lt;br /&gt;
&lt;br /&gt;
From this point on, you can follow tutorials for full conversion mods. Your mod folder will remain &amp;lt;code&amp;gt;custom_stories/&amp;lt;your story&amp;gt;&amp;lt;/code&amp;gt;. For example, if your story folder is named &amp;quot;Ascent&amp;quot;, your main init file should exist at &amp;lt;code&amp;gt;custom_stories/Ascent/config/main_init.cfg&amp;lt;/code&amp;gt; (reflecting what you put in the &amp;lt;code&amp;gt;InitCfgFile&amp;lt;/code&amp;gt; above). Create the &amp;quot;config&amp;quot; folder and the &amp;quot;main_init.cfg&amp;quot; file. The contents of your main_init.cfg file can start as such (Remember to change the references to &amp;quot;Ascent&amp;quot; to reflect your own mod, such as MainSaveFolder and GameName):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;ConfigFiles&lt;br /&gt;
	Resources = &amp;quot;resources.cfg&amp;quot;&lt;br /&gt;
	Materials = &amp;quot;materials.cfg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	Game	= &amp;quot;config/game.cfg&amp;quot;&lt;br /&gt;
	Menu	= &amp;quot;config/menu.cfg&amp;quot;&lt;br /&gt;
	PreMenu	= &amp;quot;config/pre_menu.cfg&amp;quot;&lt;br /&gt;
	Demo	= &amp;quot;config/demo.cfg&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	DefaultMainSettings	= &amp;quot;config/default_main_settings.cfg&amp;quot;&lt;br /&gt;
	DefaultMainSettingsSDL2	= &amp;quot;config/default_main_settings_sdl2.cfg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	DefaultMainSettingsLow		= &amp;quot;launcher/default_main_settings_low.cfg&amp;quot;&lt;br /&gt;
	DefaultMainSettingsMedium	= &amp;quot;launcher/default_main_settings_medium.cfg&amp;quot;&lt;br /&gt;
	DefaultMainSettingsHigh		= &amp;quot;launcher/default_main_settings_high.cfg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	DefaultUserSettings	= &amp;quot;config/default_user_settings.cfg&amp;quot;&lt;br /&gt;
	DefaultUserKeys		= &amp;quot;config/default_user_keys.cfg&amp;quot;&lt;br /&gt;
	DefaultUserKeysSDL2	= &amp;quot;config/default_user_keys_sdl2.cfg&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	DefaultBaseLanguage	= &amp;quot;base_english.lang&amp;quot;&lt;br /&gt;
	DefaultGameLanguage	= &amp;quot;english.lang&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Directories&lt;br /&gt;
	MainSaveFolder 	 	 = &amp;quot;Ascent&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	BaseLanguageFolder 	 = &amp;quot;config/&amp;quot;&lt;br /&gt;
	GameLanguageFolder 	 = &amp;quot;config/lang_main/&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	CustomStoryPath 	 = &amp;quot;custom_stories&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Variables&lt;br /&gt;
	GameName = &amp;quot;Ascent, an Amnesia mod&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;StartMap&lt;br /&gt;
	File	= &amp;quot;level_01.map&amp;quot;&lt;br /&gt;
	Folder	= &amp;quot;maps/&amp;quot;&lt;br /&gt;
	Pos	= &amp;quot;PlayerStartArea_1&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: Paths specified in this file are relative paths starting from the custom story's main folder, eg: &amp;quot;custom_stories/Ascent&amp;quot;. For example, leaving Resources as &amp;quot;resources.cfg&amp;quot; means it should exist at &amp;quot;custom_stories/Ascent/resources.cfg&amp;quot;. If a file is not found here, it will fall back to using the file specified in the base game main_init.cfg.&lt;br /&gt;
&lt;br /&gt;
'''resources.cfg is required for your full conversion to load any files contained in your custom story's folder!''' Simply copying the original resources.cfg and placing it in your custom story's folder is sufficient. Note that unlike the base game, full conversions will not automatically read from the &amp;quot;lang&amp;quot; folder, so you will have to add it to resources.cfg. Your custom story can now override base game assets with its own.&lt;br /&gt;
&lt;br /&gt;
Lang files are a special case: they operate on a per-entry basis, meaning any entries not found in your custom story's lang file will load from the base game's lang file instead. This means you can override any existing lang entry as well as add your own, but you can also use any entry from the base game without needing to add them to yours.&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/ScriptReference/Constants_And_Enumerations&amp;diff=7001</id>
		<title>HPL2/ScriptReference/Constants And Enumerations</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/ScriptReference/Constants_And_Enumerations&amp;diff=7001"/>
		<updated>2025-01-19T21:40:58Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== At a Glance ==&lt;br /&gt;
&lt;br /&gt;
Constants and enumerations allow you to define names which refer to values that should never change during the execution of a script.&lt;br /&gt;
&lt;br /&gt;
'''Constants'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;// Some math constants:&lt;br /&gt;
const float PI = 3.1415926f;&lt;br /&gt;
const float E = 2.7182818f;&lt;br /&gt;
&lt;br /&gt;
// Integer constants:&lt;br /&gt;
// The constants in this example define when should collision events take place;&lt;br /&gt;
// intended to be used with the AddEntityCollideCallback() engine function&lt;br /&gt;
&lt;br /&gt;
const int COLLIDE_ON_ENTER = 1;&lt;br /&gt;
const int COLLIDE_ON_LEAVE = -1;&lt;br /&gt;
const int COLLIDE_ON_BOTH = 0;&lt;br /&gt;
&lt;br /&gt;
// Usage:&lt;br /&gt;
AddEntityCollideCallback(&amp;quot;Player&amp;quot;, &amp;quot;Area_Example&amp;quot;, &amp;quot;ExampleCallback&amp;quot;, false, COLLIDE_ON_BOTH);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Enumerated Constants (Enumerations)'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;enum Color     // Note: Enums are based on the int type.&lt;br /&gt;
{&lt;br /&gt;
    Red,        // has the default value of: 0&lt;br /&gt;
    Green,      // value: (previous + 1) = 1&lt;br /&gt;
    Blue        // value: (previous + 1) = 2, etc, if more added...&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Usage:&lt;br /&gt;
Color col = Color::Blue;  // emphasizes the containing enum, improves code clarity&lt;br /&gt;
&lt;br /&gt;
// Or just:&lt;br /&gt;
Color col = Blue;         // same effect&lt;br /&gt;
&lt;br /&gt;
// Assigning an integer value is not possible without an explicit conversion:&lt;br /&gt;
Color col = 2;    // Causes compilation error!&lt;br /&gt;
&lt;br /&gt;
// Converting from integers - should generally be avoided:&lt;br /&gt;
Color col = Color(2);   // Assigns Blue to col, since 2 corresponds to Color::Blue&lt;br /&gt;
&lt;br /&gt;
// However:&lt;br /&gt;
Color col = Color(-15);   // Has a value of -15, which is not tied to any Color! Could be a problem!&lt;br /&gt;
&lt;br /&gt;
// This is allowed:&lt;br /&gt;
int colValue = col;   // so, enums can be passed to functions expecting ints --&amp;gt; see example below&lt;br /&gt;
&lt;br /&gt;
// Enumerations - choosing your own values&lt;br /&gt;
enum CollisionState&lt;br /&gt;
{&lt;br /&gt;
    Leave = -1,      // = -1&lt;br /&gt;
    Both,            // =  0   (previous + 1)&lt;br /&gt;
    Enter            // =  1   (previous + 1)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Used as parameters to a function:&lt;br /&gt;
AddEntityCollideCallback(&amp;quot;Player&amp;quot;, &amp;quot;Area_Example&amp;quot;, &amp;quot;ExampleCallback&amp;quot;, false, CollisionState::Both);&lt;br /&gt;
&lt;br /&gt;
// You can define all or some of the values; those left undefined will be&lt;br /&gt;
// assigned the value of previous_constant + 1&lt;br /&gt;
enum Ending&lt;br /&gt;
{&lt;br /&gt;
    Good = 1,           // =   1&lt;br /&gt;
    ReallyGood,         // =   2   (previous + 1)&lt;br /&gt;
    Neutral = -10,      // = -10&lt;br /&gt;
    ReallyBad = -2,     // =  -2&lt;br /&gt;
    Bad,                // =  -1   (previous + 1)&lt;br /&gt;
    Default = Neutral   // = -10    &amp;lt;-- You can use previously defined constants&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Binary FLAGS:&lt;br /&gt;
enum QuestState&lt;br /&gt;
{&lt;br /&gt;
    FoundNote1   = 0x01,    // HEX for  1, which is in binary: 0000 0001&lt;br /&gt;
    FoundNote2   = 0x02,    // HEX for  2, which is in binary: 0000 0010&lt;br /&gt;
    FoundItem    = 0x04,    // HEX for  4, which is in binary: 0000 0100&lt;br /&gt;
    FoundPassage = 0x08,    // HEX for  8, which is in binary: 0000 1000&lt;br /&gt;
    FoundAll     = 0x0F     // HEX for 15, which is in binary: 0000 1111&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Discussion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Often, you'll need to define some values which are supposed to remain unchanged (constant) throughout the script, for the entire duration of its execution. You could use variables for this, being very careful not to change them, but even the best of scripters can make a mistake. The script language provides several constructs which enable you to define such constants, so that you can let the compiler worry about keeping them safe from you accidentally changing them. If you by any chance make a mistake and try to reassign a constant, the compiler will greet you with an error message - which is a good thing, because this protects your script from some potentially sneaky bugs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Constants can be of any type, and are declared almost exactly the same way as variables; the only difference is that the declaration is preceded by the ''const'' keyword, and that the value has to be assigned immediately (because it cannot be changed later on).&amp;lt;br /&amp;gt;'''const''' ''typeName'' ''constantName'' = ''value'';&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The names of the constants defined are often written using ALL_CAPS, and individual words are separated with an underscore ''_''. This naming convention enables you to easily distinguish such constants from variables and other names, ''but'' it is a matter of preference, and is not required by the language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It is common to define consts for mathematical and scientific constants, such are the numbers ''pi'', ''e'', or the gravitational acceleration ''g'', etc. Other uses of constants include defining minimum or maximum values for something (max items, max health, etc...), or passing them as special values to functions (more on that later on).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
const float PI = 3.1415926f;&lt;br /&gt;
const float E = 2.7182818f;&lt;br /&gt;
&lt;br /&gt;
const int MIN_ITEMS_FOUND = 2;&lt;br /&gt;
const int MAX_ITEMS_FOUND = 5;&lt;br /&gt;
&lt;br /&gt;
const float MAX_HEALTH = 100.0f;&lt;br /&gt;
&lt;br /&gt;
const float MAX_WAIT_TIME = 10.0f;  // in seconds&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can use constants in various ways, for example, in conditions of [[HPL2/ScriptReference/Control flow - Conditional Statements|conditional statements]] and [[HPL2/ScriptReference/Control flow - Loops|loops]], or in mathematical expressions, or you can assign them to variables (note: when assigning to a variable, the variable gets a copy of the value stored in the constant; the variable can then be manipulated without affecting the constant itself). For example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float radius = 2.5f;&lt;br /&gt;
float circleArea = PI * radius * radius;&lt;br /&gt;
&lt;br /&gt;
// OR&lt;br /&gt;
float health = MAX_HEALTH;&lt;br /&gt;
&lt;br /&gt;
// later on...&lt;br /&gt;
health = 0.0f; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Constants As Function Parameters ===&lt;br /&gt;
&lt;br /&gt;
A function can take a parameter to decide which way should it go about doing its job (see [[HPL2/ScriptReference/Functions Part 1|Functions - Part 1]] to learn more about functions). If there are only two ways, the function might accept a ''bool'' parameter, and make a decision based on whether the value of that parameter is ''true'' or ''false''.&lt;br /&gt;
For example, the engine exposes this predefined function: ''SetFogActive(bool abActive)''. It takes a single ''bool'' parameter, which it uses to decide if the fog should be activated or deactivated.&lt;br /&gt;
&lt;br /&gt;
Often, though, there's more than two options, and in that case integers can be used to represent each of them. This approach is versatile in that it can be used to represent a varying number of options, however, the drawback is that the user of the function needs to remember the meanings of these numbers (sometimes referred to as &amp;quot;magic numbers&amp;quot;), and their meanings cannot be inferred just by reading the code.&amp;lt;br /&amp;gt;Amnesia provides some functions which use special-meaning integer values as parameters. Such parameters often appear in callbacks as well.&lt;br /&gt;
For example, this predefined function, which forces a lever to be stuck in a certain position, takes three parameters: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;void SetLeverStuckState(string&amp;amp; leverName, int stuckState, bool useEffects);&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The first parameter ''leverName'' tells it to which lever it should be applied to. The third parameter ''useEffects'' we can ignore in this discussion. The second parameter, ''stuckState'' is an ''int'' parameter, and it tells the function in which position the lever should be stuck. It can be either: &lt;br /&gt;
* ''-1'' - stuck at &amp;quot;min&amp;quot; side&lt;br /&gt;
* ''1'' - stuck at &amp;quot;max&amp;quot; side&lt;br /&gt;
* ''0'' - not stuck, rests in the middle&lt;br /&gt;
&lt;br /&gt;
This  is how the function is used: if you wanted a lever which, say, controls the supply of electricity, called &amp;quot;Lever_Power&amp;quot;, to be stuck at the &amp;quot;max&amp;quot; position, which will mean that the power is on, you would write:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;SetLeverStuckState(&amp;quot;Lever_Power&amp;quot;, 1, false);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, you can't tell, if you don't already know, what ''1'' means just by looking at that line of code - you have to consult the documentation. The number itself is essentially meaningless to a human reader. ''Constants can help with this:''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
// Globally declared constants (script-scope):&lt;br /&gt;
const int LEVER_MIN = -1;&lt;br /&gt;
const int LEVER_MAX = 1;&lt;br /&gt;
const int LEVER_FREE = 0;&lt;br /&gt;
&lt;br /&gt;
//...&lt;br /&gt;
&lt;br /&gt;
// Elsewhere in the program:&lt;br /&gt;
SetLeverStuckState(&amp;quot;Lever_Power&amp;quot;, LEVER_MAX, false);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now it's clear that the the function makes the lever stuck in the &amp;quot;max&amp;quot; state. But, constants can do even better than that. It is still not obvious what this &amp;quot;max&amp;quot; state means in the context of the game (that is, your custom story or full conversion) itself. We assumed earlier that the lever is used to turn the power on or off. Thus, to convey this information, the code can be modified like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
// Globally declared constants (script-scope):&lt;br /&gt;
&lt;br /&gt;
// Leave these for any other, generic levers, which might &lt;br /&gt;
// possibly exist on the map&lt;br /&gt;
const int LEVER_MIN = -1;&lt;br /&gt;
const int LEVER_MAX = 1;&lt;br /&gt;
const int LEVER_FREE = 0;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// Specific constants for the power-on/off lever:&lt;br /&gt;
const int LEVER_POWER_OFF = LEVER_MIN;&lt;br /&gt;
const int LEVER_POWER_ON = LEVER_MAX;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
//...&lt;br /&gt;
&lt;br /&gt;
// Elsewhere in the program:&lt;br /&gt;
SetLeverStuckState(&amp;quot;Lever_Power&amp;quot;, LEVER_POWER_ON, false);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now it is fairly obvious what the call to SetLeverStuckState() function does.&lt;br /&gt;
&lt;br /&gt;
=== Enumerations ===&lt;br /&gt;
&lt;br /&gt;
Often you need to define a set of constants that are somehow related to each other, especially when they are intended to be passed as function parameters, like in the examples above. ''Enumerations'' provide a convenient language mechanism which enables you to group related constants together under one name. The syntax is as follows (in pseudocode):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
enum EnumName&lt;br /&gt;
{&lt;br /&gt;
    EnumConstantNameA,&lt;br /&gt;
    EnumConstantNameB,&lt;br /&gt;
    EnumConstantNameC,&lt;br /&gt;
    EnumConstantNameD,&lt;br /&gt;
    &lt;br /&gt;
    // etc...&lt;br /&gt;
    &lt;br /&gt;
    // Note: it is not an error for the last&lt;br /&gt;
    // EnumConstant to be followed by a ',' symbol,&lt;br /&gt;
    // but it's generally not written&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use the ''enum'' keyword to declare an enumeration; then you give it a name, and simply list a bunch of constants between the ''{'' and ''}''. As with variables, the names you chose for the enumeration and its constants should be meaningful to a human reader.&amp;lt;br /&amp;gt;Enumerations (sometimes simply called enums) are based on the ''int'' type; that is, the values of the defined constants are nothing but integers under the hood. By default, the value of the first constant is ''0'', and all the other constants have the value of the previous constant incremented by one. So, using pseudocode from the code box above, the values are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
enum EnumName&lt;br /&gt;
{&lt;br /&gt;
    EnumConstantNameA,    //  = 0&lt;br /&gt;
    EnumConstantNameB,    //  = 1   (previous + 1)&lt;br /&gt;
    EnumConstantNameC,    //  = 2   (previous + 1)&lt;br /&gt;
    EnumConstantNameD     //  = 3   (previous + 1)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You are allowed to specify your own values for ''some or all'' of the enumerated constants. For those constants you didn't specify any value, the same (previous + 1) rule will be applied:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
enum EnumName&lt;br /&gt;
{&lt;br /&gt;
    EnumConstantNameA = -2,    //  = -2&lt;br /&gt;
    EnumConstantNameB,         //  = -1   (previous + 1)&lt;br /&gt;
    EnumConstantNameC =  15,   //  = 15&lt;br /&gt;
    EnumConstantNameD          //  = 16   (previous + 1)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enumerations, even though based on integers, should be viewed as code constructs which define a ''new data type'', along with a set of values valid for the variables of that type. This is not entirely true, since variables of an enumerated type can be forced to store a value which is not defined in the corresponding list of enumerated constants, but let's ignore that for the moment. To declare such a variable, the same rules apply as for any other variable type:&amp;lt;br /&amp;gt;&lt;br /&gt;
''EnumName'' ''variableName'';&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Just like with normal constants (those defined using the ''const'' keyword) declared at global (script-level) scope, enumerated constants can be accessed by their name. For example, to initialize a enum-type variable, you can write:&amp;lt;br /&amp;gt;&lt;br /&gt;
''EnumName'' ''variableName'' = ''EnumConstantName'';&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, for the reasons of code readability and clarity, when accessing enumerated constants it is often a good idea to include the name of the enumeration (''EnumName'') itself (especially when passing these values as parameters to functions), since ''EnumName'' often explains what is the common property used to group all the constants together in the first place. For this, the so-called scope resolution operator ''::'' is used:&amp;lt;br /&amp;gt;&lt;br /&gt;
''EnumName'' ''variableName'' = ''EnumName''::''EnumConstantName'';&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
enum Direction&lt;br /&gt;
{&lt;br /&gt;
    North,&lt;br /&gt;
    West,&lt;br /&gt;
    South,&lt;br /&gt;
    East&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Later on:&lt;br /&gt;
Direction sideOfTheWorld = Direction::North;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
// Let's assume there are only two types of items in your game&lt;br /&gt;
&lt;br /&gt;
enum HealingPotion&lt;br /&gt;
{&lt;br /&gt;
    Small  = 10,&lt;br /&gt;
    Medium = 30,&lt;br /&gt;
    Large  = 60,&lt;br /&gt;
    Mega   = 100&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
enum BodyArmor&lt;br /&gt;
{&lt;br /&gt;
    Weak  = 50,&lt;br /&gt;
    Strong  = 100&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Later on:&lt;br /&gt;
HealingPotion vial = HealingPotion::Small;&lt;br /&gt;
HealingPotion leatherArmor = BodyArmor::Weak;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// Or as a parameter to a hypothetical function&lt;br /&gt;
// void GivePlayerItems(HealingPotion potion, BodyArmor armor);&lt;br /&gt;
&lt;br /&gt;
// Use:&lt;br /&gt;
GivePlayerItems(HealingPotion::Small, BodyArmor::Weak);&lt;br /&gt;
&lt;br /&gt;
// Rather than:&lt;br /&gt;
GivePlayerItems(Small, Weak);   // which is which?&lt;br /&gt;
&lt;br /&gt;
// Alternatively:&lt;br /&gt;
GivePlayerItems(vial, leatherArmor);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Although enumerated constants are grouped together under a single name, and can be accessed through that name using the scope resolution operator (''::''), they actually have a global (script-level) scope, so two constants in two different enums cannot share a name. For example, this is not allowed by the language:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
enum HealingPotion&lt;br /&gt;
{&lt;br /&gt;
    Small  = 10,&lt;br /&gt;
    Medium = 30,&lt;br /&gt;
    Large  = 60,&lt;br /&gt;
    Mega   = 100&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
enum BodyArmor&lt;br /&gt;
{&lt;br /&gt;
    Small  = 50,    // compiler error&lt;br /&gt;
    Large  = 100    // compiler error&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Relation to the Integer Type ====&lt;br /&gt;
&lt;br /&gt;
As discussed, enums are based on the ''int'' type. This allows them to be implicitly converted to integers if required, so they can be used in place of them. This is especially useful with functions that use &amp;quot;magic numbers&amp;quot;. Implicit conversion ''from'' integers to enums, however, ''is not allowed''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
enum PowerLeverState&lt;br /&gt;
{&lt;br /&gt;
    Undefined,     // = 0&lt;br /&gt;
    On,            // = 1&lt;br /&gt;
    Off            // = 2&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Later on:&lt;br /&gt;
// Accepts a value of type PowerLeverState, even though it expects an int&lt;br /&gt;
SetLeverStuckState(&amp;quot;Lever_Power&amp;quot;, PowerLeverState::On, false);&lt;br /&gt;
&lt;br /&gt;
// Also:&lt;br /&gt;
int stateValue = PowerLeverState::Off;  // allowed; stateValue is now 2&lt;br /&gt;
&lt;br /&gt;
// Wheres:&lt;br /&gt;
PowerLeverState state = 2;              // NOT allowed!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want to assign an ''int'' value to a enum-type variable, you have to explicitly convert it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
PowerLeverState state1 = PowerLeverState(2);    // now state1 = PowerLeverState::Off&lt;br /&gt;
&lt;br /&gt;
// Also:&lt;br /&gt;
int val = RandomInt(0, 2);&lt;br /&gt;
PowerLeverState state2 = PowerLeverState(val);  // state2 takes a random value&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, conversions like this should be done with care; although there are legitimate uses for them, conversions of this sort often indicate that your script can be better structured. When converting from integers, you run a risk of making your enum-type variables contain values other than those that have been defined as acceptable for their type:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
PowerLeverState state1 = PowerLeverState(100);  // state1 = 100. Now what? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// Also:&lt;br /&gt;
int val = -1;&lt;br /&gt;
&lt;br /&gt;
// later on&lt;br /&gt;
PowerLeverState state2 = PowerLeverState(val);  // state2 = -1. Could this cause problems? &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although this compiles, and no error is displayed, depending on how your script is written, this may or may not cause problems. As conversions of this kind might happen accidentally, if your script relies on enums always having valid values, then there's a great chance that it will fail if a problematic enum-typed value comes along. So, always assume that such a value could be passed to your functions, and decide what to do if it happens. Often enough, you can simply ignore that case, and make your function do nothing and just silently end, but, if the underlying integer value is somehow used (for example, to cycle through all the possible values in a given enumeration), you need to check if the value provided is in the valid range first, and replace it with some acceptable value if it's not. &lt;br /&gt;
&lt;br /&gt;
==== Using Enums to Define Binary Flags ====&lt;br /&gt;
&lt;br /&gt;
The following section discusses slightly more advanced concepts, and also assumes you have the basic understanding of  [[HPL2/ScriptReference/Control flow - Conditional Statements|conditional statements]]. You can skip it and come back later if you find it too hard to follow.&lt;br /&gt;
&lt;br /&gt;
As it was discussed on the [[HPL2/ScriptReference/Types|Types]] page, the computer stores data in the form of ''bytes''. One byte contains 8 ''bits'', each of which can be either 0 or 1. This means that the computer encodes ''everything'' as sequences of zeros and ones (from simple data like integer numbers, floating point numbers, to srings, vectors, player attributes, Amnesia monsters, the image on this screen, etc.).&lt;br /&gt;
&lt;br /&gt;
[http://farm9.staticflickr.com/8467/8371332748_e001db2c28_n.jpg ]&lt;br /&gt;
&lt;br /&gt;
The binary system represents all numbers using only two symbols, 0 and 1. Each combination of zeros and ones encodes an integer number (for integer types) or maybe something else (for other types). For example, the binary number 00110101 depicted above represents the number 53. Now, we are not too concerned here with the details of ''how'' exactly all these are encoded (you can read about that elsewhere), but we are going to take a closer look at integer numbers, since this is what enum constants are under the hood. Let as first look at a single byte.&lt;br /&gt;
&lt;br /&gt;
Because there are 256 different combinations of ones and zeros for 8 binary places, a byte can encode 256 different values at ''one time''. But, when used in a clever way, a byte can represent up to 8 different binary states ''simultaneously''. Such binary states (like on/off, pressed/depressed, lit/unlit, locked/unlocked etc.), can be encoded by correlating them to a specific position (specific bit) in a byte. For example, in the image below, a single byte is used to encode 6 different states related to the progress of a player through a level. Two of the bits are not used.&lt;br /&gt;
&lt;br /&gt;
[http://farm9.staticflickr.com/8513/8371352462_ccf55f1631.jpg ]&lt;br /&gt;
&lt;br /&gt;
In this example, knowing what is represented by each of the bits, you can read the value 0011 1010 to mean: &lt;br /&gt;
* 0 - (not used)&lt;br /&gt;
* 0 - (not used)&lt;br /&gt;
* 1 - the monster was slain by the player&lt;br /&gt;
* 1 - the key was found&lt;br /&gt;
* 1 - the light is lit&lt;br /&gt;
* 0 - the note was not found&lt;br /&gt;
* 1 - the switch is in the &amp;quot;on&amp;quot; state&lt;br /&gt;
* 0 - the lock is left unlocked&lt;br /&gt;
&lt;br /&gt;
All of that information is encoded in ''a single byte''. This is one of the reasons to use flags - using them saves memory (a single byte vs several state variables). The other reason is that flags can be (and usually are) passed as parameters to functions, whereby several indicators of simple binary states are passed to the function simultaneously, through one variable. Flags often encode &amp;quot;settings&amp;quot;-like data, but should be used with care, as they can affect code readability and clarity.&lt;br /&gt;
&lt;br /&gt;
''How to manipulate individual bits then?'' Well, by assigning integer numbers to variables, and by using binary logical operators, described below. However, manipulating bits while working with numbers in the decimal system is not very convenient. This is why programmers often use ''hexadecimal'' (HEX) numbers for such tasks. The reason is: there's a direct correspondence between HEX and binary numbers, as the table below shows, which makes it easy to deal with binary representations.&lt;br /&gt;
&lt;br /&gt;
[http://farm9.staticflickr.com/8365/8371351734_f2f2795a54.jpg ]&lt;br /&gt;
&lt;br /&gt;
As you can see, unlike the decimal number system, which represents all numbers using 10 different symbols (0-9), the HEX number system represents those same numbers using 16 different symbols (0-F). It just so happens that each of the HEX digits perfectly corresponds to one of all possible 4-bit combinations. Any one byte can thus be represented by 2 HEX digits - all you need to do is to refer to the table above, pick two hexadecimal digits, and write them together. To get the corresponding binary number, just replace the HEX digit with its binary equivalent from the table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Representing bytes using HEX system - some examples:&lt;br /&gt;
&lt;br /&gt;
----------------------&lt;br /&gt;
HEX          binary&lt;br /&gt;
----------------------&lt;br /&gt;
 00         0000 0000&lt;br /&gt;
 40         0100 0000&lt;br /&gt;
 02         0000 0010&lt;br /&gt;
 88         1000 1000&lt;br /&gt;
 3A         0011 1010&lt;br /&gt;
 FC         1111 1100&lt;br /&gt;
----------------------&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that to be able to do this, you ''don't have to'' understand the internal workings of the decimal, binary and hexadecimal number systems (although I encourage you to learn more on the web), nor do you have to know how to convert binary and HEX representations to and from decimal; all you need to know is which HEX digit corresponds to which binary sequence (and you can get that from the table). &lt;br /&gt;
&lt;br /&gt;
Since HEX digits include both numerals and characters, the script language needs a way to distinguish HEX numerical literals from other numbers and variable names. So, the language provides the ''0x'' prefix - when you want to express a number in the HEX format, start by typing ''0x'' and then immediately (with no spaces in between) follow with your hex digits:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
0x51  // A HEX number.&lt;br /&gt;
51    // A decimal number.&lt;br /&gt;
&lt;br /&gt;
0x03  // A HEX number.&lt;br /&gt;
03    // A decimal integer 3.&lt;br /&gt;
&lt;br /&gt;
0x5A  // A HEX number.&lt;br /&gt;
5A    // A compiler error?&lt;br /&gt;
&lt;br /&gt;
0xD6  // A HEX number.&lt;br /&gt;
D6    // A variable? A function? A type name?&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the [[HPL2/ScriptReference/Types|Types]] page, it was said that the ''int'' type takes up 4 bytes of memory. This means that a single integer can be used to represent 32 different binary states, of &amp;quot;flags&amp;quot;, simultaneously. As with a single byte before, you don't have to use all of them. Also, since a 2-digit HEX number represents one byte, an 8-digit HEX number can be used to represent any 4-byte integer. You don't have to use all of the 8 digits, either -- if you use less than 8, the compiler will assume that the missing digits are all 0.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, this can all be applied when specifying values for the enumerated constants, so that they can be used as binary flags. For the purpose of being flags, only binary values which contain a single bit set to 1 are used. In the table above, such values are highlighted in blue. There are only four of them, and they are all different representations for the numbers which are powers of two (just like, in decimal system, numbers like 1, 10, 100, 1000, etc., are all various powers of 10).&lt;br /&gt;
&lt;br /&gt;
This way, each enum constant corresponds to a single bit in the binary number.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
// Note: Although the constants are 4-byte integers, since only a single byte &lt;br /&gt;
// is used, all values will be represented as bytes&lt;br /&gt;
&lt;br /&gt;
enum QuestCompletedFlags&lt;br /&gt;
{&lt;br /&gt;
    None             = 0x00,    //  = 0000 0000&lt;br /&gt;
    DoorLocked       = 0x01,    //  = 0000 0001&lt;br /&gt;
    SwitchTurnedOn   = 0x02,    //  = 0000 0010&lt;br /&gt;
    NoteFound        = 0x04,    //  = 0000 0100&lt;br /&gt;
    LightsLit        = 0x08,    //  = 0000 1000&lt;br /&gt;
    KeyFound         = 0x10,    //  = 0001 0000&lt;br /&gt;
    MonsterSlain     = 0x20     //  = 0010 0000&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The enum flags defined in the code box above correspond to the possible states depicted earlier. Once the flags (constants) themselves are defined, they can be combined using the binary OR operator ''|'':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int questState = QuestCompletedFlags::DoorLocked | QuestCompletedFlags::LightsLit;&lt;br /&gt;
&lt;br /&gt;
/* The value of questState is now (in binary):&lt;br /&gt;
-------------------------------------------------&lt;br /&gt;
   DoorLocked:   0000 0001&lt;br /&gt;
 | LightsLit:    0000 1000&lt;br /&gt;
 = questState:   0000 1001   (the door is locked and the lights are lit) */&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next code box shows how to represent the state which corresponds to the image below:&lt;br /&gt;
[http://farm9.staticflickr.com/8513/8371352462_ccf55f1631.jpg ]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
// NOTE: &amp;quot;QuestCompletedFlags::&amp;quot; qualifiers ommitted for brevity.&lt;br /&gt;
&lt;br /&gt;
int questState = SwitchTurnedOn | LightsLit | KeyFound | MonsterSlain;&lt;br /&gt;
&lt;br /&gt;
/* The value of questState is now (in binary):&lt;br /&gt;
-------------------------------------------------&lt;br /&gt;
   SwitchTurnedOn:  0000 0010&lt;br /&gt;
 | LightsLit:       0000 1000&lt;br /&gt;
 | KeyFound:        0001 0000&lt;br /&gt;
 | MonsterSlain:    0010 0000&lt;br /&gt;
 = questState:      0011 1010  */&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you are familiar with the [[HPL2/ScriptReference/Control flow - Conditional Statements#using_logical_operators|boolean logical operators]], you'll be pleased to learn that the binary logical operators work pretty much the same way, only on individual bits. They take two numbers as input, and produce a third number based on the bits of the inputs provided.&lt;br /&gt;
&lt;br /&gt;
'''The binary OR operator''' (''|'') sets a bit to ''1'' in the output if ''any'' of the corresponding bits in the inputs is ''1''. This is why it can be used to combine flags.&amp;lt;br /&amp;gt;0011 | 1100 = 1111&lt;br /&gt;
&lt;br /&gt;
'''The binary AND operator''' (''&amp;amp;'') sets a bit to ''1'' in the output ''only if both'' of the corresponding input bits are ''1''. For this reason, it can be used to check if a certain bit is set or not.&amp;lt;br /&amp;gt;1110 &amp;amp; 0100 = 0100  -&amp;gt; if the result equals to the value of the tested flag, the bit was set&amp;lt;br /&amp;gt;1110 &amp;amp; 0001 = 0000  -&amp;gt; if the result is 0 (zero), the bit was not set&lt;br /&gt;
&lt;br /&gt;
'''The binary XOR operator''' (''^''), a.k.a exclusive-OR, sets a bit to ''1'' only if the corresponding input bits ''are different''. It can be used to invert all the bits.&amp;lt;br /&amp;gt;0101 ^ 0000 = 0101  -&amp;gt; (nothing happens)&amp;lt;br /&amp;gt;0101 ^ 1111 = 1010  -&amp;gt; inversion&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So, how it all looks like in code? You've already seen how to set flags using the binary OR (''|'') operator.&lt;br /&gt;
The following code snippet demonstrates, continuing from the previous examples, how to check if the flag ''MonsterSlain'' was set in the ''questState'' variable:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
if ((questState &amp;amp; QuestCompletedFlags::MonsterSlain) == QuestCompletedFlags::MonsterSlain)&lt;br /&gt;
{&lt;br /&gt;
    // the monster was slain by the Player...&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
    // the monster lives!&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//   questState:    0011 1010&lt;br /&gt;
// &amp;amp; MonsterSlain:  0010 0000&lt;br /&gt;
// =                0010 0000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also check for several flags at once, by using AND (''&amp;amp;'') with binary numbers with multiple bits set to ''1''. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
// the value of: 0x30 = 0011 0000&lt;br /&gt;
int checkState = QuestCompletedFlags::MonsterSlain | QuestCompletedFlags::KeyFound;  &lt;br /&gt;
&lt;br /&gt;
if ((questState &amp;amp; checkState) == checkState)&lt;br /&gt;
{&lt;br /&gt;
    // both flags set&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Or, you can check all at once:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int checkState = 0x3F;  //  = 0011 1111&lt;br /&gt;
&lt;br /&gt;
if ((questState &amp;amp; checkState) == checkState)&lt;br /&gt;
{&lt;br /&gt;
    // all quests completed&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is often convenient to include the &amp;quot;all flags set&amp;quot; value into the enumeration:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
enum QuestCompletedFlags&lt;br /&gt;
{&lt;br /&gt;
    None             = 0x00,    //  = 0000 0000&lt;br /&gt;
    DoorLocked       = 0x01,    //  = 0000 0001&lt;br /&gt;
    SwitchTurnedOn   = 0x02,    //  = 0000 0010&lt;br /&gt;
    NoteFound        = 0x04,    //  = 0000 0100&lt;br /&gt;
    LightsLit        = 0x08,    //  = 0000 1000&lt;br /&gt;
    KeyFound         = 0x10,    //  = 0001 0000&lt;br /&gt;
    MonsterSlain     = 0x20,    //  = 0010 0000&lt;br /&gt;
    AllDone          = 0x3F     //  = 0011 1111&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
//later on:&lt;br /&gt;
int checkState = QuestCompletedFlags::AllDone;&lt;br /&gt;
&lt;br /&gt;
if ((questState &amp;amp; checkState) == checkState)&lt;br /&gt;
{&lt;br /&gt;
    // all quests completed&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Do not confuse binary logical operators (''|'', ''&amp;amp;'', and ''^''), which return a ''number'' as a result, with their boolean equivalents (''||'', ''&amp;amp;&amp;amp;'', and ''^^''), which return a ''boolean value'' (either ''true'' or ''false'').&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/TDD&amp;diff=7000</id>
		<title>HPL2/TDD</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/TDD&amp;diff=7000"/>
		<updated>2025-01-19T21:34:17Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: Added Areas link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto;&amp;quot;&lt;br /&gt;
|+&amp;lt;p style=&amp;quot;margin:1em auto 0; text-align:center; width:400px;&amp;quot;&amp;gt;[[File:Tdd-header.jpg|250px|link=|Amnesia: The Dark Descent]]&amp;lt;/p&amp;gt;&amp;lt;p style=&amp;quot;margin:1em auto 0; text-align:center; width:400px;&amp;quot;&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
|'''[[HPL2/Getting_started|&amp;lt;center&amp;gt;Getting started&amp;lt;/center&amp;gt;]]''' &lt;br /&gt;
|Check out how to quickly get started creating custom content for Amnesia – The Dark Descent.&lt;br /&gt;
|-&lt;br /&gt;
|'''[[HPL2/TDD/Modding|&amp;lt;center&amp;gt;Modding&amp;lt;/center&amp;gt;]]'''&lt;br /&gt;
|Create, organize and release your Amnesia mods&lt;br /&gt;
|-&lt;br /&gt;
|'''[[HPL2/TDD/Level Design|&amp;lt;center&amp;gt;Level Design&amp;lt;/center&amp;gt;]]'''&lt;br /&gt;
|Work with the Level Editor and create immersive worlds&lt;br /&gt;
|-&lt;br /&gt;
|'''[[HPL2/Engine_Scripts|&amp;lt;center&amp;gt;Script Functions&amp;lt;/center&amp;gt;]]'''&lt;br /&gt;
|See a list of all available script functions for Amnesia TDD&lt;br /&gt;
|-&lt;br /&gt;
|'''[[HPL2/TDD/Scripting|&amp;lt;center&amp;gt;Scripting&amp;lt;/center&amp;gt;]]'''&lt;br /&gt;
|Some useful links for scripting&lt;br /&gt;
|-&lt;br /&gt;
|'''[[HPL2/TDD/Modeling|&amp;lt;center&amp;gt;Modeling&amp;lt;/center&amp;gt;]]'''&lt;br /&gt;
|Import, export, add and modify 3D models for the game&lt;br /&gt;
|-&lt;br /&gt;
|'''[[HPL2/TDD/Entities|&amp;lt;center&amp;gt;Entities&amp;lt;/center&amp;gt;]]'''&lt;br /&gt;
|Use the Model Editor to create interactive and dynamic objects&lt;br /&gt;
|-&lt;br /&gt;
|'''[[HPL2/TDD/Materials|&amp;lt;center&amp;gt;Materials&amp;lt;/center&amp;gt;]]'''&lt;br /&gt;
|Use the Material Editor to combine texture maps to create materials&lt;br /&gt;
|-&lt;br /&gt;
|'''[[HPL2/TDD/Effects|&amp;lt;center&amp;gt;Effects&amp;lt;/center&amp;gt;]]'''&lt;br /&gt;
|About effects: Lights, Billboards, Sounds and Particle Systems (effects like smoke, sparks, blood and fire)&lt;br /&gt;
|-&lt;br /&gt;
|'''[[HPL2/TDD/Areas|&amp;lt;center&amp;gt;Areas&amp;lt;/center&amp;gt;]]'''&lt;br /&gt;
|Volumes and points placed in the Level Editor for scripting, water, ladders, ropes, and more&lt;br /&gt;
|-&lt;br /&gt;
|'''[[HPL2/Tutorials|&amp;lt;center&amp;gt;Tutorials&amp;lt;/center&amp;gt;]]'''&lt;br /&gt;
|Step-by-step guides on a variety of topics, created by the community&lt;br /&gt;
|-&lt;br /&gt;
|'''[[HPL2/Third party tools|&amp;lt;center&amp;gt;Third-Party Tools&amp;lt;/center&amp;gt;]]'''&lt;br /&gt;
|Useful developer tools, some of which are created by the community&lt;br /&gt;
|-&lt;br /&gt;
|'''[[HPL2/Glossary|&amp;lt;center&amp;gt;Glossary&amp;lt;/center&amp;gt;]]'''&lt;br /&gt;
|Explanations for terms you may encounter&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Entry pages]]&lt;br /&gt;
__NOTOC____NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/AMFP/NewAreas&amp;diff=6999</id>
		<title>HPL2/AMFP/NewAreas</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/AMFP/NewAreas&amp;diff=6999"/>
		<updated>2025-01-19T21:16:39Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Infection */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AMFP features two new area types which weren't present in TDD.&lt;br /&gt;
&lt;br /&gt;
== ColorGrading ==&lt;br /&gt;
&lt;br /&gt;
This is an area which applies color correction when entered. It will show up as yellow in the Level Editor.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Variables&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| LookUpTable || File (.png) || || Determines the color grading map to use. Ready ones are located in &amp;lt;code&amp;gt;/textures/gradingmaps&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| FadeTime || Float || 1 || The time it takes for grading map to fade in/out after entering/leaving the area.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For information about creating custom grading textures, take a look at [[HPL2/AMFP/ColorGr|this guide]].&lt;br /&gt;
&lt;br /&gt;
== Infection ==&lt;br /&gt;
&lt;br /&gt;
This is a remnant of the unused infection system. It fills up the infection meter or lowers it when the player is inside the area. The area will show up as lime green in the Level Editor.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Variables&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| IncrementSpeed || Float || 20 || The speed at which the infection level rises or lowers. Negative values are also valid, which will heal the player's infection.&lt;br /&gt;
|-&lt;br /&gt;
| InfectionLevelLowerBound || Float || -1 || Lowest infection level the area can heal to.&lt;br /&gt;
|-&lt;br /&gt;
| InfectionLevelUpperBound || Float || 1 || Highest infection level the area can damage to.&amp;lt;br&amp;gt;The player won't be able to get a higher infection level while standing in the area. Values 1-4. 4 and above lets the player die from infection. Infection drain is disabled when the bound has been hit and the player is still in the area.&lt;br /&gt;
|-&lt;br /&gt;
| TotalIncrementBound || Float || 0 || Disables the area when it has incremented the infection by a certain amount.&lt;br /&gt;
|-&lt;br /&gt;
| DisableOnLevelBoundHit || Bool || false || Disables the area if upper or lower level bound has been reached.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that infection is bounded to the ''middle'' of the level's range, not the true boundaries.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Level !! Middle Value&lt;br /&gt;
|-&lt;br /&gt;
| -1 || -37.5&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 12.5&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 37.5&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 62.5&lt;br /&gt;
|-&lt;br /&gt;
| 4 || 87.5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Using a negative bound value will never hit the level bound, so the area will not disable itself when DisableOnLevelBoundHit is true. This is because infection can never be less than 0.&lt;br /&gt;
&lt;br /&gt;
For more information about the infection mechanic, see [[HPL2/AMFP/Infection| the Infection article]].&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/AMFP/NewAreas&amp;diff=6998</id>
		<title>HPL2/AMFP/NewAreas</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/AMFP/NewAreas&amp;diff=6998"/>
		<updated>2025-01-19T21:01:55Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Infection */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AMFP features two new area types which weren't present in TDD.&lt;br /&gt;
&lt;br /&gt;
== ColorGrading ==&lt;br /&gt;
&lt;br /&gt;
This is an area which applies color correction when entered. It will show up as yellow in the Level Editor.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Variables&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| LookUpTable || File (.png) || || Determines the color grading map to use. Ready ones are located in &amp;lt;code&amp;gt;/textures/gradingmaps&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| FadeTime || Float || 1 || The time it takes for grading map to fade in/out after entering/leaving the area.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For information about creating custom grading textures, take a look at [[HPL2/AMFP/ColorGr|this guide]].&lt;br /&gt;
&lt;br /&gt;
== Infection ==&lt;br /&gt;
&lt;br /&gt;
This is a remnant of the unused infection system. It fills up the infection meter or lowers it when the player is inside the area. The area will show up as lime green in the Level Editor.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Variables&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| IncrementSpeed || Float || 20 || The speed at which the infection level rises or lowers. Negative values are also valid, which will heal the player's infection.&lt;br /&gt;
|-&lt;br /&gt;
| InfectionLevelLowerBound || Float || -1 || Lowest infection level the area can heal to.&lt;br /&gt;
|-&lt;br /&gt;
| InfectionLevelUpperBound || Float || 1 || Highest infection level the area can damage to.&amp;lt;br&amp;gt;The player won't be able to get a higher infection level while standing in the area. Values 1-4. 4 and above lets the player die from infection. Infection drain is disabled when the bound has been hit and the player is still in the area.&lt;br /&gt;
|-&lt;br /&gt;
| TotalIncrementBound || Float || 0 || Disables the area when it has incremented the infection by a certain amount.&lt;br /&gt;
|-&lt;br /&gt;
| DisableOnLevelBoundHit || Bool || false || Disables the area if upper or lower level bound has been reached.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that infection is bounded to the ''middle'' of the level's range, not the true boundaries.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Level !! Middle Value&lt;br /&gt;
|-&lt;br /&gt;
| -1 || -37.5&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 12.5&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 37.5&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 62.5&lt;br /&gt;
|-&lt;br /&gt;
| 4 || 87.5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For more information about the infection mechanic, see [[HPL2/AMFP/Infection| the Infection article]].&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/AMFP/NewAreas&amp;diff=6997</id>
		<title>HPL2/AMFP/NewAreas</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/AMFP/NewAreas&amp;diff=6997"/>
		<updated>2025-01-19T20:30:17Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Infection */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AMFP features two new area types which weren't present in TDD.&lt;br /&gt;
&lt;br /&gt;
== ColorGrading ==&lt;br /&gt;
&lt;br /&gt;
This is an area which applies color correction when entered. It will show up as yellow in the Level Editor.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Variables&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| LookUpTable || File (.png) || || Determines the color grading map to use. Ready ones are located in &amp;lt;code&amp;gt;/textures/gradingmaps&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| FadeTime || Float || 1 || The time it takes for grading map to fade in/out after entering/leaving the area.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For information about creating custom grading textures, take a look at [[HPL2/AMFP/ColorGr|this guide]].&lt;br /&gt;
&lt;br /&gt;
== Infection ==&lt;br /&gt;
&lt;br /&gt;
This is a remnant of the unused infection system. It fills up the infection meter or lowers it when the player is inside the area. The area will show up as lime green in the Level Editor.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Variables&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| IncrementSpeed || Float || 20 || The speed at which the infection level rises or lowers. Negative values are also valid, which will heal the player's infection.&lt;br /&gt;
|-&lt;br /&gt;
| InfectionLevelLowerBound || Float || -1 || Lowest infection level the area can heal to.&lt;br /&gt;
|-&lt;br /&gt;
| InfectionLevelUpperBound || Float || 1 || Highest infection level the area can damage to.&amp;lt;br&amp;gt;The player won't be able to get a higher infection level while standing in the area. Values 1-4. 4 and above lets the player die from infection. Infection drain is disabled when the bound has been hit and the player is still in the area.&lt;br /&gt;
|-&lt;br /&gt;
| TotalIncrementBound || Float || 0 || Disables the area when it has incremented the infection by a certain amount.&lt;br /&gt;
|-&lt;br /&gt;
| DisableOnLevelBoundHit || Bool || false || Disables the area if upper or lower level bound has been reached.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that infection is bounded to the ''middle'' of the level's range, not the true boundaries.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Level !! Middle Value&lt;br /&gt;
|-&lt;br /&gt;
| -1 || -37.5&lt;br /&gt;
|-&lt;br /&gt;
| 0 || -12.5&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 12.5&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 37.5&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 62.5&lt;br /&gt;
|-&lt;br /&gt;
| 4 || 87.5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For more information about the infection mechanic, see [[HPL2/AMFP/Infection| the Infection article]].&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/AMFP/Infection&amp;diff=6996</id>
		<title>HPL2/AMFP/Infection</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/AMFP/Infection&amp;diff=6996"/>
		<updated>2025-01-19T19:51:52Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Infection =&lt;br /&gt;
&lt;br /&gt;
Infection is a mechanic which was cut from the final game, but it wasn't fully removed from it.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The mechanic is quite similar to sanity from TDD. It is a meter which fills up in certain circumstances and plays visual and sound effects, which depend on the meter's value.&lt;br /&gt;
&lt;br /&gt;
The infection meter is primarily changed by Infection areas. There are multiple of them placed in the game, but they all have been deactivated (which means that they can be restored). Infection areas can either increase or decrease infection. The only other functional method of changing infection (outside of scripting) is by standing in a Liquid area with the InfectionLevel variable set.&lt;br /&gt;
&lt;br /&gt;
There are 4 levels of infection, all of which play increasingly noticeable screen effects (sepia, image trails, and radial blur).&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Level !! Value Range (Check) !! Value (Set) !! Effects&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0 || 0 || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || 1-25 || 30 || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || 26-50 || 50 || &lt;br /&gt;
|-&lt;br /&gt;
| 3 || 51-75 || 70 || Running disabled&lt;br /&gt;
|-&lt;br /&gt;
| 4 || 76-100 || 90 || Running disabled, -50% speed&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Infection levels are calculated differently when going from level to value when checking infection level compared to setting infection level. Because of this quirk, setting infection to level 1 actually puts it in the level 2 range.&lt;br /&gt;
&lt;br /&gt;
The meter goes down automatically after the player leaves the infected area. It will gradually fall to zero, unless the player has gathered above 80 infection; in that case, they will die after 2 seconds (unless &amp;quot;faux mode&amp;quot; is enabled). Interestingly, infection no longer decreases over time above 75, which leaves a tight margin of 5 infection points which won't kill the player but will not decrease.&lt;br /&gt;
&lt;br /&gt;
Currently the only way to view the meter (aside from the audiovisual effects) is to press F1 in debug mode and turn on player info.&lt;br /&gt;
&lt;br /&gt;
== Other evidence ==&lt;br /&gt;
&lt;br /&gt;
According to these sections of '''game.cfg''', the infection system was a slightly modified version of the sanity mechanic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;Infection&lt;br /&gt;
    EventsFile = &amp;quot;misc/main_sanity_events.cfg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    MinTimeBetweenEvents = &amp;quot;300&amp;quot;&lt;br /&gt;
    MaxEventSanity = &amp;quot;65&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    MaxSanity_LongWait = &amp;quot;65&amp;quot;&lt;br /&gt;
    MaxSanity_MedWait = &amp;quot;45&amp;quot;&lt;br /&gt;
    MaxSanity_ShortWait = &amp;quot;25&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    TimeBetween_LongWait = &amp;quot;270&amp;quot;&lt;br /&gt;
    TimeBetween_MedWait = &amp;quot;180&amp;quot;&lt;br /&gt;
    TimeBetween_ShortWait = &amp;quot;80&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    MinExamineInfection = &amp;quot;50&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    InfectionArea_CheckTimeMin = &amp;quot;1&amp;quot;&lt;br /&gt;
    InfectionArea_CheckTimeMax = &amp;quot;2&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Player_Infection&lt;br /&gt;
	&lt;br /&gt;
	HitZoomInSpeed = &amp;quot;3.5&amp;quot;&lt;br /&gt;
	HitZoomOutSpeed = &amp;quot;0.6&amp;quot;&lt;br /&gt;
	HitZoomInFOVMul = &amp;quot;0.06&amp;quot;&lt;br /&gt;
	HitZoomInAspectMul = &amp;quot;0.15&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	InfectionDecreaseSpeed = &amp;quot;0.75&amp;quot;&lt;br /&gt;
	InfectionDecreaseLimitLevel = &amp;quot;3&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	InfectionVeryHighLimit = &amp;quot;80&amp;quot;&lt;br /&gt;
	InfectionEffectsStart = &amp;quot;35&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	InfectionWaveAlphaMul = &amp;quot;1&amp;quot;&lt;br /&gt;
	InfectionWaveSpeedMul = &amp;quot;1&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	CheckEnemyNearOrSeenInterval = &amp;quot;0.3&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	NearEnemyDecrease = &amp;quot;0.3&amp;quot;&lt;br /&gt;
	NearCritterDecrease = &amp;quot;0.1&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	StartSwayMinInfection = &amp;quot;15&amp;quot;&lt;br /&gt;
	SwayMaxSavedPositions = &amp;quot;30&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
  HighInfectionLimitForDeathTimer = &amp;quot;80&amp;quot;&lt;br /&gt;
	TimeUntilDeathAtHighInfection = &amp;quot;2&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	LightLampMinInfectionIncrease = &amp;quot;0.1&amp;quot;&lt;br /&gt;
	LightLampMaxInfectionIncrease = &amp;quot;5&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  NumberOfInfectionLevels = &amp;quot;4&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  InfectionLevelOneSpeedMultiplier = &amp;quot;1.0&amp;quot;&lt;br /&gt;
  InfectionLevelTwoSpeedMultiplier = &amp;quot;1.0&amp;quot;&lt;br /&gt;
  InfectionLevelThreeSpeedMultiplier = &amp;quot;1.0&amp;quot;&lt;br /&gt;
  InfectionLevelFourSpeedMultiplier = &amp;quot;0.5&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  MaxInfectionLevelAtWhichPlayerCanRun = &amp;quot;2&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  GradientThresholdOffset = &amp;quot;1.1&amp;quot;&lt;br /&gt;
  GradientFallofExponent = &amp;quot;8.0&amp;quot;&lt;br /&gt;
  InfectionMapZoom = &amp;quot;0.95&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  VomitEffectDuration =&amp;quot;3.0&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  InfectionEffectGrowSpeed = &amp;quot;1&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, in the game it uses a separate meter (which is visible via the aforementioned debug menu method).&lt;br /&gt;
&lt;br /&gt;
The mentioned sanity events config file contains exactly the same data as TDD, which means that it wasn't used in the end.&lt;br /&gt;
&lt;br /&gt;
Infection was supposed to increase near creatures, yet the config still has the old sanity property names:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    NearEnemyDecrease = &amp;quot;0.3&amp;quot;&lt;br /&gt;
    NearCritterDecrease = &amp;quot;0.1&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The proper names for these are &amp;lt;code&amp;gt;NearEnemyIncrease&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;NearCritterIncrease&amp;lt;/code&amp;gt;, although only CritterSpider increases infection, as a result of repurposed TDD code.&lt;br /&gt;
&lt;br /&gt;
These property names were changed to replace &amp;quot;Sanity&amp;quot; with &amp;quot;Infection&amp;quot;, but are entirely unused:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
   LightLampMinInfectionIncrease = &amp;quot;0.1&amp;quot;&lt;br /&gt;
   LightLampMaxInfectionIncrease = &amp;quot;5&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ManPig enemies have unused vomit animations and unused entity parameters, such as:&lt;br /&gt;
&lt;br /&gt;
* DistanceAtWhichFleeingPigVomitAttacks&lt;br /&gt;
* MinimumTimeBetweenVomitAttacks&lt;br /&gt;
* MinTimeBeforeIgnoringPlayerAfterVomit&lt;br /&gt;
&lt;br /&gt;
These seem to indicate that ManPigs would have attacked the player by vomiting, increasing the infection meter. The C++ source code shows that being vomited on would instantly set infection to the maximum level:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void cLuxPlayer::VomitDamage()&lt;br /&gt;
{&lt;br /&gt;
	mfTimeSinceLastVomit = 0.0f;&lt;br /&gt;
&lt;br /&gt;
	/*if ( GetInfectionLevel() &amp;lt; 3 )&lt;br /&gt;
	{&lt;br /&gt;
		SetInfectionLevel( 3 );&lt;br /&gt;
	}&lt;br /&gt;
	else*/ if ( GetInfectionLevel() &amp;lt; 4 )&lt;br /&gt;
	{&lt;br /&gt;
		SetInfectionLevel( 4 );&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A particle effect called &amp;quot;''ps_pig_attack_vomit''&amp;quot; was also left in the game.&lt;br /&gt;
&lt;br /&gt;
== Missing parts ==&lt;br /&gt;
&lt;br /&gt;
When the infection is used in-game by enabling the infection areas, some errors get printed to the log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ERROR: Could not load sound 'infection_loop_1'&lt;br /&gt;
ERROR: Can't find sound 'infection_loop_1'!&lt;br /&gt;
ERROR: Couldn't create SoundEntity 'infection_drain_high.snt'&lt;br /&gt;
ERROR: Couldn't create SoundEntity 'infection_heartbeat.snt'&lt;br /&gt;
WARNING: Could not find language file entry 'InfectionHigh'&lt;br /&gt;
ERROR: Couldn't create SoundEntity 'infection_pant.snt'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This indicates that some of the sound entity (.snt) files are missing. They don't have the raw sound files (.ogg) either.&lt;br /&gt;
&lt;br /&gt;
Furthermore, the game displays an empty hint when player reaches level 4 of infection. Its lang file name is &amp;quot;InfectionHigh&amp;quot;, which means that it can be remade and will display automatically. It is unknown if hints for other infection levels exist.&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=6995</id>
		<title>HPL2/Engine Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&amp;diff=6995"/>
		<updated>2025-01-19T07:47:49Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: Moved effect voice functions to sounds section as effect voices are purely audio, no visuals&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TocRight}}&lt;br /&gt;
&lt;br /&gt;
This page documents all scripts available in Amnesia: The Dark Descent.&lt;br /&gt;
&lt;br /&gt;
{{note|'''Note''': Some of the functions require the Amnesia 1.3 or 1.5 update. Steam and other online store copies should be automatically updated. Other copies can get 1.3 [http://www.frictionalgames.com/forum/thread-24334.html here].}}&lt;br /&gt;
&lt;br /&gt;
== Directives ==&lt;br /&gt;
&lt;br /&gt;
First off, &amp;lt;code&amp;gt;#include &amp;quot;file.hps&amp;quot;&amp;lt;/code&amp;gt; can be used to programmatically merge together multiple separate files to make organizing scripts easier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
==Engine scripts==&lt;br /&gt;
===Main===&lt;br /&gt;
&lt;br /&gt;
The following functions are the main hps functions that the HPL2 engine looks to run on certain events - similar to the C++ int main() function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void OnStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the map is loaded for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnEnter();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs whenever the player enters a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnLeave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function that runs when the player leaves a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnGameStart();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is found in the global.hps file and the inventory.hps file, and is run when the game is first started by the player (ie via &amp;quot;Start New Game&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void OnUpdate(float afStep);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
This function is executed for every game update or &amp;quot;tick&amp;quot;. Can be used for rapid-firing updates instead of looping timers. Keep in mind that this can affect game performance if not used with care.&lt;br /&gt;
&lt;br /&gt;
#''afStep''- Time elapsed in seconds since the last frame. Multiply speeds, distances etc. by this argument to avoid framerate dependence issues (for example: if you move something in this function with constant speed, it will move faster on computers which run the game with high FPS and slower on computers with low FPS).&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float RandFloat(float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random float.&lt;br /&gt;
&lt;br /&gt;
#''afMin ''- minimum value&lt;br /&gt;
#''afMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int RandInt(int alMin, int alMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a random int. Note: the maximum value is ''inclusive''  - the RandInt() function may return this value.&lt;br /&gt;
&lt;br /&gt;
#''alMin ''- minimum value&lt;br /&gt;
#''alMax ''- maximum value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringContains(string &amp;amp;in asString, string &amp;amp;in asSubString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a string contains the specified string. &amp;lt;br /&amp;gt;Example: searching for &amp;quot;hello&amp;quot; in &amp;quot;hello world&amp;quot; would return '''true'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to check&lt;br /&gt;
#''asSubString ''- the string to search for&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; StringSub(string &amp;amp;in asString, int alStart, int alCount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the substring in a string. &amp;lt;br /&amp;gt;Example: in the string &amp;quot;frictional games rocks&amp;quot;, using 4 as ''alStart''  and 6 as ''alCount''  would return '''&amp;quot;tional&amp;quot;'''.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string&lt;br /&gt;
#''alStart ''- start position in the string&lt;br /&gt;
#''alCount ''- amount of characters&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int StringToInt(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns an integer converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float StringToFloat(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a float converted from a string, else returns 0.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool StringToBool(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
If possible, returns a boolean converted from a string, else returns false.&lt;br /&gt;
&lt;br /&gt;
#''asString''  - String to convert.&lt;br /&gt;
&lt;br /&gt;
===Mathematical Operations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathCos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathTan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAsin(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc sine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAcos(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc cosine of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the arc tangent of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAtan2(float afX, float afY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Calculates and returns the arc tangent of the specified values.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - First value to operate.&lt;br /&gt;
#''afY''  - Second value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathSqrt(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the square root of the specified value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathPow(float afBase, float afExp);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the value of afBase raised to the power of afExp.&lt;br /&gt;
&lt;br /&gt;
#''afBase''  - The base value.&lt;br /&gt;
#''afExp''  - Value to calculate the base with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMin(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the lowest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathMax(float afA, float afB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the highest value.&lt;br /&gt;
&lt;br /&gt;
#''afA''  - First value.&lt;br /&gt;
#''afB''  - Second value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathClamp(float afX, float afMin, float afMax);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns afX clamped between afMin and afMax. If afX &amp;lt; afMin, returns afMin, and if afX &amp;gt; afMax, returns afMax.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - The value to clamp.&lt;br /&gt;
#''afMin''  - The minimum value to clamp afX with.&lt;br /&gt;
#''afMax''  - The maximum value to clamp afX with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float MathAbs(float afX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the absolute value.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - Value to operate.&lt;br /&gt;
&lt;br /&gt;
===Debugging===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void Print(string &amp;amp;in asString);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a string to the log file (''hpl.log'').&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDebugMessage(string &amp;amp;in asString, bool abCheckForDuplicates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints a line of text to the debug console at the bottom left of the screen. Debug mode must be enabled for the console messages to be visible.&lt;br /&gt;
&lt;br /&gt;
#''asString ''- the string to print&lt;br /&gt;
#''abCheckForDuplicates ''- if true, the string won't be printed more than once on screen until it disappears&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ProgLog(string &amp;amp;in asLevel, string &amp;amp;in asMessage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prints an entry to the ProgLog (progression log). &amp;lt;br /&amp;gt;ProgLog is a file created in Documents/Amnesia/main (or an FC folder if one is being used). It logs certain events, such us opening the menu or picking up the lantern, as well as the player's state (Health, Sanity, Oil, Tinderboxes, Coins), for the purpose of documenting a tester's playstyle. &amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt;This function allows to log custom messages.The messages in the ProgLog file are sorted by time elapsed since a map was loaded.&lt;br /&gt;
&lt;br /&gt;
ProgLog has to be enabled for a player profile in ''user_settings.cfg''  before it starts working.&lt;br /&gt;
&lt;br /&gt;
#''asLevel ''- can be &amp;quot;Low&amp;quot;, &amp;quot;Medium&amp;quot; or &amp;quot;High&amp;quot;. It's a tag which appears in each log entry, for event prioritising.&lt;br /&gt;
#''asMessage ''- The custom message to be printed to the log.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool ScriptDebugOn();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the debug mode is enabled. &amp;lt;br /&amp;gt;See [[HPL2/Development_Environment|&amp;quot;Setting up Development Environment&amp;quot;]] to setup debug mode on your own computer.&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
{{warning|Regular variables (int, float, etc.) are '''not''' saved by the game. Using them in important parts of yor script will break it upon loading a game save. In HPL, those variables should only be used for disposable counters, like spawning objects in a &amp;quot;for&amp;quot; loop. For variables which need to be saved, use the wrappers as described below.}}&lt;br /&gt;
&lt;br /&gt;
====Local====&lt;br /&gt;
&lt;br /&gt;
Local variables can be used throughout the same script file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddLocalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetLocalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddLocalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetLocalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLocalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddLocalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetLocalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Global====&lt;br /&gt;
&lt;br /&gt;
Global variables can be used throughout several maps and can be accessed by several script files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
void AddGlobalVarInt(string &amp;amp;in asName, int alVal);&lt;br /&gt;
int GetGlobalVarInt(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
void AddGlobalVarFloat(string &amp;amp;in asName, float afVal);&lt;br /&gt;
float GetGlobalVarFloat(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetGlobalVarString(string &amp;amp;in asName, const string &amp;amp;in asVal);&lt;br /&gt;
void AddGlobalVarString(string &amp;amp;in asName, string &amp;amp;in asVal);&lt;br /&gt;
string&amp;amp; GetGlobalVarString(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Particle Systems===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadParticleSystem(string &amp;amp;in asPSFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asPSFile''  - The particle system file to load. Extension: .ps&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntity(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateParticleSystemAtEntityExt(string &amp;amp;in asPSName, string &amp;amp;in asPSFile, string &amp;amp;in asEntity, bool abSavePS,&lt;br /&gt;
float afR, float afG, float afB, float afA, bool abFadeAtDistance, float afFadeMinEnd, float afFadeMinStart,&lt;br /&gt;
float afFadeMaxStart, float afFadeMaxEnd);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a particle system on an entity, extended method with more options.&lt;br /&gt;
&lt;br /&gt;
#''asPSName ''- internal name&lt;br /&gt;
#''asPSFile ''- the particle system to use + extension .ps&lt;br /&gt;
#''asEntity ''- the entity to create the particle system at&lt;br /&gt;
#''abSavePS ''- determines whether a particle system should &amp;quot;remember&amp;quot; its shown/hidden state, so that this state can be restored when the player revisits the level&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''abFadeAtDistance ''- determines whether a particle system fades from a certain distance on&lt;br /&gt;
#''afFadeMinEnd ''- minimum distance at which the particle system stops fading&lt;br /&gt;
#''afFadeMinStart ''- minimum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxStart ''- maximum distance at which the particle system starts fading&lt;br /&gt;
#''afFadeMaxEnd ''- maximum distance at which the particle system stops fading&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DestroyParticleSystem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Destroys a particle system.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - The internal name of the particle system&lt;br /&gt;
&lt;br /&gt;
===Sounds &amp;amp; Music===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PreloadSound(string &amp;amp;in asSoundFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preloads a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile''  - The sound file to load (extension .snt optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayGuiSound(string &amp;amp;in asSoundFile, float afVolume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays a sound, not using 3D.&lt;br /&gt;
&lt;br /&gt;
#''asSoundFile ''- the sound to play (extension .snt/.ogg optional)&lt;br /&gt;
#''afVolume ''- the volume of the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaySoundAtEntity(string &amp;amp;in asSoundName, string &amp;amp;in asSoundFile, string &amp;amp;in asEntity, float afFadeTime, bool abSaveSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a sound at an entity.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''asSoundFile ''- the sound to use (extension .snt optional)&lt;br /&gt;
#''asEntity ''- the entity to create the sound at. Using &amp;quot;Player&amp;quot; is effectively the same as &amp;lt;code&amp;gt;PlayGuiSound&amp;lt;/code&amp;gt;, yet this function allows a looping sound to be saved&lt;br /&gt;
#''afFadeTime ''- time in seconds the sound needs to fade. Avoids enemies hearing the sound if afFadeTime is at least 0.1f&lt;br /&gt;
#''abSaveSound ''- if ''true'', a looping sound will &amp;quot;remember&amp;quot; its playback state (currently playing/stopped), and that state will be restored the next time the level is entered. If ''true'', the sound is never attached to the entity! Note that saving should only be used on ''looping sounds''!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeInSound(string &amp;amp;in asSoundName, float afFadeTime, bool abPlayStart);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades in a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds&lt;br /&gt;
#''abPlayStart ''- Play the sound defined in the &amp;lt;code&amp;gt;&amp;lt;Start&amp;gt;&amp;lt;/code&amp;gt; section of the .snt before playing the main sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopSound(string &amp;amp;in asSoundName, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades out a sound.&lt;br /&gt;
&lt;br /&gt;
#''asSoundName ''- internal name&lt;br /&gt;
#''afFadeTime ''- time in seconds, use 0 to immediately stop the sound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayMusic(string &amp;amp;in asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays music.&lt;br /&gt;
&lt;br /&gt;
#''asMusicFile ''- the music file to play (extension .ogg optional)&lt;br /&gt;
#''abLoop ''- determines whether a music track should loop&lt;br /&gt;
#''afVolume ''- volume of the music&lt;br /&gt;
#''afFadeTime ''- time in seconds until music reaches full volume&lt;br /&gt;
#''alPrio ''- priority of the music. Note that only the music with the highest priority can be heard! 0 - lowest, 1 - higher, etc.&lt;br /&gt;
#''abResume''  - if ''true'', playback will be continued from where the track stopped after the call to &amp;lt;code&amp;gt;StopMusic()&amp;lt;/code&amp;gt;. If ''false'', the track will be restarted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopMusic(float afFadeTime, int alPrio);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops music.&lt;br /&gt;
&lt;br /&gt;
#''afFadeTime ''- time in seconds until music stops&lt;br /&gt;
#''alPrio ''- the priority of the music that should stop&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice(string &amp;amp;in asVoiceFile, string &amp;amp;in asEffectFile, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry,&lt;br /&gt;
bool abUsePosition, string &amp;amp;in asPosEntity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This adds a voice and an additional sound effect to be played. It is okay to call this many times in order to play many voices in a row. The EffectVoiceOverCallback is not called until ALL voices have finished.&lt;br /&gt;
&lt;br /&gt;
#''asVoiceFile ''- the voice to play&lt;br /&gt;
#''asEffectFile ''- the sound effect to play&lt;br /&gt;
#''asTextCat ''- the category in the .lang file, usually &amp;quot;Voice&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''abUsePosition ''- plays using 3D from the entity, or without 3D&lt;br /&gt;
#''asPosEntity ''- the entity at which the sound is played from&lt;br /&gt;
#''afMinDistance ''- minimum distance the voice is heard&lt;br /&gt;
#''afMaxDistance ''- maximum distance the voice is heard&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopAllEffectVoices(float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all voices and calls the EffectVoiceOverCallback.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEffectVoiceActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether EffectVoices are still active.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetEffectVoiceOverCallback(string &amp;amp;in asFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to be called when the EffectVoices are finished. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundVolume(float afDestVolume, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound volume, that means everything you can hear '''from the world'''. This does not affect music of GUI sounds.&lt;br /&gt;
&lt;br /&gt;
#''afDestVolume ''- desired volume&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired volume&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeGlobalSoundSpeed(float afDestSpeed, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Influences the global sound speed.&lt;br /&gt;
&lt;br /&gt;
#''afDestSpeed ''- desired speed&lt;br /&gt;
#''afTime ''- time in seconds until volume reaches desired speed&lt;br /&gt;
&lt;br /&gt;
===Lights===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightVisible(string &amp;amp;in asLightName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables lights.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''abVisible ''- determines the state of the light&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeLightTo(string &amp;amp;in asLightName, float afR, float afG, float afB, float afA, float afRadius, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the properties of a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName ''- internal name&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
#''afRadius ''- radius of the light. -1 means keeping the radius&lt;br /&gt;
#''afTime ''- time in seconds until change is done&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLightFlickerActive(string &amp;amp;in asLightName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates flickering on a light.&lt;br /&gt;
&lt;br /&gt;
#''asLightName'' - The internal light name&lt;br /&gt;
#''abActive'' - true = active, false = inactive&lt;br /&gt;
&lt;br /&gt;
==Game scripts==&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartCredits(string &amp;amp;in asMusic, bool abLoopMusic, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alEndNum);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts the end credits screen.&lt;br /&gt;
&lt;br /&gt;
#''asMusic ''- the music to play (including .ogg)&lt;br /&gt;
#''abLoopMusic ''- determines whether the music should loop&lt;br /&gt;
#''asTextCat ''- the category to be used in the .lang file, usually &amp;quot;Ending&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alEndNum ''- Amnesia has 3 different endings and displays a code at the bottom. Determines which code is displayed. 0-2 will display codes, any other integer will not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartDemoEnd();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shows the demo end screen. The background and UI elements are defined in demo.cfg, with the text using the entries in the &amp;quot;Demo&amp;quot; category of the .lang file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AutoSave();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an auto save file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CheckPoint(string &amp;amp;in asName, string &amp;amp;in asStartPos, string &amp;amp;in asCallback, string &amp;amp;in asDeathHintCat, string &amp;amp;in asDeathHintEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a checkpoint at which the player will respawn in case he dies. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asName, int alCount)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;Count is 0 on the first checkpoint load!&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the editor&lt;br /&gt;
#''asCallback ''- the function to call when the player dies/respawns&lt;br /&gt;
#''asDeathHintCat ''- the category of the death hint message to be used in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asDeathHintEntry ''- the entry in the .lang file&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeMap(string &amp;amp;in asMapName, string &amp;amp;in asStartPos, string &amp;amp;in asStartSound, string &amp;amp;in asEndSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Loads another map after a 1.5 second fade out.&lt;br /&gt;
&lt;br /&gt;
#''asMapName ''- the file to load&lt;br /&gt;
#''asStartPos ''- the name of the StartPos in the next map&lt;br /&gt;
#''asStartSound ''- the sound that is played when the change starts&lt;br /&gt;
#''asEndSound ''- the sound that is played when the new map is loaded&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ClearSavedMaps();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the &amp;quot;history&amp;quot; of the save, useful to do when you know the player will not be able to go back anymore. Makes the next save much smaller in size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateDataCache();&lt;br /&gt;
void DestroyDataCache();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This caches all current textures and models and they are not released until destroy is called. If there is already cached data it is destroyed.&lt;br /&gt;
Create caches to enable faster loading when going back to a map. Destroy the cache if you know the player won't go back to that map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMapDisplayNameEntry(string &amp;amp;in asNameEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the map name shown in save file names. If none is set NULL is assumed.&lt;br /&gt;
&lt;br /&gt;
#''asNameEntry ''- the entry to display, category must be &amp;quot;Levels&amp;quot;!&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the skybox.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxTexture(string &amp;amp;in asTexture);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the texture of the skybox.&lt;br /&gt;
&lt;br /&gt;
#''asTexture''  - The texture file to set. Extension: .dds&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSkyBoxColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the solid color of the skybox rather than a texture.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the global fog.&lt;br /&gt;
&lt;br /&gt;
#''abActive''  - true = active, false = inactive&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogColor(float afR, float afG, float afB, float afA);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the color to use for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afR ''- red value&lt;br /&gt;
#''afG ''- green value&lt;br /&gt;
#''afB ''- blue value&lt;br /&gt;
#''afA ''- alpha value&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetFogProperties(float afStart, float afEnd, float afFalloffExp, bool abCulling);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the properties for the global fog.&lt;br /&gt;
&lt;br /&gt;
#''afStart ''- how many meters from the camera should the fog begin&lt;br /&gt;
#''afEnd ''- how many meters from the camera should the fog reach full thickness&lt;br /&gt;
#''afFalloffExp ''- the amount by which the thinkness increases&lt;br /&gt;
#''abCulling ''- whether occlusion culling is active for the fog; this prevents objects behind the fog from being loaded&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetupLoadScreen(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, int alRandomNum, string &amp;amp;in asImageFile);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which loading screen will be shown when changing maps.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category of the loading text in the .lang file to be shown on the loading screen, usually &amp;quot;LoadingText&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''alRandomNum ''- if greater 1, then it will randomize between 1 and alRandom for each LoadScreen giving entry the suffix XX (eg 01). If &amp;lt; =1 then no suffix is added&lt;br /&gt;
#''asImageFile ''- the image to be shown (optional)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void UnlockAchievement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlocks the specified achievement. Only able to be used for the ending achievements.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the achievement. Only the following strings are valid:&lt;br /&gt;
::* Benefactor&lt;br /&gt;
::* Survivor&lt;br /&gt;
::* Sacrifice&lt;br /&gt;
::* Quitter&lt;br /&gt;
::* Egotist&lt;br /&gt;
::* Altruist&lt;br /&gt;
::* Vacillator&lt;br /&gt;
&lt;br /&gt;
===Game Timer===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddTimer(string &amp;amp;in asName, float afTime, string &amp;amp;in asFunction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a timer which calls a function when it expires. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asTimer)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the name of the timer&lt;br /&gt;
#''afTime ''- time in seconds&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveTimer(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a timer, no matter how much time is left.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the timer.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetTimerTimeLeft(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the time left on a timer.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - the internal name of the timer.&lt;br /&gt;
&lt;br /&gt;
===Screen Effects===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeOut(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to black.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen is completly black&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeIn(float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen back to normal.&lt;br /&gt;
&lt;br /&gt;
#''afTime ''- time in seconds until the screen back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeImageTrailTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies the image trail effect to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeSepiaColorTo(float afAmount, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the screen go dark red.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity (default: 0) &lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeRadialBlurTo(float afSize, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Applies radial blur effects to the screen.&lt;br /&gt;
&lt;br /&gt;
#''afSize ''- intensity (default: 0)&lt;br /&gt;
#''afSpeed ''- time in seconds until full effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetRadialBlurStartDist(float afStartDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines at which distance the radial blur effects appear.&lt;br /&gt;
&lt;br /&gt;
#''afStartDist ''- the distance at which the effect starts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectFlash(float afFadeIn, float afWhite, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white.&lt;br /&gt;
&lt;br /&gt;
#''afFadeIn ''- time in seconds until screen is white&lt;br /&gt;
#''afWhite ''- determines to which percentage the screen fades to white (1.0 = completly white)&lt;br /&gt;
#''afFadeOut ''- time in seconds until screen is back to normal again&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartEffectEmotionFlash(string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades the screen to white and shows a text message.&lt;br /&gt;
&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the text entry in the .lang file&lt;br /&gt;
#''asSound ''- the sound to play while fading&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetFlashbackIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a flashback is still in effect.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerSpawnPS(string &amp;amp;in asSPSFile);&lt;br /&gt;
void StopPlayerSpawnPS();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Continuously spawn regular particle systems (''.ps'') around the player. Particles created by this script carry over from map to map.&lt;br /&gt;
&lt;br /&gt;
#''asSPSFile''  - the ''.sps''  file to use. Example ''.sps''  files are located in the ''/misc''  folder in the main game directory.&amp;lt;br&amp;gt;Custom ''.sps''  files can be created by hand in a text editor (see existing ones and mimic how those are written). &amp;lt;br /&amp;gt;Since ''StopPlayerSpawnPS()''  doesn't seem to work, to stop an SPS you must create an ''.sps''  file with an empty particle field field and override the old SPS by calling ''StartPlayerSpawnPS''  again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shakes the screen.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- intensity of the shake&lt;br /&gt;
#''afTime ''- duration of the shake&lt;br /&gt;
#''afFadeInTime ''- time in seconds until full intensity is reached&lt;br /&gt;
#''afFadeOutTime ''- time until screen is back to normal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInDarknessEffectsActive(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the sanity drain and night vision effects while in the darkness.&lt;br /&gt;
&lt;br /&gt;
''bool abX''  - Enable/disable effects.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowScreenImage(string &amp;amp;in asImageName, float afX, float afY, float afScale, bool abUseRelativeCoordinates, float afDuration, float afFadeIn, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.5}}&lt;br /&gt;
&lt;br /&gt;
Displays an image file directly onto the screen. See [[HPL2/Tutorials/ShowScreenImage()|ShowScreenImage()]] in the tutorials section for more information.&lt;br /&gt;
&lt;br /&gt;
# ''asImageName'' - The image file to render (.jpg, .png, .tga, .dds)&lt;br /&gt;
# ''afX'' - The X position of the image&lt;br /&gt;
# ''afY'' - The Y position of the image&lt;br /&gt;
# ''afScale'' - The size of the image in pixels (not scale), or original image size if negative&lt;br /&gt;
# ''abUseRelativeCoordinates'' - Whether X and Y are relative to the screen resoltion, or pixel co-ordinates if not&lt;br /&gt;
# ''afDuration'' - The duration that the image is displayed for&lt;br /&gt;
# ''afFadeIn'' - The time, in seconds, to fade in the image&lt;br /&gt;
# ''afFadeOut'' - The time, in seconds, to fade out the image&lt;br /&gt;
&lt;br /&gt;
===Insanity===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInsanitySetEnabled(string &amp;amp;in asSet, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which InsanitySets are enabled.&lt;br /&gt;
&lt;br /&gt;
#''asSet ''- the set&lt;br /&gt;
#''abX ''- enabled or not&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartInsanityEvent(string &amp;amp;in asEventName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Starts a specified insanity event.&lt;br /&gt;
&lt;br /&gt;
#''asEventName ''- Insanity event to play.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartRandomInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts a random insanity event from the available sets.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopCurrentInsanityEvent();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Stops the currently playing insanity event.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void InsanityEventIsActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an insanity event is currently in effect.&amp;lt;br&amp;gt;Not useful at all due to having a return type of &amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt; when it should be &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Player===&lt;br /&gt;
&lt;br /&gt;
Note that the player's maximum health and sanity is 100.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerActive(bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enabled/Disable player controlled movement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangePlayerStateToNormal();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets the player's state, forcing them to stop interacting with objects. It also clears the inventory item to be used (as if it was double-clicked on in the inventory again) and dismounts the player from ladders.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerCrouching(bool abCrouch);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddPlayerBodyForce(float afX, float afY, float afZ, bool abUseLocalCoords);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pushes the player into a certain direction. Note that you need values above ~2000 to see any effects.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- amount along the X-axis&lt;br /&gt;
#''afY ''- amount along the Y-axis&lt;br /&gt;
#''afZ ''- amount along the Z-axis&lt;br /&gt;
#''abUseLocalCoords ''- If true, axes are based on where the player is facing, not the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ShowPlayerCrossHairIcons(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the icons when a player has something in focus.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerSanity(float afSanity);&lt;br /&gt;
void AddPlayerSanity(float afSanity);&lt;br /&gt;
float GetPlayerSanity();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerHealth(float afHealth);&lt;br /&gt;
void AddPlayerHealth(float afHealth);&lt;br /&gt;
float GetPlayerHealth();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerLampOil(float afOil);&lt;br /&gt;
void AddPlayerLampOil(float afOil);&lt;br /&gt;
float GetPlayerLampOil();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the lamp oil of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerSpeed();&lt;br /&gt;
float GetPlayerYSpeed();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current speed of the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSanityDrainDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables sanity drain from darkness.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoost();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a large amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! New Sanity&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || 100&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || 90&lt;br /&gt;
|-&lt;br /&gt;
| 50-74 || 80&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityBoostSmall();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Boosts the player's sanity by a small amount depending on the current sanity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Sanity !! Sanity Bonus&lt;br /&gt;
|-&lt;br /&gt;
| 0-24 || +20&lt;br /&gt;
|-&lt;br /&gt;
| 25-49 || +15&lt;br /&gt;
|-&lt;br /&gt;
| 50-75 || +10&lt;br /&gt;
|-&lt;br /&gt;
| 75-100 || +5&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveSanityDamage(float afAmount, bool abUseEffect);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the sanity of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- amount of sanity damage done&lt;br /&gt;
#''abUseEffect ''- determines whether an effect is played when the sanity damage is dealt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GivePlayerDamage(float afAmount, string &amp;amp;in asType, bool abSpinHead, bool abLethal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduces the health of the player.&lt;br /&gt;
&lt;br /&gt;
#''afAmount ''- amount of damage done to health&lt;br /&gt;
#''asType ''- plays a certain effect on the screen when the damage is dealt (BloodSplat, Claws, or Slash) &lt;br /&gt;
#''abSpinHead ''- changes the camera view when damage is dealt&lt;br /&gt;
#''abLethal ''- set to true if player can die from given damage. If ''false'' and the damage would have left the player with less than 10 health, health is set to 10.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerFOVMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the field of view of the player. A shorter FOV will create a zoom effect.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- multiplier of default FOV (1 is default)&lt;br /&gt;
#''afSpeed ''- the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerAspectMulTo(float afX, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the aspect ratio of the player. Basically stretches or narrows the screen horizontally.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- multiplier of default aspect (default is 1)&lt;br /&gt;
#''afSpeed ''- the speed of change between FOVs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- angle of rotation of head, positive being counter-clockwise&lt;br /&gt;
#''afSpeedMul ''- speed (possibly acceleration) multiplier of the rotation (default 1, which is really slow)&lt;br /&gt;
#''afMaxSpeed ''- maximum speed of rotation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerForward(float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Moves the player forward. It needs to be called in a timer that updates 60 times / second.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the position of the camera on the player's body.&lt;br /&gt;
&lt;br /&gt;
#''afX ''- amount along the X-axis&lt;br /&gt;
#''afY ''- amount along the Y-axis&lt;br /&gt;
#''afZ ''- amount along the Z-axis&lt;br /&gt;
#''afSpeed ''- speed at which the change happens&lt;br /&gt;
#''afSlowDownDist ''- distance at which to start slowing down (prevents the head from abruptly stopping)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPlayerLookAt(string &amp;amp;in asEntityName, float afSpeedMul, float afMaxSpeed, string &amp;amp;in asAtTargetCallback);&lt;br /&gt;
void StopPlayerLookAt();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the player to look at a certain entity until StopPlayerLookAt is used.&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- the entity to look at &lt;br /&gt;
#''afSpeedMul ''- how fast should the player look at the entity&lt;br /&gt;
#''afMaxSpeed ''- maximum speed allowed&lt;br /&gt;
#''asAtTargetCallback ''- function to call when player looks at target&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerMoveSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerRunSpeedMul(float afMul);&lt;br /&gt;
void SetPlayerLookSpeedMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the player's move/run/look speed. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpForceMul(float afMul);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the player's jump multiplier. Higher values = higher jumps. Default is 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerJumpDisabled(bool abX);&lt;br /&gt;
void SetPlayerCrouchDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to jump/crouch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportPlayer(string &amp;amp;in asStartPosName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly teleports the player to the target StartPos.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternActive(bool abX, bool abUseEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the player use his lantern.&lt;br /&gt;
&lt;br /&gt;
# ''abX'' - Set lantern to be active (true) or inactive (false)&lt;br /&gt;
# ''abUseEffects'' - Play on/off sounds&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetLanternActive();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player currently uses his lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/Disables the player's ability to use his lantern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternLitCallback(string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the function to call when the player uses his lantern. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;MyFunc(bool abLit)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message on the screen.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTime ''- determines how long the message is displayed. If time is &amp;lt; =0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetDeathHint(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the message that appears when the player dies.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DisableDeathStartSound();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the death sound when the player dies. This must be called directly before player is killed! The variable as soon as player dies too.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPermaDeathSound(string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.2}}&lt;br /&gt;
&lt;br /&gt;
Sets the sound played after the player dies when permadeath is active. Permadeath is only active when the game is launched with the &amp;lt;code&amp;gt;ptest&amp;lt;/code&amp;gt; command line parameter. Only used for the post-death Suitor lines in ''Justine''.&lt;br /&gt;
&lt;br /&gt;
#''asSound'' - The sound to be played after death. Expects a voice-type sound.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerFallDamageDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables the player's ability to take fall damage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerPos(float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the player's position within the level.&lt;br /&gt;
&lt;br /&gt;
#''afX''  - X co-ordinate position.&lt;br /&gt;
#''afY''  - Y co-ordinate position.&lt;br /&gt;
#''afZ''  - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerPosX();&lt;br /&gt;
float GetPlayerPosY();&lt;br /&gt;
float GetPlayerPosZ();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the player's position within the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
===Journal===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddNote(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a note to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _Name and _Text and be in category &amp;quot;Journal&amp;quot;!&lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddDiary(string &amp;amp;in asNameAndTextEntry, string &amp;amp;in asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a diary to the player's journal.&lt;br /&gt;
&lt;br /&gt;
#''asNameAndTextEntry ''- entries in the .lang file. Must end with _NameX and _TextY whereas X and Y are numbers of the parts (_Name1: first diary, _Text1: first page) and be in category &amp;quot;Journal&amp;quot;! &lt;br /&gt;
#''asImage ''- the background image to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ReturnOpenJournal(bool abOpenJournal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Only called in the pickup diary callback! If true the journal displays the entry else not.&lt;br /&gt;
&lt;br /&gt;
===Quests===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a quest to the player's journal under mementos. Completed quests cannot be readded.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name to be used&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot;Quest_&amp;lt;texthere&amp;gt;_Text”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CompleteQuest(string &amp;amp;in asName, string &amp;amp;in asNameAndTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Completes a quest. If the quest has not been added, it's marked as complete anyway, preventing it from being added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
#''asNameAndTextEntry ''- entry in the .lang file. Must start with &amp;quot; Quest_&amp;lt;texthere&amp;gt;_Text ”, and be in category “Journal”!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool QuestIsCompleted(string &amp;amp;in asName);&lt;br /&gt;
bool QuestIsAdded(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a quest is completed/added.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name of the quest&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetNumberOfQuestsInMap(int alNumberOfQuests);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the number of quests in the map. Obsolete; formerly used to calculate a completion percentage when looking at a level door.&lt;br /&gt;
&lt;br /&gt;
#''alNumberOfQuests ''- Amount of quests&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveHint(string &amp;amp;in asName, string &amp;amp;in asMessageCat, string &amp;amp;in asMessageEntry, float afTimeShown);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a hint on the player's screen.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name&lt;br /&gt;
#''asMessageCat ''- the category in the .lang file, usually &amp;quot;Hints&amp;quot;&lt;br /&gt;
#''asMessageEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTimeShown ''- time in seconds until the message disappears. If time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void BlockHint(string &amp;amp;in asName);&lt;br /&gt;
void UnBlockHint(string &amp;amp;in asName);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Blocking a hint prevents it from being shown. Blocked hints are included in savefiles, so they should persist between levels. Unblocking a hint allows it to be shown.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; blocks the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveHint(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes the hint from the list of already shown hints, allowing it to appear again.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the internal name. Basic game hints use the same name as their respective lang entries, with the exception of &amp;quot;numbered&amp;quot; hints. For example, &amp;lt;code&amp;gt;EntityGrab&amp;lt;/code&amp;gt; reenables the &amp;lt;code&amp;gt;EntityGrab01&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EntityGrab02&amp;lt;/code&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
===Inventory===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ExitInventory();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Exits the inventory by force.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the player's ability to open his inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInventoryMessage(string &amp;amp;in asTextCategory, string &amp;amp;in asTextEntry, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a message on the inventory screen. Used for feedback messages when failing to combine items.&lt;br /&gt;
&lt;br /&gt;
#''asTextCategory ''- the category in the .lang file, usually &amp;quot;Inventory&amp;quot;&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
#''afTime ''- time in seconds until the message disappears. If life time is &amp;lt;= 0 then the life time is calculated based on string length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItem(string &amp;amp;in asName, string &amp;amp;in asType, string &amp;amp;in asSubTypeName, string &amp;amp;in asImageName, float afAmount);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds an item to the inventory of the player. Note that the item does not have to exist as entity in the world to be able to do this.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asType ''- item type to give, Available types are:&lt;br /&gt;
::*Puzzle&lt;br /&gt;
::*Lantern&lt;br /&gt;
::*Health&lt;br /&gt;
::*Sanity&lt;br /&gt;
::*LampOil&lt;br /&gt;
::*Tinderbox&lt;br /&gt;
#''asSubTypeName ''- item name for .lang file&lt;br /&gt;
#''asImageName ''- the image which will appear in inventory. For example: &amp;lt;code&amp;gt;void GiveItem(&amp;quot;chemical_container_full_1&amp;quot;, &amp;quot;Puzzle&amp;quot;, &amp;quot;chemical_container_full&amp;quot;, &amp;quot;chemical_container_full.tga&amp;quot;, 1);&amp;lt;/code&amp;gt; will use the image from &amp;lt;code&amp;gt;graphics/item/chemical_container_full.tga&amp;lt;/code&amp;gt; &lt;br /&gt;
#''afAmount ''- amount the item gives, - For example: Oil potions will fill the oil meter by this amount, Health potions will heal by this amount, etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item from the player's inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool HasItem(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether the player has an item in his inventory.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void GiveItemFromFile(string &amp;amp;in asName, string &amp;amp;in asFileName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a single item to the player's inventory. This is meant to be used for debug mostly as it creates the actual item and then destroys it.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asFileName ''- item to give + extension (.ent)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddCombineCallback(string &amp;amp;in asName, string &amp;amp;in asItemA, string &amp;amp;in asItemB, string &amp;amp;in asFunction, bool abAutoRemove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to combine items in his inventory. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItemA, string &amp;amp;in asItemB)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name for the callback&lt;br /&gt;
#''asItemA ''- internal name of first item&lt;br /&gt;
#''asItemB ''- internal name of second item&lt;br /&gt;
#''asFunction ''- the function to call&lt;br /&gt;
#''abAutoRemove ''- determines whether the callback should be removed when the items are combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveCombineCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes a combine callback.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - the internal name of the callback to be removed (as specified in AddCombineCallback)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddUseItemCallback(string &amp;amp;in asName, string &amp;amp;in asItem, string &amp;amp;in asEntity, string &amp;amp;in asFunction, bool abAutoDestroy);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to use items on the world. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asItem, string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
#''asItem ''- internal name of the item&lt;br /&gt;
#''asEntity ''- entity to be able to use the item on&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abAutoDestroy ''- determines whether the callback should be removed when the item is used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveUseItemCallback(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an item callback.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name of the callback&lt;br /&gt;
&lt;br /&gt;
===Entities===&lt;br /&gt;
&lt;br /&gt;
====General====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityActive(string &amp;amp;in asName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityVisible(string &amp;amp;in asName, bool abVisible);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates an entity's visual mesh. The collision body remains.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the entity.&lt;br /&gt;
#''abActive''  - Activate/deactivate mesh.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntityExists(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether an entity exists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCustomFocusCrossHair(string &amp;amp;in asName, string&amp;amp; asCrossHair);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the crosshair that is used when focusing an entity.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCrossHair ''- desired crosshair, can be: &lt;br /&gt;
::*Default (no crosshair)&lt;br /&gt;
::*Grab&lt;br /&gt;
::*Push&lt;br /&gt;
::*Ignite&lt;br /&gt;
::*Pick&lt;br /&gt;
::*LevelDoor&lt;br /&gt;
::*Ladder&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void CreateEntityAtArea(string &amp;amp;in asEntityName, string &amp;amp;in asEntityFile, string &amp;amp;in asAreaName, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an entity at an area. When creating an enemy though, it cannot chase properly along PathNodes (using for example &amp;lt;code&amp;gt;ShowEnemyPlayerPosition&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
#''asEntityName ''- internal name&lt;br /&gt;
#''asEntityFile ''- entity to be used extension .ent&lt;br /&gt;
#''asAreaName ''- the area to create the entity at&lt;br /&gt;
#''abFullGameSave ''- determines whether an entity &amp;quot;remembers&amp;quot; its state&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ReplaceEntity(string &amp;amp;in asName, string &amp;amp;in asBodyName, string &amp;amp;in asNewEntityName, string &amp;amp;in asNewEntityFile, bool abFullGameSave);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Removes an entity and places a new one in its place.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to replace.&lt;br /&gt;
#''asBodyName'' - Name of the body of the entity to place the new entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''asNewEntityName'' - Name of the new entity.&lt;br /&gt;
#''asNewEntityFile'' - Name of the new entity file. Extension .ent. &lt;br /&gt;
#''abFullGameSave'' - Whether ALL properties of this entity should be saved throughout levels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlaceEntityAtEntity(string &amp;amp;in asName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBodyName, bool abUseRotation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Places an entity at the position of another entity. Does not work for enemies, use TeleportEnemyToEntity instead.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to place.&lt;br /&gt;
#''asTargetEntity'' - Name of the other entity to place the first entity at.&lt;br /&gt;
#''asTargetBodyName'' - Name of the body of the entity to place the first entity at. If empty the first body is used (might be buggy, recommended to name a body anyway).&lt;br /&gt;
#''abUseRotation'' - Whether the entity should be rotated like the target entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPos(string &amp;amp;in asName, float afX, float afY, float afZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Moves an entity to a position in the level.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity to move.&lt;br /&gt;
#''afX'' - X co-ordinate position.&lt;br /&gt;
#''afY'' - Y co-ordinate position.&lt;br /&gt;
#''afZ'' - Z co-ordinate position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetEntityPosX(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosY(string &amp;amp;in asName);&lt;br /&gt;
float GetEntityPosZ(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns an entity's position in the level on the specified axis.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Name of the entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerLookAtCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveWhenLookedAt);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player looks at a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = looking, -1 = not looking&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveWhenLookedAt ''- determines whether the callback should be removed when the player looked at the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityPlayerInteractCallback(string &amp;amp;in asName, string &amp;amp;in asCallback, bool abRemoveOnInteraction);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when the player interacts with a certain entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
#''abRemoveOnInteraction ''- determines whether the callback should be removed when the player interacts with the entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityCallbackFunc(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when certain events occur with an entity. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, string &amp;amp;in asType)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;asType&amp;lt;/code&amp;gt; values depend on entity type:&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! asType Value&lt;br /&gt;
|-&lt;br /&gt;
| Object || Break&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || OnIgnite&lt;br /&gt;
|-&lt;br /&gt;
| Item || OnPickup&lt;br /&gt;
|-&lt;br /&gt;
| Enemy || OnDeath&lt;br /&gt;
|-&lt;br /&gt;
| Enemy_Grunt&amp;lt;br&amp;gt;Enemy_Manpig || OnAutoDisabled&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityConnectionStateChangeCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A callback called when ever the connection state changes (button being switched on, lever switched, etc). &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void Func(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: -1 = off, 0 = between, 1 = on&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetEntityInteractionDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disallows interaction with an entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void BreakJoint (string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Breaks a joint. Do not use this on joints in SwingDoors, Levers, Wheels, etc. where the joint is part of an interaction. That will make the game crash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void AddEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName, string &amp;amp;in asFunction, bool abDeleteOnCollide, int alStates);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when two entities collide. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asParent, string &amp;amp;in asChild, int alState)&amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;alState: 1 = enter, -1 = leave&lt;br /&gt;
&lt;br /&gt;
#''asParentName ''- internal name of main object&lt;br /&gt;
#''asChildName ''- internal name of object that collides with main object (asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) NOT supported!)&lt;br /&gt;
#''asFunction ''- function to call&lt;br /&gt;
#''abDeleteOnCollide ''- determines whether the callback after it was called&lt;br /&gt;
#''alStates ''- 1 = only enter, -1 = only leave, 0 = both&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveEntityCollideCallback(string &amp;amp;in asParentName, string &amp;amp;in asChildName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an EntityCollideCallback. Asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) not supported in ''asChildName''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntitiesCollide(string &amp;amp;in asEntityA, string &amp;amp;in asEntityB);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether two entities collide. This function does NOT support asterix (&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;) or &amp;quot;Player&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetBodyMass(string &amp;amp;in asName, float afMass);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Sets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName.&lt;br /&gt;
#''afMass''  - The mass to set.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float GetBodyMass(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gets the mass of an entity's body.&lt;br /&gt;
&lt;br /&gt;
#''asName''  - Name of the body of an entity. The body name of an entity is EntityName_BodyName. &lt;br /&gt;
#''afMass''  - The mass to get.&lt;br /&gt;
&lt;br /&gt;
====Props====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropEffectActive(string &amp;amp;in asName, bool abActive, bool abFadeAndPlaySounds);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Can be used on coal to give it the black color it should have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropActiveAndFade(string &amp;amp;in asName, bool abActive, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates a prop.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''abActive ''- nothing to add&lt;br /&gt;
#''afFadeTime ''- time in seconds until prop fully fades&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropStaticPhysics(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activates/deactivates the physics of a prop, setting the mass to 0. Setting as true will make entities static in midair.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
bool GetPropIsInteractedWith(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a prop is interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void RotatePropToSpeed(string &amp;amp;in asName, float afAcc, float afGoalSpeed, float afAxisX, float afAxisY, float afAxisZ, bool abResetSpeed, string &amp;amp;in asOffsetArea);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rotates the prop up to a set speed.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afGoalSpeed ''- desired speed &lt;br /&gt;
#''afAxisX ''- rotation around X axis&lt;br /&gt;
#''afAxisY ''- rotation around Y axis&lt;br /&gt;
#''afAxisZ ''- rotation around Z axis&lt;br /&gt;
#''abResetSpeed ''- determines whether the speed is resetted after goal speed is reached&lt;br /&gt;
#''asOffsetArea ''- the area to rotate around, if empty, then the center of the body is used Note: The entity you want to rotate MUST be a &amp;quot;StaticObject&amp;quot; entity!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void StopPropMovement(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops all movement of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddAttachedPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop.&lt;br /&gt;
&lt;br /&gt;
#''asPropName''- the prop to attach another prop at &lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop&lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
{{bug|''afRotZ '' is used for both the ZX rotation and the Z position of the attached prop. Unwanted rotation can be avoided by using: &amp;lt;br /&amp;gt;''AddAttachedPropToProp(asPropName, asAttachName, asAttachFile, afPosX, afPosY, '''0''', afPosZ, '''90.0f''', afPosZ)''}}&lt;br /&gt;
&lt;br /&gt;
{{bug|Attaching a breakable prop to a physically active prop, and then breaking the attached prop, will cause the game to crash, should the parent object be moved or reset.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName, string &amp;amp;in asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to another prop. Fixed version of &amp;lt;code&amp;gt;AddAttachedPropToProp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
#''asPropName ''- the prop to attach another prop at&lt;br /&gt;
#''asAttachName ''- internal name of the prop that gets attached&lt;br /&gt;
#''asAttachFile ''- the prop that gets attached extension .ent&lt;br /&gt;
#''afPosX ''- X position of the attach from the prop &lt;br /&gt;
#''afPosY ''- Y position of the attach from the prop&lt;br /&gt;
#''afPosZ ''- Z position of the attach from the prop&lt;br /&gt;
#''afRotX ''- rotation around X axis of the attach&lt;br /&gt;
#''afRotY ''- rotation around Y axis of the attach&lt;br /&gt;
#''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of &amp;lt;code&amp;gt;AddEntityCollideCallback&amp;lt;/code&amp;gt;, attached props will not call the callback function if they collide with a &amp;quot;static_object&amp;quot; or a &amp;quot;StaticProp&amp;quot; entity type!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void RemoveAttachedPropFromProp(string &amp;amp;in asPropName, string &amp;amp;in asAttachName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches a prop from a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
void AddPropHealth(string &amp;amp;in asName, float afHealth);&lt;br /&gt;
float GetPropHealth(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifies/returns the health of a prop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ResetProp(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets a prop's state to the original one when the map was loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void PlayPropAnimation(string &amp;amp;in asProp, string &amp;amp;in asAnimation, float afFadeTime, bool abLoop, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the prop play an animation and calls a function. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asProp)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asProp ''- internal name of the prop&lt;br /&gt;
#''asAnimation ''- animation to play&lt;br /&gt;
#''afFadeTime ''- Fade time between current and new animations&lt;br /&gt;
#''abLoop ''- determines whether the animation loops &lt;br /&gt;
#''asCallback ''- function to call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddPropForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddPropImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyForce(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
void AddBodyImpulse(string &amp;amp;in asName, float afX, float afY, float afZ, string &amp;amp;in asCoordSystem);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These functions push objects. Note that rather high values are needed when applying ''forces''  (on the order of ~100 (weak) to ~10000 (strong)), but not impulses (values less than 10 can be appropriate). Forces are external influences, and will have different effect depending on the mass of the object they are being applied to; impulses disregard mass, and can cause objects to break, as if hit. A &amp;quot;Body&amp;quot; is a physics-related helper object, to which a force or an impulse can be applied. Entities can consist of several bodies, interconnected in various ways (you can create/examine bodies in the model editor).&lt;br /&gt;
&lt;br /&gt;
#''asName ''- the object to push; for bodies, use this format: &amp;quot;''entityName''_''bodyName''&amp;quot;&lt;br /&gt;
#''afX ''- magnitude along the X-axis&lt;br /&gt;
#''afY ''- magnitude along the Y-axis&lt;br /&gt;
#''afZ ''- magnitude along the Z-axis&lt;br /&gt;
#''asCoordSystem ''- determines which coordinate system is used, &amp;quot;local&amp;quot; or &amp;quot;world&amp;quot;&lt;br /&gt;
&lt;br /&gt;
All of these functions are ''additive''  - when called consecutively, for each call, the vectors defined by (afX, afY, afZ) will be added together, and a resultant force/impulse will be calculated ''before''  any physics simulation is applied to the target object.&lt;br /&gt;
&lt;br /&gt;
====Connections====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithRope(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asRopeName, bool abInteractOnly, float afSpeedMul, float afToMinSpeed, float afToMaxSpeed, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects a prop with the movement of a rope (i.e. turn a wheel to move a rope). For Levers, the rope only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName''- The name of the connection&lt;br /&gt;
#''asPropName'' - The name of the prop; can be a Lever or Wheel&lt;br /&gt;
#''asRopeName'' - The name of the rope&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''afSpeedMul'' - Speed multiplier of how quickly the rope moves&lt;br /&gt;
#''afToMinSpeed'' - The slowest the rope can move&lt;br /&gt;
#''afToMaxSpeed'' - The fastest the rope can move&lt;br /&gt;
#''abInvert'' - Whether to invert the direction the rope moves&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InteractConnectPropWithMoveObject(string &amp;amp;in asName, string &amp;amp;in asPropName, string &amp;amp;in asMoveObjectName, bool abInteractOnly, bool abInvert, int alStatesUsed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This one should only be used if there must be an exact correspondence to prop &amp;quot;amount&amp;quot; and the MoveObject open amount. It is best used for Wheel-door connections, where the MoveObject moves continuously along with the Wheel. For Levers, the MoveObject only moves when the Lever is at the min, max, or middle.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asPropName'' - The entity that controls the movement; can be a Lever or Wheel&lt;br /&gt;
#''asMoveObject'' - The MoveObject to move&lt;br /&gt;
#''abInteractOnly'' - If the connection is only affected by interacting with the prop directly&lt;br /&gt;
#''abInvert'' - If the state is inverted, making the MoveObject move in the opposite direction&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ConnectEntities(string &amp;amp;in asName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, bool abInvertStateSent, int alStatesUsed, string &amp;amp;in asCallbackFunc);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connects two entities together so that changing the state of the main entity changes the state of the connected entity.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Entity Type !! Max State (1) !! Min State (-1)&lt;br /&gt;
|-&lt;br /&gt;
| Lamp || Lit || Unlit&lt;br /&gt;
|-&lt;br /&gt;
| MoveObject || Open || Close&lt;br /&gt;
|-&lt;br /&gt;
| SwingDoor&lt;br /&gt;
|rowspan=2| Locked&lt;br /&gt;
|rowspan=2| Unlocked&lt;br /&gt;
|-&lt;br /&gt;
| Chest&lt;br /&gt;
|-&lt;br /&gt;
| Button || Switched on || Switched off&lt;br /&gt;
|-&lt;br /&gt;
| Lever&lt;br /&gt;
|rowspan=2| Unstuck&lt;br /&gt;
|rowspan=2| Stuck (at min)&lt;br /&gt;
|-&lt;br /&gt;
| Wheel&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the connection&lt;br /&gt;
#''asMainEntity'' - The entity that causes the change; can be a Lever, Wheel, Button, or Photocell&lt;br /&gt;
#''asConnectEntity'' - The entity that is affected by the change&lt;br /&gt;
#''abInvertStateSent'' - If the state is inverted, making the connected entity change to the opposite state&lt;br /&gt;
#''alStatesUsed'' - The state to use, ignoring the other (1=max only, -1=min only, 0=both)&lt;br /&gt;
#''asCallbackFunc'' - The name of the connection callback&lt;br /&gt;
&lt;br /&gt;
Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asConnectionName, string &amp;amp;in asMainEntity, string &amp;amp;in asConnectEntity, int alState)&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;alState is what is sent to connection entity and will be inverted if abInvertStateSent = true!&lt;br /&gt;
&lt;br /&gt;
====Lamps====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLampLit(string &amp;amp;in asName, bool abLit, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Turns a lamp on or off.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the lamp&lt;br /&gt;
#''abLit ''- Set true if you want the lamp to be lit, set to false if you want the lamp to be unlit&lt;br /&gt;
#''abEffects ''- If you want to have the lamp fade in/out when it gets lit/unlit&lt;br /&gt;
&lt;br /&gt;
====Doors====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorLocked(string &amp;amp;in asName, bool abLocked, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abLocked'' - Locked/unlocked&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is locked/unlocked&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorClosed(string &amp;amp;in asName, bool abClosed, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Name of the door&lt;br /&gt;
#''abClosed'' - Closed/open&lt;br /&gt;
#''abEffects ''- If sounds are played when the door is closed/opened&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
bool GetSwingDoorLocked(string &amp;amp;in asName);&lt;br /&gt;
bool GetSwingDoorClosed(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks whether a swing door is locked/closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorDisableAutoClose(string &amp;amp;in asName, bool abDisableAutoClose);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deactivates the &amp;quot;auto-close&amp;quot; when a door is nearly closed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetSwingDoorState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns an integer depending on how far the door is opened. &amp;lt;br /&amp;gt;-1 = angle is close to 0°, 1 = angle is 70% or higher of max, 0 = inbetween -1 and 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLocked(string &amp;amp;in asName, bool abLocked);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Locks a level door. Note that level doors are NOT swing doors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedSound(string &amp;amp;in asName, string &amp;amp;in asSound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determines which sound is played when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetLevelDoorLockedText(string &amp;amp;in asName, string &amp;amp;in asTextCat, string &amp;amp;in asTextEntry);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Displays a message when interacting with a locked level door.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''asTextCat ''- the category in the .lang file&lt;br /&gt;
#''asTextEntry ''- the entry in the .lang file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectState(string &amp;amp;in asName, float afState);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween (and above, for example, the bridge_metal_vert) are valid too!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMoveObjectStateExt(string &amp;amp;in asName, float afState, float afAcc, float afMaxSpeed, float afSlowdownDist, bool abResetSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves an object to a certain state, extended method.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''afState ''- state of the object, 0 = closed, 1 = open, values inbetween are valid too!&lt;br /&gt;
#''afAcc ''- acceleration&lt;br /&gt;
#''afMaxSpeed ''- maximum speed&lt;br /&gt;
#''afSlowdownDist ''- Distance to the target state before deceleration occurs.&lt;br /&gt;
#''abResetSpeed ''- Set to ''true'' if the prop's speed should be reset before performing the movement, else the prop will accelerate from its current speed to afMaxSpeed.&lt;br /&gt;
&lt;br /&gt;
====Levers, wheels and buttons====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropObjectStuckState(string &amp;amp;in asName, int alState);&lt;br /&gt;
void SetWheelStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
void SetLeverStuckState(string &amp;amp;in asName, int alState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes a prop&amp;lt;nowiki&amp;gt;\&amp;lt;/nowiki&amp;gt;wheel&amp;lt;nowiki&amp;gt;\&amp;lt;/nowiki&amp;gt;lever stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name &lt;br /&gt;
#''alState ''- 0 = not stuck, 1 = at max, -1 = at min &lt;br /&gt;
#''abEffects ''- use effects&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelAngle(string &amp;amp;in asName, float afAngle, bool abAutoMove);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves a wheel to a certain angle.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- internal name&lt;br /&gt;
#''afAngle ''- angle&lt;br /&gt;
#''abAutoMove ''- determines whether the wheel should move on its own&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetWheelInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
void SetLeverInteractionDisablesStuck(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows the player to make a wheel/lever unstuck when interacted with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int GetLeverState(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the state of the lever. &amp;lt;br /&amp;gt;0 = not stuck, 1 = at max, -1 = at min&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderStuckState(string &amp;amp;in asName, int alStuckState, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes a MultiSlider stuck in a certain state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetMultiSliderCallback(string &amp;amp;in asName, string &amp;amp;in asCallback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calls a function when state changes. &amp;lt;br /&amp;gt;Callback syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetButtonSwitchedOn(string &amp;amp;in asName, bool abSwitchedOn, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Sticky areas====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetAllowStickyAreaAttachment(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows entities to stick to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asProp);&lt;br /&gt;
void AttachBodyToStickyArea(string &amp;amp;in asAreaName, string &amp;amp;in asBody);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop/body to a StickyArea.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void DetachFromStickyArea(string &amp;amp;in asAreaName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches everything from a StickyArea.&lt;br /&gt;
&lt;br /&gt;
====NPCs====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCAwake(string &amp;amp;in asName, bool abAwake, bool abEffects);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wakes/sleeps a NPC.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The name of the NPC&lt;br /&gt;
#''abAwake'' - ''true'' to awaken, ''false'' to sleep&lt;br /&gt;
#''abEffects'' - Play the &amp;quot;Awake&amp;quot; or &amp;quot;Sleep&amp;quot; animations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetNPCFollowPlayer(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets a NPC's head to follow the player's movements.&lt;br /&gt;
&lt;br /&gt;
====Enemies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisabled(string &amp;amp;in asName, bool abDisabled);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables an enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyIsHallucination(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes an enemy a hallucination. Hallucinations fade to smoke when they get near the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void FadeEnemyToSmoke(string &amp;amp;in asName, bool abPlaySound);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instantly fades an enemy to smoke.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ShowEnemyPlayerPosition(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Makes the enemy run to the player, no matter where he is.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AlertEnemyOfPlayerPresence(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Gives the specified enemy the player's current position and makes it search the area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDisableTriggers(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables or disables enemy triggers. If disabled, enemy will not react to player or attack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddEnemyPatrolNode(string &amp;amp;in asName, string &amp;amp;in asNodeName, float afWaitTime, string &amp;amp;in asAnimation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a patrol node to the enemy's path.&lt;br /&gt;
&lt;br /&gt;
#''asName''- Internal name of the enemy &lt;br /&gt;
#''asNodeName'' - Path node &lt;br /&gt;
#''afWaitTime'' - Time in seconds that the enemy waits at the path node before continuing. If 0, randomized between 1-3.&lt;br /&gt;
#''asAnimation'' - The animation the enemy uses when reaching the path node&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ClearEnemyPatrolNodes(string &amp;amp;in asEnemyName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the current path of patrol nodes of the enemy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemySanityDecreaseActive(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether an enemy activates the player's sanity drain when stared at.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy &lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToNode(string &amp;amp;in asEnemyName, string &amp;amp;in asNodeName, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific PathNode.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asNodeName'' - Internal name of the node to teleport to &lt;br /&gt;
#''abChangeY'' - Whether the Y position of the node will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void TeleportEnemyToEntity(string &amp;amp;in asEnemyName, string &amp;amp;in asTargetEntity, string &amp;amp;in asTargetBody, bool abChangeY);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Teleports an enemy to a specific entity.&lt;br /&gt;
&lt;br /&gt;
#''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
#''asTargetEntity'' - Internal name of the entity to teleport to&lt;br /&gt;
#''asTargetBody'' - Internal name of the entity's body name to teleport to. If empty, the first body will be used (might be unstable, recommended to input a body anyway)&lt;br /&gt;
#''abChangeY'' - Whether the Y position of the node will be used when teleporting the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeManPigPose(string &amp;amp;in asName, string &amp;amp;in asPoseType);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Changes the pose a specified ManPig.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''asPoseType'' - Name of the ManPig pose to use. Can be &amp;quot;Biped&amp;quot; or &amp;quot;Quadruped&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigFadeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should fade the player's view in and out.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigSoundDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should play the proximity sounds.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigEasyEscapeDisabled(string &amp;amp;in asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should be easier to escape from when hunted. If not disabled, easy escape is activated if the player is more than 12.35 meters away, the enemy can't see the player, and the player has less than 75 health. When this occurs, the enemy is forced to stop hunting and wait for half a second.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ForceTeslaPigSighting(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Forces a Tesla ManPig to be visible for a short time.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
string&amp;amp; GetEnemyStateName(string &amp;amp;in asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
Returns the name of the state a specified enemy is current in.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
Possible states for all enemies:&lt;br /&gt;
*Idle&lt;br /&gt;
*Wait&lt;br /&gt;
*Patrol&lt;br /&gt;
*Investigate&lt;br /&gt;
*Alert&lt;br /&gt;
*Search&lt;br /&gt;
*Hurt&lt;br /&gt;
*Hunt&lt;br /&gt;
*HuntPause&lt;br /&gt;
*HuntWander&lt;br /&gt;
*AttackMeleeShort&lt;br /&gt;
*AttackMeleeLong&lt;br /&gt;
*BreakDoor&lt;br /&gt;
*Dead&lt;br /&gt;
&lt;br /&gt;
Waterlurker-only states:&lt;br /&gt;
*GoHome&lt;br /&gt;
*Eat&lt;br /&gt;
&lt;br /&gt;
ManPig-only states: &lt;br /&gt;
*Flee&lt;br /&gt;
*Stalk&lt;br /&gt;
*Track&lt;br /&gt;
&lt;br /&gt;
Unused states:&lt;br /&gt;
*AttackRange&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/AMFP/ScriptFunctions&amp;diff=6994</id>
		<title>HPL2/AMFP/ScriptFunctions</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/AMFP/ScriptFunctions&amp;diff=6994"/>
		<updated>2025-01-19T07:31:53Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Player */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Engine scripts ==&lt;br /&gt;
&lt;br /&gt;
A list of script functions available in A Machine For Pigs (that are not present in The Dark Descent). Many of TDD's scripts are available in AMFP, but not all. Some are replaced by ones listed below, and others are removed.&lt;br /&gt;
&lt;br /&gt;
=== General ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void CheckPoint(string&amp;amp; asName, string&amp;amp; asStartPos, string&amp;amp; asCallback, string&amp;amp; asDeathHintCat, string&amp;amp; asDeathHintEntry, bool abKeepPlayerInLimbo);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a check point where the player will respawn if they die. '''Callback syntax:'''&amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asName, int alCount)&amp;lt;/code&amp;gt;&lt;br /&gt;
This function replaces TDD's &amp;lt;code&amp;gt;CheckPoint()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The internal name of the callback&lt;br /&gt;
# ''asStartPos'' - The name of the PlayerStartArea to respawn at&lt;br /&gt;
# ''asCallback'' - The name of the callback function to run&lt;br /&gt;
# ''asDeathHintCat'' - The name of the .lang file category&lt;br /&gt;
# ''asDeathHintEntry'' - The name of the .lang file entry&lt;br /&gt;
# ''abKeepPlayerInLimbo'' - Whether to put the player into a state of &amp;quot;limbo&amp;quot; upon death. In limbo, the death occurs normally, but once the screen fades to black, it remains so until &amp;lt;code&amp;gt;ReleasePlayerFromLimbo()&amp;lt;/code&amp;gt;  is called. Player is still controllable during death.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ReleasePlayerFromLimbo();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Respawns the player if stuck in &amp;quot;limbo&amp;quot;. Limbo can be enabled with ''CheckPoint''. Limbo is the state between life and death. The player enters limbo upon dying but won't respawn until this function is called.&lt;br /&gt;
&lt;br /&gt;
=== Particle Systems ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetParticleSystemActive(string&amp;amp; asName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pauses a particle system in its current frame. The paused particle system remains frozen at this frame until reactivated or destroyed.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The name of the particle system&lt;br /&gt;
# ''abActive'' - False to pause, true to unpause&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DestroyParticleSystemInstantly(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Destroys a particle system and any existing particles already emitted from it. Similar to ''DestroyParticleSystem'', except that one will not destroy the existing particles and rather let them live out their lives. This function will cut all particles' lives short.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The internal name of the particle system&lt;br /&gt;
&lt;br /&gt;
=== Sounds ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice2(string&amp;amp; asVoiceFile, string&amp;amp; asEffectFile, string&amp;amp; asTextCat, string&amp;amp; asTextEntry, float afTextDelay, string&amp;amp; asText2Entry, float afText2Delay, bool abUsePostion, string&amp;amp; asPosEnitity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays an audio file with two consecutive subtitles.&lt;br /&gt;
&lt;br /&gt;
# ''asVoiceFile''  - The entire voice file to play (intended to include 2 sections)&lt;br /&gt;
# ''asEffectFile''  - The background effect file to play during voices. Leave empty for no extra effect&lt;br /&gt;
# ''asTextCat''  - The .lang text category for the subtitles&lt;br /&gt;
# ''asTextEntry''  - The first .lang subtitle entry&lt;br /&gt;
# ''afTextDelay''  - The time to wait until the first subtitle starts&lt;br /&gt;
# ''asText2Entry''  - The second .lang subtitle entry&lt;br /&gt;
# ''afText2Delay''  - The time to wait until the second subtitle starts&lt;br /&gt;
# ''abUsePosition''  - Whether to use 3D to play the sound from an entity&lt;br /&gt;
# ''asPosEntity''  - The entity to play the sound from. If empty, plays from player&lt;br /&gt;
# ''afMinDistance''  - The minimum distance required between the player and the entity in order to hear the audio&lt;br /&gt;
# ''afMaxDistance''  - The maximum distance allowed between the player and the entity in order to hear the audio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice3(string&amp;amp; asVoiceFile, string&amp;amp; asEffectFile, string&amp;amp; asTextCat, string&amp;amp; asTextEntry, float afTextDelay, string&amp;amp; asText2Entry, float afText2Delay, string&amp;amp; asText3Entry, float afText3Delay, bool abUsePostion, string&amp;amp; asPosEnitity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays an audio file with three consecutive subtitles.&lt;br /&gt;
&lt;br /&gt;
# ''asVoiceFile''  - The entire voice file to play (intended to include 3 sections)&lt;br /&gt;
# ''asEffectFile''  - The background effect file to play during voices. Leave empty for no extra effect&lt;br /&gt;
# ''asTextCat''  - The .lang text category for the subtitles&lt;br /&gt;
# ''asTextEntry''  - The first .lang subtitle entry&lt;br /&gt;
# ''afTextDelay''  - The time to wait until the first subtitle starts&lt;br /&gt;
# ''asText2Entry''  - The second .lang subtitle entry&lt;br /&gt;
# ''afText2Delay''  - The time to wait until the second subtitle starts&lt;br /&gt;
# ''asText3Entry''  - The third .lang subtitle entry&lt;br /&gt;
# ''afText3Delay''  - The time to wait until the third subtitle starts&lt;br /&gt;
# ''abUsePosition''  - Whether to use 3D to play the sound from an entity&lt;br /&gt;
# ''asPosEntity''  - The entity to play the sound from. If empty, plays from player&lt;br /&gt;
# ''afMinDistance''  - The minimum distance required between the player and the entity in order to hear the audio&lt;br /&gt;
# ''afMaxDistance''  - The maximum distance allowed between the player and the entity in order to hear the audio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice4(string&amp;amp; asVoiceFile, string&amp;amp; asEffectFile, string&amp;amp; asTextCat, string&amp;amp; asTextEntry, float afTextDelay, string&amp;amp; asText2Entry, float afText2Delay, string&amp;amp; asText3Entry, float afText3Delay, string&amp;amp; asText4Entry, float afText4Delay, bool abUsePostion, string&amp;amp; asPosEnitity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays an audio file with four consecutive subtitles.&lt;br /&gt;
&lt;br /&gt;
# ''asVoiceFile''  - The entire voice file to play (intended to include 4 sections)&lt;br /&gt;
# ''asEffectFile''  - The background effect file to play during voices. Leave empty for no extra effect&lt;br /&gt;
# ''asTextCat''  - The .lang text category for the subtitles&lt;br /&gt;
# ''asTextEntry''  - The first .lang subtitle entry&lt;br /&gt;
# ''afTextDelay''  - The time to wait until the first subtitle starts&lt;br /&gt;
# ''asText2Entry''  - The second .lang subtitle entry&lt;br /&gt;
# ''afText2Delay''  - The time to wait until the second subtitle starts&lt;br /&gt;
# ''asText3Entry''  - The third .lang subtitle entry&lt;br /&gt;
# ''afText3Delay''  - The time to wait until the third subtitle starts&lt;br /&gt;
# ''asText4Entry''  - The fourth .lang subtitle entry&lt;br /&gt;
# ''afText4Delay''  - The time to wait until the fourth subtitle starts&lt;br /&gt;
# ''abUsePosition''  - Whether to use 3D to play the sound from an entity&lt;br /&gt;
# ''asPosEntity''  - The entity to play the sound from. If empty, plays from player&lt;br /&gt;
# ''afMinDistance''  - The minimum distance required between the player and the entity in order to hear the audio&lt;br /&gt;
# ''afMaxDistance''  - The maximum distance allowed between the player and the entity in order to hear the audio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice5(string&amp;amp; asVoiceFile, string&amp;amp; asEffectFile, string&amp;amp; asTextCat, string&amp;amp; asTextEntry, float afTextDelay, string&amp;amp; asText2Entry, float afText2Delay, string&amp;amp; asText3Entry, float afText3Delay, string&amp;amp; asText4Entry, float afText4Delay, string&amp;amp; asText5Entry, float afText5Delay, bool abUsePostion, string&amp;amp; asPosEnitity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays an audio file with five consecutive subtitles.&lt;br /&gt;
&lt;br /&gt;
# ''asVoiceFile''  - The entire voice file to play (intended to include 5 sections)&lt;br /&gt;
# ''asEffectFile''  - The background effect file to play during voices. Leave empty for no extra effect&lt;br /&gt;
# ''asTextCat''  - The .lang text category for the subtitles&lt;br /&gt;
# ''asTextEntry''  - The first .lang subtitle entry&lt;br /&gt;
# ''afTextDelay''  - The time to wait until the first subtitle starts&lt;br /&gt;
# ''asText2Entry''  - The second .lang subtitle entry&lt;br /&gt;
# ''afText2Delay''  - The time to wait until the second subtitle starts&lt;br /&gt;
# ''asText3Entry''  - The third .lang subtitle entry&lt;br /&gt;
# ''afText3Delay''  - The time to wait until the third subtitle starts&lt;br /&gt;
# ''asText4Entry''  - The fourth .lang subtitle entry&lt;br /&gt;
# ''afText4Delay''  - The time to wait until the fourth subtitle starts&lt;br /&gt;
# ''asText5Entry''  - The fifth .lang subtitle entry&lt;br /&gt;
# ''afText5Delay''  - The time to wait until the fifth subtitle starts&lt;br /&gt;
# ''abUsePosition''  - Whether to use 3D to play the sound from an entity&lt;br /&gt;
# ''asPosEntity''  - The entity to play the sound from. If empty, plays from player&lt;br /&gt;
# ''afMinDistance''  - The minimum distance required between the player and the entity in order to hear the audio&lt;br /&gt;
# ''afMaxDistance''  - The maximum distance allowed between the player and the entity in order to hear the audio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice5(string&amp;amp; asVoiceFile, string&amp;amp; asEffectFile, string&amp;amp; asTextCat, string&amp;amp; asTextEntry, float afTextDelay, string&amp;amp; asText2Entry, float afText2Delay, string&amp;amp; asText3Entry, float afText3Delay, string&amp;amp; asText4Entry, float afText4Delay, string&amp;amp; asText5Entry, float afText5Delay, string&amp;amp; asText6Entry, float afText6Delay, bool abUsePostion, string&amp;amp; asPosEnitity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays an audio file with six consecutive subtitles.&lt;br /&gt;
&lt;br /&gt;
# ''asVoiceFile''  - The entire voice file to play (intended to include 6 sections)&lt;br /&gt;
# ''asEffectFile''  - The background effect file to play during voices. Leave empty for no extra effect&lt;br /&gt;
# ''asTextCat''  - The .lang text category for the subtitles&lt;br /&gt;
# ''asTextEntry''  - The first .lang subtitle entry&lt;br /&gt;
# ''afTextDelay''  - The time to wait until the first subtitle starts&lt;br /&gt;
# ''asText2Entry''  - The second .lang subtitle entry&lt;br /&gt;
# ''afText2Delay''  - The time to wait until the second subtitle starts&lt;br /&gt;
# ''asText3Entry''  - The third .lang subtitle entry&lt;br /&gt;
# ''afText3Delay''  - The time to wait until the third subtitle starts&lt;br /&gt;
# ''asText4Entry''  - The fourth .lang subtitle entry&lt;br /&gt;
# ''afText4Delay''  - The time to wait until the fourth subtitle starts&lt;br /&gt;
# ''asText5Entry''  - The fifth .lang subtitle entry&lt;br /&gt;
# ''afText5Delay''  - The time to wait until the fifth subtitle starts&lt;br /&gt;
# ''asText6Entry''  - The sixth .lang subtitle entry&lt;br /&gt;
# ''afText6Delay''  - The time to wait until the sixth subtitle starts&lt;br /&gt;
# ''abUsePosition''  - Whether to use 3D to play the sound from an entity&lt;br /&gt;
# ''asPosEntity''  - The entity to play the sound from. If empty, plays from player&lt;br /&gt;
# ''afMinDistance''  - The minimum distance required between the player and the entity in order to hear the audio&lt;br /&gt;
# ''afMaxDistance''  - The maximum distance allowed between the player and the entity in order to hear the audio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice7(string&amp;amp; asVoiceFile, string&amp;amp; asEffectFile, string&amp;amp; asTextCat, string&amp;amp; asTextEntry, float afTextDelay, string&amp;amp; asText2Entry, float afText2Delay, string&amp;amp; asText3Entry, float afText3Delay, string&amp;amp; asText4Entry, float afText4Delay, string&amp;amp; asText5Entry, float afText5Delay, string&amp;amp; asText6Entry, float afText6Delay, string&amp;amp; asText7Entry, float afText7Delay, bool abUsePostion, string&amp;amp; asPosEnitity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays an audio file with seven consecutive subtitles.&lt;br /&gt;
&lt;br /&gt;
# ''asVoiceFile''  - The entire voice file to play (intended to include 7 sections)&lt;br /&gt;
# ''asEffectFile''  - The background effect file to play during voices. Leave empty for no extra effect&lt;br /&gt;
# ''asTextCat''  - The .lang text category for the subtitles&lt;br /&gt;
# ''asTextEntry''  - The first .lang subtitle entry&lt;br /&gt;
# ''afTextDelay''  - The time to wait until the first subtitle starts&lt;br /&gt;
# ''asText2Entry''  - The second .lang subtitle entry&lt;br /&gt;
# ''afText2Delay''  - The time to wait until the second subtitle starts&lt;br /&gt;
# ''asText3Entry''  - The third .lang subtitle entry&lt;br /&gt;
# ''afText3Delay''  - The time to wait until the third subtitle starts&lt;br /&gt;
# ''asText4Entry''  - The fourth .lang subtitle entry&lt;br /&gt;
# ''afText4Delay''  - The time to wait until the fourth subtitle starts&lt;br /&gt;
# ''asText5Entry''  - The fifth .lang subtitle entry&lt;br /&gt;
# ''afText5Delay''  - The time to wait until the fifth subtitle starts&lt;br /&gt;
# ''asText6Entry''  - The sixth .lang subtitle entry&lt;br /&gt;
# ''afText6Delay''  - The time to wait until the sixth subtitle starts&lt;br /&gt;
# ''asText7Entry''  - The seventh .lang subtitle entry&lt;br /&gt;
# ''afText7Delay ''- The time to wait until the seventh subtitle starts&lt;br /&gt;
# ''abUsePosition''  - Whether to use 3D to play the sound from an entity&lt;br /&gt;
# ''asPosEntity''  - The entity to play the sound from. If empty, plays from player&lt;br /&gt;
# ''afMinDistance''  - The minimum distance required between the player and the entity in order to hear the audio&lt;br /&gt;
# ''afMaxDistance''  - The maximum distance allowed between the player and the entity in order to hear the audio&lt;br /&gt;
&lt;br /&gt;
=== Screen Effects ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ShowScreenImage(string&amp;amp; asImageName, float afX, float afY, float afScale, bool abUseRelativeCoordinates, float afDuration, float afFadeIn, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shows a 2D image on the screen. Originally used for showing the intro logo during a sequence.&lt;br /&gt;
&lt;br /&gt;
May work similarly to the [[HPL2/Tutorials/ShowScreenImage()|ATTD 1.5 ShowScreenImage()]].&lt;br /&gt;
&lt;br /&gt;
# ''asImageName''  - The image file to show. Does not have to be pow2 (although it gives a warning if not)&lt;br /&gt;
# ''afX''- The X position of the top left corner, starting from the center of the screen. Use negative half of the width of the image to center it.&lt;br /&gt;
# ''afY''- The Y position of the top left corner, starting from the center of the screen.&lt;br /&gt;
# ''afScale'' - The size of the image in pixels (not scale), or original image size if negative&lt;br /&gt;
# ''abUseRelativeCoordinates'' - Whether X and Y are relative to the screen resoltion, or pixel co-ordinates if not&lt;br /&gt;
# ''afDuration'' - How long, in seconds, the image displays. This does not include fade times&lt;br /&gt;
# ''afFadeIn'' - How long, in seconds, the fade in spends&lt;br /&gt;
# ''afFadeOut'' - How long, in seconds, the fade out spends&lt;br /&gt;
&lt;br /&gt;
=== Journal ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddHint(string&amp;amp; asNameAndTextEntry, string&amp;amp; asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a hint to the player's journal.&amp;lt;br&amp;gt;This function replaces TDD's ''AddDiary''.&lt;br /&gt;
&lt;br /&gt;
# ''asNameAndTextEntry'' - The .lang text entry of the hint. The entry must be in category &amp;quot;Journal&amp;quot; and use the format Hint_MyHint_Name for the title and Hint_MyHint_Text for the body, where MyHint replaces the value you put in this argument.&lt;br /&gt;
# ''asImage'' - This argument does not seem to be used. Presumed to be for displaying an image but possibly removed functionality. All existing occurrences are empty.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
bool GetJournalDisabled();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the journal is currently disabled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetJournalDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the player's ability to open their journal.&lt;br /&gt;
&lt;br /&gt;
# ''abX''  - True to disable, false to enable again&lt;br /&gt;
&lt;br /&gt;
=== Player ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternFlickerActive(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables the flicker effect for the lantern's light.&lt;br /&gt;
&lt;br /&gt;
# ''abX'' - True to flicker, false to not flicker&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerInfection(float afInfection);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the [[HPL2/AMFP/Infection|infection]] level for the player. Infection replaces sanity from TDD and acts similar, however it goes from 0-100 instead of 100-0. An infection level above 50 will affect the player's ability to move. Infection level above 80 will kill the player after a 2 second delay. Infection slowly decreases over time, unless above 75. &amp;lt;br /&amp;gt;This function replaces TDD's ''SetPlayerSanity''.&lt;br /&gt;
&lt;br /&gt;
# ''afInfection'' - The level of infection to set&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddPlayerInfection(float afInfection);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds an amount of infection to the player's current amount.&amp;lt;br&amp;gt;This function replaces TDD's ''AddPlayerSanity''.&lt;br /&gt;
&lt;br /&gt;
# ''afInfection'' - The amount to add&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerInfection();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the amount of infection the player currently has.&amp;lt;br&amp;gt;This function replaces TDD's ''GetPlayerSanity''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void GiveInfectionDamage(float afAmount, bool abUseEffect);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increases the infection of the player.&amp;lt;br&amp;gt;This function replaces TDD's ''GiveSanityDamage''.&lt;br /&gt;
&lt;br /&gt;
# ''afAmount'' - Amount of infection damage done&lt;br /&gt;
# ''abUseEffect'' - Determines whether a sound effect is played when the infection damage is dealt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInfectionFauxMode(bool abFauxMode);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable/disable &amp;quot;faux mode&amp;quot; for infection. In faux mode, the player cannot die of infection and infection sounds don't play.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerPitchTo(float afX, float afSpeedMul, float afMaxSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves the player's pitch (up and down rotation).&lt;br /&gt;
&lt;br /&gt;
# ''afX'' - The target pitch to move towards. 0 = straight forward. Clamped to range: -70 to +70.&lt;br /&gt;
# ''afSpeedMul'' - The speed multiplier of the movement. A low value makes a slow change.&lt;br /&gt;
# ''afMaxSpeed'' - The max speed of the movement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerUsesDragFootsteps(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets whether the player's footstep sounds are replaced with &amp;quot;drag&amp;quot; versions. Some surface materials do not have drag steps, and will therefore play no footstep sounds.&lt;br /&gt;
&lt;br /&gt;
# abX - Whether to use &amp;quot;drag&amp;quot; step sounds&lt;br /&gt;
&lt;br /&gt;
=== Entities ===&lt;br /&gt;
&lt;br /&gt;
==== General ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntityActive(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns whether an entity in the level is active or not.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The entity to check&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateEntityAtArea(string&amp;amp; asEntityName, string&amp;amp; asEntityFile, string&amp;amp; asAreaName, bool abFullGameSave, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an entity at an area with the specified offsets and rotation. &amp;lt;br /&amp;gt;This function replaces TDD's ''CreateEntityAtArea''.&lt;br /&gt;
&lt;br /&gt;
# ''asEntityName'' - The internal name of the created entity&lt;br /&gt;
# ''asEntityFile'' - The file for the entity (extension .ent)&lt;br /&gt;
# ''asAreaName'' - The area to create entity at&lt;br /&gt;
# ''abFullGameSave'' - Determines whether an entity &amp;quot;remembers&amp;quot; its state&lt;br /&gt;
# ''afOffsetX'' - The offset along the X axis in units&lt;br /&gt;
# ''afOffsetY'' - The offset along the Y axis in units&lt;br /&gt;
# ''afOffsetZ'' - The offset along the Z axis in units&lt;br /&gt;
# ''afRotX'' - The rotation on the X axis in degrees&lt;br /&gt;
# ''afRotY'' - The rotation on the Y axis in degrees&lt;br /&gt;
# ''afRotZ'' - The rotation on the Z axis in degrees&lt;br /&gt;
&lt;br /&gt;
==== Props ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPhysicsAutoDisable(string&amp;amp; asName, bool abAutoDisable);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If physics bodies will automatically sleep (become inactive and stop moving). Only used on chandeliers in the campaign.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The prop to affect&lt;br /&gt;
# ''abAutoDisable'' - Whether physics auto disables or not&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToBone(string&amp;amp; asChildEntityName, string&amp;amp; asParentEntityName, string&amp;amp; asParentBoneName, float fPosX, float fPosY, float fPosZ, float fRotX, float fRotY, float fRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to a specific bone within another entity. You can inspect bones in the Model Editor. Note: Offsets and rotations are local to the bone and relative to its rotation.&lt;br /&gt;
&lt;br /&gt;
# ''asChildEntityName'' - The prop to attach&lt;br /&gt;
# ''asParentEntityName'' - The entity that holds the bone to attach to&lt;br /&gt;
# ''asParentBoneName'' - The bone within the entity to attach to&lt;br /&gt;
# ''afPosX'' - Offset along the X axis&lt;br /&gt;
# ''afPosY'' - Offset along the Y axis&lt;br /&gt;
# ''afPosZ'' - Offset along the Z axis&lt;br /&gt;
# ''afRotX'' - Rotation along the X axis&lt;br /&gt;
# ''afRotY'' - Rotation along the Y axis&lt;br /&gt;
# ''afRotZ'' - Rotation along the Z axis&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DetachPropFromBone(string&amp;amp; asChildEntityName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches an attached prop. Note: When detached, physics are not automatically enabled on the prop.&lt;br /&gt;
&lt;br /&gt;
# ''asChildEntityName'' - The attached prop&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AttachAreaToProp(string&amp;amp; asAreaName, string&amp;amp; asProp, int alBody);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches an area to a prop. Originally used to attach a liquid area to a movable water plane entity in the sewers map.&lt;br /&gt;
&lt;br /&gt;
# ''asAreaName'' - The area to attach&lt;br /&gt;
# ''asProp'' - The prop to attach area to&lt;br /&gt;
# ''alBody'' - The ID of the physics body of the prop to attach to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopPropAnimation(string&amp;amp; asProp);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops the animation currently playing on a prop. Animations can be started with ''PlayPropAnimation''.&lt;br /&gt;
&lt;br /&gt;
# ''asProp'' - The name of the prop&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayCurrentAnimation(string&amp;amp; asProp, float afFadeTime, bool abLoop);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades in the active animation, optionally allowing it to loop.&lt;br /&gt;
&lt;br /&gt;
# ''asProp'' - The name of the prop&lt;br /&gt;
# ''afFadeTime'' - The fade time between animations&lt;br /&gt;
# ''abLoop'' - If the animation should be looped&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PauseCurrentAnimation(string&amp;amp; asProp, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades out the active animation.&lt;br /&gt;
&lt;br /&gt;
# ''asProp'' - The name of the prop&lt;br /&gt;
# ''afFadeTime'' - The fade time between animations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropAnimationSpeed(string&amp;amp; asProp, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the speed of the animation. Generally used in conjunction with ''PlayPropAnimation''.&lt;br /&gt;
&lt;br /&gt;
# ''asProp'' - The prop that is being animated&lt;br /&gt;
# ''afSpeed'' - The new animation speed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropAnimationPosition(string&amp;amp; asProp, float afPos);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Jumps to a specific point in an animation. Generally used in conjunction with ''PlayPropAnimation''.&lt;br /&gt;
&lt;br /&gt;
# ''asProp'' - The prop that is being animated&lt;br /&gt;
# ''afPos'' - The time within the animation, in seconds, to jump to&lt;br /&gt;
&lt;br /&gt;
==== Lamps ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLampFlickerActive(string&amp;amp; asName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables a flickering effect on a Lamp.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The lamp entity&lt;br /&gt;
# ''abActive'' - Whether to enable flicker&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeLampTo(string&amp;amp; asName, float afR, float afG, float afB, float afA, float afRadius, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades a Lamp's light to another color. This function uses integers for color values instead of floats, which is a little odd. Likewise, it uses a double floating point for the last argument instead of a regular one.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The lamp to change&lt;br /&gt;
# ''afR'' - Red value (appropriate values are 0 - 10)&lt;br /&gt;
# ''afG'' - Green value (appropriate values are 0 - 10)&lt;br /&gt;
# ''afB'' - Blue value (appropriate values are 0 - 10)&lt;br /&gt;
# ''afA'' - Alpha value (has no effect?)&lt;br /&gt;
# ''afRadius'' - The new radius to use (affects illumination strength)&lt;br /&gt;
# ''afTime'' - Time in seconds until the light properties have changed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLampCanBeLitByPlayer(string&amp;amp; asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables the player's ability to light a lamp.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The name of the Lamp&lt;br /&gt;
# ''abX'' - State to set&lt;br /&gt;
&lt;br /&gt;
==== Doors ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorOpenAmount(string&amp;amp; asName, float afOpenAmount, float afDuration, bool abOpenTowardsMaxAngle);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the open amount for a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The SwingDoor entity&lt;br /&gt;
# ''afOpenAmount'' - The new amount state to set. Range: 0 - 1&lt;br /&gt;
# ''afDuration'' - The time in seconds until the door has changed state&lt;br /&gt;
# ''abOpenTowardsMaxAngle'' - If the door will swing to its max angle instead of its min angle&lt;br /&gt;
&lt;br /&gt;
==== Buttons ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetButtonCanBeSwitchedOn(string&amp;amp; asName, bool abCanBeSwitchedOn);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes whether a Button can be switched from off to on.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The Button entity&lt;br /&gt;
# ''abCanBeSwitchedOn'' - Whether it can be switched on&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetButtonCanBeSwitchedOff(string&amp;amp; asName, bool abCanBeSwitchedOff);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes whether a Button can be switched from on to off.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The Button entity&lt;br /&gt;
# ''abCanBeSwitchedOff'' - Whether it can be switched off&lt;br /&gt;
&lt;br /&gt;
==== PhoneBoxes ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPhoneRinging(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables a PhoneBox to start ringing. A ringing phone box can be interacted with to play some audio files. After interacting, the phone will stop ringing.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The PhoneBox entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopPhoneRinging(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops a ringing PhoneBox.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The PhoneBox entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void HangUpPhone(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hangs up a PhoneBox.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The PhoneBox entity&lt;br /&gt;
&lt;br /&gt;
==== Enemies ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEnemyPatrolNode(string&amp;amp; asName, string&amp;amp; asNodeName, float afWaitTime, string&amp;amp; asAnimation, bool abLoopAnimation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a patrol node to the enemy's walking path. A path is restarted from the beginning when the final node is reached. Note: Inputting an invalid animation in asAnimation at the final node will make the enemy wait there indefinitely.&amp;lt;br /&amp;gt;This function replaces TDD's AddEnemyPatrolNode.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The name of the enemy&lt;br /&gt;
# ''asNodeName'' - Internal name of path node&lt;br /&gt;
# ''afWaitTime'' - The time, in seconds, the enemy waits at this node before continuing. Note: A time of 0 instead randomizes between 1 and 3 seconds, so use 0.01 instead if you want the enemy to immediately continue to the next node.&lt;br /&gt;
# ''asAnimation'' - The animation to play on the enemy when they arrive at this path node. Animations can be found in the Model Editor. Leave empty to play no special animation (uses default Idle animation). Note: If the animation lasts longer than afWaitTime, the enemy waits until the animation is complete before continuing the path.&lt;br /&gt;
# ''abLoopAnimation'' - If the animation should be looped&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyMoveType(string&amp;amp; asName, string&amp;amp; asMoveType);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes how an enemy moves.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The name of the enemy&lt;br /&gt;
# ''asMoveType'' - The type to change to. Can be &amp;quot;WalkBiped&amp;quot;, &amp;quot;RunBiped&amp;quot;, &amp;quot;ChargeBiped&amp;quot;, &amp;quot;Idle&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetManPigType(string&amp;amp; asName, string&amp;amp; asManPigType);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the personality type for a ManPig enemy. Non-functional; left over from an earlier state of development. Only &amp;quot;Freddy&amp;quot; is used as the type, but supposedly it should also accept &amp;quot;Rod&amp;quot; and &amp;quot;Jane&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The ManPig enemy.&lt;br /&gt;
# ''asManPigType'' - The type to set. Type can be &amp;quot;Freddy&amp;quot;, &amp;quot;Rod&amp;quot;, &amp;quot;Jane&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The three types allegedly describe three different personality types for the AI, according to Peter Howell in [https://researchportal.port.ac.uk/portal/files/3364888/PeterHowell_PhD.pdf his PhD, section 7.4.4].&lt;br /&gt;
&lt;br /&gt;
Extract:&lt;br /&gt;
&lt;br /&gt;
''The initial design of the game’s enemy artificial intelligence system contained three unique sets of behavioural controls. There was only one visual enemy style, however every enemy agent in the game would be assigned one of three possible ‘personalities’, referred to in the game’s code as the ‘Rod’, ‘Jane’ and ‘Freddy’ personality types. These personalities each had a different set of behavioural rules, thus allowing enemy agents that may otherwise appear identical to behave very differently to one another.''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Enemy Agent Personality Type !! Primary Behavioral Traits&lt;br /&gt;
|-&lt;br /&gt;
| Rod || &lt;br /&gt;
*Will maintain a 'safe' distance to the player-character.&lt;br /&gt;
*If unable to do so, will approach player character, investigate them (by getting close and smelling them), before continuing its patrol. &lt;br /&gt;
|-&lt;br /&gt;
| Jane || &lt;br /&gt;
*Will maintain a ‘safe’ distance from player-character, whilst observing the player-character’s movements&lt;br /&gt;
*If unable to maintain ‘safe’ distance, will panic and flee.&lt;br /&gt;
*If cornered and unable to flee, will attack and knock player-character to floor, then flee. &lt;br /&gt;
*Will only attack and kill player-character as a last resort. &lt;br /&gt;
|-&lt;br /&gt;
| Freddy || &lt;br /&gt;
*Will actively hunt the player-character.&lt;br /&gt;
*Will attack and kill them if given the opportunity. &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigFadeDisabled(string&amp;amp; asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should fade the player's view in and out.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Internal name of the enemy&lt;br /&gt;
#''abX''- Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigSoundDisabled(string&amp;amp; asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should play the proximity sounds.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigEasyEscapeDisabled(string&amp;amp; asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should be easier to escape from when hunted. If not disabled, easy escape is activated if the player is more than 12.35 meters away, the enemy can't see the player, and the player has less than 75 health. When this occurs, the enemy is forced to stop hunting and wait for half a second.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ForceTeslaPigSighting(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces a Tesla ManPig to be visible for a short time.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayEnemyAnimation(string&amp;amp; asEnemyName, string&amp;amp; asAnimName, bool abLoop, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays a specific animation for an enemy.&lt;br /&gt;
&lt;br /&gt;
# ''asEnemyName'' - Internal name of the enemy (asterisk is allowed)&lt;br /&gt;
# ''asAnimName'' - The name of an animation registered to the enemy&lt;br /&gt;
# ''abLoop'' - Whether the animation loops&lt;br /&gt;
# ''afFadeTime'' - The fade time between animations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void PlayScriptedAnimation(string&amp;amp; asName, string&amp;amp; asAnimationName, bool abLoopAnimation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays an animation that has been added to an entity through the Model Editor. Similar to ''PlayEnemyAnimation''.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - Internal name of the enemy&lt;br /&gt;
# ''asAnimationName'' - The animation name&lt;br /&gt;
# ''abLoopAnimation'' - Whether to loop the animation or play it only once&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeEnemyPose(string&amp;amp; asName, string&amp;amp; asPoseType);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the pose for an enemy. Can be either &amp;quot;Biped&amp;quot; or &amp;quot;Quadruped&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - Internal name of the enemy&lt;br /&gt;
# ''asPoseType''  - The pose to change to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ForceEnemyWaitState(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the enemy's AI to change its state to &amp;quot;Wait&amp;quot;, which makes the enemy wait for a short while before continuing its' normal actions. An enemy without patrol nodes defaults to the &amp;quot;Wait&amp;quot; state. Otherwise, if patrol nodes are added, the enemy will continue the path after waiting is done.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SendEnemyTimeOut(string&amp;amp; asName, float afTimeOut );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the enemy's AI to change its state to &amp;quot;TimeOut&amp;quot;, which forces the enemy to pause.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - Internal name of the enemy&lt;br /&gt;
# ''afTimeOut'' - The length of the time out&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopAnimationAndContinue(string&amp;amp; asName, float afTimeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the enemy to stop its patrol animation for the specified amount of time.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - Internal name of the enemy&lt;br /&gt;
# ''afTimeOut'' - The length of the time out&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyBlind(string&amp;amp; asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets whether the enemy can see the player if they are within visible range.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - Internal name of the enemy&lt;br /&gt;
# ''abX'' - Whether enemy is blind&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDeaf(string&amp;amp; asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets whether the enemy can hear the player make sound if they are within audible range.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - Internal name of the enemy&lt;br /&gt;
# ''abX'' - Whether enemy is deaf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetPlayerCanSeeEnemy(string&amp;amp; asEnemyName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns whether the enemy is within visible range of the player.&lt;br /&gt;
&lt;br /&gt;
# ''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetEnemyPlayerDistance(string&amp;amp; asEnemyName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the distance (in meters) between the enemy and the player.&lt;br /&gt;
&lt;br /&gt;
# ''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int GetEnemyState(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the enemy's current state as an integer.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/AMFP/ScriptFunctions&amp;diff=6993</id>
		<title>HPL2/AMFP/ScriptFunctions</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/AMFP/ScriptFunctions&amp;diff=6993"/>
		<updated>2025-01-19T07:30:43Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Player */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Engine scripts ==&lt;br /&gt;
&lt;br /&gt;
A list of script functions available in A Machine For Pigs (that are not present in The Dark Descent). Many of TDD's scripts are available in AMFP, but not all. Some are replaced by ones listed below, and others are removed.&lt;br /&gt;
&lt;br /&gt;
=== General ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void CheckPoint(string&amp;amp; asName, string&amp;amp; asStartPos, string&amp;amp; asCallback, string&amp;amp; asDeathHintCat, string&amp;amp; asDeathHintEntry, bool abKeepPlayerInLimbo);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a check point where the player will respawn if they die. '''Callback syntax:'''&amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asName, int alCount)&amp;lt;/code&amp;gt;&lt;br /&gt;
This function replaces TDD's &amp;lt;code&amp;gt;CheckPoint()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The internal name of the callback&lt;br /&gt;
# ''asStartPos'' - The name of the PlayerStartArea to respawn at&lt;br /&gt;
# ''asCallback'' - The name of the callback function to run&lt;br /&gt;
# ''asDeathHintCat'' - The name of the .lang file category&lt;br /&gt;
# ''asDeathHintEntry'' - The name of the .lang file entry&lt;br /&gt;
# ''abKeepPlayerInLimbo'' - Whether to put the player into a state of &amp;quot;limbo&amp;quot; upon death. In limbo, the death occurs normally, but once the screen fades to black, it remains so until &amp;lt;code&amp;gt;ReleasePlayerFromLimbo()&amp;lt;/code&amp;gt;  is called. Player is still controllable during death.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ReleasePlayerFromLimbo();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Respawns the player if stuck in &amp;quot;limbo&amp;quot;. Limbo can be enabled with ''CheckPoint''. Limbo is the state between life and death. The player enters limbo upon dying but won't respawn until this function is called.&lt;br /&gt;
&lt;br /&gt;
=== Particle Systems ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetParticleSystemActive(string&amp;amp; asName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pauses a particle system in its current frame. The paused particle system remains frozen at this frame until reactivated or destroyed.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The name of the particle system&lt;br /&gt;
# ''abActive'' - False to pause, true to unpause&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DestroyParticleSystemInstantly(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Destroys a particle system and any existing particles already emitted from it. Similar to ''DestroyParticleSystem'', except that one will not destroy the existing particles and rather let them live out their lives. This function will cut all particles' lives short.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The internal name of the particle system&lt;br /&gt;
&lt;br /&gt;
=== Sounds ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice2(string&amp;amp; asVoiceFile, string&amp;amp; asEffectFile, string&amp;amp; asTextCat, string&amp;amp; asTextEntry, float afTextDelay, string&amp;amp; asText2Entry, float afText2Delay, bool abUsePostion, string&amp;amp; asPosEnitity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays an audio file with two consecutive subtitles.&lt;br /&gt;
&lt;br /&gt;
# ''asVoiceFile''  - The entire voice file to play (intended to include 2 sections)&lt;br /&gt;
# ''asEffectFile''  - The background effect file to play during voices. Leave empty for no extra effect&lt;br /&gt;
# ''asTextCat''  - The .lang text category for the subtitles&lt;br /&gt;
# ''asTextEntry''  - The first .lang subtitle entry&lt;br /&gt;
# ''afTextDelay''  - The time to wait until the first subtitle starts&lt;br /&gt;
# ''asText2Entry''  - The second .lang subtitle entry&lt;br /&gt;
# ''afText2Delay''  - The time to wait until the second subtitle starts&lt;br /&gt;
# ''abUsePosition''  - Whether to use 3D to play the sound from an entity&lt;br /&gt;
# ''asPosEntity''  - The entity to play the sound from. If empty, plays from player&lt;br /&gt;
# ''afMinDistance''  - The minimum distance required between the player and the entity in order to hear the audio&lt;br /&gt;
# ''afMaxDistance''  - The maximum distance allowed between the player and the entity in order to hear the audio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice3(string&amp;amp; asVoiceFile, string&amp;amp; asEffectFile, string&amp;amp; asTextCat, string&amp;amp; asTextEntry, float afTextDelay, string&amp;amp; asText2Entry, float afText2Delay, string&amp;amp; asText3Entry, float afText3Delay, bool abUsePostion, string&amp;amp; asPosEnitity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays an audio file with three consecutive subtitles.&lt;br /&gt;
&lt;br /&gt;
# ''asVoiceFile''  - The entire voice file to play (intended to include 3 sections)&lt;br /&gt;
# ''asEffectFile''  - The background effect file to play during voices. Leave empty for no extra effect&lt;br /&gt;
# ''asTextCat''  - The .lang text category for the subtitles&lt;br /&gt;
# ''asTextEntry''  - The first .lang subtitle entry&lt;br /&gt;
# ''afTextDelay''  - The time to wait until the first subtitle starts&lt;br /&gt;
# ''asText2Entry''  - The second .lang subtitle entry&lt;br /&gt;
# ''afText2Delay''  - The time to wait until the second subtitle starts&lt;br /&gt;
# ''asText3Entry''  - The third .lang subtitle entry&lt;br /&gt;
# ''afText3Delay''  - The time to wait until the third subtitle starts&lt;br /&gt;
# ''abUsePosition''  - Whether to use 3D to play the sound from an entity&lt;br /&gt;
# ''asPosEntity''  - The entity to play the sound from. If empty, plays from player&lt;br /&gt;
# ''afMinDistance''  - The minimum distance required between the player and the entity in order to hear the audio&lt;br /&gt;
# ''afMaxDistance''  - The maximum distance allowed between the player and the entity in order to hear the audio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice4(string&amp;amp; asVoiceFile, string&amp;amp; asEffectFile, string&amp;amp; asTextCat, string&amp;amp; asTextEntry, float afTextDelay, string&amp;amp; asText2Entry, float afText2Delay, string&amp;amp; asText3Entry, float afText3Delay, string&amp;amp; asText4Entry, float afText4Delay, bool abUsePostion, string&amp;amp; asPosEnitity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays an audio file with four consecutive subtitles.&lt;br /&gt;
&lt;br /&gt;
# ''asVoiceFile''  - The entire voice file to play (intended to include 4 sections)&lt;br /&gt;
# ''asEffectFile''  - The background effect file to play during voices. Leave empty for no extra effect&lt;br /&gt;
# ''asTextCat''  - The .lang text category for the subtitles&lt;br /&gt;
# ''asTextEntry''  - The first .lang subtitle entry&lt;br /&gt;
# ''afTextDelay''  - The time to wait until the first subtitle starts&lt;br /&gt;
# ''asText2Entry''  - The second .lang subtitle entry&lt;br /&gt;
# ''afText2Delay''  - The time to wait until the second subtitle starts&lt;br /&gt;
# ''asText3Entry''  - The third .lang subtitle entry&lt;br /&gt;
# ''afText3Delay''  - The time to wait until the third subtitle starts&lt;br /&gt;
# ''asText4Entry''  - The fourth .lang subtitle entry&lt;br /&gt;
# ''afText4Delay''  - The time to wait until the fourth subtitle starts&lt;br /&gt;
# ''abUsePosition''  - Whether to use 3D to play the sound from an entity&lt;br /&gt;
# ''asPosEntity''  - The entity to play the sound from. If empty, plays from player&lt;br /&gt;
# ''afMinDistance''  - The minimum distance required between the player and the entity in order to hear the audio&lt;br /&gt;
# ''afMaxDistance''  - The maximum distance allowed between the player and the entity in order to hear the audio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice5(string&amp;amp; asVoiceFile, string&amp;amp; asEffectFile, string&amp;amp; asTextCat, string&amp;amp; asTextEntry, float afTextDelay, string&amp;amp; asText2Entry, float afText2Delay, string&amp;amp; asText3Entry, float afText3Delay, string&amp;amp; asText4Entry, float afText4Delay, string&amp;amp; asText5Entry, float afText5Delay, bool abUsePostion, string&amp;amp; asPosEnitity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays an audio file with five consecutive subtitles.&lt;br /&gt;
&lt;br /&gt;
# ''asVoiceFile''  - The entire voice file to play (intended to include 5 sections)&lt;br /&gt;
# ''asEffectFile''  - The background effect file to play during voices. Leave empty for no extra effect&lt;br /&gt;
# ''asTextCat''  - The .lang text category for the subtitles&lt;br /&gt;
# ''asTextEntry''  - The first .lang subtitle entry&lt;br /&gt;
# ''afTextDelay''  - The time to wait until the first subtitle starts&lt;br /&gt;
# ''asText2Entry''  - The second .lang subtitle entry&lt;br /&gt;
# ''afText2Delay''  - The time to wait until the second subtitle starts&lt;br /&gt;
# ''asText3Entry''  - The third .lang subtitle entry&lt;br /&gt;
# ''afText3Delay''  - The time to wait until the third subtitle starts&lt;br /&gt;
# ''asText4Entry''  - The fourth .lang subtitle entry&lt;br /&gt;
# ''afText4Delay''  - The time to wait until the fourth subtitle starts&lt;br /&gt;
# ''asText5Entry''  - The fifth .lang subtitle entry&lt;br /&gt;
# ''afText5Delay''  - The time to wait until the fifth subtitle starts&lt;br /&gt;
# ''abUsePosition''  - Whether to use 3D to play the sound from an entity&lt;br /&gt;
# ''asPosEntity''  - The entity to play the sound from. If empty, plays from player&lt;br /&gt;
# ''afMinDistance''  - The minimum distance required between the player and the entity in order to hear the audio&lt;br /&gt;
# ''afMaxDistance''  - The maximum distance allowed between the player and the entity in order to hear the audio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice5(string&amp;amp; asVoiceFile, string&amp;amp; asEffectFile, string&amp;amp; asTextCat, string&amp;amp; asTextEntry, float afTextDelay, string&amp;amp; asText2Entry, float afText2Delay, string&amp;amp; asText3Entry, float afText3Delay, string&amp;amp; asText4Entry, float afText4Delay, string&amp;amp; asText5Entry, float afText5Delay, string&amp;amp; asText6Entry, float afText6Delay, bool abUsePostion, string&amp;amp; asPosEnitity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays an audio file with six consecutive subtitles.&lt;br /&gt;
&lt;br /&gt;
# ''asVoiceFile''  - The entire voice file to play (intended to include 6 sections)&lt;br /&gt;
# ''asEffectFile''  - The background effect file to play during voices. Leave empty for no extra effect&lt;br /&gt;
# ''asTextCat''  - The .lang text category for the subtitles&lt;br /&gt;
# ''asTextEntry''  - The first .lang subtitle entry&lt;br /&gt;
# ''afTextDelay''  - The time to wait until the first subtitle starts&lt;br /&gt;
# ''asText2Entry''  - The second .lang subtitle entry&lt;br /&gt;
# ''afText2Delay''  - The time to wait until the second subtitle starts&lt;br /&gt;
# ''asText3Entry''  - The third .lang subtitle entry&lt;br /&gt;
# ''afText3Delay''  - The time to wait until the third subtitle starts&lt;br /&gt;
# ''asText4Entry''  - The fourth .lang subtitle entry&lt;br /&gt;
# ''afText4Delay''  - The time to wait until the fourth subtitle starts&lt;br /&gt;
# ''asText5Entry''  - The fifth .lang subtitle entry&lt;br /&gt;
# ''afText5Delay''  - The time to wait until the fifth subtitle starts&lt;br /&gt;
# ''asText6Entry''  - The sixth .lang subtitle entry&lt;br /&gt;
# ''afText6Delay''  - The time to wait until the sixth subtitle starts&lt;br /&gt;
# ''abUsePosition''  - Whether to use 3D to play the sound from an entity&lt;br /&gt;
# ''asPosEntity''  - The entity to play the sound from. If empty, plays from player&lt;br /&gt;
# ''afMinDistance''  - The minimum distance required between the player and the entity in order to hear the audio&lt;br /&gt;
# ''afMaxDistance''  - The maximum distance allowed between the player and the entity in order to hear the audio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice7(string&amp;amp; asVoiceFile, string&amp;amp; asEffectFile, string&amp;amp; asTextCat, string&amp;amp; asTextEntry, float afTextDelay, string&amp;amp; asText2Entry, float afText2Delay, string&amp;amp; asText3Entry, float afText3Delay, string&amp;amp; asText4Entry, float afText4Delay, string&amp;amp; asText5Entry, float afText5Delay, string&amp;amp; asText6Entry, float afText6Delay, string&amp;amp; asText7Entry, float afText7Delay, bool abUsePostion, string&amp;amp; asPosEnitity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays an audio file with seven consecutive subtitles.&lt;br /&gt;
&lt;br /&gt;
# ''asVoiceFile''  - The entire voice file to play (intended to include 7 sections)&lt;br /&gt;
# ''asEffectFile''  - The background effect file to play during voices. Leave empty for no extra effect&lt;br /&gt;
# ''asTextCat''  - The .lang text category for the subtitles&lt;br /&gt;
# ''asTextEntry''  - The first .lang subtitle entry&lt;br /&gt;
# ''afTextDelay''  - The time to wait until the first subtitle starts&lt;br /&gt;
# ''asText2Entry''  - The second .lang subtitle entry&lt;br /&gt;
# ''afText2Delay''  - The time to wait until the second subtitle starts&lt;br /&gt;
# ''asText3Entry''  - The third .lang subtitle entry&lt;br /&gt;
# ''afText3Delay''  - The time to wait until the third subtitle starts&lt;br /&gt;
# ''asText4Entry''  - The fourth .lang subtitle entry&lt;br /&gt;
# ''afText4Delay''  - The time to wait until the fourth subtitle starts&lt;br /&gt;
# ''asText5Entry''  - The fifth .lang subtitle entry&lt;br /&gt;
# ''afText5Delay''  - The time to wait until the fifth subtitle starts&lt;br /&gt;
# ''asText6Entry''  - The sixth .lang subtitle entry&lt;br /&gt;
# ''afText6Delay''  - The time to wait until the sixth subtitle starts&lt;br /&gt;
# ''asText7Entry''  - The seventh .lang subtitle entry&lt;br /&gt;
# ''afText7Delay ''- The time to wait until the seventh subtitle starts&lt;br /&gt;
# ''abUsePosition''  - Whether to use 3D to play the sound from an entity&lt;br /&gt;
# ''asPosEntity''  - The entity to play the sound from. If empty, plays from player&lt;br /&gt;
# ''afMinDistance''  - The minimum distance required between the player and the entity in order to hear the audio&lt;br /&gt;
# ''afMaxDistance''  - The maximum distance allowed between the player and the entity in order to hear the audio&lt;br /&gt;
&lt;br /&gt;
=== Screen Effects ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ShowScreenImage(string&amp;amp; asImageName, float afX, float afY, float afScale, bool abUseRelativeCoordinates, float afDuration, float afFadeIn, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shows a 2D image on the screen. Originally used for showing the intro logo during a sequence.&lt;br /&gt;
&lt;br /&gt;
May work similarly to the [[HPL2/Tutorials/ShowScreenImage()|ATTD 1.5 ShowScreenImage()]].&lt;br /&gt;
&lt;br /&gt;
# ''asImageName''  - The image file to show. Does not have to be pow2 (although it gives a warning if not)&lt;br /&gt;
# ''afX''- The X position of the top left corner, starting from the center of the screen. Use negative half of the width of the image to center it.&lt;br /&gt;
# ''afY''- The Y position of the top left corner, starting from the center of the screen.&lt;br /&gt;
# ''afScale'' - The size of the image in pixels (not scale), or original image size if negative&lt;br /&gt;
# ''abUseRelativeCoordinates'' - Whether X and Y are relative to the screen resoltion, or pixel co-ordinates if not&lt;br /&gt;
# ''afDuration'' - How long, in seconds, the image displays. This does not include fade times&lt;br /&gt;
# ''afFadeIn'' - How long, in seconds, the fade in spends&lt;br /&gt;
# ''afFadeOut'' - How long, in seconds, the fade out spends&lt;br /&gt;
&lt;br /&gt;
=== Journal ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddHint(string&amp;amp; asNameAndTextEntry, string&amp;amp; asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a hint to the player's journal.&amp;lt;br&amp;gt;This function replaces TDD's ''AddDiary''.&lt;br /&gt;
&lt;br /&gt;
# ''asNameAndTextEntry'' - The .lang text entry of the hint. The entry must be in category &amp;quot;Journal&amp;quot; and use the format Hint_MyHint_Name for the title and Hint_MyHint_Text for the body, where MyHint replaces the value you put in this argument.&lt;br /&gt;
# ''asImage'' - This argument does not seem to be used. Presumed to be for displaying an image but possibly removed functionality. All existing occurrences are empty.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
bool GetJournalDisabled();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the journal is currently disabled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetJournalDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the player's ability to open their journal.&lt;br /&gt;
&lt;br /&gt;
# ''abX''  - True to disable, false to enable again&lt;br /&gt;
&lt;br /&gt;
=== Player ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternFlickerActive(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables the flicker effect for the lantern's light.&lt;br /&gt;
&lt;br /&gt;
# ''abX'' - True to flicker, false to not flicker&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerInfection(float afInfection);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the [[HPL2/AMFP/Infection|infection]] level for the player. Infection replaces sanity from TDD and acts similar, however it goes from 0-100 instead of 100-0. An infection level above 50 will affect the player's ability to move. Infection level above 80 will kill the player. Infection slowly decreases over time, unless high enough. &amp;lt;br /&amp;gt;This function replaces TDD's ''SetPlayerSanity''.&lt;br /&gt;
&lt;br /&gt;
# ''afInfection'' - The level of infection to set&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddPlayerInfection(float afInfection);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds an amount of infection to the player's current amount.&amp;lt;br&amp;gt;This function replaces TDD's ''AddPlayerSanity''.&lt;br /&gt;
&lt;br /&gt;
# ''afInfection'' - The amount to add&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerInfection();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the amount of infection the player currently has.&amp;lt;br&amp;gt;This function replaces TDD's ''GetPlayerSanity''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void GiveInfectionDamage(float afAmount, bool abUseEffect);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increases the infection of the player.&amp;lt;br&amp;gt;This function replaces TDD's ''GiveSanityDamage''.&lt;br /&gt;
&lt;br /&gt;
# ''afAmount'' - Amount of infection damage done&lt;br /&gt;
# ''abUseEffect'' - Determines whether a sound effect is played when the infection damage is dealt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInfectionFauxMode(bool abFauxMode);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable/disable &amp;quot;faux mode&amp;quot; for infection. In faux mode, the player cannot die of infection and infection sounds don't play.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerPitchTo(float afX, float afSpeedMul, float afMaxSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves the player's pitch (up and down rotation).&lt;br /&gt;
&lt;br /&gt;
# ''afX'' - The target pitch to move towards. 0 = straight forward. Clamped to range: -70 to +70.&lt;br /&gt;
# ''afSpeedMul'' - The speed multiplier of the movement. A low value makes a slow change.&lt;br /&gt;
# ''afMaxSpeed'' - The max speed of the movement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerUsesDragFootsteps(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets whether the player's footstep sounds are replaced with &amp;quot;drag&amp;quot; versions. Some surface materials do not have drag steps, and will therefore play no footstep sounds.&lt;br /&gt;
&lt;br /&gt;
# abX - Whether to use &amp;quot;drag&amp;quot; step sounds&lt;br /&gt;
&lt;br /&gt;
=== Entities ===&lt;br /&gt;
&lt;br /&gt;
==== General ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntityActive(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns whether an entity in the level is active or not.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The entity to check&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateEntityAtArea(string&amp;amp; asEntityName, string&amp;amp; asEntityFile, string&amp;amp; asAreaName, bool abFullGameSave, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an entity at an area with the specified offsets and rotation. &amp;lt;br /&amp;gt;This function replaces TDD's ''CreateEntityAtArea''.&lt;br /&gt;
&lt;br /&gt;
# ''asEntityName'' - The internal name of the created entity&lt;br /&gt;
# ''asEntityFile'' - The file for the entity (extension .ent)&lt;br /&gt;
# ''asAreaName'' - The area to create entity at&lt;br /&gt;
# ''abFullGameSave'' - Determines whether an entity &amp;quot;remembers&amp;quot; its state&lt;br /&gt;
# ''afOffsetX'' - The offset along the X axis in units&lt;br /&gt;
# ''afOffsetY'' - The offset along the Y axis in units&lt;br /&gt;
# ''afOffsetZ'' - The offset along the Z axis in units&lt;br /&gt;
# ''afRotX'' - The rotation on the X axis in degrees&lt;br /&gt;
# ''afRotY'' - The rotation on the Y axis in degrees&lt;br /&gt;
# ''afRotZ'' - The rotation on the Z axis in degrees&lt;br /&gt;
&lt;br /&gt;
==== Props ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPhysicsAutoDisable(string&amp;amp; asName, bool abAutoDisable);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If physics bodies will automatically sleep (become inactive and stop moving). Only used on chandeliers in the campaign.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The prop to affect&lt;br /&gt;
# ''abAutoDisable'' - Whether physics auto disables or not&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToBone(string&amp;amp; asChildEntityName, string&amp;amp; asParentEntityName, string&amp;amp; asParentBoneName, float fPosX, float fPosY, float fPosZ, float fRotX, float fRotY, float fRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to a specific bone within another entity. You can inspect bones in the Model Editor. Note: Offsets and rotations are local to the bone and relative to its rotation.&lt;br /&gt;
&lt;br /&gt;
# ''asChildEntityName'' - The prop to attach&lt;br /&gt;
# ''asParentEntityName'' - The entity that holds the bone to attach to&lt;br /&gt;
# ''asParentBoneName'' - The bone within the entity to attach to&lt;br /&gt;
# ''afPosX'' - Offset along the X axis&lt;br /&gt;
# ''afPosY'' - Offset along the Y axis&lt;br /&gt;
# ''afPosZ'' - Offset along the Z axis&lt;br /&gt;
# ''afRotX'' - Rotation along the X axis&lt;br /&gt;
# ''afRotY'' - Rotation along the Y axis&lt;br /&gt;
# ''afRotZ'' - Rotation along the Z axis&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DetachPropFromBone(string&amp;amp; asChildEntityName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches an attached prop. Note: When detached, physics are not automatically enabled on the prop.&lt;br /&gt;
&lt;br /&gt;
# ''asChildEntityName'' - The attached prop&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AttachAreaToProp(string&amp;amp; asAreaName, string&amp;amp; asProp, int alBody);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches an area to a prop. Originally used to attach a liquid area to a movable water plane entity in the sewers map.&lt;br /&gt;
&lt;br /&gt;
# ''asAreaName'' - The area to attach&lt;br /&gt;
# ''asProp'' - The prop to attach area to&lt;br /&gt;
# ''alBody'' - The ID of the physics body of the prop to attach to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopPropAnimation(string&amp;amp; asProp);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops the animation currently playing on a prop. Animations can be started with ''PlayPropAnimation''.&lt;br /&gt;
&lt;br /&gt;
# ''asProp'' - The name of the prop&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayCurrentAnimation(string&amp;amp; asProp, float afFadeTime, bool abLoop);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades in the active animation, optionally allowing it to loop.&lt;br /&gt;
&lt;br /&gt;
# ''asProp'' - The name of the prop&lt;br /&gt;
# ''afFadeTime'' - The fade time between animations&lt;br /&gt;
# ''abLoop'' - If the animation should be looped&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PauseCurrentAnimation(string&amp;amp; asProp, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades out the active animation.&lt;br /&gt;
&lt;br /&gt;
# ''asProp'' - The name of the prop&lt;br /&gt;
# ''afFadeTime'' - The fade time between animations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropAnimationSpeed(string&amp;amp; asProp, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the speed of the animation. Generally used in conjunction with ''PlayPropAnimation''.&lt;br /&gt;
&lt;br /&gt;
# ''asProp'' - The prop that is being animated&lt;br /&gt;
# ''afSpeed'' - The new animation speed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropAnimationPosition(string&amp;amp; asProp, float afPos);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Jumps to a specific point in an animation. Generally used in conjunction with ''PlayPropAnimation''.&lt;br /&gt;
&lt;br /&gt;
# ''asProp'' - The prop that is being animated&lt;br /&gt;
# ''afPos'' - The time within the animation, in seconds, to jump to&lt;br /&gt;
&lt;br /&gt;
==== Lamps ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLampFlickerActive(string&amp;amp; asName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables a flickering effect on a Lamp.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The lamp entity&lt;br /&gt;
# ''abActive'' - Whether to enable flicker&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeLampTo(string&amp;amp; asName, float afR, float afG, float afB, float afA, float afRadius, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades a Lamp's light to another color. This function uses integers for color values instead of floats, which is a little odd. Likewise, it uses a double floating point for the last argument instead of a regular one.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The lamp to change&lt;br /&gt;
# ''afR'' - Red value (appropriate values are 0 - 10)&lt;br /&gt;
# ''afG'' - Green value (appropriate values are 0 - 10)&lt;br /&gt;
# ''afB'' - Blue value (appropriate values are 0 - 10)&lt;br /&gt;
# ''afA'' - Alpha value (has no effect?)&lt;br /&gt;
# ''afRadius'' - The new radius to use (affects illumination strength)&lt;br /&gt;
# ''afTime'' - Time in seconds until the light properties have changed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLampCanBeLitByPlayer(string&amp;amp; asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables the player's ability to light a lamp.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The name of the Lamp&lt;br /&gt;
# ''abX'' - State to set&lt;br /&gt;
&lt;br /&gt;
==== Doors ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorOpenAmount(string&amp;amp; asName, float afOpenAmount, float afDuration, bool abOpenTowardsMaxAngle);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the open amount for a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The SwingDoor entity&lt;br /&gt;
# ''afOpenAmount'' - The new amount state to set. Range: 0 - 1&lt;br /&gt;
# ''afDuration'' - The time in seconds until the door has changed state&lt;br /&gt;
# ''abOpenTowardsMaxAngle'' - If the door will swing to its max angle instead of its min angle&lt;br /&gt;
&lt;br /&gt;
==== Buttons ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetButtonCanBeSwitchedOn(string&amp;amp; asName, bool abCanBeSwitchedOn);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes whether a Button can be switched from off to on.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The Button entity&lt;br /&gt;
# ''abCanBeSwitchedOn'' - Whether it can be switched on&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetButtonCanBeSwitchedOff(string&amp;amp; asName, bool abCanBeSwitchedOff);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes whether a Button can be switched from on to off.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The Button entity&lt;br /&gt;
# ''abCanBeSwitchedOff'' - Whether it can be switched off&lt;br /&gt;
&lt;br /&gt;
==== PhoneBoxes ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPhoneRinging(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables a PhoneBox to start ringing. A ringing phone box can be interacted with to play some audio files. After interacting, the phone will stop ringing.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The PhoneBox entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopPhoneRinging(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops a ringing PhoneBox.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The PhoneBox entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void HangUpPhone(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hangs up a PhoneBox.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The PhoneBox entity&lt;br /&gt;
&lt;br /&gt;
==== Enemies ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEnemyPatrolNode(string&amp;amp; asName, string&amp;amp; asNodeName, float afWaitTime, string&amp;amp; asAnimation, bool abLoopAnimation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a patrol node to the enemy's walking path. A path is restarted from the beginning when the final node is reached. Note: Inputting an invalid animation in asAnimation at the final node will make the enemy wait there indefinitely.&amp;lt;br /&amp;gt;This function replaces TDD's AddEnemyPatrolNode.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The name of the enemy&lt;br /&gt;
# ''asNodeName'' - Internal name of path node&lt;br /&gt;
# ''afWaitTime'' - The time, in seconds, the enemy waits at this node before continuing. Note: A time of 0 instead randomizes between 1 and 3 seconds, so use 0.01 instead if you want the enemy to immediately continue to the next node.&lt;br /&gt;
# ''asAnimation'' - The animation to play on the enemy when they arrive at this path node. Animations can be found in the Model Editor. Leave empty to play no special animation (uses default Idle animation). Note: If the animation lasts longer than afWaitTime, the enemy waits until the animation is complete before continuing the path.&lt;br /&gt;
# ''abLoopAnimation'' - If the animation should be looped&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyMoveType(string&amp;amp; asName, string&amp;amp; asMoveType);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes how an enemy moves.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The name of the enemy&lt;br /&gt;
# ''asMoveType'' - The type to change to. Can be &amp;quot;WalkBiped&amp;quot;, &amp;quot;RunBiped&amp;quot;, &amp;quot;ChargeBiped&amp;quot;, &amp;quot;Idle&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetManPigType(string&amp;amp; asName, string&amp;amp; asManPigType);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the personality type for a ManPig enemy. Non-functional; left over from an earlier state of development. Only &amp;quot;Freddy&amp;quot; is used as the type, but supposedly it should also accept &amp;quot;Rod&amp;quot; and &amp;quot;Jane&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The ManPig enemy.&lt;br /&gt;
# ''asManPigType'' - The type to set. Type can be &amp;quot;Freddy&amp;quot;, &amp;quot;Rod&amp;quot;, &amp;quot;Jane&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The three types allegedly describe three different personality types for the AI, according to Peter Howell in [https://researchportal.port.ac.uk/portal/files/3364888/PeterHowell_PhD.pdf his PhD, section 7.4.4].&lt;br /&gt;
&lt;br /&gt;
Extract:&lt;br /&gt;
&lt;br /&gt;
''The initial design of the game’s enemy artificial intelligence system contained three unique sets of behavioural controls. There was only one visual enemy style, however every enemy agent in the game would be assigned one of three possible ‘personalities’, referred to in the game’s code as the ‘Rod’, ‘Jane’ and ‘Freddy’ personality types. These personalities each had a different set of behavioural rules, thus allowing enemy agents that may otherwise appear identical to behave very differently to one another.''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Enemy Agent Personality Type !! Primary Behavioral Traits&lt;br /&gt;
|-&lt;br /&gt;
| Rod || &lt;br /&gt;
*Will maintain a 'safe' distance to the player-character.&lt;br /&gt;
*If unable to do so, will approach player character, investigate them (by getting close and smelling them), before continuing its patrol. &lt;br /&gt;
|-&lt;br /&gt;
| Jane || &lt;br /&gt;
*Will maintain a ‘safe’ distance from player-character, whilst observing the player-character’s movements&lt;br /&gt;
*If unable to maintain ‘safe’ distance, will panic and flee.&lt;br /&gt;
*If cornered and unable to flee, will attack and knock player-character to floor, then flee. &lt;br /&gt;
*Will only attack and kill player-character as a last resort. &lt;br /&gt;
|-&lt;br /&gt;
| Freddy || &lt;br /&gt;
*Will actively hunt the player-character.&lt;br /&gt;
*Will attack and kill them if given the opportunity. &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigFadeDisabled(string&amp;amp; asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should fade the player's view in and out.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Internal name of the enemy&lt;br /&gt;
#''abX''- Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigSoundDisabled(string&amp;amp; asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should play the proximity sounds.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigEasyEscapeDisabled(string&amp;amp; asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should be easier to escape from when hunted. If not disabled, easy escape is activated if the player is more than 12.35 meters away, the enemy can't see the player, and the player has less than 75 health. When this occurs, the enemy is forced to stop hunting and wait for half a second.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ForceTeslaPigSighting(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces a Tesla ManPig to be visible for a short time.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayEnemyAnimation(string&amp;amp; asEnemyName, string&amp;amp; asAnimName, bool abLoop, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays a specific animation for an enemy.&lt;br /&gt;
&lt;br /&gt;
# ''asEnemyName'' - Internal name of the enemy (asterisk is allowed)&lt;br /&gt;
# ''asAnimName'' - The name of an animation registered to the enemy&lt;br /&gt;
# ''abLoop'' - Whether the animation loops&lt;br /&gt;
# ''afFadeTime'' - The fade time between animations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void PlayScriptedAnimation(string&amp;amp; asName, string&amp;amp; asAnimationName, bool abLoopAnimation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays an animation that has been added to an entity through the Model Editor. Similar to ''PlayEnemyAnimation''.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - Internal name of the enemy&lt;br /&gt;
# ''asAnimationName'' - The animation name&lt;br /&gt;
# ''abLoopAnimation'' - Whether to loop the animation or play it only once&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeEnemyPose(string&amp;amp; asName, string&amp;amp; asPoseType);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the pose for an enemy. Can be either &amp;quot;Biped&amp;quot; or &amp;quot;Quadruped&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - Internal name of the enemy&lt;br /&gt;
# ''asPoseType''  - The pose to change to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ForceEnemyWaitState(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the enemy's AI to change its state to &amp;quot;Wait&amp;quot;, which makes the enemy wait for a short while before continuing its' normal actions. An enemy without patrol nodes defaults to the &amp;quot;Wait&amp;quot; state. Otherwise, if patrol nodes are added, the enemy will continue the path after waiting is done.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SendEnemyTimeOut(string&amp;amp; asName, float afTimeOut );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the enemy's AI to change its state to &amp;quot;TimeOut&amp;quot;, which forces the enemy to pause.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - Internal name of the enemy&lt;br /&gt;
# ''afTimeOut'' - The length of the time out&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopAnimationAndContinue(string&amp;amp; asName, float afTimeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the enemy to stop its patrol animation for the specified amount of time.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - Internal name of the enemy&lt;br /&gt;
# ''afTimeOut'' - The length of the time out&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyBlind(string&amp;amp; asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets whether the enemy can see the player if they are within visible range.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - Internal name of the enemy&lt;br /&gt;
# ''abX'' - Whether enemy is blind&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDeaf(string&amp;amp; asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets whether the enemy can hear the player make sound if they are within audible range.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - Internal name of the enemy&lt;br /&gt;
# ''abX'' - Whether enemy is deaf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetPlayerCanSeeEnemy(string&amp;amp; asEnemyName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns whether the enemy is within visible range of the player.&lt;br /&gt;
&lt;br /&gt;
# ''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetEnemyPlayerDistance(string&amp;amp; asEnemyName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the distance (in meters) between the enemy and the player.&lt;br /&gt;
&lt;br /&gt;
# ''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int GetEnemyState(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the enemy's current state as an integer.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/AMFP/ScriptFunctions&amp;diff=6992</id>
		<title>HPL2/AMFP/ScriptFunctions</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/AMFP/ScriptFunctions&amp;diff=6992"/>
		<updated>2025-01-19T07:28:07Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Journal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Engine scripts ==&lt;br /&gt;
&lt;br /&gt;
A list of script functions available in A Machine For Pigs (that are not present in The Dark Descent). Many of TDD's scripts are available in AMFP, but not all. Some are replaced by ones listed below, and others are removed.&lt;br /&gt;
&lt;br /&gt;
=== General ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void CheckPoint(string&amp;amp; asName, string&amp;amp; asStartPos, string&amp;amp; asCallback, string&amp;amp; asDeathHintCat, string&amp;amp; asDeathHintEntry, bool abKeepPlayerInLimbo);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a check point where the player will respawn if they die. '''Callback syntax:'''&amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asName, int alCount)&amp;lt;/code&amp;gt;&lt;br /&gt;
This function replaces TDD's &amp;lt;code&amp;gt;CheckPoint()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The internal name of the callback&lt;br /&gt;
# ''asStartPos'' - The name of the PlayerStartArea to respawn at&lt;br /&gt;
# ''asCallback'' - The name of the callback function to run&lt;br /&gt;
# ''asDeathHintCat'' - The name of the .lang file category&lt;br /&gt;
# ''asDeathHintEntry'' - The name of the .lang file entry&lt;br /&gt;
# ''abKeepPlayerInLimbo'' - Whether to put the player into a state of &amp;quot;limbo&amp;quot; upon death. In limbo, the death occurs normally, but once the screen fades to black, it remains so until &amp;lt;code&amp;gt;ReleasePlayerFromLimbo()&amp;lt;/code&amp;gt;  is called. Player is still controllable during death.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ReleasePlayerFromLimbo();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Respawns the player if stuck in &amp;quot;limbo&amp;quot;. Limbo can be enabled with ''CheckPoint''. Limbo is the state between life and death. The player enters limbo upon dying but won't respawn until this function is called.&lt;br /&gt;
&lt;br /&gt;
=== Particle Systems ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetParticleSystemActive(string&amp;amp; asName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pauses a particle system in its current frame. The paused particle system remains frozen at this frame until reactivated or destroyed.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The name of the particle system&lt;br /&gt;
# ''abActive'' - False to pause, true to unpause&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DestroyParticleSystemInstantly(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Destroys a particle system and any existing particles already emitted from it. Similar to ''DestroyParticleSystem'', except that one will not destroy the existing particles and rather let them live out their lives. This function will cut all particles' lives short.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The internal name of the particle system&lt;br /&gt;
&lt;br /&gt;
=== Sounds ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice2(string&amp;amp; asVoiceFile, string&amp;amp; asEffectFile, string&amp;amp; asTextCat, string&amp;amp; asTextEntry, float afTextDelay, string&amp;amp; asText2Entry, float afText2Delay, bool abUsePostion, string&amp;amp; asPosEnitity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays an audio file with two consecutive subtitles.&lt;br /&gt;
&lt;br /&gt;
# ''asVoiceFile''  - The entire voice file to play (intended to include 2 sections)&lt;br /&gt;
# ''asEffectFile''  - The background effect file to play during voices. Leave empty for no extra effect&lt;br /&gt;
# ''asTextCat''  - The .lang text category for the subtitles&lt;br /&gt;
# ''asTextEntry''  - The first .lang subtitle entry&lt;br /&gt;
# ''afTextDelay''  - The time to wait until the first subtitle starts&lt;br /&gt;
# ''asText2Entry''  - The second .lang subtitle entry&lt;br /&gt;
# ''afText2Delay''  - The time to wait until the second subtitle starts&lt;br /&gt;
# ''abUsePosition''  - Whether to use 3D to play the sound from an entity&lt;br /&gt;
# ''asPosEntity''  - The entity to play the sound from. If empty, plays from player&lt;br /&gt;
# ''afMinDistance''  - The minimum distance required between the player and the entity in order to hear the audio&lt;br /&gt;
# ''afMaxDistance''  - The maximum distance allowed between the player and the entity in order to hear the audio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice3(string&amp;amp; asVoiceFile, string&amp;amp; asEffectFile, string&amp;amp; asTextCat, string&amp;amp; asTextEntry, float afTextDelay, string&amp;amp; asText2Entry, float afText2Delay, string&amp;amp; asText3Entry, float afText3Delay, bool abUsePostion, string&amp;amp; asPosEnitity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays an audio file with three consecutive subtitles.&lt;br /&gt;
&lt;br /&gt;
# ''asVoiceFile''  - The entire voice file to play (intended to include 3 sections)&lt;br /&gt;
# ''asEffectFile''  - The background effect file to play during voices. Leave empty for no extra effect&lt;br /&gt;
# ''asTextCat''  - The .lang text category for the subtitles&lt;br /&gt;
# ''asTextEntry''  - The first .lang subtitle entry&lt;br /&gt;
# ''afTextDelay''  - The time to wait until the first subtitle starts&lt;br /&gt;
# ''asText2Entry''  - The second .lang subtitle entry&lt;br /&gt;
# ''afText2Delay''  - The time to wait until the second subtitle starts&lt;br /&gt;
# ''asText3Entry''  - The third .lang subtitle entry&lt;br /&gt;
# ''afText3Delay''  - The time to wait until the third subtitle starts&lt;br /&gt;
# ''abUsePosition''  - Whether to use 3D to play the sound from an entity&lt;br /&gt;
# ''asPosEntity''  - The entity to play the sound from. If empty, plays from player&lt;br /&gt;
# ''afMinDistance''  - The minimum distance required between the player and the entity in order to hear the audio&lt;br /&gt;
# ''afMaxDistance''  - The maximum distance allowed between the player and the entity in order to hear the audio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice4(string&amp;amp; asVoiceFile, string&amp;amp; asEffectFile, string&amp;amp; asTextCat, string&amp;amp; asTextEntry, float afTextDelay, string&amp;amp; asText2Entry, float afText2Delay, string&amp;amp; asText3Entry, float afText3Delay, string&amp;amp; asText4Entry, float afText4Delay, bool abUsePostion, string&amp;amp; asPosEnitity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays an audio file with four consecutive subtitles.&lt;br /&gt;
&lt;br /&gt;
# ''asVoiceFile''  - The entire voice file to play (intended to include 4 sections)&lt;br /&gt;
# ''asEffectFile''  - The background effect file to play during voices. Leave empty for no extra effect&lt;br /&gt;
# ''asTextCat''  - The .lang text category for the subtitles&lt;br /&gt;
# ''asTextEntry''  - The first .lang subtitle entry&lt;br /&gt;
# ''afTextDelay''  - The time to wait until the first subtitle starts&lt;br /&gt;
# ''asText2Entry''  - The second .lang subtitle entry&lt;br /&gt;
# ''afText2Delay''  - The time to wait until the second subtitle starts&lt;br /&gt;
# ''asText3Entry''  - The third .lang subtitle entry&lt;br /&gt;
# ''afText3Delay''  - The time to wait until the third subtitle starts&lt;br /&gt;
# ''asText4Entry''  - The fourth .lang subtitle entry&lt;br /&gt;
# ''afText4Delay''  - The time to wait until the fourth subtitle starts&lt;br /&gt;
# ''abUsePosition''  - Whether to use 3D to play the sound from an entity&lt;br /&gt;
# ''asPosEntity''  - The entity to play the sound from. If empty, plays from player&lt;br /&gt;
# ''afMinDistance''  - The minimum distance required between the player and the entity in order to hear the audio&lt;br /&gt;
# ''afMaxDistance''  - The maximum distance allowed between the player and the entity in order to hear the audio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice5(string&amp;amp; asVoiceFile, string&amp;amp; asEffectFile, string&amp;amp; asTextCat, string&amp;amp; asTextEntry, float afTextDelay, string&amp;amp; asText2Entry, float afText2Delay, string&amp;amp; asText3Entry, float afText3Delay, string&amp;amp; asText4Entry, float afText4Delay, string&amp;amp; asText5Entry, float afText5Delay, bool abUsePostion, string&amp;amp; asPosEnitity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays an audio file with five consecutive subtitles.&lt;br /&gt;
&lt;br /&gt;
# ''asVoiceFile''  - The entire voice file to play (intended to include 5 sections)&lt;br /&gt;
# ''asEffectFile''  - The background effect file to play during voices. Leave empty for no extra effect&lt;br /&gt;
# ''asTextCat''  - The .lang text category for the subtitles&lt;br /&gt;
# ''asTextEntry''  - The first .lang subtitle entry&lt;br /&gt;
# ''afTextDelay''  - The time to wait until the first subtitle starts&lt;br /&gt;
# ''asText2Entry''  - The second .lang subtitle entry&lt;br /&gt;
# ''afText2Delay''  - The time to wait until the second subtitle starts&lt;br /&gt;
# ''asText3Entry''  - The third .lang subtitle entry&lt;br /&gt;
# ''afText3Delay''  - The time to wait until the third subtitle starts&lt;br /&gt;
# ''asText4Entry''  - The fourth .lang subtitle entry&lt;br /&gt;
# ''afText4Delay''  - The time to wait until the fourth subtitle starts&lt;br /&gt;
# ''asText5Entry''  - The fifth .lang subtitle entry&lt;br /&gt;
# ''afText5Delay''  - The time to wait until the fifth subtitle starts&lt;br /&gt;
# ''abUsePosition''  - Whether to use 3D to play the sound from an entity&lt;br /&gt;
# ''asPosEntity''  - The entity to play the sound from. If empty, plays from player&lt;br /&gt;
# ''afMinDistance''  - The minimum distance required between the player and the entity in order to hear the audio&lt;br /&gt;
# ''afMaxDistance''  - The maximum distance allowed between the player and the entity in order to hear the audio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice5(string&amp;amp; asVoiceFile, string&amp;amp; asEffectFile, string&amp;amp; asTextCat, string&amp;amp; asTextEntry, float afTextDelay, string&amp;amp; asText2Entry, float afText2Delay, string&amp;amp; asText3Entry, float afText3Delay, string&amp;amp; asText4Entry, float afText4Delay, string&amp;amp; asText5Entry, float afText5Delay, string&amp;amp; asText6Entry, float afText6Delay, bool abUsePostion, string&amp;amp; asPosEnitity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays an audio file with six consecutive subtitles.&lt;br /&gt;
&lt;br /&gt;
# ''asVoiceFile''  - The entire voice file to play (intended to include 6 sections)&lt;br /&gt;
# ''asEffectFile''  - The background effect file to play during voices. Leave empty for no extra effect&lt;br /&gt;
# ''asTextCat''  - The .lang text category for the subtitles&lt;br /&gt;
# ''asTextEntry''  - The first .lang subtitle entry&lt;br /&gt;
# ''afTextDelay''  - The time to wait until the first subtitle starts&lt;br /&gt;
# ''asText2Entry''  - The second .lang subtitle entry&lt;br /&gt;
# ''afText2Delay''  - The time to wait until the second subtitle starts&lt;br /&gt;
# ''asText3Entry''  - The third .lang subtitle entry&lt;br /&gt;
# ''afText3Delay''  - The time to wait until the third subtitle starts&lt;br /&gt;
# ''asText4Entry''  - The fourth .lang subtitle entry&lt;br /&gt;
# ''afText4Delay''  - The time to wait until the fourth subtitle starts&lt;br /&gt;
# ''asText5Entry''  - The fifth .lang subtitle entry&lt;br /&gt;
# ''afText5Delay''  - The time to wait until the fifth subtitle starts&lt;br /&gt;
# ''asText6Entry''  - The sixth .lang subtitle entry&lt;br /&gt;
# ''afText6Delay''  - The time to wait until the sixth subtitle starts&lt;br /&gt;
# ''abUsePosition''  - Whether to use 3D to play the sound from an entity&lt;br /&gt;
# ''asPosEntity''  - The entity to play the sound from. If empty, plays from player&lt;br /&gt;
# ''afMinDistance''  - The minimum distance required between the player and the entity in order to hear the audio&lt;br /&gt;
# ''afMaxDistance''  - The maximum distance allowed between the player and the entity in order to hear the audio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice7(string&amp;amp; asVoiceFile, string&amp;amp; asEffectFile, string&amp;amp; asTextCat, string&amp;amp; asTextEntry, float afTextDelay, string&amp;amp; asText2Entry, float afText2Delay, string&amp;amp; asText3Entry, float afText3Delay, string&amp;amp; asText4Entry, float afText4Delay, string&amp;amp; asText5Entry, float afText5Delay, string&amp;amp; asText6Entry, float afText6Delay, string&amp;amp; asText7Entry, float afText7Delay, bool abUsePostion, string&amp;amp; asPosEnitity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays an audio file with seven consecutive subtitles.&lt;br /&gt;
&lt;br /&gt;
# ''asVoiceFile''  - The entire voice file to play (intended to include 7 sections)&lt;br /&gt;
# ''asEffectFile''  - The background effect file to play during voices. Leave empty for no extra effect&lt;br /&gt;
# ''asTextCat''  - The .lang text category for the subtitles&lt;br /&gt;
# ''asTextEntry''  - The first .lang subtitle entry&lt;br /&gt;
# ''afTextDelay''  - The time to wait until the first subtitle starts&lt;br /&gt;
# ''asText2Entry''  - The second .lang subtitle entry&lt;br /&gt;
# ''afText2Delay''  - The time to wait until the second subtitle starts&lt;br /&gt;
# ''asText3Entry''  - The third .lang subtitle entry&lt;br /&gt;
# ''afText3Delay''  - The time to wait until the third subtitle starts&lt;br /&gt;
# ''asText4Entry''  - The fourth .lang subtitle entry&lt;br /&gt;
# ''afText4Delay''  - The time to wait until the fourth subtitle starts&lt;br /&gt;
# ''asText5Entry''  - The fifth .lang subtitle entry&lt;br /&gt;
# ''afText5Delay''  - The time to wait until the fifth subtitle starts&lt;br /&gt;
# ''asText6Entry''  - The sixth .lang subtitle entry&lt;br /&gt;
# ''afText6Delay''  - The time to wait until the sixth subtitle starts&lt;br /&gt;
# ''asText7Entry''  - The seventh .lang subtitle entry&lt;br /&gt;
# ''afText7Delay ''- The time to wait until the seventh subtitle starts&lt;br /&gt;
# ''abUsePosition''  - Whether to use 3D to play the sound from an entity&lt;br /&gt;
# ''asPosEntity''  - The entity to play the sound from. If empty, plays from player&lt;br /&gt;
# ''afMinDistance''  - The minimum distance required between the player and the entity in order to hear the audio&lt;br /&gt;
# ''afMaxDistance''  - The maximum distance allowed between the player and the entity in order to hear the audio&lt;br /&gt;
&lt;br /&gt;
=== Screen Effects ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ShowScreenImage(string&amp;amp; asImageName, float afX, float afY, float afScale, bool abUseRelativeCoordinates, float afDuration, float afFadeIn, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shows a 2D image on the screen. Originally used for showing the intro logo during a sequence.&lt;br /&gt;
&lt;br /&gt;
May work similarly to the [[HPL2/Tutorials/ShowScreenImage()|ATTD 1.5 ShowScreenImage()]].&lt;br /&gt;
&lt;br /&gt;
# ''asImageName''  - The image file to show. Does not have to be pow2 (although it gives a warning if not)&lt;br /&gt;
# ''afX''- The X position of the top left corner, starting from the center of the screen. Use negative half of the width of the image to center it.&lt;br /&gt;
# ''afY''- The Y position of the top left corner, starting from the center of the screen.&lt;br /&gt;
# ''afScale'' - The size of the image in pixels (not scale), or original image size if negative&lt;br /&gt;
# ''abUseRelativeCoordinates'' - Whether X and Y are relative to the screen resoltion, or pixel co-ordinates if not&lt;br /&gt;
# ''afDuration'' - How long, in seconds, the image displays. This does not include fade times&lt;br /&gt;
# ''afFadeIn'' - How long, in seconds, the fade in spends&lt;br /&gt;
# ''afFadeOut'' - How long, in seconds, the fade out spends&lt;br /&gt;
&lt;br /&gt;
=== Journal ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddHint(string&amp;amp; asNameAndTextEntry, string&amp;amp; asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a hint to the player's journal.&amp;lt;br&amp;gt;This function replaces TDD's ''AddDiary''.&lt;br /&gt;
&lt;br /&gt;
# ''asNameAndTextEntry'' - The .lang text entry of the hint. The entry must be in category &amp;quot;Journal&amp;quot; and use the format Hint_MyHint_Name for the title and Hint_MyHint_Text for the body, where MyHint replaces the value you put in this argument.&lt;br /&gt;
# ''asImage'' - This argument does not seem to be used. Presumed to be for displaying an image but possibly removed functionality. All existing occurrences are empty.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
bool GetJournalDisabled();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the journal is currently disabled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetJournalDisabled(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the player's ability to open their journal.&lt;br /&gt;
&lt;br /&gt;
# ''abX''  - True to disable, false to enable again&lt;br /&gt;
&lt;br /&gt;
=== Player ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternFlickerActive(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables the flicker effect for the lantern's light.&lt;br /&gt;
&lt;br /&gt;
# ''abX'' - True to flicker, false to not flicker&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerInfection(float afInfection);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the [[HPL2/AMFP/Infection|infection]] level for the player. Infection replaces sanity from TDD and acts similar, however it goes from 0-100 instead of 100-0. An infection level above approximately 20 will affect the player's ability to move. Infection level above 80 will kill the player. Infection slowly decreases over time, unless high enough. &amp;lt;br /&amp;gt;This function replaces TDD's ''SetPlayerSanity''.&lt;br /&gt;
&lt;br /&gt;
# ''afInfection'' - The level of infection to set&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddPlayerInfection(float afInfection);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds an amount of infection to the player's current amount.&amp;lt;br&amp;gt;This function replaces TDD's ''AddPlayerSanity''.&lt;br /&gt;
&lt;br /&gt;
# ''afInfection'' - The amount to add&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerInfection();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the amount of infection the player currently has.&amp;lt;br&amp;gt;This function replaces TDD's ''GetPlayerSanity''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void GiveInfectionDamage(float afAmount, bool abUseEffect);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increases the infection of the player.&amp;lt;br&amp;gt;This function replaces TDD's ''GiveSanityDamage''.&lt;br /&gt;
&lt;br /&gt;
# ''afAmount'' - Amount of infection damage done&lt;br /&gt;
# ''abUseEffect'' - Determines whether a sound effect is played when the infection damage is dealt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInfectionFauxMode(bool abFauxMode);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable/disable &amp;quot;faux mode&amp;quot; for infection. In faux mode, the player cannot die of infection and infection sounds don't play.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerPitchTo(float afX, float afSpeedMul, float afMaxSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves the player's pitch (up and down rotation).&lt;br /&gt;
&lt;br /&gt;
# ''afX'' - The target pitch to move towards. 0 = straight forward. Clamped to range: -70 to +70.&lt;br /&gt;
# ''afSpeedMul'' - The speed multiplier of the movement. A low value makes a slow change.&lt;br /&gt;
# ''afMaxSpeed'' - The max speed of the movement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerUsesDragFootsteps(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets whether the player's footstep sounds are replaced with &amp;quot;drag&amp;quot; versions. Some surface materials do not have drag steps, and will therefore play no footstep sounds.&lt;br /&gt;
&lt;br /&gt;
# abX - Whether to use &amp;quot;drag&amp;quot; step sounds&lt;br /&gt;
&lt;br /&gt;
=== Entities ===&lt;br /&gt;
&lt;br /&gt;
==== General ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntityActive(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns whether an entity in the level is active or not.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The entity to check&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateEntityAtArea(string&amp;amp; asEntityName, string&amp;amp; asEntityFile, string&amp;amp; asAreaName, bool abFullGameSave, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an entity at an area with the specified offsets and rotation. &amp;lt;br /&amp;gt;This function replaces TDD's ''CreateEntityAtArea''.&lt;br /&gt;
&lt;br /&gt;
# ''asEntityName'' - The internal name of the created entity&lt;br /&gt;
# ''asEntityFile'' - The file for the entity (extension .ent)&lt;br /&gt;
# ''asAreaName'' - The area to create entity at&lt;br /&gt;
# ''abFullGameSave'' - Determines whether an entity &amp;quot;remembers&amp;quot; its state&lt;br /&gt;
# ''afOffsetX'' - The offset along the X axis in units&lt;br /&gt;
# ''afOffsetY'' - The offset along the Y axis in units&lt;br /&gt;
# ''afOffsetZ'' - The offset along the Z axis in units&lt;br /&gt;
# ''afRotX'' - The rotation on the X axis in degrees&lt;br /&gt;
# ''afRotY'' - The rotation on the Y axis in degrees&lt;br /&gt;
# ''afRotZ'' - The rotation on the Z axis in degrees&lt;br /&gt;
&lt;br /&gt;
==== Props ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPhysicsAutoDisable(string&amp;amp; asName, bool abAutoDisable);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If physics bodies will automatically sleep (become inactive and stop moving). Only used on chandeliers in the campaign.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The prop to affect&lt;br /&gt;
# ''abAutoDisable'' - Whether physics auto disables or not&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToBone(string&amp;amp; asChildEntityName, string&amp;amp; asParentEntityName, string&amp;amp; asParentBoneName, float fPosX, float fPosY, float fPosZ, float fRotX, float fRotY, float fRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to a specific bone within another entity. You can inspect bones in the Model Editor. Note: Offsets and rotations are local to the bone and relative to its rotation.&lt;br /&gt;
&lt;br /&gt;
# ''asChildEntityName'' - The prop to attach&lt;br /&gt;
# ''asParentEntityName'' - The entity that holds the bone to attach to&lt;br /&gt;
# ''asParentBoneName'' - The bone within the entity to attach to&lt;br /&gt;
# ''afPosX'' - Offset along the X axis&lt;br /&gt;
# ''afPosY'' - Offset along the Y axis&lt;br /&gt;
# ''afPosZ'' - Offset along the Z axis&lt;br /&gt;
# ''afRotX'' - Rotation along the X axis&lt;br /&gt;
# ''afRotY'' - Rotation along the Y axis&lt;br /&gt;
# ''afRotZ'' - Rotation along the Z axis&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DetachPropFromBone(string&amp;amp; asChildEntityName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches an attached prop. Note: When detached, physics are not automatically enabled on the prop.&lt;br /&gt;
&lt;br /&gt;
# ''asChildEntityName'' - The attached prop&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AttachAreaToProp(string&amp;amp; asAreaName, string&amp;amp; asProp, int alBody);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches an area to a prop. Originally used to attach a liquid area to a movable water plane entity in the sewers map.&lt;br /&gt;
&lt;br /&gt;
# ''asAreaName'' - The area to attach&lt;br /&gt;
# ''asProp'' - The prop to attach area to&lt;br /&gt;
# ''alBody'' - The ID of the physics body of the prop to attach to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopPropAnimation(string&amp;amp; asProp);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops the animation currently playing on a prop. Animations can be started with ''PlayPropAnimation''.&lt;br /&gt;
&lt;br /&gt;
# ''asProp'' - The name of the prop&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayCurrentAnimation(string&amp;amp; asProp, float afFadeTime, bool abLoop);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades in the active animation, optionally allowing it to loop.&lt;br /&gt;
&lt;br /&gt;
# ''asProp'' - The name of the prop&lt;br /&gt;
# ''afFadeTime'' - The fade time between animations&lt;br /&gt;
# ''abLoop'' - If the animation should be looped&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PauseCurrentAnimation(string&amp;amp; asProp, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades out the active animation.&lt;br /&gt;
&lt;br /&gt;
# ''asProp'' - The name of the prop&lt;br /&gt;
# ''afFadeTime'' - The fade time between animations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropAnimationSpeed(string&amp;amp; asProp, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the speed of the animation. Generally used in conjunction with ''PlayPropAnimation''.&lt;br /&gt;
&lt;br /&gt;
# ''asProp'' - The prop that is being animated&lt;br /&gt;
# ''afSpeed'' - The new animation speed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropAnimationPosition(string&amp;amp; asProp, float afPos);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Jumps to a specific point in an animation. Generally used in conjunction with ''PlayPropAnimation''.&lt;br /&gt;
&lt;br /&gt;
# ''asProp'' - The prop that is being animated&lt;br /&gt;
# ''afPos'' - The time within the animation, in seconds, to jump to&lt;br /&gt;
&lt;br /&gt;
==== Lamps ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLampFlickerActive(string&amp;amp; asName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables a flickering effect on a Lamp.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The lamp entity&lt;br /&gt;
# ''abActive'' - Whether to enable flicker&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeLampTo(string&amp;amp; asName, float afR, float afG, float afB, float afA, float afRadius, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades a Lamp's light to another color. This function uses integers for color values instead of floats, which is a little odd. Likewise, it uses a double floating point for the last argument instead of a regular one.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The lamp to change&lt;br /&gt;
# ''afR'' - Red value (appropriate values are 0 - 10)&lt;br /&gt;
# ''afG'' - Green value (appropriate values are 0 - 10)&lt;br /&gt;
# ''afB'' - Blue value (appropriate values are 0 - 10)&lt;br /&gt;
# ''afA'' - Alpha value (has no effect?)&lt;br /&gt;
# ''afRadius'' - The new radius to use (affects illumination strength)&lt;br /&gt;
# ''afTime'' - Time in seconds until the light properties have changed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLampCanBeLitByPlayer(string&amp;amp; asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables the player's ability to light a lamp.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The name of the Lamp&lt;br /&gt;
# ''abX'' - State to set&lt;br /&gt;
&lt;br /&gt;
==== Doors ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorOpenAmount(string&amp;amp; asName, float afOpenAmount, float afDuration, bool abOpenTowardsMaxAngle);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the open amount for a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The SwingDoor entity&lt;br /&gt;
# ''afOpenAmount'' - The new amount state to set. Range: 0 - 1&lt;br /&gt;
# ''afDuration'' - The time in seconds until the door has changed state&lt;br /&gt;
# ''abOpenTowardsMaxAngle'' - If the door will swing to its max angle instead of its min angle&lt;br /&gt;
&lt;br /&gt;
==== Buttons ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetButtonCanBeSwitchedOn(string&amp;amp; asName, bool abCanBeSwitchedOn);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes whether a Button can be switched from off to on.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The Button entity&lt;br /&gt;
# ''abCanBeSwitchedOn'' - Whether it can be switched on&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetButtonCanBeSwitchedOff(string&amp;amp; asName, bool abCanBeSwitchedOff);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes whether a Button can be switched from on to off.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The Button entity&lt;br /&gt;
# ''abCanBeSwitchedOff'' - Whether it can be switched off&lt;br /&gt;
&lt;br /&gt;
==== PhoneBoxes ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPhoneRinging(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables a PhoneBox to start ringing. A ringing phone box can be interacted with to play some audio files. After interacting, the phone will stop ringing.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The PhoneBox entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopPhoneRinging(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops a ringing PhoneBox.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The PhoneBox entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void HangUpPhone(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hangs up a PhoneBox.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The PhoneBox entity&lt;br /&gt;
&lt;br /&gt;
==== Enemies ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEnemyPatrolNode(string&amp;amp; asName, string&amp;amp; asNodeName, float afWaitTime, string&amp;amp; asAnimation, bool abLoopAnimation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a patrol node to the enemy's walking path. A path is restarted from the beginning when the final node is reached. Note: Inputting an invalid animation in asAnimation at the final node will make the enemy wait there indefinitely.&amp;lt;br /&amp;gt;This function replaces TDD's AddEnemyPatrolNode.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The name of the enemy&lt;br /&gt;
# ''asNodeName'' - Internal name of path node&lt;br /&gt;
# ''afWaitTime'' - The time, in seconds, the enemy waits at this node before continuing. Note: A time of 0 instead randomizes between 1 and 3 seconds, so use 0.01 instead if you want the enemy to immediately continue to the next node.&lt;br /&gt;
# ''asAnimation'' - The animation to play on the enemy when they arrive at this path node. Animations can be found in the Model Editor. Leave empty to play no special animation (uses default Idle animation). Note: If the animation lasts longer than afWaitTime, the enemy waits until the animation is complete before continuing the path.&lt;br /&gt;
# ''abLoopAnimation'' - If the animation should be looped&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyMoveType(string&amp;amp; asName, string&amp;amp; asMoveType);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes how an enemy moves.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The name of the enemy&lt;br /&gt;
# ''asMoveType'' - The type to change to. Can be &amp;quot;WalkBiped&amp;quot;, &amp;quot;RunBiped&amp;quot;, &amp;quot;ChargeBiped&amp;quot;, &amp;quot;Idle&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetManPigType(string&amp;amp; asName, string&amp;amp; asManPigType);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the personality type for a ManPig enemy. Non-functional; left over from an earlier state of development. Only &amp;quot;Freddy&amp;quot; is used as the type, but supposedly it should also accept &amp;quot;Rod&amp;quot; and &amp;quot;Jane&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The ManPig enemy.&lt;br /&gt;
# ''asManPigType'' - The type to set. Type can be &amp;quot;Freddy&amp;quot;, &amp;quot;Rod&amp;quot;, &amp;quot;Jane&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The three types allegedly describe three different personality types for the AI, according to Peter Howell in [https://researchportal.port.ac.uk/portal/files/3364888/PeterHowell_PhD.pdf his PhD, section 7.4.4].&lt;br /&gt;
&lt;br /&gt;
Extract:&lt;br /&gt;
&lt;br /&gt;
''The initial design of the game’s enemy artificial intelligence system contained three unique sets of behavioural controls. There was only one visual enemy style, however every enemy agent in the game would be assigned one of three possible ‘personalities’, referred to in the game’s code as the ‘Rod’, ‘Jane’ and ‘Freddy’ personality types. These personalities each had a different set of behavioural rules, thus allowing enemy agents that may otherwise appear identical to behave very differently to one another.''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Enemy Agent Personality Type !! Primary Behavioral Traits&lt;br /&gt;
|-&lt;br /&gt;
| Rod || &lt;br /&gt;
*Will maintain a 'safe' distance to the player-character.&lt;br /&gt;
*If unable to do so, will approach player character, investigate them (by getting close and smelling them), before continuing its patrol. &lt;br /&gt;
|-&lt;br /&gt;
| Jane || &lt;br /&gt;
*Will maintain a ‘safe’ distance from player-character, whilst observing the player-character’s movements&lt;br /&gt;
*If unable to maintain ‘safe’ distance, will panic and flee.&lt;br /&gt;
*If cornered and unable to flee, will attack and knock player-character to floor, then flee. &lt;br /&gt;
*Will only attack and kill player-character as a last resort. &lt;br /&gt;
|-&lt;br /&gt;
| Freddy || &lt;br /&gt;
*Will actively hunt the player-character.&lt;br /&gt;
*Will attack and kill them if given the opportunity. &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigFadeDisabled(string&amp;amp; asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should fade the player's view in and out.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Internal name of the enemy&lt;br /&gt;
#''abX''- Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigSoundDisabled(string&amp;amp; asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should play the proximity sounds.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigEasyEscapeDisabled(string&amp;amp; asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should be easier to escape from when hunted. If not disabled, easy escape is activated if the player is more than 12.35 meters away, the enemy can't see the player, and the player has less than 75 health. When this occurs, the enemy is forced to stop hunting and wait for half a second.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ForceTeslaPigSighting(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces a Tesla ManPig to be visible for a short time.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayEnemyAnimation(string&amp;amp; asEnemyName, string&amp;amp; asAnimName, bool abLoop, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays a specific animation for an enemy.&lt;br /&gt;
&lt;br /&gt;
# ''asEnemyName'' - Internal name of the enemy (asterisk is allowed)&lt;br /&gt;
# ''asAnimName'' - The name of an animation registered to the enemy&lt;br /&gt;
# ''abLoop'' - Whether the animation loops&lt;br /&gt;
# ''afFadeTime'' - The fade time between animations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void PlayScriptedAnimation(string&amp;amp; asName, string&amp;amp; asAnimationName, bool abLoopAnimation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays an animation that has been added to an entity through the Model Editor. Similar to ''PlayEnemyAnimation''.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - Internal name of the enemy&lt;br /&gt;
# ''asAnimationName'' - The animation name&lt;br /&gt;
# ''abLoopAnimation'' - Whether to loop the animation or play it only once&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeEnemyPose(string&amp;amp; asName, string&amp;amp; asPoseType);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the pose for an enemy. Can be either &amp;quot;Biped&amp;quot; or &amp;quot;Quadruped&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - Internal name of the enemy&lt;br /&gt;
# ''asPoseType''  - The pose to change to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ForceEnemyWaitState(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the enemy's AI to change its state to &amp;quot;Wait&amp;quot;, which makes the enemy wait for a short while before continuing its' normal actions. An enemy without patrol nodes defaults to the &amp;quot;Wait&amp;quot; state. Otherwise, if patrol nodes are added, the enemy will continue the path after waiting is done.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SendEnemyTimeOut(string&amp;amp; asName, float afTimeOut );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the enemy's AI to change its state to &amp;quot;TimeOut&amp;quot;, which forces the enemy to pause.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - Internal name of the enemy&lt;br /&gt;
# ''afTimeOut'' - The length of the time out&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopAnimationAndContinue(string&amp;amp; asName, float afTimeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the enemy to stop its patrol animation for the specified amount of time.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - Internal name of the enemy&lt;br /&gt;
# ''afTimeOut'' - The length of the time out&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyBlind(string&amp;amp; asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets whether the enemy can see the player if they are within visible range.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - Internal name of the enemy&lt;br /&gt;
# ''abX'' - Whether enemy is blind&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDeaf(string&amp;amp; asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets whether the enemy can hear the player make sound if they are within audible range.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - Internal name of the enemy&lt;br /&gt;
# ''abX'' - Whether enemy is deaf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetPlayerCanSeeEnemy(string&amp;amp; asEnemyName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns whether the enemy is within visible range of the player.&lt;br /&gt;
&lt;br /&gt;
# ''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetEnemyPlayerDistance(string&amp;amp; asEnemyName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the distance (in meters) between the enemy and the player.&lt;br /&gt;
&lt;br /&gt;
# ''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int GetEnemyState(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the enemy's current state as an integer.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/AMFP/NewEntities&amp;diff=6991</id>
		<title>HPL2/AMFP/NewEntities</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/AMFP/NewEntities&amp;diff=6991"/>
		<updated>2025-01-19T07:21:00Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* PhoneBox */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AMFP features a few new entity types.&lt;br /&gt;
&lt;br /&gt;
== PhoneBox ==&lt;br /&gt;
&lt;br /&gt;
The entity which executes phone calls. There's only one such asset in the game, and the entity file doesn't have any unique type vars (User Defined Variables). However, in the Level Editor, it has multiple instance vars.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop|amfp}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| VoiceFile1 || File (.ogg) || || Voice file to be played.&amp;lt;br&amp;gt;The file has to be located in the ''sounds'' folder or one of its subfolders.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry1 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay1 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry2 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay2 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry3 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay3 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry4 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay4 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry5 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay5 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry6 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay6 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry7 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay7 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Not all 7 entries must be used, but there can't be more than that in a single phonecall.&lt;br /&gt;
&lt;br /&gt;
The PhoneBox entity has three dedicated functions for it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void StartPhoneRinging(string&amp;amp; asName);&lt;br /&gt;
void StopPhoneRinging(string&amp;amp; asName);&lt;br /&gt;
void HangUpPhone(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName '' - The phone box entity to use.&lt;br /&gt;
&lt;br /&gt;
The PhoneBox won't ring until the &amp;lt;code&amp;gt;StartPhoneRinging&amp;lt;/code&amp;gt; function is called. &amp;lt;code&amp;gt;StopPhoneRinging&amp;lt;/code&amp;gt; can be used if the player leaves an area without picking up the phone, or takes too long.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;StartPhoneRinging&amp;lt;/code&amp;gt; is used, the PhoneBox will start ringing (the sound is only audible at a quite short distance, and a bell animation will play). A unique crosshair is shown when looking at the PhoneBox. Interacting with it will play a switch animation as well as the voice file, and display all the defined subtitles at specified intervals. After the voice file finishes playing, another switch animation will play and the glow will disappear (if it was used).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HangUpPhone&amp;lt;/code&amp;gt; ends the call early, stopping any voice lines currently playing. Plays a unique hang up sound (''entities/telephone/telephone_down.snt'') that is not used anywhere else.&lt;br /&gt;
&lt;br /&gt;
Keep in mind that the green light which appears on the PhoneBox is not a part of the entity; it's a Lamp entity which needs to be enabled by scripting.&lt;br /&gt;
&lt;br /&gt;
== Enemy_ManPig ==&lt;br /&gt;
The entity type used for the Wretch, Engineer, and Tesla manpigs. The Failed Experiments reuse Enemy_WaterLurker instead.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Enemy|amfp}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| NoticeSound || File (.snt) || || Sound played when enemy notices that player is nearby&lt;br /&gt;
|-&lt;br /&gt;
| GiveUpNoticeSound || File (.snt) || || Sound played when enemy gives up investigation (after a notice)&lt;br /&gt;
|-&lt;br /&gt;
| EnabledSound || File (.snt) || || Sound played when enemy is enabled&lt;br /&gt;
|-&lt;br /&gt;
| GroggyDamageCount || Float || 15 || The accumulated amount of damage the enemy can take before getting groggy by the hit.&amp;lt;br&amp;gt;The enemy will flinch after taking this amount of damage.&lt;br /&gt;
|-&lt;br /&gt;
| AlertToHuntDistance || Float || 10 || If range is above this then enemy can go from alert to hunt&lt;br /&gt;
|-&lt;br /&gt;
| AlertToInstantHuntDistance || Float || 3.5 || If range is below this, enemy geos instantly to hunt.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMinTime || Float || 2 || Min time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMaxTime || Float || 4.5 || Max time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| IncreaseAlertSpeedDistance || Float || 6 || Distance at which the alert move speed increases.&lt;br /&gt;
|-&lt;br /&gt;
| IncreasedAlertSpeedMul || Float || 1.5 || The amount that move speed is multiplied by when alert.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsToHuntLimit || Float || 30 || The accumulated limit value when alert goes to hunt because of player running towards enemy.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsCheckDistance || Float || 5 || The distance where the move toward enemy check starts&lt;br /&gt;
|-&lt;br /&gt;
| IsTesla || Bool || false || If this is the tesla pig&lt;br /&gt;
|-&lt;br /&gt;
| ChaseSound || File (.snt) || || Played when the pig is chasing.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Enemy|amfp}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| ThreatenOnAlert || Bool || false || If the pig should stand still and threaten instead of walking towards player when in alert mode.&lt;br /&gt;
|-&lt;br /&gt;
| FleeFromPlayer || Bool || false || The pig will flee instead of hunting (threaten if ThreatenOnAlert). Disabled if far enough away. Will attack if cornered.&amp;lt;br&amp;gt;Running to the furthest PathNode seems to be the main behavior.&amp;lt;br&amp;gt;'''If the map has no PathNodes, the game will crash when the enemy notices the player!'''&lt;br /&gt;
|-&lt;br /&gt;
| AutoDisableAfterFlee || Bool || false || If pig should be disabled after having fled (if possible)&amp;lt;br&amp;gt;Must not be seen by the player and must be more than 15 meters away from them.&lt;br /&gt;
|-&lt;br /&gt;
| LanternSensitivity || Float || 1 || A modifier for how quickly the pig reacts to being shined on by the lantern.&lt;br /&gt;
|-&lt;br /&gt;
| IdleBehavior || String || || The behavior used when there are no patrol nodes left to walk.&amp;lt;br&amp;gt;Can be &amp;quot;None&amp;quot;, &amp;quot;Stalk&amp;quot;, or &amp;quot;Track&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| PlayActivateSound || Bool || true || If the enemy can play its EnabledSound.&lt;br /&gt;
|-&lt;br /&gt;
| AllowZeroNodeWaitTimes || Bool || false || If set to true, path node wait times with value 0 actually mean no waiting&amp;lt;br&amp;gt;Normally, specifying a wait time of 0 in &amp;lt;code&amp;gt;AddEnemyPatrolNode&amp;lt;/code&amp;gt; results in a wait time of 1-3 seconds.&lt;br /&gt;
|-&lt;br /&gt;
| PatrolMoveSpeed || String || Walk || Whether this pig walks or runs along its patrol&amp;lt;br&amp;gt;Can be &amp;quot;Walk&amp;quot; or &amp;quot;Run&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| DamageMul || Float || 1 || Multiplier for the enemy's attack damage.&lt;br /&gt;
|-&lt;br /&gt;
| RunSpeedMul || Float || 1 || Multiplier for the enemy's run speed.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseTimeMul || Float || 1 || Multiplier for the wait time between attacks.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Enemy_Child ==&lt;br /&gt;
&lt;br /&gt;
An enemy variation used for acting out scenes. This &amp;quot;enemy&amp;quot; doesn't seem to respond to any player input, aside from proximity. Used mainly for the Mandus twins, but also for the NPCs seen running in the Streets chapter.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Enemy|amfp}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Enemy|amfp}}&lt;br /&gt;
&lt;br /&gt;
EntityTypes.cfg has a few instance vars listed in the Enemy base class that in fact only apply to Enemy_ManPig. These are skipped here.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| PatrolMoveSpeed || String || Walk || The movement speed type to use when patrolling.&amp;lt;br&amp;gt;Can be &amp;quot;Walk&amp;quot; or &amp;quot;Run&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== AnimatedProp ==&lt;br /&gt;
Identical to StaticProp, except it can play an animation. Used for models that have a continuous looping animation but otherwise have no interactivity, such as fans and machines that have moving dials or spin.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CastShadows || Bool || true || If entity casts shadows.&lt;br /&gt;
|-&lt;br /&gt;
| IsAffectedByDecal || Bool || true || If decals can be created on entity.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== VoiceFlashbackTrigger ==&lt;br /&gt;
&lt;br /&gt;
A prop that plays a voice flashback with screen effects when interacted with. The type of all entities in ''entities/voice_triggers''. Unused in the official maps, as they seem to have been replaced by Script areas that call &amp;lt;code&amp;gt;PlayEffectVoice&amp;lt;/code&amp;gt; when collided with.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop|amfp}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop|amfp}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| VoiceFile || File (.ogg) || || Voice file to be played.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/TDD/Entity_Types&amp;diff=6990</id>
		<title>HPL2/TDD/Entity Types</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/TDD/Entity_Types&amp;diff=6990"/>
		<updated>2025-01-19T07:08:35Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Lamp */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TocRight}}&lt;br /&gt;
&lt;br /&gt;
This page lists the different types of entities found within the HPL2 engine. The type determines how the entity will be set up, what kind it is, what it does under different circumstances etc. Using the Model Editor you can identify and specify which type an entity has and its type vars, in Settings &amp;gt; User defined variables. In the Level Editor, the different types have different settings applicable for them, known as instance vars. For example, a MoveObject type will have the OffsetArea box available in the Level Editor, and an Item (Note) type will have a NoteText box available.&lt;br /&gt;
&lt;br /&gt;
A list of all the types and subtypes can be found in the table of contents to the right.&lt;br /&gt;
&lt;br /&gt;
== StaticProp ==&lt;br /&gt;
&lt;br /&gt;
A StaticProp entity resembles a static object. They have no available type properties, but they can still use physics bodies (collision boxes) and have mass/gravity. Note that they cannot be interacted with in the game, and cannot be disabled. If you need this feature, use Object (Static) instead.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CastShadows || Bool || true || If entity casts shadows.&lt;br /&gt;
|-&lt;br /&gt;
| IsAffectedByDecal || Bool || true || If decals can be created on entity.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CommentaryIcon ==&lt;br /&gt;
&lt;br /&gt;
A CommentaryIcon entity is simply an object that can execute commentary sound files, as it was done in the main game. These only appear if the player has &amp;quot;Commentary&amp;quot; enabled in their settings.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| RotateSubMesh || String || || The name of the submesh that is to be rotated&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| File || File (.comment) || || The .comment file for the commentary.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Object ==&lt;br /&gt;
&lt;br /&gt;
Objects are entities that can be activated/deactivated, broken, and interact with physics.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| BreakActive || Bool || false || If entity is broken when hit hard enough or health is 0.&lt;br /&gt;
|-&lt;br /&gt;
| BreakDestroyJoints || Bool || false || If all physics joints should be destroyed when broken.&lt;br /&gt;
|-&lt;br /&gt;
| BreakMinEnergy || Float || 100 || The minimum energy needed for breakage. Energy = Object1Speed * Object1Mass + Object2Speed * Object2Mass. Speed = m/s. If Object 2 is floor or something static, its speed is always 0 and does not contribute to total energy!&lt;br /&gt;
|-&lt;br /&gt;
| BreakEntity || File (.ent) || || The entity this entity turns into when broken.&lt;br /&gt;
|-&lt;br /&gt;
| BreakEntityAlignBody || String || || The body BreakEntity uses to align itself when created. No entity is created if left empty.&lt;br /&gt;
|-&lt;br /&gt;
| BreakSound || File (.snt) || || The sound made when broken.&lt;br /&gt;
|-&lt;br /&gt;
| BreakParticleSystem || File (.ps) || || Particle system shown when broken.&lt;br /&gt;
|-&lt;br /&gt;
| BreakImpulse || Float || 4 || Impulse (speed in m/s really) added to all bodies in BreakEntity when created. The direction of impulse is outwards from center of entity.&lt;br /&gt;
|-&lt;br /&gt;
| HitDamageAmount || Float || 5 || The amount of damage made when hitting an enemy or player.&lt;br /&gt;
|-&lt;br /&gt;
| HitDamageStrength || Int || 1 || The strength of the damage.&lt;br /&gt;
|-&lt;br /&gt;
| MinHitDamageSpeed || Float || 3 || The minimum speed (m/s) needed for damage to be made.&lt;br /&gt;
|-&lt;br /&gt;
| LifeLength || Float || 0 || A time after which the entity automatically breaks. 0=lasts forever.&lt;br /&gt;
|-&lt;br /&gt;
| IsFood || Bool || false || If this is food for some enemies and can be used to lure them. Needs to have break active and health determines how long the food lasts.&amp;lt;br&amp;gt;Waterlurkers are the only enemy type that is lured by and eats food objects.&lt;br /&gt;
|-&lt;br /&gt;
| ShowHints || Bool || true || If a hint can be triggered by interacting with the prop.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| ContainedItem || String || None || An item that is created when entity breaks.&amp;lt;br&amp;gt;Must match an entity file name (extension .ent optional) in the &amp;quot;items&amp;quot; folder.&lt;br /&gt;
|-&lt;br /&gt;
| DisableBreakable || Bool || false || If the entity is breakable then having this true will make it unbreakable.&lt;br /&gt;
|-&lt;br /&gt;
| IsInsanityVision || Bool || false || If the prop is only shown when insanity is low enough.&lt;br /&gt;
|-&lt;br /&gt;
| VisionMaxSanity || Float || 30 || The max sanity the player can have for prop to show if it is an insanity vision.&amp;lt;br&amp;gt;The object will only be visible if the player's sanity is less than this value.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Static ===&lt;br /&gt;
&lt;br /&gt;
Not to be confused with an actual static object. This Object subtype is a generic object with common properties. The static subtype simply disables any additional properties from the other subtypes. An Object (Static) is similar in concept to a StaticProp type entity, however the Object (Static) can be deactivated, can break, has physics, and can have an interact callback set.&lt;br /&gt;
&lt;br /&gt;
=== Grab ===&lt;br /&gt;
&lt;br /&gt;
A Grab subtype is a normal Object entity with the ability to be grabbed by the player in the game. In order for this to work, the object must have a mass above 0.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| GrabUseDepth || Bool || false || If GrabDepth is used. If not the interaction distance is used.&lt;br /&gt;
|-&lt;br /&gt;
| GrabDepth || Float || 1.5 || The distance which a grabbed object is automatically placed at.&lt;br /&gt;
|-&lt;br /&gt;
| GrabDepthInc || Float || 0.15 || Steps that the entity will move in when moving the mouse scroll.&lt;br /&gt;
|-&lt;br /&gt;
| GrabMinDepth || Float || 1.0 || Minimum distance the entity can be from player when grabbed.&lt;br /&gt;
|-&lt;br /&gt;
| GrabMaxDepth || Float || 2.2 || Maximum distance the entity can be from player when grabbed.&lt;br /&gt;
|-&lt;br /&gt;
| GrabUseOffset || Bool || false || If rotation and position offset is used. If not offset will be relative to the interact position.&lt;br /&gt;
|-&lt;br /&gt;
| GrabPositionOffset || Vector3f || 0 || Positional offset of entity.&lt;br /&gt;
|-&lt;br /&gt;
| GrabRotationOffset || Vector3f || 0 || Rotational offset of entity. It will automatically rotate to this when grabbed.&lt;br /&gt;
|-&lt;br /&gt;
| GrabThrowImpulse || Float || 10 || The speed (m/s) at which the entity is thrown.&lt;br /&gt;
|-&lt;br /&gt;
| GrabMassMul || Float || 0.1 || How much the object will weight when grabbed. Useful for heavier objects since they can wreck mayhem otherwise. 0.5% means half (50%) of the original weight.&lt;br /&gt;
|-&lt;br /&gt;
| GrabForceMul || Float || 1 || Change how much force is added to grabbed object.&lt;br /&gt;
|-&lt;br /&gt;
| GrabTorqueMul || Float || 1 || Change how much torque is added to grabbed object.&lt;br /&gt;
|-&lt;br /&gt;
| GrabUseRotation || Bool || true || If rotation should be used on grabbed object&lt;br /&gt;
|-&lt;br /&gt;
| GrabSkipNonOuterBodies || Bool || false || If true, then bodies that are inside a chain (has two or more joints attached to it) will not be grabbed.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Push ===&lt;br /&gt;
&lt;br /&gt;
Similar to the Grab subtype, the Push subtype allows the player to push the object by taking hold of it and walking or right clicking. Examples include large rocks and the bed covering the hole in the floor in the Prison - Southern Block.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| PushAtPoint || Bool || false || If the push force should be applied to the point at the object where interaction took place.&lt;br /&gt;
|-&lt;br /&gt;
| PushForceMul || Float || 1 || Multiplier for force applied. Used to fine tune interaction.&lt;br /&gt;
|-&lt;br /&gt;
| PushImpulse || Float || 2 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Slide ===&lt;br /&gt;
&lt;br /&gt;
A Slide Object is similar to the Grab subtype, except it can only be slid in a single direction for a certain amount. An existing (but unused) entity that uses this is the secret floor carpet you can slide to the side.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| SlideMaxSpeed || Float || 10 || The maximum speed it can be moved.&lt;br /&gt;
|-&lt;br /&gt;
| SlideSlowDownFactor || Float || 1 || Amount of slowdown applied to object when not moved.&lt;br /&gt;
|-&lt;br /&gt;
| SlideSpeedFactor || Float || 1 || The higher value the more speed gain a mouse movement makes.&lt;br /&gt;
|-&lt;br /&gt;
| SlideThrowImpulse || Float || 3 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SwingDoor ==&lt;br /&gt;
&lt;br /&gt;
A SwingDoor entity is standard hinged door. Any door you can grab and swing open is considered a SwingDoor. To use a SwingDoor, you need to attach joints to where you want the door to swing around. These are usually placed by the hinges of the door. On the joint you can set the min and max values to limit how much the door can be opened. These are usually approximately 90 degrees apart in either positive or negative directions.&lt;br /&gt;
&lt;br /&gt;
If the FullGameSave instance var is not enabled, SwingDoors will reset to their initial open amount when leaving a level and returning to it.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MoveMaxSpeed || Float || 13.5 || The maximum speed it can be moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSlowDownFactor || Float || 3.0 || Amount of slowdown applied to object when not moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSpeedFactor || Float || 1.0 || The higher value the more speed gain a mouse movement makes.&lt;br /&gt;
|-&lt;br /&gt;
| MoveThrowImpulse || Float || 6.0 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
| CanInteractWithStaticBody || Bool || false || If by interacting with a static body in the entity, the door is interacted with. Meaning that interacting with any part of the entity will work.&lt;br /&gt;
|-&lt;br /&gt;
| CloseOnSound || File (.snt) || || Sound played when the door is closed.&lt;br /&gt;
|-&lt;br /&gt;
| CloseOffSound || File (.snt) || || Sound played when the door is opened.&lt;br /&gt;
|-&lt;br /&gt;
| LockOnSound || File (.snt) || || Sound played when the door is locked.&lt;br /&gt;
|-&lt;br /&gt;
| LockOffSound || File (.snt) || || Sound played when the door is unlocked.&lt;br /&gt;
|-&lt;br /&gt;
| InteractLockedSound || File (.snt) || || Sound made when player interacts with a locked door.&lt;br /&gt;
|-&lt;br /&gt;
| Breakable || Bool || false || Can the door be broken.&lt;br /&gt;
|-&lt;br /&gt;
| DamageMesh1 || File (.dae/.msh/.mesh) || || Mesh used when health is below HealthDamage1&lt;br /&gt;
|-&lt;br /&gt;
| DamageMesh2 || File (.dae/.msh/.mesh) || || Mesh used when health is below HealthDamage2&lt;br /&gt;
|-&lt;br /&gt;
| BrokenEntity || File (.ent) || || The entity this entity turns into when broken.&lt;br /&gt;
|-&lt;br /&gt;
| DamageSound || File (.snt) || || Sound made when a new damage mesh is used.&lt;br /&gt;
|-&lt;br /&gt;
| DamagePS || File (.ps) || || Particles created when a new damage mesh is used.&lt;br /&gt;
|-&lt;br /&gt;
| BreakSound || File (.snt) || || Sound made when broken.&lt;br /&gt;
|-&lt;br /&gt;
| BreakPS || File (.ps) || || Particles created when broken.&lt;br /&gt;
|-&lt;br /&gt;
| BreakImpulse || Float || 3 || Impulse set to objects in broken mesh.&amp;lt;br&amp;gt;Incorrectly defined as a sound file in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| HealthDamage1 || Float || 66 || Health when damage mesh 1 is used.&lt;br /&gt;
|-&lt;br /&gt;
| HealthDamage2 || Float || 33 || Health when damage mesh 2 is used.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| Locked || Bool || false || If the door is locked&lt;br /&gt;
|-&lt;br /&gt;
| OpenAmount || Float || 0 || The amount the door is open. 0 - 1.&lt;br /&gt;
|-&lt;br /&gt;
| DisableBreakable || Bool || false || If the entity is breakable then having this true will make it unbreakable.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Lever ==&lt;br /&gt;
&lt;br /&gt;
A Lever entity is an entity that can be swung between states to trigger callbacks. A lever requires a joint to swing around.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MoveMaxSpeed || Float || 13.5 || The maximum speed it can be moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSlowDownFactor || Float || 3.0 || Amount of slowdown applied to object when not moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSpeedFactor || Float || 1.0 || The higher value the more speed gain a mouse movement makes.&lt;br /&gt;
|-&lt;br /&gt;
| MoveThrowImpulse || Float || 6.0 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
| CanInteractWithStaticBody || Bool || false || If by interacting with a static body in the entity, the lever is interacted with. Meaning that interacting with any part of the entity will work.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitRange || Float || 5.0 || The distance from min the joint can be to be considered at min limit.&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitRange || Float || 5.0 || The distance from max the joint can be to be considered at max limit.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitSound || File (.snt) || || Sound played when at min limit&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitSound || File (.snt) || || Sound played when at max limit&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitStuck || Bool || false || If the lever becomes stuck when reaching min.&amp;lt;br&amp;gt;Missing from EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitStuck || Bool || false || If the lever becomes stuck when reaching max.&amp;lt;br&amp;gt;Missing from EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| StuckSound || File (.snt) || || Sound played when stuck&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| MiddleAngleAmount || Float || 0 || The amount between min and max that is considered middle. -1 to 1. -1=at min, 0=exactly between min and max, 1=at max&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveToAngle || Bool || True || If the lever should move to position when not interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveSpeedFactor || Float || 2 || Multiplier applied to speed to determine the speed it moves towards wanted position. The higher the faster it gets to the position.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveMaxSpeed || Float || 8 || Max speed it can move at to the wanted position&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveGoal || String || Middle || Where it should go when auto moving.&amp;lt;br&amp;gt;Can be &amp;quot;Middle&amp;quot;, &amp;quot;Min&amp;quot;, or &amp;quot;Max&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| StuckState || String || None || The initial stuck state for the lever.&amp;lt;br&amp;gt;Can be &amp;quot;None&amp;quot;, &amp;quot;Min&amp;quot;, or &amp;quot;Max&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| InteractionDisablesStuck || Bool || false || If stuck is disabled when player interacts.&lt;br /&gt;
|-&lt;br /&gt;
| OverrideDefaults || Bool || false || If normal settings, set in ent file, should be overridden by settings below.&lt;br /&gt;
|-&lt;br /&gt;
| MiddleAngleAmount || Float || 0 || The amount between min and max that is considered middle. -1 to 1. -1=at min, 0=exactly between min and max, 1=at max&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveToAngle || Bool || True || If the lever should move to position when not interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveGoal || String || Middle || Where it should go when auto moving.&amp;lt;br&amp;gt;Can be &amp;quot;Middle&amp;quot;, &amp;quot;Min&amp;quot;, or &amp;quot;Max&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Wheel ==&lt;br /&gt;
&lt;br /&gt;
A Wheel entity is a wheel that can be turned. They use states similar to the levers. Some wheels can be turned indefinitely and some (mostly valves) can be turned for a fixed amount in order to trigger an event. Wheels require a joint.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MoveMaxSpeed || Float || 13.5 || The maximum speed it can be moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSlowDownFactor || Float || 3.0 || Amount of slowdown applied to object when not moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSpeedFactor || Float || 1.0 || The higher value the more speed gain a mouse movement makes.&lt;br /&gt;
|-&lt;br /&gt;
| MoveThrowImpulse || Float || 6.0 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
| CanInteractWithStaticBody || Bool || false || If by interacting with a static body in the entity, the wheel is interacted with. Meaning that interacting with any part of the entity will work.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimit || Float || -180 || Min limit of the wheel, should be equal or below 0 but can be as low as wanted. Several revolutions are supported!&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimit || Float || 180 || Max limit of the wheel, should be equal or above 0 but can be as high as wanted. Several revolutions are supported!&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitRange || Float || 5.0 || The distance from min the joint can be to be considered at min limit.&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitRange || Float || 5.0 || The distance from max the joint can be to be considered at max limit.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitStuck || Bool || false || If the wheel becomes stuck when reaching min limit.&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitStuck || Bool || false || If the wheel becomes stuck when reaching max limit.&lt;br /&gt;
|-&lt;br /&gt;
| SpinDir || String || BothWays || The direction the wheel can be spun&amp;lt;br&amp;gt;Can be &amp;quot;BothWays&amp;quot;, &amp;quot;ToMin&amp;quot;, or &amp;quot;ToMax&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitSound || File (.snt) || || Sound played at min limit&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitSound || File (.snt) || || Sound played at max limit&lt;br /&gt;
|-&lt;br /&gt;
| StuckSound || File (.snt) || || Sound played when stuck.&lt;br /&gt;
|-&lt;br /&gt;
| SlowDownRotation || Bool || true || If rotation should be slowed to 0 when not interacting.&lt;br /&gt;
|-&lt;br /&gt;
| SkipMiddleState || Bool || true || If the middle state (when not in max or min) should be skipped by script and connections.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| StuckState || String || None || The stuck state for the wheel.&amp;lt;br&amp;gt;Can be &amp;quot;None&amp;quot;, &amp;quot;Min&amp;quot;, or &amp;quot;Max&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| InteractionDisablesStuck || Bool || false || If stuck is disabled when player interacts.&lt;br /&gt;
|-&lt;br /&gt;
| OverrideDefaults || Bool || false || If normal settings, set in ent file, should be overridden by settings below.&lt;br /&gt;
|-&lt;br /&gt;
| MinLimit || Float || -180 || Min limit of the wheel, should be equal or below 0 but can be as low as wanted. Several revolutions are supported!&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimit || Float || 180 || Max limit of the wheel, should be equal or above 0 but can be as high as wanted. Several revolutions are supported!&lt;br /&gt;
|-&lt;br /&gt;
| MinLimitStuck || Bool || false || If stuck at min limit&lt;br /&gt;
|-&lt;br /&gt;
| MaxLimitStuck || Bool || false || If stuck at max limit&lt;br /&gt;
|-&lt;br /&gt;
| SpinDir || String || BothWays || The direction the wheel can be spun&amp;lt;br&amp;gt;Can be &amp;quot;BothWays&amp;quot;, &amp;quot;ToMin&amp;quot;, or &amp;quot;ToMax&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MultiSlider ==&lt;br /&gt;
&lt;br /&gt;
A sliding-type lever that can be set to multiple states. Used for the gear levers in the Sewer.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| SlideMaxSpeed || Float || 10 || The maximum speed it can be moved.&lt;br /&gt;
|-&lt;br /&gt;
| SlideSlowDownFactor || Float || 1 || Amount of slowdown applied to object when not moved.&lt;br /&gt;
|-&lt;br /&gt;
| SlideSpeedFactor || Float || 1 || The higher value the more speed gain a mouse movement makes.&lt;br /&gt;
|-&lt;br /&gt;
| SlideThrowImpulse || Float || 3 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
| NumOfStates || Int || 3 || The number of states used.&lt;br /&gt;
|-&lt;br /&gt;
| StickToStateMaxDist || Float || 0.1 || The distance from a state that the slider sticks.&lt;br /&gt;
|-&lt;br /&gt;
| CanInteractWithStaticBody || Bool || false || If by interacting with a static body in the entity, the lever is interacted with. Meaning that interacting with any part of the entity will work.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveToCurrentState || Bool || true || If body should automove to current state when not interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveSpeedFactor || Float || 2 || Multiplier applied to speed to determine the speed it moves towards wanted position. The higher the faster it gets to the postion.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveMaxSpeed || Float || 8 || Max speed it can move at to the wanted position&lt;br /&gt;
|-&lt;br /&gt;
| ChangeStateSound || File (.snt) || || Sound played when state is changed&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| StuckSound || File (.snt) || || Sound played when stuck&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| StuckState || String || None || The stuck state for the wheel.&amp;lt;br&amp;gt;Can be &amp;quot;None&amp;quot;, &amp;quot;Min&amp;quot;, or &amp;quot;Max&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| InteractionDisablesStuck || Bool || false || If stuck is disabled when player interacts.&lt;br /&gt;
|-&lt;br /&gt;
| ChangeStateCallback || String || || Called when state changes Syntax: &amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;Used instead of ConnectionStateChangeCallback, as this entity type can have more than two possible states.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Lamp ==&lt;br /&gt;
&lt;br /&gt;
A Lamp entity is a light source. If they are unlit, they can be lit by the player, consuming a tinderbox. Examples are torches and candles.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CanBeLitByPlayer || Bool || true || If the player can use a tinderbox on it to light it.&lt;br /&gt;
|-&lt;br /&gt;
| CanBeGrabbed || Bool || false || If it can be grabbed by the player.&amp;lt;br&amp;gt;No effect. Presumably intended to make the entity behave like a Grab Object, yet this is unimplemented.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| Lit || Bool || true || If the lamp is lit or not.&lt;br /&gt;
|-&lt;br /&gt;
| ConnectedLight || String || || Name of a light (that is not in an entity!) that will be connected to the this light and will increase/decrease in color as the lamp is turned on/off.&lt;br /&gt;
|-&lt;br /&gt;
| ConnectionLightAmount || Float || 1 || The amount to multiply the lamp's color by before adding it to the connected light's color.&lt;br /&gt;
|-&lt;br /&gt;
| ConnectionLightUseOnColor || Bool || true || If the on color should always be used. If false the light color (which might be flickering) is used.&lt;br /&gt;
|-&lt;br /&gt;
| ConnectionLightUseSpec || Bool || false || If the specular of the lamp color should be used.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Button ==&lt;br /&gt;
&lt;br /&gt;
A Button entity acts like a Lever, except it does not use a joint. It simply changes its connection state and toggles effects when interacted with.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| SwitchedOn || Bool || false || If the button starts as on or off&lt;br /&gt;
|-&lt;br /&gt;
| CanBeSwitchedOn || Bool || true || If player can switch it on.&lt;br /&gt;
|-&lt;br /&gt;
| CanBeSwitchedOff || Bool || false || If player can switch it off.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Photocell ==&lt;br /&gt;
&lt;br /&gt;
A prop that changes its texture illumination and connection state based on the light level around it. Presumably a leftover from Lux Tenebris, which featured light-based puzzles.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| LightLevelOnLimit || Float || 0.9 || Light level above this value turns the photocell on.&lt;br /&gt;
|-&lt;br /&gt;
| LightLevelOffLimit || Float || 0.1 || Light level below this value turns the photocell off.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MoveObject ==&lt;br /&gt;
&lt;br /&gt;
A MoveObject entity is an entity that can be specifically moved on a single axis through the use of scripting. It can be set to either Angular or Linear. Angular rotates the object around its own center point, unless otherwise specified by the use of an OffsetArea. Linear moves the object in a direction for a specified amount. Note that a linear move object can only move on one axis. You can pick X, Y, or Z in the entity and this cannot be changed mid-game. If you want the same object to move on more than 1 axis (for example left then forward) you can switch out the entity with an identical one that uses another axis. The script to move a MoveObject is &amp;lt;code&amp;gt;SetMoveObjectState&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;SetMoveObjectStateExt&amp;lt;/code&amp;gt; (see [[HPL2/Engine Scripts|Engine Scripts]]).&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MoveObjectType || String || Linear || The way the object moves. Linear means position changes and Angular means rotation changes.&amp;lt;br&amp;gt;Can be &amp;quot;Linear&amp;quot; or &amp;quot;Angular&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| OpenAmount || Float || 1.0 || Linear: How much of the MoveAxis size that will mean that it is open. Angular: 1=90 degrees. 0.5=45deg and 2=180deg (any numbers inbetween are okay of course)&lt;br /&gt;
|-&lt;br /&gt;
| MoveAxis || String || X || he axis that the movement is about. For angular it is rotation axis and for linear it is the position axis that is changed.&amp;lt;br&amp;gt;Can be &amp;quot;X&amp;quot;, &amp;quot;Y&amp;quot;, or &amp;quot;Z&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| OpenAcc || Float || 5.0 || The acceleration for reaching OpenSpeed&lt;br /&gt;
|-&lt;br /&gt;
| OpenSpeed || Float || 1.0 || The goal speed when opening.&lt;br /&gt;
|-&lt;br /&gt;
| CloseAcc || Float || 5.0 || The acceleration for reaching CloseSpeed&lt;br /&gt;
|-&lt;br /&gt;
| CloseSpeed || Float || 1.0 || The goal speed when closing.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMove || Bool || false || If the door should move towards some goal automatically.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveStateGoal || Float || 0.0 || The amount (relative to the what is considered open) that it shall move towards.&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveAcc || Float || 9.0 || The acceleration when automoving&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveSpeed || Float || 5.0 || The goal speed when automoving&lt;br /&gt;
|-&lt;br /&gt;
| AutoMoveSlowdownDist || Float || 0.1 || The distance from state goal where it begins to slow down (in meters for linear and degrees for angular).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| AngularOffsetArea || String || || When mode is angular, this the point it rotates around. If emtpy, it rotates around it's center.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Item ==&lt;br /&gt;
&lt;br /&gt;
Item entities become inventory items when interacted with. They glow when in pickup range.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| SubItemTypeName || String || || Determines its name and description by putting 'ItemDesc_' or 'ItemName_' as prefix for the lang file entry. Category is always Inventory&lt;br /&gt;
|-&lt;br /&gt;
| ImageFile || File (.tga/.dds/.jpg/.jpeg/.png) || || The icon shown in the inventory when picked up.&lt;br /&gt;
|-&lt;br /&gt;
| PickSound || String || Generic || The sound played when picked up.&amp;lt;br&amp;gt;Must match a sound file name in the &amp;quot;ui&amp;quot; folder, starting with &amp;quot;pick_&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CustomSubItemTypeName || String || || If not emtpy it overrides SubItemTypeName in entity file. Determines its name and description by putting 'ItemDesc_' or 'ItemName_' as prefix for the lang file entry. Category is always Inventory&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Puzzle ===&lt;br /&gt;
&lt;br /&gt;
A Puzzle subtype item is a general item with no extra properties. Use this if you only need an inventory item to be used to trigger a scripted action. Other subtypes have special properties, but Puzzle only has the ability to be collected and used from the inventory. When used, it's loaded onto the crosshair so the player can use it on objects.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| TempVar || Float || 0 || User specfic usage.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Coins ===&lt;br /&gt;
&lt;br /&gt;
Unused item type for the cut Thaler items. Thalers were once used to unlock Chests and use OilBarrels, with only the former functionality remaining.&lt;br /&gt;
&lt;br /&gt;
{{warning|You can create custom coin items, but there is a single language entry which is hardcoded into the engine and can't be changed. This means that even if all the others are changed, looking at Chests will always say &amp;quot;Locked. Costs X Thalers to open.&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CoinAmount || Int || 10 || The amount of coins it contains.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Note ===&lt;br /&gt;
&lt;br /&gt;
A Note item is an item that adds text to the player's journal. It displays itself when picked up. The note can be narrated, in which case it will automatically close once it's finished. If it isn't voiced, the player must close it. Use this if you want to make a Note item using a custom model or custom properties that differ from the main notes.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| NoteText || String || || The text and name of entry for note. Entry names for these are calculated: 'Note_'+NoteText+'_Name' and 'Note_'+NoteText+'_Text'&lt;br /&gt;
|-&lt;br /&gt;
| OpenNoteInJournal || Bool || true || If the journal should be opened when the note is picked up.&lt;br /&gt;
|-&lt;br /&gt;
| UseNarration || Bool || false || If the note has narration.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Diary ===&lt;br /&gt;
&lt;br /&gt;
A Diary item is nearly identical to the Note item. Instead, it adds itself to the Diary section of the player's journal, whereas the Note adds itself to the Notes section. Additionally, diary entries are grouped together, so that when one is split into multiple parts, the player will always read them in order, regardless of the specific Diary items that were picked up.&lt;br /&gt;
&lt;br /&gt;
Diaries are also always voice enabled, while Notes have the option for it. As such, a Diary without any voice files defined in its text will instantly close the journal on pickup.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| DiaryText || String || || The text and name of entry for diary. Entry name for these calculated: 'Diary_'+DiaryText+'_Name'+Idx and 'Diary_'+DiaryText+'_Text'+Idx. Idx starts at 1.&lt;br /&gt;
|-&lt;br /&gt;
| DiaryCallback || String || || A special callback for diary pickup. Syntax: &amp;lt;code&amp;gt;void Func(string &amp;amp;in asItem, int lDiaryIdx)&amp;lt;/code&amp;gt;. Call &amp;lt;code&amp;gt;ReturnOpenJournal(false)&amp;lt;/code&amp;gt; to not open diary in journal after callback.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Lantern ===&lt;br /&gt;
&lt;br /&gt;
A Lantern item can be picked up like a normal item, but is added as a lantern to the inventory. While having this item, the player can press F to toggle it, or click it in the inventory. Note: This is NOT the lantern model in the player's hands, only the item that gives it to the player. If you want a custom lantern model, you can follow [https://www.frictionalgames.com/forum/thread-12391.html this guide].&lt;br /&gt;
&lt;br /&gt;
=== Health ===&lt;br /&gt;
&lt;br /&gt;
A Health item acts like a health potion (Laudanum). It acts like a normal item, except when used it is consumed while increasing the player's health by a specified amount.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| HealAmount || Float || 25 || How much health is regained when used.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sanity ===&lt;br /&gt;
&lt;br /&gt;
A Sanity item acts like a sanity potion. While used, they increase the player's sanity by a fixed amount, and then consumed from the inventory.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| HealAmount || Float || 25 || How much sanity is regained when used.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== LampOil ===&lt;br /&gt;
&lt;br /&gt;
A LampOil item acts like an oil potion. When used, it increases the amount of oil for the lantern, and then consumed.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| OilAmount || Float || 25 || How much oil is regained when used.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Tinderbox ===&lt;br /&gt;
&lt;br /&gt;
A Tinderbox item adds itself to the player's tinderbox counter in the inventory. Tinderboxes can be used once to light a light source.&lt;br /&gt;
&lt;br /&gt;
=== HandObject ===&lt;br /&gt;
&lt;br /&gt;
Unused. Would have equipped the corresponding hand object on use.&lt;br /&gt;
&lt;br /&gt;
== Chest ==&lt;br /&gt;
&lt;br /&gt;
This is an unused feature, but it was kept in the engine and can be restored by making a custom entity. It is a object which can be opened using coins (or their replacements, if a custom Coin-type entity is made). Interacting with it brings up a text GUI. The text GUI can be changed in the base language file.&lt;br /&gt;
To make an entity of this type, just copy an existing entity file and change its entity type.&lt;br /&gt;
'''The chests that ended up in the game are actually just Levers.'''&lt;br /&gt;
&lt;br /&gt;
{{warning|In versions before 1.5, Chests did not write their CoinsNeeded instance var to save data, which caused the coin requirement of all Chests to default to 0 when loading a save.}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MoveMaxSpeed || Float || 13.5 || The maximum speed it can be moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSlowDownFactor || Float || 3.0 || Amount of slowdown applied to object when not moved.&lt;br /&gt;
|-&lt;br /&gt;
| MoveSpeedFactor || Float || 1.0 || The higher value the more speed gain a mouse movement makes.&lt;br /&gt;
|-&lt;br /&gt;
| MoveThrowImpulse || Float || 6.0 || Impulse added when thrown.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CoinsNeeded || Int || 200 || Coins required to open the chest.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== OilBarrel ==&lt;br /&gt;
&lt;br /&gt;
An OilBarrel entity simply adds some oil to the player's lantern upon interaction. The oil amount depends on the player's combined total oil stored in their lantern and as LampOil type items (the sum of the oil that the items would refill on use), determined when the player first looks at the OilBarrel. If the total oil is less than 100, the OilBarrel will contain exactly enough oil to bring it to 100. Otherwise (or if Hard Mode is enabled), it provides only 10 oil.&lt;br /&gt;
&lt;br /&gt;
If the FullGameSave instance var is not enabled, OilBarrels can be used again when leaving a level and returning to it.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| FillSound || File (.snt) || || Sound played when lantern is filled.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| EmptySound || File (.snt) || || Sound played when barrel is empty.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
== EmotionStone ==&lt;br /&gt;
&lt;br /&gt;
The memory capsule entities found in the game. Interacting with an EmotionStone causes an emotion flash effect to display, fading the screen to white and displaying a message.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| DescCat || String || || Category of text shown when in focus.&lt;br /&gt;
|-&lt;br /&gt;
| DescEntry || String || || Entry of text shown when in focus.&lt;br /&gt;
|-&lt;br /&gt;
| TextCat || String || || Category of text shown when interacted with.&amp;lt;br&amp;gt;Typically &amp;quot;EmotionStone&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry || String || || Entry of text shown when interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| Sound || File (.snt) || || Sound played when interacted with.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== NPC ==&lt;br /&gt;
&lt;br /&gt;
Non-Player Characters are non-enemy characters. Agrippa and Alexander as they appear in-game are NPCs. Their only purpose is to stand in place and look at the player (if you enable the option).&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MoveHeadBones || String || || List of bones that is rotated when the NPC rotates its head.&lt;br /&gt;
|-&lt;br /&gt;
| MoveHeadBoneMuls || String || || List of floats specifying how much each bone shall be rotated (-1 to 1).&lt;br /&gt;
|-&lt;br /&gt;
| HeadMoveSpeedMul || Float || 1 || Speed multiplier that that determines move speed based on distance to wanted angle.&lt;br /&gt;
|-&lt;br /&gt;
| HeadMoveMaxSpeed || Float || 1 || The max speed that the head moves in.&lt;br /&gt;
|-&lt;br /&gt;
| MaxHeadAngle || Float || 30 || The max angle that the head can turn when looking at the player.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| FollowPlayerArea || String || || When player is in this area, the NPC will look at him.&lt;br /&gt;
|-&lt;br /&gt;
| Awake || Bool || true || If the NPC is awake and looks at the player when in area.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== LevelDoor ==&lt;br /&gt;
&lt;br /&gt;
A LevelDoor transports the player to the specified level when interacted with. The locked sounds, text, and destination can be entered in the Level Editor itself.&lt;br /&gt;
&lt;br /&gt;
LevelDoors can also teleport the player (without a loading screen) if the same map is picked.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| EnterSound || File (.snt) || || Sound played when entering door.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| ExitSound || File (.snt) || || Sound played when entering new map after having interacted with door.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry || String || || The text shown when door is in focus. Category is always Levels&lt;br /&gt;
|-&lt;br /&gt;
| StartPos || String || || The start position of the next map that the player is transported to.&lt;br /&gt;
|-&lt;br /&gt;
| MapFile || File (.map) || || The file of the next map.&lt;br /&gt;
|-&lt;br /&gt;
| Locked || Bool || false || If the door is locked.&lt;br /&gt;
|-&lt;br /&gt;
| LockedSound || File (.snt) || || Sound heard if locked and interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| LockedTextCat || String || || Category of message shown if locked and interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| LockedTextEntry || String || || Entry of message shown if locked and interacted with.&lt;br /&gt;
|-&lt;br /&gt;
| ShowStats || Bool || true || If stats of map it leads to should be shown (NOT IN USE)&amp;lt;br&amp;gt;Non-functional. Formerly used to display a completion percentage.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CritterBug ==&lt;br /&gt;
&lt;br /&gt;
Critters like rats, roaches, or fish on the ground (or in the case of fish, water). They move around the room they are placed in and run away from the player.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MeshOffsetRot || Vector3 || 0 0 0 || The mesh offset rotation.&lt;br /&gt;
|-&lt;br /&gt;
| MeshOffsetPos || Vector3 || 0 0 0 || The mesh offset position.&lt;br /&gt;
|-&lt;br /&gt;
| MaxSpeedNormal || Float || 0.5 || Max speed when in normal state&lt;br /&gt;
|-&lt;br /&gt;
| MaxSpeedAfraid || Float || 1.3 || Max speed when in the scared state&lt;br /&gt;
|-&lt;br /&gt;
| Gravity || Float || 9.8 || Amount of gravity applied.&lt;br /&gt;
|-&lt;br /&gt;
| HasRandomPauses || Bool || false || If the critter shall have random pauses&lt;br /&gt;
|-&lt;br /&gt;
| RandomPauseTimeMinMax || Vector2 || 1 3 || Random time length of pause&lt;br /&gt;
|-&lt;br /&gt;
| RandomMoveTimeMinMax || Vector2 || 2 6 || Random time length of movement (between pauses)&lt;br /&gt;
|-&lt;br /&gt;
| PlayerFleeDistance || Float || 3 || The distance from player which it begins to flee&lt;br /&gt;
|-&lt;br /&gt;
| FleeMul || Float || 2.1 || Factor for moving away from player (if fleeing)&lt;br /&gt;
|-&lt;br /&gt;
| BackToSpawnPointMul || Float || 0.1 || Factor for moving back to spawn point&lt;br /&gt;
|-&lt;br /&gt;
| WanderCircleRadius || Float || 4 || Picture a circle in front critter at a certain distance. A point inside the circle is randomly selected and then the vector from the critter to this point is the speed added. The larger the circle, the more random the walk.&lt;br /&gt;
|-&lt;br /&gt;
| WanderCircleDist || Float || 2 || The distance at which the wander circle is placed. The higher the distance, the more likely the critter is to move forward.&lt;br /&gt;
|-&lt;br /&gt;
| NormalSound || File (.snt) || || Sound made when in normal state&lt;br /&gt;
|-&lt;br /&gt;
| NormalSoundRandMinMax || Vector2 || 1 3 || Random time length between normal sounds. x=min, y=max&lt;br /&gt;
|-&lt;br /&gt;
| ScaredSound || File (.snt) || || Sound made when in afraid state&lt;br /&gt;
|-&lt;br /&gt;
| ScaredSoundRandMinMax || Vector2 || 1 3 || Random time length between afraid sounds. x=min, y=max&lt;br /&gt;
|-&lt;br /&gt;
| DeathEntity || File (.ent) || || Entity created when dead.&lt;br /&gt;
|-&lt;br /&gt;
| DeathPS || File (.ps) || || Particle created when dead.&lt;br /&gt;
|-&lt;br /&gt;
| DeathSound || File (.snt) || || Sound played when dead.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
== CritterSpider ==&lt;br /&gt;
&lt;br /&gt;
A unused critter similar to the spider enemies from [[wikipedia:Penumbra: Overture|Penumbra: Overture]]. Capable of climbing walls and ceilings, as well as attacking the player.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| MaxIdleSpeed || Float || 0.5 ||&lt;br /&gt;
|-&lt;br /&gt;
| MaxHuntSpeed || Float || 0.75 ||&lt;br /&gt;
|-&lt;br /&gt;
| HitSound || File (.snt) || || Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| IdleSound || File (.snt) || || Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| IdleSoundRandMinMax || Vector2 || 1 3 ||&lt;br /&gt;
|-&lt;br /&gt;
| AttackSound || File (.snt) || || Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| AttackPlayerDistMinMax || Vector2 || 1 3 ||&lt;br /&gt;
|-&lt;br /&gt;
| HuntPlayerDist || Float || 8 ||&lt;br /&gt;
|-&lt;br /&gt;
| HuntTimeMinMax || Vector2 || 10 30 ||&lt;br /&gt;
|-&lt;br /&gt;
| MoveTimeMinMax || Vector2 || 4 8 ||&lt;br /&gt;
|-&lt;br /&gt;
| IdleTimeMinMax || Vector2 || 0.4 2 ||&lt;br /&gt;
|-&lt;br /&gt;
| DeathEntity || File (.ent) || || Entity created when dead.&lt;br /&gt;
|-&lt;br /&gt;
| DeathPS || File (.ps) || || Particle created when dead.&lt;br /&gt;
|-&lt;br /&gt;
| DeathSound || File (.snt) || || Sound played when dead.&lt;br /&gt;
|-&lt;br /&gt;
| AttackSizeRadius || Float || 0.3 ||&lt;br /&gt;
|-&lt;br /&gt;
| AttackOffset || Vector3 || 0 0 1 ||&lt;br /&gt;
|-&lt;br /&gt;
| AttackDamageMinMax || Vector2 || 5 15 ||&lt;br /&gt;
|-&lt;br /&gt;
| AttackForce || Vector2 || 5 1 ||&lt;br /&gt;
|-&lt;br /&gt;
| AttackStrength || Int || 1 ||&lt;br /&gt;
|-&lt;br /&gt;
| AttackHitSound || File (.snt) || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop}}&lt;br /&gt;
&lt;br /&gt;
== Enemy_Grunt ==&lt;br /&gt;
&lt;br /&gt;
An Enemy_Grunt entity is a standard enemy entity, used for the Grunt, Brute, and Suitor. Enemy entities require advanced setup, and should include animations added through Settings &amp;gt; Animations. Enemy properties can be modified in the entity type window, like certain sounds and music tracks playing, the enemy's awareness levels and damage, speed and other similar settings. An enemy does not use a collision box, but instead a skeleton and the aforementioned properties to determine how to collide/hit something.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Enemy}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| NoticeSound || File (.snt) || || Sound played when enemy notices that player is nearby&lt;br /&gt;
|-&lt;br /&gt;
| GiveUpNoticeSound || File (.snt) || || Sound played when enemy gives up investigation (after a notice)&lt;br /&gt;
|-&lt;br /&gt;
| EnabledSound || File (.snt) || || Sound played when enemy is enabled&lt;br /&gt;
|-&lt;br /&gt;
| GroggyDamageCount || Float || 15 || The accumulated amount of damage the enemy can take before getting groggy by the hit.&amp;lt;br&amp;gt;The enemy will flinch after taking this amount of damage.&lt;br /&gt;
|-&lt;br /&gt;
| AlertToHuntDistance || Float || 10 || If range is above this then enemy can go from alert to hunt&lt;br /&gt;
|-&lt;br /&gt;
| AlertToInstantHuntDistance || Float || 3.5 || If range is below this, enemy geos instantly to hunt.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMinTime || Float || 2.0 || Min time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMaxTime || Float || 4.5 || Max time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| IncreaseAlertSpeedDistance || Float || 6 || Distance at which the alert move speed increases.&lt;br /&gt;
|-&lt;br /&gt;
| IncreasedAlertSpeedMul || Float || 1.5 || The amount that move speed is multiplied by when alert.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsToHuntLimit || Float || 30 || The accumulated limit value when alert goes to hunt because of player running towards enemy.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsCheckDistance || Float || 5 || The distance where the move toward enemy check starts&lt;br /&gt;
|-&lt;br /&gt;
| IdleExtraTimeMin || Float || 2 || Min time between extra idle animations&lt;br /&gt;
|-&lt;br /&gt;
| IdleExtraTimeMax || Float || 6 || Max time between extra idle animations&lt;br /&gt;
|-&lt;br /&gt;
| IdleExtraNum || Int || 3 || Number of extra idle animations&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Enemy}}&lt;br /&gt;
&lt;br /&gt;
== Enemy_ManPig ==&lt;br /&gt;
{{clr}}&lt;br /&gt;
{{ReqVer|1.3}}&lt;br /&gt;
&lt;br /&gt;
An enemy type ported from A Machine For Pigs. Compare to the [[HPL2/AMFP/NewEntities#Enemy_ManPig|AMFP version]] of the enemy.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Enemy}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Walk_ForwardSpeed || Float || 1.0 || Forward speed when walking on all fours, in meters per second.&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Walk_BackwardSpeed || Float || 1.0 || Backward speed when walking on all fours, in meters per second.&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Walk_ForwardAcc || Float || 2.0 || &lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Walk_ForwardDeacc || Float || 8.0 || &lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Run_ForwardSpeed || Float || 3.0 || Forward speed when running on all fours, in meters per second.&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Run_BackwardSpeed || Float || 2.0 || Backward speed when running on all fours, in meters per second.&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Run_ForwardAcc || Float || 4.0 || &lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_Run_ForwardDeacc || Float || 8.0 || &lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_StoppedToWalkSpeed || Float || 0.05 || Speed at which the walk animation is played when on all fours&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_WalkToStoppedSpeed || Float || 0.02 || Speed at which walk goes to stopped when on all fours&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_WalkToRunSpeed || Float || 2.0 || Speed at which walk turns to run animation when on all fours&lt;br /&gt;
|-&lt;br /&gt;
| Quadruped_RunToWalkSpeed || Float || 0.9 || Speed at which run turns to walk when on all fours&lt;br /&gt;
|-&lt;br /&gt;
| NoticeSound || File (.snt) || || Sound played when enemy notices that player is nearby&lt;br /&gt;
|-&lt;br /&gt;
| GiveUpNoticeSound || File (.snt) || || Sound played when enemy gives up investigation (after a notice)&lt;br /&gt;
|-&lt;br /&gt;
| EnabledSound || File (.snt) || || Sound played when enemy is enabled&lt;br /&gt;
|-&lt;br /&gt;
| GroggyDamageCount || Float || 1 || The accumulated amount of damage the enemy can take before getting groggy by the hit.&amp;lt;br&amp;gt;The enemy will flinch after taking this amount of damage.&lt;br /&gt;
|-&lt;br /&gt;
| AlertToHuntDistance || Float || 6 || If range is above this then enemy can go from alert to hunt&lt;br /&gt;
|-&lt;br /&gt;
| AlertToInstantHuntDistance || Float || 2.5 || If range is below this, enemy geos instantly to hunt.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMinTime || Float || 0.5 || Min time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMaxTime || Float || 1.0 || Max time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| IncreaseAlertSpeedDistance || Float || 6 || Distance at which the alert move speed increases.&lt;br /&gt;
|-&lt;br /&gt;
| IncreasedAlertSpeedMul || Float || 1.25 || The amount that move speed is multiplied by when alert.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsToHuntLimit || Float || 30 || The accumulated limit value when alert goes to hunt because of player running towards enemy.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsCheckDistance || Float || 6 || The distance where the move toward enemy check starts&lt;br /&gt;
|-&lt;br /&gt;
| IsTelsa || Bool || false || If this is the tesla pig&lt;br /&gt;
|-&lt;br /&gt;
| TeslaSoundLoop || File (.snt) || || Sound file played when the tesla's proximity effects are active.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| ChaseSound || File (.snt) || || Played when the pig is chasing.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Enemy}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| Pose || String || Biped || The pose of the enemy to start with&amp;lt;br&amp;gt;Can be &amp;quot;Biped&amp;quot; or &amp;quot;Quadruped&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| ThreatenOnAlert || Bool || false || If the pig should stand still and threaten instead of walking towards player when in alert mode.&lt;br /&gt;
|-&lt;br /&gt;
| FleeFromPlayer || Bool || false || The pig will flee instead of hunting (threaten if ThreatenOnAlert). Disabled if far enough away. Will attack if cornered.&lt;br /&gt;
|-&lt;br /&gt;
| AutoDisableAfterFlee || Bool || false || If pig should be disabled after having fled (if possible)&lt;br /&gt;
|-&lt;br /&gt;
| LanternSensitivity || Float || 1 || A modifier for how quickly the pig reacts to being shined on by the lantern.&amp;lt;br&amp;gt;Not defined in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| IdleBehavior || String || None || The behavior used when there are no patrol nodes left to walk.&amp;lt;br&amp;gt;Can be &amp;quot;None&amp;quot;, &amp;quot;Stalk&amp;quot;, or &amp;quot;Track&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| PlayActivateSound || Bool || true || If the enemy can play its EnabledSound.&lt;br /&gt;
|-&lt;br /&gt;
| AllowZeroNodeWaitTimes || Bool || false || If set to true, path node wait times with value 0 actually mean no waiting&amp;lt;br&amp;gt;Normally, specifying a wait time of 0 in &amp;lt;code&amp;gt;AddEnemyPatrolNode&amp;lt;/code&amp;gt; results in a wait time of 1-3 seconds.&lt;br /&gt;
|-&lt;br /&gt;
| PatrolMoveSpeed || String || Walk || Whether this pig walks or runs along its patrol&amp;lt;br&amp;gt;Can be &amp;quot;Walk&amp;quot; or &amp;quot;Run&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| DamageMul || Float || 1 || Multiplier for the enemy's attack damage.&amp;lt;br&amp;gt;Not defined in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| RunSpeedMul || Float || 1 || Multiplier for the enemy's run speed.&amp;lt;br&amp;gt;Not defined in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseTimeMul || Float || 1 || Multiplier for wait time between attacks.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Enemy_Waterlurker ==&lt;br /&gt;
&lt;br /&gt;
Enemy type of the &amp;quot;water monster&amp;quot;. Since you can't assign animations to it, you might as well just use the normal waterlurker of the base game unless you want to change its properties (such as damage, movement speed, or music played).&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Enemy}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| PlayerDetectionHeight || Float || 0.6 || The y-distance from the enemy that the player is detected.&lt;br /&gt;
|-&lt;br /&gt;
| EatDamage || Float || 20 || The damage dealt to food being eaten&lt;br /&gt;
|-&lt;br /&gt;
| AfterAttackPauseTime || Float || 0 || The amount of timer lurker waits after an attack&lt;br /&gt;
|-&lt;br /&gt;
| SplashPS_Walk || File (.ps) || || Particle system created at surface when walking.&lt;br /&gt;
|-&lt;br /&gt;
| SplashPS_Run || File (.ps) || || Particle system created at surface when running.&lt;br /&gt;
|-&lt;br /&gt;
| SplashPS_Eat || File (.ps) || || Particle system created at surface when eating.&lt;br /&gt;
|-&lt;br /&gt;
| SplashPS_Attack || File (.ps) || || Particle system created at surface when attacking.&lt;br /&gt;
|-&lt;br /&gt;
| SplashSound_Walk || File (.snt) || || Sound played when walking.&lt;br /&gt;
|-&lt;br /&gt;
| SplashSound_Run || File (.snt) || || Sound played when running.&lt;br /&gt;
|-&lt;br /&gt;
| SplashSound_Eat || File (.snt) || || Sound played when eating.&lt;br /&gt;
|-&lt;br /&gt;
| SplashSound_Attack || File (.snt) || || Sound played when attacking.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Enemy}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| PlayerDetectionHeight || Float || 0 || If equal or below 0 the default in data file is used! The y-distance from the enemy that the player is detected.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== PlayerHands ==&lt;br /&gt;
&lt;br /&gt;
Player's hands. Unless you want to make a different looking hand for a full conversion mod, you don't have to worry about this.&lt;br /&gt;
&lt;br /&gt;
== HandObject ==&lt;br /&gt;
&lt;br /&gt;
The only available HandObject is the lantern. It is used in conjunction with a &amp;lt;code&amp;gt;.ho&amp;lt;/code&amp;gt; config file to place it properly in PlayerHands.&lt;br /&gt;
&lt;br /&gt;
Mostly a remnant of cut items that functioned as weapons, like in [[wikipedia:Penumbra: Overture|Penumbra: Overture]], including the pickaxe from that game.&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/AMFP/NewEntities&amp;diff=6989</id>
		<title>HPL2/AMFP/NewEntities</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/AMFP/NewEntities&amp;diff=6989"/>
		<updated>2025-01-19T02:23:39Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* PhoneBox */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AMFP features a few new entity types.&lt;br /&gt;
&lt;br /&gt;
== PhoneBox ==&lt;br /&gt;
&lt;br /&gt;
The entity which executes phone calls. There's only one such asset in the game, and the entity file doesn't have any unique type vars (User Defined Variables). However, in the Level Editor, it has multiple instance vars.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop|amfp}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| VoiceFile1 || File (.ogg) || || Voice file to be played.&amp;lt;br&amp;gt;The file has to be located in the ''sounds'' folder or one of its subfolders.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry1 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay1 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry2 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay2 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry3 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay3 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry4 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay4 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry5 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay5 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry6 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay6 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry7 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay7 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Not all 7 entries must be used, but there can't be more than that in a single phonecall.&lt;br /&gt;
&lt;br /&gt;
The PhoneBox entity has three dedicated functions for it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void StartPhoneRinging(string&amp;amp; asName);&lt;br /&gt;
void StopPhoneRinging(string&amp;amp; asName);&lt;br /&gt;
void HangUpPhone(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName '' - The phone box entity to use.&lt;br /&gt;
&lt;br /&gt;
The PhoneBox won't ring until the &amp;lt;code&amp;gt;StartPhoneRinging&amp;lt;/code&amp;gt; function is called. &amp;lt;code&amp;gt;StopPhoneRinging&amp;lt;/code&amp;gt; can be used if the player leaves an area without picking up the phone, or takes too long.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;StartPhoneRinging&amp;lt;/code&amp;gt; is used, the PhoneBox will start ringing (the sound is only audible at a quite short distance, and a bell animation will play). A unique crosshair when looking at the PhoneBox. Interacting with it will play a switch animation as well as the voice file, and display all the defined subtitles at specified intervals. After the voice file finishes playing, another switch animation will play and the glow will disappear (if it was used).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HangUpPhone&amp;lt;/code&amp;gt; ends the call early, stopping any voice lines currently playing. Plays a unique hang up sound (''entities/telephone/telephone_down.snt'') that is not used anywhere else.&lt;br /&gt;
&lt;br /&gt;
Keep in mind that the green light which appears on the PhoneBox is not a part of the entity; it's a Lamp entity which needs to be enabled by scripting.&lt;br /&gt;
&lt;br /&gt;
== Enemy_ManPig ==&lt;br /&gt;
The entity type used for the Wretch, Engineer, and Tesla manpigs. The Failed Experiments reuse Enemy_WaterLurker instead.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Enemy|amfp}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| NoticeSound || File (.snt) || || Sound played when enemy notices that player is nearby&lt;br /&gt;
|-&lt;br /&gt;
| GiveUpNoticeSound || File (.snt) || || Sound played when enemy gives up investigation (after a notice)&lt;br /&gt;
|-&lt;br /&gt;
| EnabledSound || File (.snt) || || Sound played when enemy is enabled&lt;br /&gt;
|-&lt;br /&gt;
| GroggyDamageCount || Float || 15 || The accumulated amount of damage the enemy can take before getting groggy by the hit.&amp;lt;br&amp;gt;The enemy will flinch after taking this amount of damage.&lt;br /&gt;
|-&lt;br /&gt;
| AlertToHuntDistance || Float || 10 || If range is above this then enemy can go from alert to hunt&lt;br /&gt;
|-&lt;br /&gt;
| AlertToInstantHuntDistance || Float || 3.5 || If range is below this, enemy geos instantly to hunt.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMinTime || Float || 2 || Min time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMaxTime || Float || 4.5 || Max time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| IncreaseAlertSpeedDistance || Float || 6 || Distance at which the alert move speed increases.&lt;br /&gt;
|-&lt;br /&gt;
| IncreasedAlertSpeedMul || Float || 1.5 || The amount that move speed is multiplied by when alert.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsToHuntLimit || Float || 30 || The accumulated limit value when alert goes to hunt because of player running towards enemy.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsCheckDistance || Float || 5 || The distance where the move toward enemy check starts&lt;br /&gt;
|-&lt;br /&gt;
| IsTesla || Bool || false || If this is the tesla pig&lt;br /&gt;
|-&lt;br /&gt;
| ChaseSound || File (.snt) || || Played when the pig is chasing.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Enemy|amfp}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| ThreatenOnAlert || Bool || false || If the pig should stand still and threaten instead of walking towards player when in alert mode.&lt;br /&gt;
|-&lt;br /&gt;
| FleeFromPlayer || Bool || false || The pig will flee instead of hunting (threaten if ThreatenOnAlert). Disabled if far enough away. Will attack if cornered.&amp;lt;br&amp;gt;Running to the furthest PathNode seems to be the main behavior.&amp;lt;br&amp;gt;'''If the map has no PathNodes, the game will crash when the enemy notices the player!'''&lt;br /&gt;
|-&lt;br /&gt;
| AutoDisableAfterFlee || Bool || false || If pig should be disabled after having fled (if possible)&amp;lt;br&amp;gt;Must not be seen by the player and must be more than 15 meters away from them.&lt;br /&gt;
|-&lt;br /&gt;
| LanternSensitivity || Float || 1 || A modifier for how quickly the pig reacts to being shined on by the lantern.&lt;br /&gt;
|-&lt;br /&gt;
| IdleBehavior || String || || The behavior used when there are no patrol nodes left to walk.&amp;lt;br&amp;gt;Can be &amp;quot;None&amp;quot;, &amp;quot;Stalk&amp;quot;, or &amp;quot;Track&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| PlayActivateSound || Bool || true || If the enemy can play its EnabledSound.&lt;br /&gt;
|-&lt;br /&gt;
| AllowZeroNodeWaitTimes || Bool || false || If set to true, path node wait times with value 0 actually mean no waiting&amp;lt;br&amp;gt;Normally, specifying a wait time of 0 in &amp;lt;code&amp;gt;AddEnemyPatrolNode&amp;lt;/code&amp;gt; results in a wait time of 1-3 seconds.&lt;br /&gt;
|-&lt;br /&gt;
| PatrolMoveSpeed || String || Walk || Whether this pig walks or runs along its patrol&amp;lt;br&amp;gt;Can be &amp;quot;Walk&amp;quot; or &amp;quot;Run&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| DamageMul || Float || 1 || Multiplier for the enemy's attack damage.&lt;br /&gt;
|-&lt;br /&gt;
| RunSpeedMul || Float || 1 || Multiplier for the enemy's run speed.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseTimeMul || Float || 1 || Multiplier for the wait time between attacks.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Enemy_Child ==&lt;br /&gt;
&lt;br /&gt;
An enemy variation used for acting out scenes. This &amp;quot;enemy&amp;quot; doesn't seem to respond to any player input, aside from proximity. Used mainly for the Mandus twins, but also for the NPCs seen running in the Streets chapter.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Enemy|amfp}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Enemy|amfp}}&lt;br /&gt;
&lt;br /&gt;
EntityTypes.cfg has a few instance vars listed in the Enemy base class that in fact only apply to Enemy_ManPig. These are skipped here.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| PatrolMoveSpeed || String || Walk || The movement speed type to use when patrolling.&amp;lt;br&amp;gt;Can be &amp;quot;Walk&amp;quot; or &amp;quot;Run&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== AnimatedProp ==&lt;br /&gt;
Identical to StaticProp, except it can play an animation. Used for models that have a continuous looping animation but otherwise have no interactivity, such as fans and machines that have moving dials or spin.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CastShadows || Bool || true || If entity casts shadows.&lt;br /&gt;
|-&lt;br /&gt;
| IsAffectedByDecal || Bool || true || If decals can be created on entity.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== VoiceFlashbackTrigger ==&lt;br /&gt;
&lt;br /&gt;
A prop that plays a voice flashback with screen effects when interacted with. The type of all entities in ''entities/voice_triggers''. Unused in the official maps, as they seem to have been replaced by Script areas that call &amp;lt;code&amp;gt;PlayEffectVoice&amp;lt;/code&amp;gt; when collided with.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop|amfp}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop|amfp}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| VoiceFile || File (.ogg) || || Voice file to be played.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/AMFP/NewEntities&amp;diff=6988</id>
		<title>HPL2/AMFP/NewEntities</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/AMFP/NewEntities&amp;diff=6988"/>
		<updated>2025-01-19T02:21:26Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Enemy_ManPig */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AMFP features a few new entity types.&lt;br /&gt;
&lt;br /&gt;
== PhoneBox ==&lt;br /&gt;
&lt;br /&gt;
The entity which executes phone calls. There's only one such asset in the game, and the entity file doesn't have any type vars (User Defined Variables). However, in the Level Editor, it has multiple instance vars.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop|amfp}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| VoiceFile1 || File (.ogg) || || Voice file to be played.&amp;lt;br&amp;gt;The file has to be located in the ''sounds'' folder or one of its subfolders.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry1 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay1 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry2 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay2 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry3 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay3 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry4 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay4 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry5 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay5 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry6 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay6 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry7 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay7 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Not all 7 entries must be used, but there can't be more than that in a single phonecall.&lt;br /&gt;
&lt;br /&gt;
The PhoneBox entity has three dedicated functions for it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void StartPhoneRinging(string&amp;amp; asName);&lt;br /&gt;
void StopPhoneRinging(string&amp;amp; asName);&lt;br /&gt;
void HangUpPhone(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName '' - The phone box entity to use.&lt;br /&gt;
&lt;br /&gt;
The PhoneBox won't ring until the &amp;lt;code&amp;gt;StartPhoneRinging&amp;lt;/code&amp;gt; function is called. &amp;lt;code&amp;gt;StopPhoneRinging&amp;lt;/code&amp;gt; can be used if the player leaves an area without picking up the phone, or takes too long.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;StartPhoneRinging&amp;lt;/code&amp;gt; is used, the PhoneBox will start ringing (the sound is only audible at a quite short distance, and a bell animation will play). A unique crosshair when looking at the PhoneBox. Interacting with it will play a switch animation as well as the voice file, and display all the defined subtitles at specified intervals. After the voice file finishes playing, another switch animation will play and the glow will disappear (if it was used).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HangUpPhone&amp;lt;/code&amp;gt; ends the call early, stopping any voice lines currently playing. Plays a unique hang up sound (''entities/telephone/telephone_down.snt'') that is not used anywhere else.&lt;br /&gt;
&lt;br /&gt;
Keep in mind that the green light which appears on the PhoneBox is not a part of the entity; it's a Lamp entity which needs to be enabled by scripting.&lt;br /&gt;
&lt;br /&gt;
== Enemy_ManPig ==&lt;br /&gt;
The entity type used for the Wretch, Engineer, and Tesla manpigs. The Failed Experiments reuse Enemy_WaterLurker instead.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Enemy|amfp}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| NoticeSound || File (.snt) || || Sound played when enemy notices that player is nearby&lt;br /&gt;
|-&lt;br /&gt;
| GiveUpNoticeSound || File (.snt) || || Sound played when enemy gives up investigation (after a notice)&lt;br /&gt;
|-&lt;br /&gt;
| EnabledSound || File (.snt) || || Sound played when enemy is enabled&lt;br /&gt;
|-&lt;br /&gt;
| GroggyDamageCount || Float || 15 || The accumulated amount of damage the enemy can take before getting groggy by the hit.&amp;lt;br&amp;gt;The enemy will flinch after taking this amount of damage.&lt;br /&gt;
|-&lt;br /&gt;
| AlertToHuntDistance || Float || 10 || If range is above this then enemy can go from alert to hunt&lt;br /&gt;
|-&lt;br /&gt;
| AlertToInstantHuntDistance || Float || 3.5 || If range is below this, enemy geos instantly to hunt.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMinTime || Float || 2 || Min time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMaxTime || Float || 4.5 || Max time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| IncreaseAlertSpeedDistance || Float || 6 || Distance at which the alert move speed increases.&lt;br /&gt;
|-&lt;br /&gt;
| IncreasedAlertSpeedMul || Float || 1.5 || The amount that move speed is multiplied by when alert.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsToHuntLimit || Float || 30 || The accumulated limit value when alert goes to hunt because of player running towards enemy.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsCheckDistance || Float || 5 || The distance where the move toward enemy check starts&lt;br /&gt;
|-&lt;br /&gt;
| IsTesla || Bool || false || If this is the tesla pig&lt;br /&gt;
|-&lt;br /&gt;
| ChaseSound || File (.snt) || || Played when the pig is chasing.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Enemy|amfp}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| ThreatenOnAlert || Bool || false || If the pig should stand still and threaten instead of walking towards player when in alert mode.&lt;br /&gt;
|-&lt;br /&gt;
| FleeFromPlayer || Bool || false || The pig will flee instead of hunting (threaten if ThreatenOnAlert). Disabled if far enough away. Will attack if cornered.&amp;lt;br&amp;gt;Running to the furthest PathNode seems to be the main behavior.&amp;lt;br&amp;gt;'''If the map has no PathNodes, the game will crash when the enemy notices the player!'''&lt;br /&gt;
|-&lt;br /&gt;
| AutoDisableAfterFlee || Bool || false || If pig should be disabled after having fled (if possible)&amp;lt;br&amp;gt;Must not be seen by the player and must be more than 15 meters away from them.&lt;br /&gt;
|-&lt;br /&gt;
| LanternSensitivity || Float || 1 || A modifier for how quickly the pig reacts to being shined on by the lantern.&lt;br /&gt;
|-&lt;br /&gt;
| IdleBehavior || String || || The behavior used when there are no patrol nodes left to walk.&amp;lt;br&amp;gt;Can be &amp;quot;None&amp;quot;, &amp;quot;Stalk&amp;quot;, or &amp;quot;Track&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| PlayActivateSound || Bool || true || If the enemy can play its EnabledSound.&lt;br /&gt;
|-&lt;br /&gt;
| AllowZeroNodeWaitTimes || Bool || false || If set to true, path node wait times with value 0 actually mean no waiting&amp;lt;br&amp;gt;Normally, specifying a wait time of 0 in &amp;lt;code&amp;gt;AddEnemyPatrolNode&amp;lt;/code&amp;gt; results in a wait time of 1-3 seconds.&lt;br /&gt;
|-&lt;br /&gt;
| PatrolMoveSpeed || String || Walk || Whether this pig walks or runs along its patrol&amp;lt;br&amp;gt;Can be &amp;quot;Walk&amp;quot; or &amp;quot;Run&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| DamageMul || Float || 1 || Multiplier for the enemy's attack damage.&lt;br /&gt;
|-&lt;br /&gt;
| RunSpeedMul || Float || 1 || Multiplier for the enemy's run speed.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseTimeMul || Float || 1 || Multiplier for the wait time between attacks.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Enemy_Child ==&lt;br /&gt;
&lt;br /&gt;
An enemy variation used for acting out scenes. This &amp;quot;enemy&amp;quot; doesn't seem to respond to any player input, aside from proximity. Used mainly for the Mandus twins, but also for the NPCs seen running in the Streets chapter.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Enemy|amfp}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Enemy|amfp}}&lt;br /&gt;
&lt;br /&gt;
EntityTypes.cfg has a few instance vars listed in the Enemy base class that in fact only apply to Enemy_ManPig. These are skipped here.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| PatrolMoveSpeed || String || Walk || The movement speed type to use when patrolling.&amp;lt;br&amp;gt;Can be &amp;quot;Walk&amp;quot; or &amp;quot;Run&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== AnimatedProp ==&lt;br /&gt;
Identical to StaticProp, except it can play an animation. Used for models that have a continuous looping animation but otherwise have no interactivity, such as fans and machines that have moving dials or spin.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CastShadows || Bool || true || If entity casts shadows.&lt;br /&gt;
|-&lt;br /&gt;
| IsAffectedByDecal || Bool || true || If decals can be created on entity.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== VoiceFlashbackTrigger ==&lt;br /&gt;
&lt;br /&gt;
A prop that plays a voice flashback with screen effects when interacted with. The type of all entities in ''entities/voice_triggers''. Unused in the official maps, as they seem to have been replaced by Script areas that call &amp;lt;code&amp;gt;PlayEffectVoice&amp;lt;/code&amp;gt; when collided with.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop|amfp}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop|amfp}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| VoiceFile || File (.ogg) || || Voice file to be played.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/AMFP/NewEntities&amp;diff=6987</id>
		<title>HPL2/AMFP/NewEntities</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/AMFP/NewEntities&amp;diff=6987"/>
		<updated>2025-01-19T02:03:32Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* AnimatedProp */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AMFP features a few new entity types.&lt;br /&gt;
&lt;br /&gt;
== PhoneBox ==&lt;br /&gt;
&lt;br /&gt;
The entity which executes phone calls. There's only one such asset in the game, and the entity file doesn't have any type vars (User Defined Variables). However, in the Level Editor, it has multiple instance vars.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop|amfp}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| VoiceFile1 || File (.ogg) || || Voice file to be played.&amp;lt;br&amp;gt;The file has to be located in the ''sounds'' folder or one of its subfolders.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry1 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay1 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry2 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay2 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry3 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay3 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry4 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay4 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry5 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay5 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry6 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay6 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry7 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay7 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Not all 7 entries must be used, but there can't be more than that in a single phonecall.&lt;br /&gt;
&lt;br /&gt;
The PhoneBox entity has three dedicated functions for it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void StartPhoneRinging(string&amp;amp; asName);&lt;br /&gt;
void StopPhoneRinging(string&amp;amp; asName);&lt;br /&gt;
void HangUpPhone(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName '' - The phone box entity to use.&lt;br /&gt;
&lt;br /&gt;
The PhoneBox won't ring until the &amp;lt;code&amp;gt;StartPhoneRinging&amp;lt;/code&amp;gt; function is called. &amp;lt;code&amp;gt;StopPhoneRinging&amp;lt;/code&amp;gt; can be used if the player leaves an area without picking up the phone, or takes too long.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;StartPhoneRinging&amp;lt;/code&amp;gt; is used, the PhoneBox will start ringing (the sound is only audible at a quite short distance, and a bell animation will play). A unique crosshair when looking at the PhoneBox. Interacting with it will play a switch animation as well as the voice file, and display all the defined subtitles at specified intervals. After the voice file finishes playing, another switch animation will play and the glow will disappear (if it was used).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HangUpPhone&amp;lt;/code&amp;gt; ends the call early, stopping any voice lines currently playing. Plays a unique hang up sound (''entities/telephone/telephone_down.snt'') that is not used anywhere else.&lt;br /&gt;
&lt;br /&gt;
Keep in mind that the green light which appears on the PhoneBox is not a part of the entity; it's a Lamp entity which needs to be enabled by scripting.&lt;br /&gt;
&lt;br /&gt;
== Enemy_ManPig ==&lt;br /&gt;
&lt;br /&gt;
This enemy type has multiple new settings in the LevelEditor.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Enemy|amfp}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| NoticeSound || File (.snt) || || Sound played when enemy notices that player is nearby&lt;br /&gt;
|-&lt;br /&gt;
| GiveUpNoticeSound || File (.snt) || || Sound played when enemy gives up investigation (after a notice)&lt;br /&gt;
|-&lt;br /&gt;
| EnabledSound || File (.snt) || || Sound played when enemy is enabled&lt;br /&gt;
|-&lt;br /&gt;
| GroggyDamageCount || Float || 15 || The accumulated amount of damage the enemy can take before getting groggy by the hit.&amp;lt;br&amp;gt;The enemy will flinch after taking this amount of damage.&lt;br /&gt;
|-&lt;br /&gt;
| AlertToHuntDistance || Float || 10 || If range is above this then enemy can go from alert to hunt&lt;br /&gt;
|-&lt;br /&gt;
| AlertToInstantHuntDistance || Float || 3.5 || If range is below this, enemy geos instantly to hunt.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMinTime || Float || 2 || Min time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMaxTime || Float || 4.5 || Max time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| IncreaseAlertSpeedDistance || Float || 6 || Distance at which the alert move speed increases.&lt;br /&gt;
|-&lt;br /&gt;
| IncreasedAlertSpeedMul || Float || 1.5 || The amount that move speed is multiplied by when alert.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsToHuntLimit || Float || 30 || The accumulated limit value when alert goes to hunt because of player running towards enemy.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsCheckDistance || Float || 5 || The distance where the move toward enemy check starts&lt;br /&gt;
|-&lt;br /&gt;
| IsTesla || Bool || false || If this is the tesla pig&lt;br /&gt;
|-&lt;br /&gt;
| ChaseSound || File (.snt) || || Played when the pig is chasing.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Enemy|amfp}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| ThreatenOnAlert || Bool || false || If the pig should stand still and threaten instead of walking towards player when in alert mode.&lt;br /&gt;
|-&lt;br /&gt;
| FleeFromPlayer || Bool || false || The pig will flee instead of hunting (threaten if ThreatenOnAlert). Disabled if far enough away. Will attack if cornered.&amp;lt;br&amp;gt;Running to the furthest PathNode seems to be the main behavior.&amp;lt;br&amp;gt;'''If the map has no PathNodes, the game will crash when the enemy notices the player!'''&lt;br /&gt;
|-&lt;br /&gt;
| AutoDisableAfterFlee || Bool || false || If pig should be disabled after having fled (if possible)&amp;lt;br&amp;gt;Must not be seen by the player and must be more than 15 meters away from them.&lt;br /&gt;
|-&lt;br /&gt;
| LanternSensitivity || Float || 1 || A modifier for how quickly the pig reacts to being shined on by the lantern.&lt;br /&gt;
|-&lt;br /&gt;
| IdleBehavior || String || || The behavior used when there are no patrol nodes left to walk.&amp;lt;br&amp;gt;Can be &amp;quot;None&amp;quot;, &amp;quot;Stalk&amp;quot;, or &amp;quot;Track&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| PlayActivateSound || Bool || true || If the enemy can play its EnabledSound.&lt;br /&gt;
|-&lt;br /&gt;
| AllowZeroNodeWaitTimes || Bool || false || If set to true, path node wait times with value 0 actually mean no waiting&amp;lt;br&amp;gt;Normally, specifying a wait time of 0 in &amp;lt;code&amp;gt;AddEnemyPatrolNode&amp;lt;/code&amp;gt; results in a wait time of 1-3 seconds.&lt;br /&gt;
|-&lt;br /&gt;
| PatrolMoveSpeed || String || Walk || Whether this pig walks or runs along its patrol&amp;lt;br&amp;gt;Can be &amp;quot;Walk&amp;quot; or &amp;quot;Run&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| DamageMul || Float || 1 || Multiplier for the enemy's attack damage.&lt;br /&gt;
|-&lt;br /&gt;
| RunSpeedMul || Float || 1 || Multiplier for the enemy's run speed.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseTimeMul || Float || 1 || Multiplier for the wait time between attacks.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Enemy_Child ==&lt;br /&gt;
&lt;br /&gt;
An enemy variation used for acting out scenes. This &amp;quot;enemy&amp;quot; doesn't seem to respond to any player input, aside from proximity. Used mainly for the Mandus twins, but also for the NPCs seen running in the Streets chapter.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Enemy|amfp}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Enemy|amfp}}&lt;br /&gt;
&lt;br /&gt;
EntityTypes.cfg has a few instance vars listed in the Enemy base class that in fact only apply to Enemy_ManPig. These are skipped here.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| PatrolMoveSpeed || String || Walk || The movement speed type to use when patrolling.&amp;lt;br&amp;gt;Can be &amp;quot;Walk&amp;quot; or &amp;quot;Run&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== AnimatedProp ==&lt;br /&gt;
Identical to StaticProp, except it can play an animation. Used for models that have a continuous looping animation but otherwise have no interactivity, such as fans and machines that have moving dials or spin.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CastShadows || Bool || true || If entity casts shadows.&lt;br /&gt;
|-&lt;br /&gt;
| IsAffectedByDecal || Bool || true || If decals can be created on entity.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== VoiceFlashbackTrigger ==&lt;br /&gt;
&lt;br /&gt;
A prop that plays a voice flashback with screen effects when interacted with. The type of all entities in ''entities/voice_triggers''. Unused in the official maps, as they seem to have been replaced by Script areas that call &amp;lt;code&amp;gt;PlayEffectVoice&amp;lt;/code&amp;gt; when collided with.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop|amfp}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop|amfp}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| VoiceFile || File (.ogg) || || Voice file to be played.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/AMFP/NewEntities&amp;diff=6986</id>
		<title>HPL2/AMFP/NewEntities</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/AMFP/NewEntities&amp;diff=6986"/>
		<updated>2025-01-19T02:02:46Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Enemy_Child */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AMFP features a few new entity types.&lt;br /&gt;
&lt;br /&gt;
== PhoneBox ==&lt;br /&gt;
&lt;br /&gt;
The entity which executes phone calls. There's only one such asset in the game, and the entity file doesn't have any type vars (User Defined Variables). However, in the Level Editor, it has multiple instance vars.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop|amfp}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| VoiceFile1 || File (.ogg) || || Voice file to be played.&amp;lt;br&amp;gt;The file has to be located in the ''sounds'' folder or one of its subfolders.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry1 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay1 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry2 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay2 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry3 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay3 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry4 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay4 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry5 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay5 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry6 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay6 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry7 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay7 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Not all 7 entries must be used, but there can't be more than that in a single phonecall.&lt;br /&gt;
&lt;br /&gt;
The PhoneBox entity has three dedicated functions for it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void StartPhoneRinging(string&amp;amp; asName);&lt;br /&gt;
void StopPhoneRinging(string&amp;amp; asName);&lt;br /&gt;
void HangUpPhone(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName '' - The phone box entity to use.&lt;br /&gt;
&lt;br /&gt;
The PhoneBox won't ring until the &amp;lt;code&amp;gt;StartPhoneRinging&amp;lt;/code&amp;gt; function is called. &amp;lt;code&amp;gt;StopPhoneRinging&amp;lt;/code&amp;gt; can be used if the player leaves an area without picking up the phone, or takes too long.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;StartPhoneRinging&amp;lt;/code&amp;gt; is used, the PhoneBox will start ringing (the sound is only audible at a quite short distance, and a bell animation will play). A unique crosshair when looking at the PhoneBox. Interacting with it will play a switch animation as well as the voice file, and display all the defined subtitles at specified intervals. After the voice file finishes playing, another switch animation will play and the glow will disappear (if it was used).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HangUpPhone&amp;lt;/code&amp;gt; ends the call early, stopping any voice lines currently playing. Plays a unique hang up sound (''entities/telephone/telephone_down.snt'') that is not used anywhere else.&lt;br /&gt;
&lt;br /&gt;
Keep in mind that the green light which appears on the PhoneBox is not a part of the entity; it's a Lamp entity which needs to be enabled by scripting.&lt;br /&gt;
&lt;br /&gt;
== Enemy_ManPig ==&lt;br /&gt;
&lt;br /&gt;
This enemy type has multiple new settings in the LevelEditor.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Enemy|amfp}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| NoticeSound || File (.snt) || || Sound played when enemy notices that player is nearby&lt;br /&gt;
|-&lt;br /&gt;
| GiveUpNoticeSound || File (.snt) || || Sound played when enemy gives up investigation (after a notice)&lt;br /&gt;
|-&lt;br /&gt;
| EnabledSound || File (.snt) || || Sound played when enemy is enabled&lt;br /&gt;
|-&lt;br /&gt;
| GroggyDamageCount || Float || 15 || The accumulated amount of damage the enemy can take before getting groggy by the hit.&amp;lt;br&amp;gt;The enemy will flinch after taking this amount of damage.&lt;br /&gt;
|-&lt;br /&gt;
| AlertToHuntDistance || Float || 10 || If range is above this then enemy can go from alert to hunt&lt;br /&gt;
|-&lt;br /&gt;
| AlertToInstantHuntDistance || Float || 3.5 || If range is below this, enemy geos instantly to hunt.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMinTime || Float || 2 || Min time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMaxTime || Float || 4.5 || Max time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| IncreaseAlertSpeedDistance || Float || 6 || Distance at which the alert move speed increases.&lt;br /&gt;
|-&lt;br /&gt;
| IncreasedAlertSpeedMul || Float || 1.5 || The amount that move speed is multiplied by when alert.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsToHuntLimit || Float || 30 || The accumulated limit value when alert goes to hunt because of player running towards enemy.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsCheckDistance || Float || 5 || The distance where the move toward enemy check starts&lt;br /&gt;
|-&lt;br /&gt;
| IsTesla || Bool || false || If this is the tesla pig&lt;br /&gt;
|-&lt;br /&gt;
| ChaseSound || File (.snt) || || Played when the pig is chasing.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Enemy|amfp}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| ThreatenOnAlert || Bool || false || If the pig should stand still and threaten instead of walking towards player when in alert mode.&lt;br /&gt;
|-&lt;br /&gt;
| FleeFromPlayer || Bool || false || The pig will flee instead of hunting (threaten if ThreatenOnAlert). Disabled if far enough away. Will attack if cornered.&amp;lt;br&amp;gt;Running to the furthest PathNode seems to be the main behavior.&amp;lt;br&amp;gt;'''If the map has no PathNodes, the game will crash when the enemy notices the player!'''&lt;br /&gt;
|-&lt;br /&gt;
| AutoDisableAfterFlee || Bool || false || If pig should be disabled after having fled (if possible)&amp;lt;br&amp;gt;Must not be seen by the player and must be more than 15 meters away from them.&lt;br /&gt;
|-&lt;br /&gt;
| LanternSensitivity || Float || 1 || A modifier for how quickly the pig reacts to being shined on by the lantern.&lt;br /&gt;
|-&lt;br /&gt;
| IdleBehavior || String || || The behavior used when there are no patrol nodes left to walk.&amp;lt;br&amp;gt;Can be &amp;quot;None&amp;quot;, &amp;quot;Stalk&amp;quot;, or &amp;quot;Track&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| PlayActivateSound || Bool || true || If the enemy can play its EnabledSound.&lt;br /&gt;
|-&lt;br /&gt;
| AllowZeroNodeWaitTimes || Bool || false || If set to true, path node wait times with value 0 actually mean no waiting&amp;lt;br&amp;gt;Normally, specifying a wait time of 0 in &amp;lt;code&amp;gt;AddEnemyPatrolNode&amp;lt;/code&amp;gt; results in a wait time of 1-3 seconds.&lt;br /&gt;
|-&lt;br /&gt;
| PatrolMoveSpeed || String || Walk || Whether this pig walks or runs along its patrol&amp;lt;br&amp;gt;Can be &amp;quot;Walk&amp;quot; or &amp;quot;Run&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| DamageMul || Float || 1 || Multiplier for the enemy's attack damage.&lt;br /&gt;
|-&lt;br /&gt;
| RunSpeedMul || Float || 1 || Multiplier for the enemy's run speed.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseTimeMul || Float || 1 || Multiplier for the wait time between attacks.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Enemy_Child ==&lt;br /&gt;
&lt;br /&gt;
An enemy variation used for acting out scenes. This &amp;quot;enemy&amp;quot; doesn't seem to respond to any player input, aside from proximity. Used mainly for the Mandus twins, but also for the NPCs seen running in the Streets chapter.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Enemy|amfp}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Enemy|amfp}}&lt;br /&gt;
&lt;br /&gt;
EntityTypes.cfg has a few instance vars listed in the Enemy base class that in fact only apply to Enemy_ManPig. These are skipped here.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| PatrolMoveSpeed || String || Walk || The movement speed type to use when patrolling.&amp;lt;br&amp;gt;Can be &amp;quot;Walk&amp;quot; or &amp;quot;Run&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== AnimatedProp ==&lt;br /&gt;
Identical to StaticProp, except it can play animations. Used for models that have a continuous looping animation but otherwise have no interactivity, such as fans and machines that have moving dials or spin.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CastShadows || Bool || true || If entity casts shadows.&lt;br /&gt;
|-&lt;br /&gt;
| IsAffectedByDecal || Bool || true || If decals can be created on entity.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== VoiceFlashbackTrigger ==&lt;br /&gt;
&lt;br /&gt;
A prop that plays a voice flashback with screen effects when interacted with. The type of all entities in ''entities/voice_triggers''. Unused in the official maps, as they seem to have been replaced by Script areas that call &amp;lt;code&amp;gt;PlayEffectVoice&amp;lt;/code&amp;gt; when collided with.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop|amfp}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop|amfp}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| VoiceFile || File (.ogg) || || Voice file to be played.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/AMFP/NewEntities&amp;diff=6985</id>
		<title>HPL2/AMFP/NewEntities</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/AMFP/NewEntities&amp;diff=6985"/>
		<updated>2025-01-19T01:53:52Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* AnimatedProp */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AMFP features a few new entity types.&lt;br /&gt;
&lt;br /&gt;
== PhoneBox ==&lt;br /&gt;
&lt;br /&gt;
The entity which executes phone calls. There's only one such asset in the game, and the entity file doesn't have any type vars (User Defined Variables). However, in the Level Editor, it has multiple instance vars.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop|amfp}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| VoiceFile1 || File (.ogg) || || Voice file to be played.&amp;lt;br&amp;gt;The file has to be located in the ''sounds'' folder or one of its subfolders.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry1 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay1 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry2 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay2 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry3 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay3 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry4 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay4 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry5 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay5 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry6 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay6 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry7 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay7 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Not all 7 entries must be used, but there can't be more than that in a single phonecall.&lt;br /&gt;
&lt;br /&gt;
The PhoneBox entity has three dedicated functions for it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void StartPhoneRinging(string&amp;amp; asName);&lt;br /&gt;
void StopPhoneRinging(string&amp;amp; asName);&lt;br /&gt;
void HangUpPhone(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName '' - The phone box entity to use.&lt;br /&gt;
&lt;br /&gt;
The PhoneBox won't ring until the &amp;lt;code&amp;gt;StartPhoneRinging&amp;lt;/code&amp;gt; function is called. &amp;lt;code&amp;gt;StopPhoneRinging&amp;lt;/code&amp;gt; can be used if the player leaves an area without picking up the phone, or takes too long.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;StartPhoneRinging&amp;lt;/code&amp;gt; is used, the PhoneBox will start ringing (the sound is only audible at a quite short distance, and a bell animation will play). A unique crosshair when looking at the PhoneBox. Interacting with it will play a switch animation as well as the voice file, and display all the defined subtitles at specified intervals. After the voice file finishes playing, another switch animation will play and the glow will disappear (if it was used).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HangUpPhone&amp;lt;/code&amp;gt; ends the call early, stopping any voice lines currently playing. Plays a unique hang up sound (''entities/telephone/telephone_down.snt'') that is not used anywhere else.&lt;br /&gt;
&lt;br /&gt;
Keep in mind that the green light which appears on the PhoneBox is not a part of the entity; it's a Lamp entity which needs to be enabled by scripting.&lt;br /&gt;
&lt;br /&gt;
== Enemy_ManPig ==&lt;br /&gt;
&lt;br /&gt;
This enemy type has multiple new settings in the LevelEditor.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Enemy|amfp}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| NoticeSound || File (.snt) || || Sound played when enemy notices that player is nearby&lt;br /&gt;
|-&lt;br /&gt;
| GiveUpNoticeSound || File (.snt) || || Sound played when enemy gives up investigation (after a notice)&lt;br /&gt;
|-&lt;br /&gt;
| EnabledSound || File (.snt) || || Sound played when enemy is enabled&lt;br /&gt;
|-&lt;br /&gt;
| GroggyDamageCount || Float || 15 || The accumulated amount of damage the enemy can take before getting groggy by the hit.&amp;lt;br&amp;gt;The enemy will flinch after taking this amount of damage.&lt;br /&gt;
|-&lt;br /&gt;
| AlertToHuntDistance || Float || 10 || If range is above this then enemy can go from alert to hunt&lt;br /&gt;
|-&lt;br /&gt;
| AlertToInstantHuntDistance || Float || 3.5 || If range is below this, enemy geos instantly to hunt.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMinTime || Float || 2 || Min time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMaxTime || Float || 4.5 || Max time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| IncreaseAlertSpeedDistance || Float || 6 || Distance at which the alert move speed increases.&lt;br /&gt;
|-&lt;br /&gt;
| IncreasedAlertSpeedMul || Float || 1.5 || The amount that move speed is multiplied by when alert.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsToHuntLimit || Float || 30 || The accumulated limit value when alert goes to hunt because of player running towards enemy.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsCheckDistance || Float || 5 || The distance where the move toward enemy check starts&lt;br /&gt;
|-&lt;br /&gt;
| IsTesla || Bool || false || If this is the tesla pig&lt;br /&gt;
|-&lt;br /&gt;
| ChaseSound || File (.snt) || || Played when the pig is chasing.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Enemy|amfp}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| ThreatenOnAlert || Bool || false || If the pig should stand still and threaten instead of walking towards player when in alert mode.&lt;br /&gt;
|-&lt;br /&gt;
| FleeFromPlayer || Bool || false || The pig will flee instead of hunting (threaten if ThreatenOnAlert). Disabled if far enough away. Will attack if cornered.&amp;lt;br&amp;gt;Running to the furthest PathNode seems to be the main behavior.&amp;lt;br&amp;gt;'''If the map has no PathNodes, the game will crash when the enemy notices the player!'''&lt;br /&gt;
|-&lt;br /&gt;
| AutoDisableAfterFlee || Bool || false || If pig should be disabled after having fled (if possible)&amp;lt;br&amp;gt;Must not be seen by the player and must be more than 15 meters away from them.&lt;br /&gt;
|-&lt;br /&gt;
| LanternSensitivity || Float || 1 || A modifier for how quickly the pig reacts to being shined on by the lantern.&lt;br /&gt;
|-&lt;br /&gt;
| IdleBehavior || String || || The behavior used when there are no patrol nodes left to walk.&amp;lt;br&amp;gt;Can be &amp;quot;None&amp;quot;, &amp;quot;Stalk&amp;quot;, or &amp;quot;Track&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| PlayActivateSound || Bool || true || If the enemy can play its EnabledSound.&lt;br /&gt;
|-&lt;br /&gt;
| AllowZeroNodeWaitTimes || Bool || false || If set to true, path node wait times with value 0 actually mean no waiting&amp;lt;br&amp;gt;Normally, specifying a wait time of 0 in &amp;lt;code&amp;gt;AddEnemyPatrolNode&amp;lt;/code&amp;gt; results in a wait time of 1-3 seconds.&lt;br /&gt;
|-&lt;br /&gt;
| PatrolMoveSpeed || String || Walk || Whether this pig walks or runs along its patrol&amp;lt;br&amp;gt;Can be &amp;quot;Walk&amp;quot; or &amp;quot;Run&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| DamageMul || Float || 1 || Multiplier for the enemy's attack damage.&lt;br /&gt;
|-&lt;br /&gt;
| RunSpeedMul || Float || 1 || Multiplier for the enemy's run speed.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseTimeMul || Float || 1 || Multiplier for the wait time between attacks.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Enemy_Child ==&lt;br /&gt;
&lt;br /&gt;
An enemy variation used for acting out scenes. This &amp;quot;enemy&amp;quot; doesn't seem to respond to any player input, aside from proximity.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Enemy|amfp}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Enemy|amfp}}&lt;br /&gt;
&lt;br /&gt;
EntityTypes.cfg has a few instance vars listed in the Enemy base class that in fact only apply to Enemy_ManPig. These are skipped here.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| PatrolMoveSpeed || String || Walk || The movement speed type to use when patrolling.&amp;lt;br&amp;gt;Can be &amp;quot;Walk&amp;quot; or &amp;quot;Run&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== AnimatedProp ==&lt;br /&gt;
Identical to StaticProp, except it can play animations. Used for models that have a continuous looping animation but otherwise have no interactivity, such as fans and machines that have moving dials or spin.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CastShadows || Bool || true || If entity casts shadows.&lt;br /&gt;
|-&lt;br /&gt;
| IsAffectedByDecal || Bool || true || If decals can be created on entity.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== VoiceFlashbackTrigger ==&lt;br /&gt;
&lt;br /&gt;
A prop that plays a voice flashback with screen effects when interacted with. The type of all entities in ''entities/voice_triggers''. Unused in the official maps, as they seem to have been replaced by Script areas that call &amp;lt;code&amp;gt;PlayEffectVoice&amp;lt;/code&amp;gt; when collided with.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop|amfp}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop|amfp}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| VoiceFile || File (.ogg) || || Voice file to be played.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/AMFP/Infection&amp;diff=6984</id>
		<title>HPL2/AMFP/Infection</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/AMFP/Infection&amp;diff=6984"/>
		<updated>2025-01-18T21:31:15Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Infection =&lt;br /&gt;
&lt;br /&gt;
Infection is a mechanic which was cut from the final game, but it wasn't fully removed from it.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The mechanic is quite similar to sanity from TDD. It is a meter which fills up in certain circumstances and plays visual and sound effects, which depend on the meter's value.&lt;br /&gt;
&lt;br /&gt;
The infection meter is primarily changed by Infection areas. There are multiple of them placed in the game, but they all have been deactivated (which means that they can be restored). Infection areas can either increase or decrease infection. The only other functional method of changing infection (outside of scripting) is by standing in a Liquid area with the InfectionLevel variable set.&lt;br /&gt;
&lt;br /&gt;
There are 4 levels of infection, all of which play increasingly noticeable effects.&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Level !! Value Range (Check) !! Value (Set) !! Effects&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0 || 0 || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || 1-25 || 30 || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || 26-50 || 50 || &lt;br /&gt;
|-&lt;br /&gt;
| 3 || 51-75 || 70 || Running disabled&lt;br /&gt;
|-&lt;br /&gt;
| 4 || 76-100 || 90 || Running disabled, -50% speed&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Infection levels are calculated differently when going from level to value when checking infection level compared to setting infection level. Because of this quirk, setting infection to level 1 actually puts it in the level 2 range.&lt;br /&gt;
&lt;br /&gt;
The meter goes down automatically after the player leaves the infected area. It will gradually fall to zero, unless the player has gathered above 80 infection; in that case, they will die after 2 seconds (unless &amp;quot;faux mode&amp;quot; is enabled). Interestingly, infection no longer decreases over time above 75, which leaves a tight margin of 5 infection points which won't kill the player but will not decrease.&lt;br /&gt;
&lt;br /&gt;
Currently the only way to view the meter (aside from the audiovisual effects) is to press F1 in debug mode and turn on player info.&lt;br /&gt;
&lt;br /&gt;
== Other evidence ==&lt;br /&gt;
&lt;br /&gt;
According to these sections of '''game.cfg''', the infection system was a slightly modified version of the sanity mechanic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;Infection&lt;br /&gt;
    EventsFile = &amp;quot;misc/main_sanity_events.cfg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    MinTimeBetweenEvents = &amp;quot;300&amp;quot;&lt;br /&gt;
    MaxEventSanity = &amp;quot;65&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    MaxSanity_LongWait = &amp;quot;65&amp;quot;&lt;br /&gt;
    MaxSanity_MedWait = &amp;quot;45&amp;quot;&lt;br /&gt;
    MaxSanity_ShortWait = &amp;quot;25&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    TimeBetween_LongWait = &amp;quot;270&amp;quot;&lt;br /&gt;
    TimeBetween_MedWait = &amp;quot;180&amp;quot;&lt;br /&gt;
    TimeBetween_ShortWait = &amp;quot;80&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    MinExamineInfection = &amp;quot;50&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    InfectionArea_CheckTimeMin = &amp;quot;1&amp;quot;&lt;br /&gt;
    InfectionArea_CheckTimeMax = &amp;quot;2&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Player_Infection&lt;br /&gt;
	&lt;br /&gt;
	HitZoomInSpeed = &amp;quot;3.5&amp;quot;&lt;br /&gt;
	HitZoomOutSpeed = &amp;quot;0.6&amp;quot;&lt;br /&gt;
	HitZoomInFOVMul = &amp;quot;0.06&amp;quot;&lt;br /&gt;
	HitZoomInAspectMul = &amp;quot;0.15&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	InfectionDecreaseSpeed = &amp;quot;0.75&amp;quot;&lt;br /&gt;
	InfectionDecreaseLimitLevel = &amp;quot;3&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	InfectionVeryHighLimit = &amp;quot;80&amp;quot;&lt;br /&gt;
	InfectionEffectsStart = &amp;quot;35&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	InfectionWaveAlphaMul = &amp;quot;1&amp;quot;&lt;br /&gt;
	InfectionWaveSpeedMul = &amp;quot;1&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	CheckEnemyNearOrSeenInterval = &amp;quot;0.3&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	NearEnemyDecrease = &amp;quot;0.3&amp;quot;&lt;br /&gt;
	NearCritterDecrease = &amp;quot;0.1&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	StartSwayMinInfection = &amp;quot;15&amp;quot;&lt;br /&gt;
	SwayMaxSavedPositions = &amp;quot;30&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
  HighInfectionLimitForDeathTimer = &amp;quot;80&amp;quot;&lt;br /&gt;
	TimeUntilDeathAtHighInfection = &amp;quot;2&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	LightLampMinInfectionIncrease = &amp;quot;0.1&amp;quot;&lt;br /&gt;
	LightLampMaxInfectionIncrease = &amp;quot;5&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  NumberOfInfectionLevels = &amp;quot;4&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  InfectionLevelOneSpeedMultiplier = &amp;quot;1.0&amp;quot;&lt;br /&gt;
  InfectionLevelTwoSpeedMultiplier = &amp;quot;1.0&amp;quot;&lt;br /&gt;
  InfectionLevelThreeSpeedMultiplier = &amp;quot;1.0&amp;quot;&lt;br /&gt;
  InfectionLevelFourSpeedMultiplier = &amp;quot;0.5&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  MaxInfectionLevelAtWhichPlayerCanRun = &amp;quot;2&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  GradientThresholdOffset = &amp;quot;1.1&amp;quot;&lt;br /&gt;
  GradientFallofExponent = &amp;quot;8.0&amp;quot;&lt;br /&gt;
  InfectionMapZoom = &amp;quot;0.95&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  VomitEffectDuration =&amp;quot;3.0&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  InfectionEffectGrowSpeed = &amp;quot;1&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, in the game it uses a separate meter (which is visible via the aforementioned debug menu method).&lt;br /&gt;
&lt;br /&gt;
The mentioned sanity events config file contains exactly the same data as TDD, which means that it wasn't used in the end.&lt;br /&gt;
&lt;br /&gt;
Infection was supposed to increase near creatures, yet the config still has the old sanity property names:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    NearEnemyDecrease = &amp;quot;0.3&amp;quot;&lt;br /&gt;
    NearCritterDecrease = &amp;quot;0.1&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The proper names for these are &amp;lt;code&amp;gt;NearEnemyIncrease&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;NearCritterIncrease&amp;lt;/code&amp;gt;, although only CritterSpider increases infection, as a result of repurposed TDD code.&lt;br /&gt;
&lt;br /&gt;
These property names were changed to replace &amp;quot;Sanity&amp;quot; with &amp;quot;Infection&amp;quot;, but are entirely unused:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
   LightLampMinInfectionIncrease = &amp;quot;0.1&amp;quot;&lt;br /&gt;
   LightLampMaxInfectionIncrease = &amp;quot;5&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ManPig enemies have unused vomit animations and unused entity parameters, such as:&lt;br /&gt;
&lt;br /&gt;
* DistanceAtWhichFleeingPigVomitAttacks&lt;br /&gt;
* MinimumTimeBetweenVomitAttacks&lt;br /&gt;
* MinTimeBeforeIgnoringPlayerAfterVomit&lt;br /&gt;
&lt;br /&gt;
These seem to indicate that ManPigs would have attacked the player by vomiting, increasing the infection meter. The C++ source code shows that being vomited on would instantly set infection to the maximum level:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void cLuxPlayer::VomitDamage()&lt;br /&gt;
{&lt;br /&gt;
	mfTimeSinceLastVomit = 0.0f;&lt;br /&gt;
&lt;br /&gt;
	/*if ( GetInfectionLevel() &amp;lt; 3 )&lt;br /&gt;
	{&lt;br /&gt;
		SetInfectionLevel( 3 );&lt;br /&gt;
	}&lt;br /&gt;
	else*/ if ( GetInfectionLevel() &amp;lt; 4 )&lt;br /&gt;
	{&lt;br /&gt;
		SetInfectionLevel( 4 );&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A particle effect called &amp;quot;''ps_pig_attack_vomit''&amp;quot; was also left in the game.&lt;br /&gt;
&lt;br /&gt;
== Missing parts ==&lt;br /&gt;
&lt;br /&gt;
When the infection is used in-game by enabling the infection areas, some errors get printed to the log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ERROR: Could not load sound 'infection_loop_1'&lt;br /&gt;
ERROR: Can't find sound 'infection_loop_1'!&lt;br /&gt;
ERROR: Couldn't create SoundEntity 'infection_drain_high.snt'&lt;br /&gt;
ERROR: Couldn't create SoundEntity 'infection_heartbeat.snt'&lt;br /&gt;
WARNING: Could not find language file entry 'InfectionHigh'&lt;br /&gt;
ERROR: Couldn't create SoundEntity 'infection_pant.snt'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This indicates that some of the sound entity (.snt) files are missing. They don't have the raw sound files (.ogg) either.&lt;br /&gt;
&lt;br /&gt;
Furthermore, the game displays an empty hint when player reaches level 4 of infection. Its lang file name is &amp;quot;InfectionHigh&amp;quot;, which means that it can be remade and will display automatically. It is unknown if hints for other infection levels exist.&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/AMFP/Infection&amp;diff=6983</id>
		<title>HPL2/AMFP/Infection</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/AMFP/Infection&amp;diff=6983"/>
		<updated>2025-01-18T20:10:41Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Other evidence */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Infection =&lt;br /&gt;
&lt;br /&gt;
Infection is a mechanic which was cut from the final game, but it wasn't fully removed from it.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The mechanic is quite similar to sanity from TDD. It is a meter which fills up in certain circumstances and plays visual and sound effects, which depend on the meter's value.&lt;br /&gt;
&lt;br /&gt;
Currently the only known way of raising the infection meter is the infection areas. There are multiple of them placed in the game, but they all have been deactivated (which means that they can be restored).&lt;br /&gt;
&lt;br /&gt;
There are 4 levels of infection, all of which play increasingly noticeable effects. The first level is when the player has infection above zero. After reaching level 3, the player can't run, and at level 4 their movement speed is cut in half.&lt;br /&gt;
&lt;br /&gt;
The meter goes down automatically after the player leaves the infected area. It will gradually fall to zero, unless the player has gathered above 80 infection; in that case, they will die even if the meter goes down to level 3. Interestingly, above 75 the infection stops to fall, which leaves a tight margin of 5 infection points which won't kill the player but will not decrease.&lt;br /&gt;
&lt;br /&gt;
Currently the only way to view the meter (aside from the audiovisual effects) is to press F1 in debug mode and turn on player info.&lt;br /&gt;
&lt;br /&gt;
== Other evidence ==&lt;br /&gt;
&lt;br /&gt;
According to these sections of '''game.cfg''', the infection system was a slightly modified version of the sanity mechanic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;Infection&lt;br /&gt;
    EventsFile = &amp;quot;misc/main_sanity_events.cfg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    MinTimeBetweenEvents = &amp;quot;300&amp;quot;&lt;br /&gt;
    MaxEventSanity = &amp;quot;65&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    MaxSanity_LongWait = &amp;quot;65&amp;quot;&lt;br /&gt;
    MaxSanity_MedWait = &amp;quot;45&amp;quot;&lt;br /&gt;
    MaxSanity_ShortWait = &amp;quot;25&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    TimeBetween_LongWait = &amp;quot;270&amp;quot;&lt;br /&gt;
    TimeBetween_MedWait = &amp;quot;180&amp;quot;&lt;br /&gt;
    TimeBetween_ShortWait = &amp;quot;80&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    MinExamineInfection = &amp;quot;50&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    InfectionArea_CheckTimeMin = &amp;quot;1&amp;quot;&lt;br /&gt;
    InfectionArea_CheckTimeMax = &amp;quot;2&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Player_Infection&lt;br /&gt;
	&lt;br /&gt;
	HitZoomInSpeed = &amp;quot;3.5&amp;quot;&lt;br /&gt;
	HitZoomOutSpeed = &amp;quot;0.6&amp;quot;&lt;br /&gt;
	HitZoomInFOVMul = &amp;quot;0.06&amp;quot;&lt;br /&gt;
	HitZoomInAspectMul = &amp;quot;0.15&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	InfectionDecreaseSpeed = &amp;quot;0.75&amp;quot;&lt;br /&gt;
	InfectionDecreaseLimitLevel = &amp;quot;3&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	InfectionVeryHighLimit = &amp;quot;80&amp;quot;&lt;br /&gt;
	InfectionEffectsStart = &amp;quot;35&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	InfectionWaveAlphaMul = &amp;quot;1&amp;quot;&lt;br /&gt;
	InfectionWaveSpeedMul = &amp;quot;1&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	CheckEnemyNearOrSeenInterval = &amp;quot;0.3&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	NearEnemyDecrease = &amp;quot;0.3&amp;quot;&lt;br /&gt;
	NearCritterDecrease = &amp;quot;0.1&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	StartSwayMinInfection = &amp;quot;15&amp;quot;&lt;br /&gt;
	SwayMaxSavedPositions = &amp;quot;30&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
  HighInfectionLimitForDeathTimer = &amp;quot;80&amp;quot;&lt;br /&gt;
	TimeUntilDeathAtHighInfection = &amp;quot;2&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	LightLampMinInfectionIncrease = &amp;quot;0.1&amp;quot;&lt;br /&gt;
	LightLampMaxInfectionIncrease = &amp;quot;5&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  NumberOfInfectionLevels = &amp;quot;4&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  InfectionLevelOneSpeedMultiplier = &amp;quot;1.0&amp;quot;&lt;br /&gt;
  InfectionLevelTwoSpeedMultiplier = &amp;quot;1.0&amp;quot;&lt;br /&gt;
  InfectionLevelThreeSpeedMultiplier = &amp;quot;1.0&amp;quot;&lt;br /&gt;
  InfectionLevelFourSpeedMultiplier = &amp;quot;0.5&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  MaxInfectionLevelAtWhichPlayerCanRun = &amp;quot;2&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  GradientThresholdOffset = &amp;quot;1.1&amp;quot;&lt;br /&gt;
  GradientFallofExponent = &amp;quot;8.0&amp;quot;&lt;br /&gt;
  InfectionMapZoom = &amp;quot;0.95&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  VomitEffectDuration =&amp;quot;3.0&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  InfectionEffectGrowSpeed = &amp;quot;1&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, in the game it uses a separate meter (which is visible via the aforementioned debug menu method).&lt;br /&gt;
&lt;br /&gt;
The mentioned sanity events config file contains exactly the same data as TDD, which means that it wasn't used in the end.&lt;br /&gt;
&lt;br /&gt;
Infection was supposed to increase near creatures, yet the config still has the old sanity property names:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    NearEnemyDecrease = &amp;quot;0.3&amp;quot;&lt;br /&gt;
    NearCritterDecrease = &amp;quot;0.1&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The proper names for these are &amp;lt;code&amp;gt;NearEnemyIncrease&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;NearCritterIncrease&amp;lt;/code&amp;gt;, although only CritterSpider increases infection, as a result of repurposed TDD code.&lt;br /&gt;
&lt;br /&gt;
These property names were changed to replace &amp;quot;Sanity&amp;quot; with &amp;quot;Infection&amp;quot;, but are entirely unused:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
   LightLampMinInfectionIncrease = &amp;quot;0.1&amp;quot;&lt;br /&gt;
   LightLampMaxInfectionIncrease = &amp;quot;5&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ManPig enemies have unused vomit animations and unused entity parameters, such as:&lt;br /&gt;
&lt;br /&gt;
* DistanceAtWhichFleeingPigVomitAttacks&lt;br /&gt;
* MinimumTimeBetweenVomitAttacks&lt;br /&gt;
* MinTimeBeforeIgnoringPlayerAfterVomit&lt;br /&gt;
&lt;br /&gt;
These seem to indicate that ManPigs would have attacked the player by vomiting, increasing the infection meter. The C++ source code shows that being vomited on would instantly set infection to the maximum level:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void cLuxPlayer::VomitDamage()&lt;br /&gt;
{&lt;br /&gt;
	mfTimeSinceLastVomit = 0.0f;&lt;br /&gt;
&lt;br /&gt;
	/*if ( GetInfectionLevel() &amp;lt; 3 )&lt;br /&gt;
	{&lt;br /&gt;
		SetInfectionLevel( 3 );&lt;br /&gt;
	}&lt;br /&gt;
	else*/ if ( GetInfectionLevel() &amp;lt; 4 )&lt;br /&gt;
	{&lt;br /&gt;
		SetInfectionLevel( 4 );&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A particle effect called &amp;quot;''ps_pig_attack_vomit''&amp;quot; was also left in the game.&lt;br /&gt;
&lt;br /&gt;
== Missing parts ==&lt;br /&gt;
&lt;br /&gt;
When the infection is used in-game by enabling the infection areas, some errors get printed to the log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ERROR: Could not load sound 'infection_loop_1'&lt;br /&gt;
ERROR: Can't find sound 'infection_loop_1'!&lt;br /&gt;
ERROR: Couldn't create SoundEntity 'infection_drain_high.snt'&lt;br /&gt;
ERROR: Couldn't create SoundEntity 'infection_heartbeat.snt'&lt;br /&gt;
WARNING: Could not find language file entry 'InfectionHigh'&lt;br /&gt;
ERROR: Couldn't create SoundEntity 'infection_pant.snt'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This indicates that some of the sound entity (.snt) files are missing. They don't have the raw sound files (.ogg) either.&lt;br /&gt;
&lt;br /&gt;
Furthermore, the game displays an empty hint when player reaches level 4 of infection. Its lang file name is &amp;quot;InfectionHigh&amp;quot;, which means that it can be remade and will display automatically. It is unknown if hints for other infection levels exist.&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/AMFP/NewEntities&amp;diff=6982</id>
		<title>HPL2/AMFP/NewEntities</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/AMFP/NewEntities&amp;diff=6982"/>
		<updated>2025-01-18T19:42:13Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* VoiceFlashbackTrigger */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AMFP features a few new entity types.&lt;br /&gt;
&lt;br /&gt;
== PhoneBox ==&lt;br /&gt;
&lt;br /&gt;
The entity which executes phone calls. There's only one such asset in the game, and the entity file doesn't have any type vars (User Defined Variables). However, in the Level Editor, it has multiple instance vars.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop|amfp}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| VoiceFile1 || File (.ogg) || || Voice file to be played.&amp;lt;br&amp;gt;The file has to be located in the ''sounds'' folder or one of its subfolders.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry1 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay1 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry2 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay2 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry3 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay3 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry4 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay4 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry5 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay5 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry6 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay6 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry7 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay7 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Not all 7 entries must be used, but there can't be more than that in a single phonecall.&lt;br /&gt;
&lt;br /&gt;
The PhoneBox entity has three dedicated functions for it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void StartPhoneRinging(string&amp;amp; asName);&lt;br /&gt;
void StopPhoneRinging(string&amp;amp; asName);&lt;br /&gt;
void HangUpPhone(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName '' - The phone box entity to use.&lt;br /&gt;
&lt;br /&gt;
The PhoneBox won't ring until the &amp;lt;code&amp;gt;StartPhoneRinging&amp;lt;/code&amp;gt; function is called. &amp;lt;code&amp;gt;StopPhoneRinging&amp;lt;/code&amp;gt; can be used if the player leaves an area without picking up the phone, or takes too long.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;StartPhoneRinging&amp;lt;/code&amp;gt; is used, the PhoneBox will start ringing (the sound is only audible at a quite short distance, and a bell animation will play). A unique crosshair when looking at the PhoneBox. Interacting with it will play a switch animation as well as the voice file, and display all the defined subtitles at specified intervals. After the voice file finishes playing, another switch animation will play and the glow will disappear (if it was used).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HangUpPhone&amp;lt;/code&amp;gt; ends the call early, stopping any voice lines currently playing. Plays a unique hang up sound (''entities/telephone/telephone_down.snt'') that is not used anywhere else.&lt;br /&gt;
&lt;br /&gt;
Keep in mind that the green light which appears on the PhoneBox is not a part of the entity; it's a Lamp entity which needs to be enabled by scripting.&lt;br /&gt;
&lt;br /&gt;
== Enemy_ManPig ==&lt;br /&gt;
&lt;br /&gt;
This enemy type has multiple new settings in the LevelEditor.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Enemy|amfp}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| NoticeSound || File (.snt) || || Sound played when enemy notices that player is nearby&lt;br /&gt;
|-&lt;br /&gt;
| GiveUpNoticeSound || File (.snt) || || Sound played when enemy gives up investigation (after a notice)&lt;br /&gt;
|-&lt;br /&gt;
| EnabledSound || File (.snt) || || Sound played when enemy is enabled&lt;br /&gt;
|-&lt;br /&gt;
| GroggyDamageCount || Float || 15 || The accumulated amount of damage the enemy can take before getting groggy by the hit.&amp;lt;br&amp;gt;The enemy will flinch after taking this amount of damage.&lt;br /&gt;
|-&lt;br /&gt;
| AlertToHuntDistance || Float || 10 || If range is above this then enemy can go from alert to hunt&lt;br /&gt;
|-&lt;br /&gt;
| AlertToInstantHuntDistance || Float || 3.5 || If range is below this, enemy geos instantly to hunt.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMinTime || Float || 2 || Min time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMaxTime || Float || 4.5 || Max time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| IncreaseAlertSpeedDistance || Float || 6 || Distance at which the alert move speed increases.&lt;br /&gt;
|-&lt;br /&gt;
| IncreasedAlertSpeedMul || Float || 1.5 || The amount that move speed is multiplied by when alert.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsToHuntLimit || Float || 30 || The accumulated limit value when alert goes to hunt because of player running towards enemy.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsCheckDistance || Float || 5 || The distance where the move toward enemy check starts&lt;br /&gt;
|-&lt;br /&gt;
| IsTesla || Bool || false || If this is the tesla pig&lt;br /&gt;
|-&lt;br /&gt;
| ChaseSound || File (.snt) || || Played when the pig is chasing.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Enemy|amfp}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| ThreatenOnAlert || Bool || false || If the pig should stand still and threaten instead of walking towards player when in alert mode.&lt;br /&gt;
|-&lt;br /&gt;
| FleeFromPlayer || Bool || false || The pig will flee instead of hunting (threaten if ThreatenOnAlert). Disabled if far enough away. Will attack if cornered.&amp;lt;br&amp;gt;Running to the furthest PathNode seems to be the main behavior.&amp;lt;br&amp;gt;'''If the map has no PathNodes, the game will crash when the enemy notices the player!'''&lt;br /&gt;
|-&lt;br /&gt;
| AutoDisableAfterFlee || Bool || false || If pig should be disabled after having fled (if possible)&amp;lt;br&amp;gt;Must not be seen by the player and must be more than 15 meters away from them.&lt;br /&gt;
|-&lt;br /&gt;
| LanternSensitivity || Float || 1 || A modifier for how quickly the pig reacts to being shined on by the lantern.&lt;br /&gt;
|-&lt;br /&gt;
| IdleBehavior || String || || The behavior used when there are no patrol nodes left to walk.&amp;lt;br&amp;gt;Can be &amp;quot;None&amp;quot;, &amp;quot;Stalk&amp;quot;, or &amp;quot;Track&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| PlayActivateSound || Bool || true || If the enemy can play its EnabledSound.&lt;br /&gt;
|-&lt;br /&gt;
| AllowZeroNodeWaitTimes || Bool || false || If set to true, path node wait times with value 0 actually mean no waiting&amp;lt;br&amp;gt;Normally, specifying a wait time of 0 in &amp;lt;code&amp;gt;AddEnemyPatrolNode&amp;lt;/code&amp;gt; results in a wait time of 1-3 seconds.&lt;br /&gt;
|-&lt;br /&gt;
| PatrolMoveSpeed || String || Walk || Whether this pig walks or runs along its patrol&amp;lt;br&amp;gt;Can be &amp;quot;Walk&amp;quot; or &amp;quot;Run&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| DamageMul || Float || 1 || Multiplier for the enemy's attack damage.&lt;br /&gt;
|-&lt;br /&gt;
| RunSpeedMul || Float || 1 || Multiplier for the enemy's run speed.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseTimeMul || Float || 1 || Multiplier for the wait time between attacks.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Enemy_Child ==&lt;br /&gt;
&lt;br /&gt;
An enemy variation used for acting out scenes. This &amp;quot;enemy&amp;quot; doesn't seem to respond to any player input, aside from proximity.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Enemy|amfp}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Enemy|amfp}}&lt;br /&gt;
&lt;br /&gt;
EntityTypes.cfg has a few instance vars listed in the Enemy base class that in fact only apply to Enemy_ManPig. These are skipped here.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| PatrolMoveSpeed || String || Walk || The movement speed type to use when patrolling.&amp;lt;br&amp;gt;Can be &amp;quot;Walk&amp;quot; or &amp;quot;Run&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== AnimatedProp ==&lt;br /&gt;
This type doesn't seem to have any particular use. It is unclear why it was added, as ''.dae''  with animations will play automatically anyway, and &amp;lt;code&amp;gt;PlayPropAnimation()&amp;lt;/code&amp;gt; isn't used with AnimatedProps.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CastShadows || Bool || true || If entity casts shadows.&lt;br /&gt;
|-&lt;br /&gt;
| IsAffectedByDecal || Bool || true || If decals can be created on entity.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== VoiceFlashbackTrigger ==&lt;br /&gt;
&lt;br /&gt;
A prop that plays a voice flashback with screen effects when interacted with. The type of all entities in ''entities/voice_triggers''. Unused in the official maps, as they seem to have been replaced by Script areas that call &amp;lt;code&amp;gt;PlayEffectVoice&amp;lt;/code&amp;gt; when collided with.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop|amfp}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop|amfp}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| VoiceFile || File (.ogg) || || Voice file to be played.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=Template:HPL2_InstanceVars_Prop&amp;diff=6981</id>
		<title>Template:HPL2 InstanceVars Prop</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=Template:HPL2_InstanceVars_Prop&amp;diff=6981"/>
		<updated>2025-01-18T19:05:08Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;white-space:nowrap;text-align:-webkit-center&amp;quot;| Instance Vars (All Props)&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CastShadows || Bool || true || If entity casts shadows.&lt;br /&gt;
|-&lt;br /&gt;
| StaticPhysics || Bool || false || If the mass of all bodies should be 0.&amp;lt;br&amp;gt;If enabled, the entity cannot be moved by physics or player interactions.&lt;br /&gt;
|-&lt;br /&gt;
{{#ifeq:{{{1|}}}|amfp|&lt;br /&gt;
{{!}} IsOccluder {{!}}{{!}} Bool {{!}}{{!}} false {{!}}{{!}} If objects behind should be culled.&lt;br /&gt;
{{!}}-&lt;br /&gt;
}}&lt;br /&gt;
| IsAffectedByDecal || Bool || true || If decals can be created on entity.&lt;br /&gt;
|-&lt;br /&gt;
| CallbackFunc || String || || A callback function used for a number of events. Syntax: &amp;lt;code&amp;gt;void Func(string &amp;amp;in asEntityName, string &amp;amp;in asType)&amp;lt;/code&amp;gt;. asType can be OnPickup, Break, OnIgnite&lt;br /&gt;
|-&lt;br /&gt;
| ConnectedProps || String || || Props that are connected to this entity and what will happen will depend upon type of prop and what happens. OnBreak makes the connected props active and gives them an impulse. Enter with space and/or comma between entity names.&lt;br /&gt;
|-&lt;br /&gt;
| ConnectionStateChangeCallback || String || || A callback called when ever the connection state changes (button being switched on). Syntax: &amp;lt;code&amp;gt;void Func(string &amp;amp;in asEntityName, int alState)&amp;lt;/code&amp;gt;. alState: -1=off, 0=between, 1=on&lt;br /&gt;
|-&lt;br /&gt;
| FullGameSave || Bool || false || If the all things in the entity should be saved when exiting the level. Only use on few entities!&amp;lt;br&amp;gt;If enabled, additional entity properties are saved, such as the open amount of SwingDoors.&lt;br /&gt;
|-&lt;br /&gt;
| PlayerLookAtCallback || String || || Callback called when player looks at entity. Syntax: &amp;lt;code&amp;gt;void Func(string &amp;amp;in asEntity, int alState)&amp;lt;/code&amp;gt; alState: 1=looking, -1=stopped looking&lt;br /&gt;
|-&lt;br /&gt;
| PlayerLookAtCallbackAutoRemove || Bool || false || Should look at callback be removed when entity is looked at and callback called.&lt;br /&gt;
|-&lt;br /&gt;
| PlayerInteractCallback || String || || Callback called when player interacts with entity. Syntax: &amp;lt;code&amp;gt;void Func(string &amp;amp;in asEntity)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| PlayerInteractCallbackAutoRemove || Bool || false || Should interact callback be removed when entity is interacted with and is callback called.&lt;br /&gt;
|-&lt;br /&gt;
{{#ifeq:{{{1|}}}|amfp|&lt;br /&gt;
{{!}} GlowEnabled {{!}}{{!}} Bool {{!}}{{!}} true {{!}}{{!}} If the object should have a glowing effect. Only works on interactables!&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}} GlowColor {{!}}{{!}} Color {{!}}{{!}} 0.5 0.5 1.0 0 {{!}}{{!}} Color of the objects glow.&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}} GlowOutlineColor {{!}}{{!}} Color {{!}}{{!}} 0 0 0.5 0 {{!}}{{!}} Color of the outline when object is in focus&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}} UpdateAnimationWhenCulled {{!}}{{!}} Bool {{!}}{{!}} false {{!}}{{!}} Should the animation be reset when the player isn't looking.&lt;br /&gt;
{{!}}-&lt;br /&gt;
}}&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/AMFP/NewEntities&amp;diff=6980</id>
		<title>HPL2/AMFP/NewEntities</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/AMFP/NewEntities&amp;diff=6980"/>
		<updated>2025-01-18T17:35:26Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* AnimatedProp */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AMFP features a few new entity types.&lt;br /&gt;
&lt;br /&gt;
== PhoneBox ==&lt;br /&gt;
&lt;br /&gt;
The entity which executes phone calls. There's only one such asset in the game, and the entity file doesn't have any type vars (User Defined Variables). However, in the Level Editor, it has multiple instance vars.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop|amfp}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| VoiceFile1 || File (.ogg) || || Voice file to be played.&amp;lt;br&amp;gt;The file has to be located in the ''sounds'' folder or one of its subfolders.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry1 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay1 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry2 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay2 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry3 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay3 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry4 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay4 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry5 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay5 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry6 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay6 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry7 || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
| Delay7 || Float || 1 || The time between text entries.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Not all 7 entries must be used, but there can't be more than that in a single phonecall.&lt;br /&gt;
&lt;br /&gt;
The PhoneBox entity has three dedicated functions for it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void StartPhoneRinging(string&amp;amp; asName);&lt;br /&gt;
void StopPhoneRinging(string&amp;amp; asName);&lt;br /&gt;
void HangUpPhone(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#''asName '' - The phone box entity to use.&lt;br /&gt;
&lt;br /&gt;
The PhoneBox won't ring until the &amp;lt;code&amp;gt;StartPhoneRinging&amp;lt;/code&amp;gt; function is called. &amp;lt;code&amp;gt;StopPhoneRinging&amp;lt;/code&amp;gt; can be used if the player leaves an area without picking up the phone, or takes too long.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;StartPhoneRinging&amp;lt;/code&amp;gt; is used, the PhoneBox will start ringing (the sound is only audible at a quite short distance, and a bell animation will play). A unique crosshair when looking at the PhoneBox. Interacting with it will play a switch animation as well as the voice file, and display all the defined subtitles at specified intervals. After the voice file finishes playing, another switch animation will play and the glow will disappear (if it was used).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HangUpPhone&amp;lt;/code&amp;gt; ends the call early, stopping any voice lines currently playing. Plays a unique hang up sound (''entities/telephone/telephone_down.snt'') that is not used anywhere else.&lt;br /&gt;
&lt;br /&gt;
Keep in mind that the green light which appears on the PhoneBox is not a part of the entity; it's a Lamp entity which needs to be enabled by scripting.&lt;br /&gt;
&lt;br /&gt;
== Enemy_ManPig ==&lt;br /&gt;
&lt;br /&gt;
This enemy type has multiple new settings in the LevelEditor.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Enemy|amfp}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Type Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| NoticeSound || File (.snt) || || Sound played when enemy notices that player is nearby&lt;br /&gt;
|-&lt;br /&gt;
| GiveUpNoticeSound || File (.snt) || || Sound played when enemy gives up investigation (after a notice)&lt;br /&gt;
|-&lt;br /&gt;
| EnabledSound || File (.snt) || || Sound played when enemy is enabled&lt;br /&gt;
|-&lt;br /&gt;
| GroggyDamageCount || Float || 15 || The accumulated amount of damage the enemy can take before getting groggy by the hit.&amp;lt;br&amp;gt;The enemy will flinch after taking this amount of damage.&lt;br /&gt;
|-&lt;br /&gt;
| AlertToHuntDistance || Float || 10 || If range is above this then enemy can go from alert to hunt&lt;br /&gt;
|-&lt;br /&gt;
| AlertToInstantHuntDistance || Float || 3.5 || If range is below this, enemy geos instantly to hunt.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMinTime || Float || 2 || Min time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseMaxTime || Float || 4.5 || Max time enemy spends not attacking after an attack.&lt;br /&gt;
|-&lt;br /&gt;
| IncreaseAlertSpeedDistance || Float || 6 || Distance at which the alert move speed increases.&lt;br /&gt;
|-&lt;br /&gt;
| IncreasedAlertSpeedMul || Float || 1.5 || The amount that move speed is multiplied by when alert.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsToHuntLimit || Float || 30 || The accumulated limit value when alert goes to hunt because of player running towards enemy.&lt;br /&gt;
|-&lt;br /&gt;
| AlertRunTowardsCheckDistance || Float || 5 || The distance where the move toward enemy check starts&lt;br /&gt;
|-&lt;br /&gt;
| IsTesla || Bool || false || If this is the tesla pig&lt;br /&gt;
|-&lt;br /&gt;
| ChaseSound || File (.snt) || || Played when the pig is chasing.&amp;lt;br&amp;gt;Incorrectly defined as a string in EntityTypes.cfg.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Enemy|amfp}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| ThreatenOnAlert || Bool || false || If the pig should stand still and threaten instead of walking towards player when in alert mode.&lt;br /&gt;
|-&lt;br /&gt;
| FleeFromPlayer || Bool || false || The pig will flee instead of hunting (threaten if ThreatenOnAlert). Disabled if far enough away. Will attack if cornered.&amp;lt;br&amp;gt;Running to the furthest PathNode seems to be the main behavior.&amp;lt;br&amp;gt;'''If the map has no PathNodes, the game will crash when the enemy notices the player!'''&lt;br /&gt;
|-&lt;br /&gt;
| AutoDisableAfterFlee || Bool || false || If pig should be disabled after having fled (if possible)&amp;lt;br&amp;gt;Must not be seen by the player and must be more than 15 meters away from them.&lt;br /&gt;
|-&lt;br /&gt;
| LanternSensitivity || Float || 1 || A modifier for how quickly the pig reacts to being shined on by the lantern.&lt;br /&gt;
|-&lt;br /&gt;
| IdleBehavior || String || || The behavior used when there are no patrol nodes left to walk.&amp;lt;br&amp;gt;Can be &amp;quot;None&amp;quot;, &amp;quot;Stalk&amp;quot;, or &amp;quot;Track&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| PlayActivateSound || Bool || true || If the enemy can play its EnabledSound.&lt;br /&gt;
|-&lt;br /&gt;
| AllowZeroNodeWaitTimes || Bool || false || If set to true, path node wait times with value 0 actually mean no waiting&amp;lt;br&amp;gt;Normally, specifying a wait time of 0 in &amp;lt;code&amp;gt;AddEnemyPatrolNode&amp;lt;/code&amp;gt; results in a wait time of 1-3 seconds.&lt;br /&gt;
|-&lt;br /&gt;
| PatrolMoveSpeed || String || Walk || Whether this pig walks or runs along its patrol&amp;lt;br&amp;gt;Can be &amp;quot;Walk&amp;quot; or &amp;quot;Run&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| DamageMul || Float || 1 || Multiplier for the enemy's attack damage.&lt;br /&gt;
|-&lt;br /&gt;
| RunSpeedMul || Float || 1 || Multiplier for the enemy's run speed.&lt;br /&gt;
|-&lt;br /&gt;
| HuntPauseTimeMul || Float || 1 || Multiplier for the wait time between attacks.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Enemy_Child ==&lt;br /&gt;
&lt;br /&gt;
An enemy variation used for acting out scenes. This &amp;quot;enemy&amp;quot; doesn't seem to respond to any player input, aside from proximity.&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Enemy|amfp}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Enemy|amfp}}&lt;br /&gt;
&lt;br /&gt;
EntityTypes.cfg has a few instance vars listed in the Enemy base class that in fact only apply to Enemy_ManPig. These are skipped here.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| PatrolMoveSpeed || String || Walk || The movement speed type to use when patrolling.&amp;lt;br&amp;gt;Can be &amp;quot;Walk&amp;quot; or &amp;quot;Run&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== AnimatedProp ==&lt;br /&gt;
This type doesn't seem to have any particular use. It is unclear why it was added, as ''.dae''  with animations will play automatically anyway, and &amp;lt;code&amp;gt;PlayPropAnimation()&amp;lt;/code&amp;gt; isn't used with AnimatedProps.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CastShadows || Bool || true || If entity casts shadows.&lt;br /&gt;
|-&lt;br /&gt;
| IsAffectedByDecal || Bool || true || If decals can be created on entity.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== VoiceFlashbackTrigger ==&lt;br /&gt;
&lt;br /&gt;
The type of all entities from ''entities/voice_triggers''. It seems that these entities weren't used in any of the maps, which makes this entity type unrestorable. &lt;br /&gt;
&lt;br /&gt;
{{note|'''Note:''' This entity type is patched in the custom config so that it doesn't give errors when loaded into the editor. However, the intended functionality cannot be used and the editors will only show generic settings for the entity.}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 TypeVars Prop|amfp}}&lt;br /&gt;
&lt;br /&gt;
{{HPL2 InstanceVars Prop|amfp}}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+Instance Vars&lt;br /&gt;
! Name !! Type !! Default !! Description&lt;br /&gt;
|-&lt;br /&gt;
| VoiceFile || File (.ogg) || || Voice file to be played.&lt;br /&gt;
|-&lt;br /&gt;
| TextEntry || String || || The text entry to be used. Category is always Voice&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL2/AMFP/ScriptFunctions&amp;diff=6979</id>
		<title>HPL2/AMFP/ScriptFunctions</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL2/AMFP/ScriptFunctions&amp;diff=6979"/>
		<updated>2025-01-18T17:01:07Z</updated>

		<summary type="html">&lt;p&gt;BoxFigs: /* Enemies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Engine scripts ==&lt;br /&gt;
&lt;br /&gt;
A list of script functions available in A Machine For Pigs (that are not present in The Dark Descent). Many of TDD's scripts are available in AMFP, but not all. Some are replaced by ones listed below, and others are removed.&lt;br /&gt;
&lt;br /&gt;
=== General ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void CheckPoint(string&amp;amp; asName, string&amp;amp; asStartPos, string&amp;amp; asCallback, string&amp;amp; asDeathHintCat, string&amp;amp; asDeathHintEntry, bool abKeepPlayerInLimbo);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a check point where the player will respawn if they die. '''Callback syntax:'''&amp;lt;code&amp;gt;void MyFunc(string &amp;amp;in asName, int alCount)&amp;lt;/code&amp;gt;&lt;br /&gt;
This function replaces TDD's &amp;lt;code&amp;gt;CheckPoint()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The internal name of the callback&lt;br /&gt;
# ''asStartPos'' - The name of the PlayerStartArea to respawn at&lt;br /&gt;
# ''asCallback'' - The name of the callback function to run&lt;br /&gt;
# ''asDeathHintCat'' - The name of the .lang file category&lt;br /&gt;
# ''asDeathHintEntry'' - The name of the .lang file entry&lt;br /&gt;
# ''abKeepPlayerInLimbo'' - Whether to put the player into a state of &amp;quot;limbo&amp;quot; upon death. In limbo, the death occurs normally, but once the screen fades to black, it remains so until &amp;lt;code&amp;gt;ReleasePlayerFromLimbo()&amp;lt;/code&amp;gt;  is called. Player is still controllable during death.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ReleasePlayerFromLimbo();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Respawns the player if stuck in &amp;quot;limbo&amp;quot;. Limbo can be enabled with ''CheckPoint''. Limbo is the state between life and death. The player enters limbo upon dying but won't respawn until this function is called.&lt;br /&gt;
&lt;br /&gt;
=== Particle Systems ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetParticleSystemActive(string&amp;amp; asName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pauses a particle system in its current frame. The paused particle system remains frozen at this frame until reactivated or destroyed.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The name of the particle system&lt;br /&gt;
# ''abActive'' - False to pause, true to unpause&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DestroyParticleSystemInstantly(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Destroys a particle system and any existing particles already emitted from it. Similar to ''DestroyParticleSystem'', except that one will not destroy the existing particles and rather let them live out their lives. This function will cut all particles' lives short.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - The internal name of the particle system&lt;br /&gt;
&lt;br /&gt;
=== Sounds ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice2(string&amp;amp; asVoiceFile, string&amp;amp; asEffectFile, string&amp;amp; asTextCat, string&amp;amp; asTextEntry, float afTextDelay, string&amp;amp; asText2Entry, float afText2Delay, bool abUsePostion, string&amp;amp; asPosEnitity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays an audio file with two consecutive subtitles.&lt;br /&gt;
&lt;br /&gt;
# ''asVoiceFile''  - The entire voice file to play (intended to include 2 sections)&lt;br /&gt;
# ''asEffectFile''  - The background effect file to play during voices. Leave empty for no extra effect&lt;br /&gt;
# ''asTextCat''  - The .lang text category for the subtitles&lt;br /&gt;
# ''asTextEntry''  - The first .lang subtitle entry&lt;br /&gt;
# ''afTextDelay''  - The time to wait until the first subtitle starts&lt;br /&gt;
# ''asText2Entry''  - The second .lang subtitle entry&lt;br /&gt;
# ''afText2Delay''  - The time to wait until the second subtitle starts&lt;br /&gt;
# ''abUsePosition''  - Whether to use 3D to play the sound from an entity&lt;br /&gt;
# ''asPosEntity''  - The entity to play the sound from. If empty, plays from player&lt;br /&gt;
# ''afMinDistance''  - The minimum distance required between the player and the entity in order to hear the audio&lt;br /&gt;
# ''afMaxDistance''  - The maximum distance allowed between the player and the entity in order to hear the audio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice3(string&amp;amp; asVoiceFile, string&amp;amp; asEffectFile, string&amp;amp; asTextCat, string&amp;amp; asTextEntry, float afTextDelay, string&amp;amp; asText2Entry, float afText2Delay, string&amp;amp; asText3Entry, float afText3Delay, bool abUsePostion, string&amp;amp; asPosEnitity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays an audio file with three consecutive subtitles.&lt;br /&gt;
&lt;br /&gt;
# ''asVoiceFile''  - The entire voice file to play (intended to include 3 sections)&lt;br /&gt;
# ''asEffectFile''  - The background effect file to play during voices. Leave empty for no extra effect&lt;br /&gt;
# ''asTextCat''  - The .lang text category for the subtitles&lt;br /&gt;
# ''asTextEntry''  - The first .lang subtitle entry&lt;br /&gt;
# ''afTextDelay''  - The time to wait until the first subtitle starts&lt;br /&gt;
# ''asText2Entry''  - The second .lang subtitle entry&lt;br /&gt;
# ''afText2Delay''  - The time to wait until the second subtitle starts&lt;br /&gt;
# ''asText3Entry''  - The third .lang subtitle entry&lt;br /&gt;
# ''afText3Delay''  - The time to wait until the third subtitle starts&lt;br /&gt;
# ''abUsePosition''  - Whether to use 3D to play the sound from an entity&lt;br /&gt;
# ''asPosEntity''  - The entity to play the sound from. If empty, plays from player&lt;br /&gt;
# ''afMinDistance''  - The minimum distance required between the player and the entity in order to hear the audio&lt;br /&gt;
# ''afMaxDistance''  - The maximum distance allowed between the player and the entity in order to hear the audio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice4(string&amp;amp; asVoiceFile, string&amp;amp; asEffectFile, string&amp;amp; asTextCat, string&amp;amp; asTextEntry, float afTextDelay, string&amp;amp; asText2Entry, float afText2Delay, string&amp;amp; asText3Entry, float afText3Delay, string&amp;amp; asText4Entry, float afText4Delay, bool abUsePostion, string&amp;amp; asPosEnitity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays an audio file with four consecutive subtitles.&lt;br /&gt;
&lt;br /&gt;
# ''asVoiceFile''  - The entire voice file to play (intended to include 4 sections)&lt;br /&gt;
# ''asEffectFile''  - The background effect file to play during voices. Leave empty for no extra effect&lt;br /&gt;
# ''asTextCat''  - The .lang text category for the subtitles&lt;br /&gt;
# ''asTextEntry''  - The first .lang subtitle entry&lt;br /&gt;
# ''afTextDelay''  - The time to wait until the first subtitle starts&lt;br /&gt;
# ''asText2Entry''  - The second .lang subtitle entry&lt;br /&gt;
# ''afText2Delay''  - The time to wait until the second subtitle starts&lt;br /&gt;
# ''asText3Entry''  - The third .lang subtitle entry&lt;br /&gt;
# ''afText3Delay''  - The time to wait until the third subtitle starts&lt;br /&gt;
# ''asText4Entry''  - The fourth .lang subtitle entry&lt;br /&gt;
# ''afText4Delay''  - The time to wait until the fourth subtitle starts&lt;br /&gt;
# ''abUsePosition''  - Whether to use 3D to play the sound from an entity&lt;br /&gt;
# ''asPosEntity''  - The entity to play the sound from. If empty, plays from player&lt;br /&gt;
# ''afMinDistance''  - The minimum distance required between the player and the entity in order to hear the audio&lt;br /&gt;
# ''afMaxDistance''  - The maximum distance allowed between the player and the entity in order to hear the audio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice5(string&amp;amp; asVoiceFile, string&amp;amp; asEffectFile, string&amp;amp; asTextCat, string&amp;amp; asTextEntry, float afTextDelay, string&amp;amp; asText2Entry, float afText2Delay, string&amp;amp; asText3Entry, float afText3Delay, string&amp;amp; asText4Entry, float afText4Delay, string&amp;amp; asText5Entry, float afText5Delay, bool abUsePostion, string&amp;amp; asPosEnitity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays an audio file with five consecutive subtitles.&lt;br /&gt;
&lt;br /&gt;
# ''asVoiceFile''  - The entire voice file to play (intended to include 5 sections)&lt;br /&gt;
# ''asEffectFile''  - The background effect file to play during voices. Leave empty for no extra effect&lt;br /&gt;
# ''asTextCat''  - The .lang text category for the subtitles&lt;br /&gt;
# ''asTextEntry''  - The first .lang subtitle entry&lt;br /&gt;
# ''afTextDelay''  - The time to wait until the first subtitle starts&lt;br /&gt;
# ''asText2Entry''  - The second .lang subtitle entry&lt;br /&gt;
# ''afText2Delay''  - The time to wait until the second subtitle starts&lt;br /&gt;
# ''asText3Entry''  - The third .lang subtitle entry&lt;br /&gt;
# ''afText3Delay''  - The time to wait until the third subtitle starts&lt;br /&gt;
# ''asText4Entry''  - The fourth .lang subtitle entry&lt;br /&gt;
# ''afText4Delay''  - The time to wait until the fourth subtitle starts&lt;br /&gt;
# ''asText5Entry''  - The fifth .lang subtitle entry&lt;br /&gt;
# ''afText5Delay''  - The time to wait until the fifth subtitle starts&lt;br /&gt;
# ''abUsePosition''  - Whether to use 3D to play the sound from an entity&lt;br /&gt;
# ''asPosEntity''  - The entity to play the sound from. If empty, plays from player&lt;br /&gt;
# ''afMinDistance''  - The minimum distance required between the player and the entity in order to hear the audio&lt;br /&gt;
# ''afMaxDistance''  - The maximum distance allowed between the player and the entity in order to hear the audio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice5(string&amp;amp; asVoiceFile, string&amp;amp; asEffectFile, string&amp;amp; asTextCat, string&amp;amp; asTextEntry, float afTextDelay, string&amp;amp; asText2Entry, float afText2Delay, string&amp;amp; asText3Entry, float afText3Delay, string&amp;amp; asText4Entry, float afText4Delay, string&amp;amp; asText5Entry, float afText5Delay, string&amp;amp; asText6Entry, float afText6Delay, bool abUsePostion, string&amp;amp; asPosEnitity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays an audio file with six consecutive subtitles.&lt;br /&gt;
&lt;br /&gt;
# ''asVoiceFile''  - The entire voice file to play (intended to include 6 sections)&lt;br /&gt;
# ''asEffectFile''  - The background effect file to play during voices. Leave empty for no extra effect&lt;br /&gt;
# ''asTextCat''  - The .lang text category for the subtitles&lt;br /&gt;
# ''asTextEntry''  - The first .lang subtitle entry&lt;br /&gt;
# ''afTextDelay''  - The time to wait until the first subtitle starts&lt;br /&gt;
# ''asText2Entry''  - The second .lang subtitle entry&lt;br /&gt;
# ''afText2Delay''  - The time to wait until the second subtitle starts&lt;br /&gt;
# ''asText3Entry''  - The third .lang subtitle entry&lt;br /&gt;
# ''afText3Delay''  - The time to wait until the third subtitle starts&lt;br /&gt;
# ''asText4Entry''  - The fourth .lang subtitle entry&lt;br /&gt;
# ''afText4Delay''  - The time to wait until the fourth subtitle starts&lt;br /&gt;
# ''asText5Entry''  - The fifth .lang subtitle entry&lt;br /&gt;
# ''afText5Delay''  - The time to wait until the fifth subtitle starts&lt;br /&gt;
# ''asText6Entry''  - The sixth .lang subtitle entry&lt;br /&gt;
# ''afText6Delay''  - The time to wait until the sixth subtitle starts&lt;br /&gt;
# ''abUsePosition''  - Whether to use 3D to play the sound from an entity&lt;br /&gt;
# ''asPosEntity''  - The entity to play the sound from. If empty, plays from player&lt;br /&gt;
# ''afMinDistance''  - The minimum distance required between the player and the entity in order to hear the audio&lt;br /&gt;
# ''afMaxDistance''  - The maximum distance allowed between the player and the entity in order to hear the audio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEffectVoice7(string&amp;amp; asVoiceFile, string&amp;amp; asEffectFile, string&amp;amp; asTextCat, string&amp;amp; asTextEntry, float afTextDelay, string&amp;amp; asText2Entry, float afText2Delay, string&amp;amp; asText3Entry, float afText3Delay, string&amp;amp; asText4Entry, float afText4Delay, string&amp;amp; asText5Entry, float afText5Delay, string&amp;amp; asText6Entry, float afText6Delay, string&amp;amp; asText7Entry, float afText7Delay, bool abUsePostion, string&amp;amp; asPosEnitity, float afMinDistance, float afMaxDistance);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays an audio file with seven consecutive subtitles.&lt;br /&gt;
&lt;br /&gt;
# ''asVoiceFile''  - The entire voice file to play (intended to include 7 sections)&lt;br /&gt;
# ''asEffectFile''  - The background effect file to play during voices. Leave empty for no extra effect&lt;br /&gt;
# ''asTextCat''  - The .lang text category for the subtitles&lt;br /&gt;
# ''asTextEntry''  - The first .lang subtitle entry&lt;br /&gt;
# ''afTextDelay''  - The time to wait until the first subtitle starts&lt;br /&gt;
# ''asText2Entry''  - The second .lang subtitle entry&lt;br /&gt;
# ''afText2Delay''  - The time to wait until the second subtitle starts&lt;br /&gt;
# ''asText3Entry''  - The third .lang subtitle entry&lt;br /&gt;
# ''afText3Delay''  - The time to wait until the third subtitle starts&lt;br /&gt;
# ''asText4Entry''  - The fourth .lang subtitle entry&lt;br /&gt;
# ''afText4Delay''  - The time to wait until the fourth subtitle starts&lt;br /&gt;
# ''asText5Entry''  - The fifth .lang subtitle entry&lt;br /&gt;
# ''afText5Delay''  - The time to wait until the fifth subtitle starts&lt;br /&gt;
# ''asText6Entry''  - The sixth .lang subtitle entry&lt;br /&gt;
# ''afText6Delay''  - The time to wait until the sixth subtitle starts&lt;br /&gt;
# ''asText7Entry''  - The seventh .lang subtitle entry&lt;br /&gt;
# ''afText7Delay ''- The time to wait until the seventh subtitle starts&lt;br /&gt;
# ''abUsePosition''  - Whether to use 3D to play the sound from an entity&lt;br /&gt;
# ''asPosEntity''  - The entity to play the sound from. If empty, plays from player&lt;br /&gt;
# ''afMinDistance''  - The minimum distance required between the player and the entity in order to hear the audio&lt;br /&gt;
# ''afMaxDistance''  - The maximum distance allowed between the player and the entity in order to hear the audio&lt;br /&gt;
&lt;br /&gt;
=== Screen Effects ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void ShowScreenImage(string&amp;amp; asImageName, float afX, float afY, float afScale, bool abUseRelativeCoordinates, float afDuration, float afFadeIn, float afFadeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shows a 2D image on the screen. Originally used for showing the intro logo during a sequence.&lt;br /&gt;
&lt;br /&gt;
May work similarly to the [[HPL2/Tutorials/ShowScreenImage()|ATTD 1.5 ShowScreenImage()]].&lt;br /&gt;
&lt;br /&gt;
# ''asImageName''  - The image file to show. Does not have to be pow2 (although it gives a warning if not)&lt;br /&gt;
# ''afX''- The X position of the top left corner, starting from the center of the screen. Use negative half of the width of the image to center it.&lt;br /&gt;
# ''afY''- The Y position of the top left corner, starting from the center of the screen.&lt;br /&gt;
# ''afScale'' - The size of the image in pixels (not scale), or original image size if negative&lt;br /&gt;
# ''abUseRelativeCoordinates'' - Whether X and Y are relative to the screen resoltion, or pixel co-ordinates if not&lt;br /&gt;
# ''afDuration'' - How long, in seconds, the image displays. This does not include fade times&lt;br /&gt;
# ''afFadeIn'' - How long, in seconds, the fade in spends&lt;br /&gt;
# ''afFadeOut'' - How long, in seconds, the fade out spends&lt;br /&gt;
&lt;br /&gt;
=== Journal ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void AddHint(string&amp;amp; asNameAndTextEntry, string&amp;amp; asImage);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a hint to the player's journal.&amp;lt;br&amp;gt;This function replaces TDD's ''AddDiary''.&lt;br /&gt;
&lt;br /&gt;
# ''asNameAndTextEntry'' - The .lang text entry of the hint. The entry must be in category &amp;quot;Journal&amp;quot; and use the format Hint_MyHint_Name for the title and Hint_MyHint_Text for the body, where MyHint replaces the value you put in this argument.&lt;br /&gt;
# ''asImage'' - This argument does not seem to be used. Presumed to be for displaying an image but possibly removed functionality. All existing occurrences are empty.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
bool GetJournalDisabled();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns if the journal is currently disabled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void SetJournalDisabled(const bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disables the player's ability to open their journal.&lt;br /&gt;
&lt;br /&gt;
# ''abX''  - True to disable, false to enable again&lt;br /&gt;
&lt;br /&gt;
=== Player ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLanternFlickerActive(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables the flicker effect for the lantern's light.&lt;br /&gt;
&lt;br /&gt;
# ''abX'' - True to flicker, false to not flicker&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerInfection(float afInfection);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the [[HPL2/AMFP/Infection|infection]] level for the player. Infection replaces sanity from TDD and acts similar, however it goes from 0-100 instead of 100-0. An infection level above approximately 20 will affect the player's ability to move. Infection level above 80 will kill the player. Infection slowly decreases over time, unless high enough. &amp;lt;br /&amp;gt;This function replaces TDD's ''SetPlayerSanity''.&lt;br /&gt;
&lt;br /&gt;
# ''afInfection'' - The level of infection to set&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddPlayerInfection(float afInfection);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds an amount of infection to the player's current amount.&amp;lt;br&amp;gt;This function replaces TDD's ''AddPlayerSanity''.&lt;br /&gt;
&lt;br /&gt;
# ''afInfection'' - The amount to add&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
float GetPlayerInfection();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the amount of infection the player currently has.&amp;lt;br&amp;gt;This function replaces TDD's ''GetPlayerSanity''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void GiveInfectionDamage(float afAmount, bool abUseEffect);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increases the infection of the player.&amp;lt;br&amp;gt;This function replaces TDD's ''GiveSanityDamage''.&lt;br /&gt;
&lt;br /&gt;
# ''afAmount'' - Amount of infection damage done&lt;br /&gt;
# ''abUseEffect'' - Determines whether a sound effect is played when the infection damage is dealt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetInfectionFauxMode(bool abFauxMode);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable/disable &amp;quot;faux mode&amp;quot; for infection. In faux mode, the player cannot die of infection and infection sounds don't play.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadePlayerPitchTo(float afX, float afSpeedMul, float afMaxSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves the player's pitch (up and down rotation).&lt;br /&gt;
&lt;br /&gt;
# ''afX'' - The target pitch to move towards. 0 = straight forward. Clamped to range: -70 to +70.&lt;br /&gt;
# ''afSpeedMul'' - The speed multiplier of the movement. A low value makes a slow change.&lt;br /&gt;
# ''afMaxSpeed'' - The max speed of the movement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPlayerUsesDragFootsteps(bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets whether the player's footstep sounds are replaced with &amp;quot;drag&amp;quot; versions. Some surface materials do not have drag steps, and will therefore play no footstep sounds.&lt;br /&gt;
&lt;br /&gt;
# abX - Whether to use &amp;quot;drag&amp;quot; step sounds&lt;br /&gt;
&lt;br /&gt;
=== Entities ===&lt;br /&gt;
&lt;br /&gt;
==== General ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetEntityActive(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns whether an entity in the level is active or not.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The entity to check&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void CreateEntityAtArea(string&amp;amp; asEntityName, string&amp;amp; asEntityFile, string&amp;amp; asAreaName, bool abFullGameSave, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an entity at an area with the specified offsets and rotation. &amp;lt;br /&amp;gt;This function replaces TDD's ''CreateEntityAtArea''.&lt;br /&gt;
&lt;br /&gt;
# ''asEntityName'' - The internal name of the created entity&lt;br /&gt;
# ''asEntityFile'' - The file for the entity (extension .ent)&lt;br /&gt;
# ''asAreaName'' - The area to create entity at&lt;br /&gt;
# ''abFullGameSave'' - Determines whether an entity &amp;quot;remembers&amp;quot; its state&lt;br /&gt;
# ''afOffsetX'' - The offset along the X axis in units&lt;br /&gt;
# ''afOffsetY'' - The offset along the Y axis in units&lt;br /&gt;
# ''afOffsetZ'' - The offset along the Z axis in units&lt;br /&gt;
# ''afRotX'' - The rotation on the X axis in degrees&lt;br /&gt;
# ''afRotY'' - The rotation on the Y axis in degrees&lt;br /&gt;
# ''afRotZ'' - The rotation on the Z axis in degrees&lt;br /&gt;
&lt;br /&gt;
==== Props ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPhysicsAutoDisable(string&amp;amp; asName, bool abAutoDisable);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If physics bodies will automatically sleep (become inactive and stop moving). Only used on chandeliers in the campaign.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The prop to affect&lt;br /&gt;
# ''abAutoDisable'' - Whether physics auto disables or not&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AttachPropToBone(string&amp;amp; asChildEntityName, string&amp;amp; asParentEntityName, string&amp;amp; asParentBoneName, float fPosX, float fPosY, float fPosZ, float fRotX, float fRotY, float fRotZ);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a prop to a specific bone within another entity. You can inspect bones in the Model Editor. Note: Offsets and rotations are local to the bone and relative to its rotation.&lt;br /&gt;
&lt;br /&gt;
# ''asChildEntityName'' - The prop to attach&lt;br /&gt;
# ''asParentEntityName'' - The entity that holds the bone to attach to&lt;br /&gt;
# ''asParentBoneName'' - The bone within the entity to attach to&lt;br /&gt;
# ''afPosX'' - Offset along the X axis&lt;br /&gt;
# ''afPosY'' - Offset along the Y axis&lt;br /&gt;
# ''afPosZ'' - Offset along the Z axis&lt;br /&gt;
# ''afRotX'' - Rotation along the X axis&lt;br /&gt;
# ''afRotY'' - Rotation along the Y axis&lt;br /&gt;
# ''afRotZ'' - Rotation along the Z axis&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void DetachPropFromBone(string&amp;amp; asChildEntityName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches an attached prop. Note: When detached, physics are not automatically enabled on the prop.&lt;br /&gt;
&lt;br /&gt;
# ''asChildEntityName'' - The attached prop&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AttachAreaToProp(string&amp;amp; asAreaName, string&amp;amp; asProp, int alBody);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches an area to a prop. Originally used to attach a liquid area to a movable water plane entity in the sewers map.&lt;br /&gt;
&lt;br /&gt;
# ''asAreaName'' - The area to attach&lt;br /&gt;
# ''asProp'' - The prop to attach area to&lt;br /&gt;
# ''alBody'' - The ID of the physics body of the prop to attach to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopPropAnimation(string&amp;amp; asProp);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops the animation currently playing on a prop. Animations can be started with ''PlayPropAnimation''.&lt;br /&gt;
&lt;br /&gt;
# ''asProp'' - The name of the prop&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayCurrentAnimation(string&amp;amp; asProp, float afFadeTime, bool abLoop);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades in the active animation, optionally allowing it to loop.&lt;br /&gt;
&lt;br /&gt;
# ''asProp'' - The name of the prop&lt;br /&gt;
# ''afFadeTime'' - The fade time between animations&lt;br /&gt;
# ''abLoop'' - If the animation should be looped&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PauseCurrentAnimation(string&amp;amp; asProp, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades out the active animation.&lt;br /&gt;
&lt;br /&gt;
# ''asProp'' - The name of the prop&lt;br /&gt;
# ''afFadeTime'' - The fade time between animations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropAnimationSpeed(string&amp;amp; asProp, float afSpeed);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the speed of the animation. Generally used in conjunction with ''PlayPropAnimation''.&lt;br /&gt;
&lt;br /&gt;
# ''asProp'' - The prop that is being animated&lt;br /&gt;
# ''afSpeed'' - The new animation speed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetPropAnimationPosition(string&amp;amp; asProp, float afPos);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Jumps to a specific point in an animation. Generally used in conjunction with ''PlayPropAnimation''.&lt;br /&gt;
&lt;br /&gt;
# ''asProp'' - The prop that is being animated&lt;br /&gt;
# ''afPos'' - The time within the animation, in seconds, to jump to&lt;br /&gt;
&lt;br /&gt;
==== Lamps ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLampFlickerActive(string&amp;amp; asName, bool abActive);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables a flickering effect on a Lamp.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The lamp entity&lt;br /&gt;
# ''abActive'' - Whether to enable flicker&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void FadeLampTo(string&amp;amp; asName, float afR, float afG, float afB, float afA, float afRadius, float afTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fades a Lamp's light to another color. This function uses integers for color values instead of floats, which is a little odd. Likewise, it uses a double floating point for the last argument instead of a regular one.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The lamp to change&lt;br /&gt;
# ''afR'' - Red value (appropriate values are 0 - 10)&lt;br /&gt;
# ''afG'' - Green value (appropriate values are 0 - 10)&lt;br /&gt;
# ''afB'' - Blue value (appropriate values are 0 - 10)&lt;br /&gt;
# ''afA'' - Alpha value (has no effect?)&lt;br /&gt;
# ''afRadius'' - The new radius to use (affects illumination strength)&lt;br /&gt;
# ''afTime'' - Time in seconds until the light properties have changed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetLampCanBeLitByPlayer(string&amp;amp; asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables the player's ability to light a lamp.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The name of the Lamp&lt;br /&gt;
# ''abX'' - State to set&lt;br /&gt;
&lt;br /&gt;
==== Doors ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetSwingDoorOpenAmount(string&amp;amp; asName, float afOpenAmount, float afDuration, bool abOpenTowardsMaxAngle);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the open amount for a SwingDoor.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The SwingDoor entity&lt;br /&gt;
# ''afOpenAmount'' - The new amount state to set. Range: 0 - 1&lt;br /&gt;
# ''afDuration'' - The time in seconds until the door has changed state&lt;br /&gt;
# ''abOpenTowardsMaxAngle'' - If the door will swing to its max angle instead of its min angle&lt;br /&gt;
&lt;br /&gt;
==== Buttons ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetButtonCanBeSwitchedOn(string&amp;amp; asName, bool abCanBeSwitchedOn);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes whether a Button can be switched from off to on.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The Button entity&lt;br /&gt;
# ''abCanBeSwitchedOn'' - Whether it can be switched on&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetButtonCanBeSwitchedOff(string&amp;amp; asName, bool abCanBeSwitchedOff);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes whether a Button can be switched from on to off.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The Button entity&lt;br /&gt;
# ''abCanBeSwitchedOff'' - Whether it can be switched off&lt;br /&gt;
&lt;br /&gt;
==== PhoneBoxes ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StartPhoneRinging(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables a PhoneBox to start ringing. A ringing phone box can be interacted with to play some audio files. After interacting, the phone will stop ringing.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The PhoneBox entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopPhoneRinging(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stops a ringing PhoneBox.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The PhoneBox entity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void HangUpPhone(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hangs up a PhoneBox.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The PhoneBox entity&lt;br /&gt;
&lt;br /&gt;
==== Enemies ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void AddEnemyPatrolNode(string&amp;amp; asName, string&amp;amp; asNodeName, float afWaitTime, string&amp;amp; asAnimation, bool abLoopAnimation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a patrol node to the enemy's walking path. A path is restarted from the beginning when the final node is reached. Note: Inputting an invalid animation in asAnimation at the final node will make the enemy wait there indefinitely.&amp;lt;br /&amp;gt;This function replaces TDD's AddEnemyPatrolNode.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The name of the enemy&lt;br /&gt;
# ''asNodeName'' - Internal name of path node&lt;br /&gt;
# ''afWaitTime'' - The time, in seconds, the enemy waits at this node before continuing. Note: A time of 0 instead randomizes between 1 and 3 seconds, so use 0.01 instead if you want the enemy to immediately continue to the next node.&lt;br /&gt;
# ''asAnimation'' - The animation to play on the enemy when they arrive at this path node. Animations can be found in the Model Editor. Leave empty to play no special animation (uses default Idle animation). Note: If the animation lasts longer than afWaitTime, the enemy waits until the animation is complete before continuing the path.&lt;br /&gt;
# ''abLoopAnimation'' - If the animation should be looped&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyMoveType(string&amp;amp; asName, string&amp;amp; asMoveType);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes how an enemy moves.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The name of the enemy&lt;br /&gt;
# ''asMoveType'' - The type to change to. Can be &amp;quot;WalkBiped&amp;quot;, &amp;quot;RunBiped&amp;quot;, &amp;quot;ChargeBiped&amp;quot;, &amp;quot;Idle&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetManPigType(string&amp;amp; asName, string&amp;amp; asManPigType);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the personality type for a ManPig enemy. Non-functional; left over from an earlier state of development. Only &amp;quot;Freddy&amp;quot; is used as the type, but supposedly it should also accept &amp;quot;Rod&amp;quot; and &amp;quot;Jane&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - The ManPig enemy.&lt;br /&gt;
# ''asManPigType'' - The type to set. Type can be &amp;quot;Freddy&amp;quot;, &amp;quot;Rod&amp;quot;, &amp;quot;Jane&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The three types allegedly describe three different personality types for the AI, according to Peter Howell in [https://researchportal.port.ac.uk/portal/files/3364888/PeterHowell_PhD.pdf his PhD, section 7.4.4].&lt;br /&gt;
&lt;br /&gt;
Extract:&lt;br /&gt;
&lt;br /&gt;
''The initial design of the game’s enemy artificial intelligence system contained three unique sets of behavioural controls. There was only one visual enemy style, however every enemy agent in the game would be assigned one of three possible ‘personalities’, referred to in the game’s code as the ‘Rod’, ‘Jane’ and ‘Freddy’ personality types. These personalities each had a different set of behavioural rules, thus allowing enemy agents that may otherwise appear identical to behave very differently to one another.''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Enemy Agent Personality Type !! Primary Behavioral Traits&lt;br /&gt;
|-&lt;br /&gt;
| Rod || &lt;br /&gt;
*Will maintain a 'safe' distance to the player-character.&lt;br /&gt;
*If unable to do so, will approach player character, investigate them (by getting close and smelling them), before continuing its patrol. &lt;br /&gt;
|-&lt;br /&gt;
| Jane || &lt;br /&gt;
*Will maintain a ‘safe’ distance from player-character, whilst observing the player-character’s movements&lt;br /&gt;
*If unable to maintain ‘safe’ distance, will panic and flee.&lt;br /&gt;
*If cornered and unable to flee, will attack and knock player-character to floor, then flee. &lt;br /&gt;
*Will only attack and kill player-character as a last resort. &lt;br /&gt;
|-&lt;br /&gt;
| Freddy || &lt;br /&gt;
*Will actively hunt the player-character.&lt;br /&gt;
*Will attack and kill them if given the opportunity. &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigFadeDisabled(string&amp;amp; asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should fade the player's view in and out.&lt;br /&gt;
&lt;br /&gt;
#''asName ''- Internal name of the enemy&lt;br /&gt;
#''abX''- Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigSoundDisabled(string&amp;amp; asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should play the proximity sounds.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void SetTeslaPigEasyEscapeDisabled(string&amp;amp; asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enables/disables whether a specified Tesla ManPig should be easier to escape from when hunted. If not disabled, easy escape is activated if the player is more than 12.35 meters away, the enemy can't see the player, and the player has less than 75 health. When this occurs, the enemy is forced to stop hunting and wait for half a second.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
#''abX'' - Enabled/disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ForceTeslaPigSighting(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces a Tesla ManPig to be visible for a short time.&lt;br /&gt;
&lt;br /&gt;
#''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void PlayEnemyAnimation(string&amp;amp; asEnemyName, string&amp;amp; asAnimName, bool abLoop, float afFadeTime);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays a specific animation for an enemy.&lt;br /&gt;
&lt;br /&gt;
# ''asEnemyName'' - Internal name of the enemy (asterisk is allowed)&lt;br /&gt;
# ''asAnimName'' - The name of an animation registered to the enemy&lt;br /&gt;
# ''abLoop'' - Whether the animation loops&lt;br /&gt;
# ''afFadeTime'' - The fade time between animations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void PlayScriptedAnimation(string&amp;amp; asName, string&amp;amp; asAnimationName, bool abLoopAnimation);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plays an animation that has been added to an entity through the Model Editor. Similar to ''PlayEnemyAnimation''.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - Internal name of the enemy&lt;br /&gt;
# ''asAnimationName'' - The animation name&lt;br /&gt;
# ''abLoopAnimation'' - Whether to loop the animation or play it only once&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ChangeEnemyPose(string&amp;amp; asName, string&amp;amp; asPoseType);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the pose for an enemy. Can be either &amp;quot;Biped&amp;quot; or &amp;quot;Quadruped&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - Internal name of the enemy&lt;br /&gt;
# ''asPoseType''  - The pose to change to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void ForceEnemyWaitState(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the enemy's AI to change its state to &amp;quot;Wait&amp;quot;, which makes the enemy wait for a short while before continuing its' normal actions. An enemy without patrol nodes defaults to the &amp;quot;Wait&amp;quot; state. Otherwise, if patrol nodes are added, the enemy will continue the path after waiting is done.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SendEnemyTimeOut(string&amp;amp; asName, float afTimeOut );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the enemy's AI to change its state to &amp;quot;TimeOut&amp;quot;, which forces the enemy to pause.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - Internal name of the enemy&lt;br /&gt;
# ''afTimeOut'' - The length of the time out&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void StopAnimationAndContinue(string&amp;amp; asName, float afTimeOut);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forces the enemy to stop its patrol animation for the specified amount of time.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - Internal name of the enemy&lt;br /&gt;
# ''afTimeOut'' - The length of the time out&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyBlind(string&amp;amp; asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets whether the enemy can see the player if they are within visible range.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - Internal name of the enemy&lt;br /&gt;
# ''abX'' - Whether enemy is blind&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
void SetEnemyDeaf(string&amp;amp; asName, bool abX);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets whether the enemy can hear the player make sound if they are within audible range.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - Internal name of the enemy&lt;br /&gt;
# ''abX'' - Whether enemy is deaf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool GetPlayerCanSeeEnemy(string&amp;amp; asEnemyName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns whether the enemy is within visible range of the player.&lt;br /&gt;
&lt;br /&gt;
# ''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float GetEnemyPlayerDistance(string&amp;amp; asEnemyName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the distance (in meters) between the enemy and the player.&lt;br /&gt;
&lt;br /&gt;
# ''asEnemyName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
int GetEnemyState(string&amp;amp; asName);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the enemy's current state as an integer.&lt;br /&gt;
&lt;br /&gt;
# ''asName'' - Internal name of the enemy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>BoxFigs</name></author>
		
	</entry>
</feed>