Notice: Some of the functions below require the Amnesia 1.3 update. Steam copies should be automatically updated. Other copies can go here.
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.
void OnStart();
The function that runs when the map is loaded for the first time.
void OnEnter();
The function that runs whenever the player enters a map.
void OnLeave();
The function that runs when the player leaves a map.
void OnGameStart();
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 “Start New Game”).
float RandFloat(float afMin, float afMax);
Generates a random float.
int RandInt(int alMin, int alMax);
Generates a random int. Note: the maximum value is inclusive - the RandInt() function may return this value.
bool StringContains(string& asString, string& asSubString);
Checks whether a string contains the specified string.
Example: searching for “hello” in “hello world” would return true.
string& StringSub(string& asString, int alStart, int alCount);
Returns the substring in a string.
Example: in the string “frictional games rocks”, using 4 as alStart and 6 as alCount would return “tional”.
int StringToInt(string&in asString);
Requires 1.3
If possible, returns an integer converted from a string, else returns 0.
float StringToFloat(string&in asString);
Requires 1.3
If possible, returns a float converted from a string, else returns 0.
bool StringToBool(string&in asString);
Requires 1.3
If possible, returns a boolean converted from a string, else returns false.
float MathSin(float afX);
Requires 1.3
Returns the sine of the specified value.
float MathCos(float afX);
Requires 1.3
Returns the cosine of the specified value.
float MathTan(float afX);
Requires 1.3
Returns the tangent of the specified value.
float MathAsin(float afX);
Requires 1.3
Returns the arc sine of the specified value.
float MathAcos(float afX);
Requires 1.3
Returns the arc cosine of the specified value.
float MathAtan(float afX);
Requires 1.3
Returns the arc tangent of the specified value.
float MathAtan2(float afX, float afY);
Requires 1.3
Calculates and returns the arc tangent of the specified values.
float MathSqrt(float afX);
Requires 1.3
Returns the square root of the specified value.
float MathPow(float afBase, float afExp);
Requires 1.3
Returns the value of afBase raised to the power of afExp.
float MathMin(float afA, float afB);
Requires 1.3
Returns the lowest value.
float MathMax(float afA, float afB);
Requires 1.3
Returns the highest value.
float MathClamp(float afX, float afMin, float afMax);
Requires 1.3
Returns afX clamped between afMin and afMax. If afX < afMin, returns afMin, and if afX > afMax, returns afMax.
float MathAbs(float afX);
Requires 1.3
Returns the absolute value.
void Print (string& asString);
Prints a string to the log file (hpl.log
).
void AddDebugMessage(string& asString, bool abCheckForDuplicates);
Prints a string to the debug console.
void ProgLog(string& asLevel, string& asMessage);
Prints an entry to the ProgLog (progression log).
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.
This function allows to log custom messages.The messages in the ProgLog file are sorted by time elapsed since a map was loaded.
ProgLog has to be enabled for a player profile in user_settings.cfg
before it starts working.
bool ScriptDebugOn();
Checks whether the debug mode is enabled.
See Setting up Development Environment to setup debug mode on your own computer.
Local variables can be used throughout the same script file.
void SetLocalVarInt(string& asName, int alVal); void AddLocalVarInt(string& asName, int alVal); int GetLocalVarInt(string& asName);
void SetLocalVarFloat(string& asName, float afVal); void AddLocalVarFloat(string& asName, float afVal); float GetLocalVarFloat(string& asName);
void SetLocalVarString(string& asName, const string& asVal); void AddLocalVarString(string& asName, string& asVal); string& GetLocalVarString(string& asName);
Global variables can be used throughout several maps and can be accessed by several script files.
void SetGlobalVarInt(string& asName, int alVal); void AddGlobalVarInt(string& asName, int alVal); int GetGlobalVarInt(string& asName);
void SetGlobalVarFloat(string& asName, float afVal); void AddGlobalVarFloat(string& asName, float afVal); float GetGlobalVarFloat(string& asName);
void SetGlobalVarString(string& asName, const string& asVal); void AddGlobalVarString(string& asName, string& asVal); string& GetGlobalVarString(string& asName);
void PreloadParticleSystem(string& asPSFile);
Preloads a particle system.
void CreateParticleSystemAtEntity(string& asPSName, string& asPSFile, string& asEntity, bool abSavePS);
Creates a particle system on an entity.
void CreateParticleSystemAtEntityExt(string& asPSName, string& asPSFile, string& asEntity, bool abSavePS, float afR, float afG, float afB, float afA, bool abFadeAtDistance, float afFadeMinEnd, float afFadeMinStart, float afFadeMaxStart, float afFadeMaxEnd);
Creates a particle system on an entity, extended method with more options.
void DestroyParticleSystem(string& asName);
Destroys a particle system.
void PreloadSound(string& asSoundFile);
Preloads a sound.
void PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);
Creates a sound on an entity.
true
, a looping sound will “remember” 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!void FadeInSound(string& asSoundName, float afFadeTime, bool abPlayStart);
Fades in a sound.
void StopSound(string& asSoundName, float afFadeTime);
Fades out a sound.
void PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);
Plays music.
true
, playback will be continued from where the track stopped after the call to StopMusic(); if false
, the track will be restarted.void StopMusic(float afFadeTime, int alPrio);
Stops music.
void FadeGlobalSoundVolume(float afDestVolume, float afTime);
Influences the global sound volume, that means everything you can hear from the world. This does not affect music of GUI sounds.
void FadeGlobalSoundSpeed(float afDestSpeed, float afTime);
Influences the global sound speed.
void SetLightVisible(string& asLightName, bool abVisible);
Enables/disables lights.
void FadeLightTo(string& asLightName, float afR, float afG, float afB, float afA, float afRadius, float afTime);
Changes the properties of a light.
void SetLightFlickerActive(string& asLightName, bool abActive);
Activates flickering on a light.
void StartCredits(string& asMusic, bool abLoopMusic, string& asTextCat, string& asTextEntry, int alEndNum);
Starts the end credits screen.
void StartDemoEnd();
Starts the end images that are used in the demo, images are named “demo_end01.jpg”, increase the number for each image you want to use. (NEEDS VERIFICATION)
void AutoSave();
Save the game to the auto save.
void CheckPoint (string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry);
Sets a checkpoint at which the player will respawn in case he dies.
Callback syntax: void MyFunc(string &in asName, int alCount)
Count is 0 on the first checkpoint load!
void ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);
Immediatly loads another map.
void ClearSavedMaps();
Clears the “history” 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.
void CreateDataCache(); void DestroyDataCache();
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.
void SetMapDisplayNameEntry(string& asNameEntry);
Sets the map name shown in save file names. If none is set NULL is assumed.
void SetSkyBoxActive(bool abActive);
Enables/Disables the skybox.
void SetSkyBoxTexture(string& asTexture);
Sets the texture of the skybox.
void SetSkyBoxColor(float afR, float afG, float afB, float afA);
Sets the solid color of the skybox rather than a texture.
void SetFogActive(bool abActive);
Enables/Disables the global fog.
void SetFogColor(float afR, float afG, float afB, float afA);
Sets the color to use for the global fog.
void SetFogProperties(float afStart, float afEnd, float afFalloffExp, bool abCulling);
Sets the properties for the global fog.
void SetupLoadScreen(string&asTextCat, string&asTextEntry, int alRandomNum, string&asImageFile);
Determines which loading screen will be shown when changing maps.
void AddTimer(string& asName, float afTime, string& asFunction);
Creates a timer which calls a function when it expires.
Callback syntax: void MyFunc(string &in asTimer)
void RemoveTimer(string& asName);
Removes a timer, no matter how much time is left.
float GetTimerTimeLeft(string& asName);
Returns the time left on a timer.
void FadeOut(float afTime);
Fades the screen to black.
afTime - time in seconds until the screen is completly black
void FadeIn(float afTime);
Fades the screen back to normal.
afTime - time in seconds until the screen back to normal
void FadeImageTrailTo(float afAmount, float afSpeed);
Applies the image trail effect to the screen.
afAmount - intensity (default: 0)
afSpeed - time in seconds until full effect
void FadeSepiaColorTo(float afAmount, float afSpeed);
Makes the screen go dark red.
afAmount - intensity (default: 0)
afSpeed - time in seconds until full effect
void FadeRadialBlurTo(float afSize, float afSpeed);
Applies radial blur effects to the screen.
afSize - intensity (default: 0)
afSpeed - time in seconds until full effect
void SetRadialBlurStartDist(float afStartDist);
Determines at which distance the radial blur effects appear.
afStartDist - the distance at which the effect starts
void StartEffectFlash(float afFadeIn, float afWhite, float afFadeOut);
Fades the screen to white.
afFadeIn - time in seconds until screen is white
afWhite - determines to which percentage the screen fades to white (1.0 = completly white)
afFadeOut - time in seconds until screen is back to normal again
void StartEffectEmotionFlash(string& asTextCat, string& asTextEntry, string& asSound);
Fades the screen to white and shows a text message.
asTextCat - the category in the .lang file
asTextEntry - the text entry in the .lang file
asSound - the sound to play while fading
void AddEffectVoice(string& asVoiceFile, string& asEffectFile, string& asTextCat, string& asTextEntry, bool abUsePosition, string& asPosEntity, float afMinDistance, float afMaxDistance);
This adds a voice and an 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.
asVoiceFile - the voice to play
asEffectFile - the effect to play
asTextCat - the category in the .lang file
asTextEntry - the text entry in the .lang file
abUsePosition - plays using 3D from the entity, or without 3D
asPosEntity - the entity at which the effect appears
afMinDistance - minimum distance to see the effect
afMaxDistance - maximum distance to see the effect
void StopAllEffectVoices(float afFadeOutTime);
Stops all voices and calls the EffectVoiceOverCallback.
bool GetEffectVoiceActive();
Checks whether EffectVoices are still active.
void SetEffectVoiceOverCallback(string& asFunc);
Sets the function to be called when the EffectVoices are finished.
Callback syntax: void MyFunc()
bool GetFlashbackIsActive();
Checks whether a flashback is still in effect.
void StartPlayerSpawnPS(string& asSPSFile); void StopPlayerSpawnPS();
Continuously spawn regular particle systems (.ps
) around the player. Particles created by this script carry over from map to map.
asSPSFile - the .sps
file to use. Exemplary .sps
files are located in the /misc
folder in the main game directory.
Custom .sps
files can be created by hand in a text editor (see existing ones and mimic how those are written).
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.
void PlayGuiSound(string& asSoundFile, float afVolume);
Plays a sound, not using 3D.
asSoundFile - the sound to play (extension is .snt)
afVolume - the volume of the sound
void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);
Shakes the screen.
afAmount - intensity of the shake
afTime - duration of the shake
afFadeInTime - time in seconds until full intensity is reached
afFadeOutTime - time until screen is back to normal
void SetInDarknessEffectsActive(bool abX);
Requires 1.3
Enables/disables the sanity drain and night vision effects while in the darkness.
bool abX - Enable/disable effects.
void SetInsanitySetEnabled(string& asSet, bool abX);
Determines which InsanitySets are enabled.
asSet - the set
abX - enabled or not
void StartInsanityEvent(string &in asEventName);
Requires 1.3
Starts a specified insanity event.
asEventName - Insanity event to play.
void StartRandomInsanityEvent();
Starts a random insanity event from the available sets.
void StopCurrentInsanityEvent();
Requires 1.3
Stops the currently playing insanity event.
void InsanityEventIsActive();
Checks whether an insanity event is currently in effect… Or so it was supposed to be, but as it doesn't return a value, we can never know
Note that the player's maximum health and sanity is 100.
void SetPlayerActive(bool abActive);
Enabled/Disable player controlled movement.
void ChangePlayerStateToNormal();
Sets certain effects back to normal. It can for example make the player drop an item.
void SetPlayerCrouching(bool abCrouch);
Forces the player to crouch.
void AddPlayerBodyForce(float afX, float afY, float afZ, bool abUseLocalCoords);
Pushes the player into a certain direction. Note that you need values above ~2000 to see any effects.
afX - amount along the X-axis
afY - amount along the Y-axis
afZ - amount along the Z-axis
abUseLocalCoords - If true, axes are based on where the player is facing, not the world.
void ShowPlayerCrossHairIcons(bool abX);
Enables/Disables the icons when a player has something in focus.
void SetPlayerSanity(float afSanity); void AddPlayerSanity(float afSanity); float GetPlayerSanity();
Modifies/returns the sanity of the player.
void SetPlayerHealth(float afHealth); void AddPlayerHealth(float afHealth); float GetPlayerHealth();
Modifies/returns the health of the player.
void SetPlayerLampOil(float afOil); void AddPlayerLampOil(float afOil); float GetPlayerLampOil();
Modifies/returns the lamp oil of the player.
float GetPlayerSpeed(); float GetPlayerYSpeed();
Returns the current speed of the player.
void SetSanityDrainDisabled(bool abX);
Enables/Disables sanity drain from darkness, monsters, etc.
void GiveSanityBoost(); void GiveSanityBoostSmall();
Boosts the player's sanity by a fixed amount.
void GiveSanityDamage(float afAmount, bool abUseEffect);
Reduces the sanity of the player.
afAmount - amount of sanity damage done
abUseEffect - determines whether an effect is played when the sanity damage is dealt
void GivePlayerDamage(float afAmount, string& asType, bool abSpinHead, bool abLethal);
Reduces the health of the player.
afAmount - amount of damage done to health
asType - plays a certain effect on the screen when the damage is dealt (BloodSplat, Claws or Slash)
abSpinHead - changes the camera view when damage is dealt
abLethal - set to true if player can die from given damage
void FadePlayerFOVMulTo(float afX, float afSpeed);
Changes the field of view of the player. A shorter FOV will create a zoom effect.
afX - multiplier of default FOV (1 is default)
afSpeed - the speed of change between FOV's
void FadePlayerAspectMulTo(float afX, float afSpeed);
Changes the aspect ratio of the player. Basically stretches or narrows the screen horizontally.
afX - multiplier of default aspect (default is 1)
afSpeed - the speed of change between FOV's
void FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed);
Rotates the position of the camera on the player's body.
afX - angle of rotation of head, positive being counter-clockwise
afSpeedMul - speed (possibly acceleration) multiplier of the rotation (default 1, which is really slow)
afMaxSpeed - maximum speed of rotation
void MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist);
Changes the position of the camera on the player's body.
afX - amount along the X-axis
afY - amount along the Y-axis
afZ - amount along the Z-axis
afSpeed - speed at which the change happens
afSlowDownDist - distance at which to start slowing down (prevents the head from abruptly stopping)
void StartPlayerLookAt(string& asEntityName, float afSpeedMul, float afMaxSpeed, string& asAtTargetCallback); void StopPlayerLookAt();
Forces the player to look at a certain entity until StopPlayerLookAt is used.
asEntityName - the entity to look at
afSpeedMul - how fast should the player look at the entity
afMaxSpeed - maximum speed allowed
asAtTargetCallback - function to call when player looks at target
void SetPlayerMoveSpeedMul(float afMul); void SetPlayerRunSpeedMul(float afMul); void SetPlayerLookSpeedMul(float afMul);
Changes the player's move/run/look speed. Default is 1.
void SetPlayerJumpForceMul(float afMul);
Requires 1.3
Changes the player's jump multiplier. Higher values = higher jumps. Default is 1.
void SetPlayerJumpDisabled(bool abX); void SetPlayerCrouchDisabled(bool abX);
Enables/Disables the player's ability to jump/crouch.
void TeleportPlayer(string& asStartPosName);
Instantly teleports the player to the target StartPos.
void SetLanternActive(bool abX, bool abUseEffects);
Makes the player use his lantern.
bool GetLanternActive();
Checks whether the player currently uses his lantern.
void SetLanternDisabled(bool abX);
Enables/Disables the player's ability to use his lantern.
void SetLanternLitCallback(string& asCallback);
Sets the function to call when the player uses his lantern.
Callback syntax: MyFunc(bool abLit)
void SetMessage(string& asTextCategory, string& asTextEntry, float afTime);
Displays a message on the screen.
asTextCategory - the category in the .lang file
asTextEntry - the entry in the .lang file
afTime - determines how long the message is displayed. If time is < =0 then the life time is calculated based on string length.
void SetDeathHint(string& asTextCategory, string& asTextEntry);
Sets the message that appears when the player dies.
asTextCategory - the category in the .lang file
asTextEntry - the entry in the .lang file
void DisableDeathStartSound();
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.
void MovePlayerForward(float afAmount)
“REQUIRES THE 1.2 PATCH: JUSTINE” Moves the player forward. It needs to be called in a timer that updates 60 times / second.
void SetPlayerFallDamageDisabled(bool abX);
Requires 1.3
Enables/disables the player's ability to take fall damage.
void SetPlayerPos(float afX, float afY, float afZ);
Requires 1.3
Sets the player's position within the level.
afX - X co-ordinate position.
afY - Y co-ordinate position.
afZ - Z co-ordinate position.
float GetPlayerPosX(); float GetPlayerPosY(); float GetPlayerPosZ();
Requires 1.3
Returns the player's position within the level on the specified axis.
void AddNote(string& asNameAndTextEntry, string& asImage);
Adds a note to the player's journal.
asNameAndTextEntry - entries in the .lang file. Must end with _Name and _Text and be in category “Journal”!
asImage - the background image to be used
void AddDiary(string& asNameAndTextEntry, string& asImage);
Adds a diary to the player's journal.
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 “Journal”!
asImage - the background image to be used
void ReturnOpenJournal(bool abOpenJournal);
Only called in the pickup diary callback! If true the journal displays the entry else not.
void AddQuest(string& asName, string& asNameAndTextEntry);
Adds a quest to the player's journal.
asName - the internal name to be used
asNameAndTextEntry - entry in the .lang file. Must start with “Quest_<texthere>_Text”, and be in category “Journal”!
void CompleteQuest(string& asName, string& asNameAndTextEntry);
Completes a quest.
asName - the internal name of the quest
asNameAndTextEntry - entry in the .lang file. Must start with ” Quest_<texthere>_Text ”, and be in category “Journal”!
bool QuestIsCompleted(string& asName); bool QuestIsAdded(string& asName);
Checks whether a quest is completed/added.
void SetNumberOfQuestsInMap(int alNumberOfQuests);
Sets the number of quests in the map.
alNumberOfQuests - Amount of Quests
void GiveHint (string& asName, string& asMessageCat, string& asMessageEntry, float afTimeShown);
Displays a hint on the player's screen.
asName - the internal name
asMessageCat - the category in the .lang file
asMessageEntry - the entry in the .lang file
afTimeShown - time in seconds until the message disappears. If time is ⇐ 0 then the life time is calculated based on string length.
void RemoveHint (string& asName); void BlockHint (string& asName); void UnBlockHint (string& asName);
Removes\Blocks\Unblocks a hint.
void ExitInventory();
Exits the inventory by force.
void SetInventoryDisabled(bool abX);
Disables the player's ability to open his inventory.
void SetInventoryMessage(string& asTextCategory, string& asTextEntry, float afTime);
Adds a message at the bottom of the inventory screen.
asTextCategory - the category in the .lang file
asTextEntry - the entry in the .lang file
afTime - time in seconds until the message disappears. If life time is ⇐ 0 then the life time is calculated based on string length.
void GiveItem(string& asName, string& asType, string& asSubTypeName, string& asImageName, float afAmount);
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.
asName - internal name
asType - item to give
asSubTypeName - item name for .lang file
asImageName - For exemple: void GiveItem(string& asName, string& asType, “chemical_container_full”, “chemical_container_full.tga” , float afAmount); The image is from <nowiki> <nowiki> <nowiki>\ </nowiki> </nowiki> </nowiki> graphics\Item\chemical_container_full.tga : is the image which will appear in Inventory - img155.imageshack.us/img155/6871/20806785.jpg
afAmount - amount to give
void RemoveItem(string& asName);
Removes an item from the player's inventory.
bool HasItem(string& asName);
Checks whether the player has an item in his inventory.
void GiveItemFromFile(string& asName, string& asFileName);
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.
asName - internal name
asFileName - item to give + extension (.ent)
void AddCombineCallback(string& asName, string& asItemA, string& asItemB, string& asFunction, bool abAutoRemove);
Allows the player to combine items in his inventory.
Callback syntax: void MyFunc(string &in asItemA, string &in asItemB)
asName - internal name for the callback
asItemA - internal name of first item
asItemB - internal name of second item
asFunction - the function to call
abAutoRemove - determines whether the callback should be removed when the items are combined
void RemoveCombineCallback(string& asName);
Removes a combine callback.
asName - the internal name of the callback to be removed (as specified in AddCombineCallback)
void AddUseItemCallback(string& asName, string& asItem, string& asEntity, string& asFunction, bool abAutoDestroy);
Allows the player to use items on the world.
Callback syntax: void MyFunc(string &in asItem, string &in asEntity)
asName - internal name
asItem - internal name of the item
asEntity - entity to be able to use the item on
asFunction - function to call
abAutoDestroy - determines whether the item is destroyed when used
void RemoveUseItemCallback(string& asName);
Removes an item callback.
void SetEntityActive(string& asName, bool abActive);
Activates/deactivates an entity.
void SetEntityVisible(string &in asName, bool abVisible);
Requires 1.3
Activates/deactivates an entity's visual mesh. The collision body remains.
asName - Name of the entity.
abActive - Activate/deactivate mesh.
bool GetEntityExists(string& asName);
Checks whether an entity exists.
void SetEntityCustomFocusCrossHair(string& asName, string& asCrossHair);
Changes the crosshair that is used when focusing an entity.
asName - internal name
asCrossHair - desired crosshair, can be: Default (uses default), Grab, Push, Ignite, Pick, LevelDoor, Ladder
void CreateEntityAtArea(string& asEntityName, string& asEntityFile, string& asAreaName, bool abFullGameSave);
Creates an entity at an area. When creating an enemy though, it cannot chase properly along PathNodes(using for example ShowEnemyPlayerPosition).
asEntityName - internal name
asEntityFile - entity to be used extension .ent
asAreaName - the area to create the entity at
abFullGameSave - determines whether an entity “remembers” its state
void ReplaceEntity(string &in asName, string &in asBodyName, string &in asNewEntityName, string &in asNewEntityFile, bool abFullGameSave);
Requires 1.3
Removes an entity and places a new one in its place.
asName - Name of the entity to replace.
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).
asNewEntityName - Name of the new entity.
asNewEntityFile - Name of the new entity file. Extension .ent.
abFullGameSave - Whether ALL properties of this entity should be saved throughout levels.
void PlaceEntityAtEntity(string &in asName, string &in asTargetEntity, string &in asTargetBodyName, bool abUseRotation);
Requires 1.3
Places an entity at the position of another entity. Does not work for enemies, use TeleportEnemyToEntity instead.
asName - Name of the entity to place.
asTargetEntity - Name of the other entity to place the first entity at.
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).
abUseRotation - Whether the entity should be rotated like the target entity.
void SetEntityPos(string &in asName, float afX, float afY, float afZ);
Requires 1.3
Moves an entity to a position in the level.
asName - Name of the entity to move.
afX - X co-ordinate position.
afY - Y co-ordinate position.
afZ - Z co-ordinate position.
float GetEntityPosX(string &in asName); float GetEntityPosY(string &in asName); float GetEntityPosZ(string &in asName);
Requires 1.3
Returns an entity's position in the level on the specified axis.
asName - Name of the entity.
void SetEntityPlayerLookAtCallback(string& asName, string& asCallback, bool abRemoveWhenLookedAt);
Calls a function when the player looks at a certain entity.
Callback syntax: void MyFunc(string &in asEntity, int alState)
alState: 1 = looking, -1 = not looking
asName - internal name
asCallback - function to call
abRemoveWhenLookedAt - determines whether the callback should be removed when the player looked at the entity
void SetEntityPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction);
Calls a function when the player interacts with a certain entity.
Callback syntax: void MyFunc(string &in asEntity)
asName - internal name
asCallback - function to call
abRemoveOnInteraction - determines whether the callback should be removed when the player interacts with the entity
void SetEntityCallbackFunc(string& asName, string& asCallback);
Calls a function when the player interacts with a certain entity.
Callback syntax: void MyFunc(string &in asEntity, string &in type)
Type depends on entity type and includes: “OnPickup”, “Break”, “OnIgnite”, etc
void SetEntityConnectionStateChangeCallback(string& asName, string& asCallback);
A callback called when ever the connection state changes (button being switched on, lever switched, etc).
Callback syntax: void Func(string &in asEntity, int alState)
alState: -1 = off, 0 = between, 1 = on
void SetEntityInteractionDisabled //