Currently the engine uses fbx sdk 2012 which isn't avalable anymore which means the engine wont compile. If you want to give a shot anyway you can find the sdk here: https://www.autodesk.com/fbx
Other than that, here is almost everything you need to build Amnesia: The Dark Descent. Included are project files for Visual Studio 2010 and CMake for Linux & macOS.
We encourage everyone to contribute code to this project, so just sign up for a github account, create a fork and hack away at the codebase.
All code is under the GPL Version 3 license. Read the LICENSE file for terms of use of the license.
Local variables can be used throughout the same script file.
void SetLocalVarBool(string &in asName, bool abVal);
bool GetLocalVarBool(string& asName)
Global variables can be used throughout several maps and can be accessed by several script files.
void SetGlobalVarBool(string &in asName, bool abVal);
bool GetGlobalVarBool(string& asName)
void SetProgLogTimerActive(bool abTimerActive);
Sets the ending to be in-game timer to be active.
- abTimerActive - Sets the in-game timer to be either on or off
void DisplayCounterTimer(bool abDisplayTimer);
Should the in-game timer be displayed on screen.
- abDisplayTimer - Enables/disables in-game timer display
void DisplayCounterSettings(float afX, float afY, float afZ, float afR, float afG, float afB, float afA, float afTimerSize, string& asTimerAlign);
Additional settings for the in-game timer display.
- afX - The X position of the timer
- afY - The Y position of the timer
- afZ - The Z position of the timer
- afR - The Red color value of the timer text
- afG - The Green color value of the timer text
- afB - The Blue color value of the timer text
- afTimerSize - How big should the timer text should be
- asTimerAlign - Which side of the screen should the timer should be displayed at; can be either "Left","Right" or "Center".
int GetCurrentInGameHour();
int GetCurrentInGameMin();
int GetCurrentInGameSec();
Returns either the in-game hour, minute or second.
StartCreditsAndRankScreen(string& asMusicCredits, bool abLoopMusicCredits, string& asTextCat, string& asTextEntry, bool abCreditsBackground, string& asMusicRank, bool abLoopMusicRank, float afRankMusicVol, float afRankMusicFade, string& asImageName);
Starts the credits as well as the rank screen at the end of it.
- asMusicCredits - The music to play during the credits
- abLoopMusicCredits - Whether the credits music should loop
- asTextCat - The category to be used in the .lang file for the credits
- asTextEntry - The entry in the .lang file for the credits
- abCreditsBackground - Should the credits background should be displayed
- asMusicRank - The music to play during the rank screen
- abLoopMusicRank - Whether the rank screen music should loop
- afRankMusicVol - Sets the volume for rank screen music
- afRankMusicFade - Sets the time for rank screen music to fade in
- asImageName - What image to display during the rank screen.
void StartRankScreen(string& asMusic, bool abLoopMusic, float afRankMusicVol, float afRankMusicFade, string& asImageName);
Starts the rank screen.
- asMusic - The music to play during the rank scrren
- abLoopMusic - Whether the music should loop
- afRankMusicVol - Sets the volume for rank screen music
- afRankMusicFade - Sets the time for rank screen music to fade in
- asImageName - What image to display during the rank screen.
SetEnding(string& asEnding, bool abCompletedOnHardMode);
Sets the ending to be written as completed in the user_endings.cfg in the player's save folder and if they completed it on Hard Mode or not.
- asEnding - Which Ending type to use, can be either "DefaultGood", "DefaulBad", "GoodJoke" or "BadJoke".
- abCompletedOnHardMode - If the game was completed on Hard Mode or not
bool GetEndingCompletion(string& asEndingType);
Returns if the player got a certain ending.
string& GetPreviousEnding();
Returns the most recent ending obtained.
int GetGameClears();
Returns the amount of times the player has beaten the game.
DoHardModeSave();
Saves the game in Hard Mode.
bool HardModeEnabled();
Returns if the game is being played in Hard Mode or not.
void ForceExitDirectlyToMenu();
Forces the game to exit to the main menu.
bool GetPlayerCrouching();
Returns if the player is crouching or not.
void SetCustomTextMessage(string &in asTextCategory, string &in asTextEntry, float afX, float afY, float afZ, float afR, float afG, float afB, float afTime);
Extended version of the original SetMessage function, displays a message on the screen with custom positions and coloring.
- asTextCategory - the category in the .lang file
- asTextEntry - the entry in the .lang file
- afX - X-axis position of the text on the screen
- afY - Y-axis position of the text on the screen
- afZ - Z-axis position of the text on the screen
- afR - Red color value of the text on the screen
- afG - Green color value of the text on the screen
- afB - Blue color value of the text on the screen
- afTime - determines how long the message is displayed. If time is < =0 then the life time is calculated based on string length.
void StartCustomPauseMessage(string &in asMainTextCategory, string &in asMainTextEntry, bool abMultipleButtons, string &in asButton1TextCat, string &in asButton1TextEnt, string &in asButton2TextCat, string &in asButton2TextEnt, string &in asCallback);
Starts a custom message prompt on the screen that pauses the game until a button(s) is pressed/selected.
- asMainTextCategory - The category in the .lang file for the main text of the prompt
- asMainTextEntry - The entry in the .lang file for the main text of the prompt
- abMultipleButtons - If set to True - allows up to two buttons to be selected, handy for Yes/No-style prompts. If False - only one button displayed.
- asButton1TextCat - The category in the .lang file for the text on Button 1 - REQUIRED if abMultipleButtons is set to either True or False.
- asButton1TextEnt - The entry in the .lang file for the text on Button 1 - REQUIRED if abMultipleButtons is set to either True or False.
- asButton2TextCat - The category in the .lang file for the text on Button 2 - REQUIRED if abMultipleButtons is set to True.
- asButton2TextEnt - The entry in the .lang file for the text on Button 2 - REQUIRED if abMultipleButtons is set to True.
- asCallback - The function to call when one of the Buttons is pressed.
void StartCustomColorEffectFlash(float afR, float afG, float afB, float afA, float afFadeIn, float afFadeOut);
Fades the screen to a custom color.
- afR - Red color value of the screen flash
- afG - Green color value of the screen flash
- afB - Blue color value of the screen flash
- afA - Alpha value of the screen flash
- afFadeIn - time in seconds until the effect is started
- afFadeOut - time in seconds until screen is back to normal again
void ShowScreenImage(string &in asImageName, float afX, float afY, float afScale, bool abUseRelativeCoordinates, float afDuration, float afFadeIn, float afFadeOut);
Shows a 2D image on the screen
- asImageFile - The image file to show. Does not have to be pow2 (although it gives a warning if not)
- 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.
- afY - The Y position of the top left corner, starting from the center of the screen.
- afScale - The scale of the image file, use -1 to display the image with it's original size
- abUseRelativeCoordinates - If the relative coordinates of the screen size should be use?
- afDuration - How long, in seconds, the image displays. This does not include fade times
- afFadeIn - How long, in seconds, the fade in spends
- afFadeOut - How long, in seconds, the fade out spends
void HideScreenImageImmediately();
Instantly hides an image being shown from ShowScreenImage.
void HideScreenImageWithFade(float afFadeOut);
Simliar to HideScreenImageImmediately but allows you to fade out the image instead.
- afFadeOut - How long, in seconds that it takes the image to fade out
void AttachAreaToProp(string& asAreaName, string& asProp, int alBody);
Attaches an area to a prop.
- asAreaName - The area to attach
- asProp - The prop to attach area to
- alBody - Body of the prop to attach the area to
float GetEntitiesDistance(string& asEntityA, string& asEntityB);
Returns the distance between two entities.
- asEntityA - The name of the first entity
- asEntityB - The name of the second entity
float GetEntityRotationX(string &in asName, int body);
float GetEntityRotationY(string &in asName, int body);
float GetEntityRotationZ(string &in asName, int body);
Returns the distance between two entities. Function by NB-Nutboi.
- asName - Name of the entity to get the rotation from
- body - The body of the entity to get the rotation from (if you're not sure, go with 0)
void SetEntityRotation(string &in asName, float afrX, float afrY, float afrZ, int body);
It will set the world rotation for the entity body selected. Function by NB-Nutboi.
- asName - name of the entity
- afrX - rotation in the X axis that should be set
- afrY - rotation in the Y axis that should be set
- afrZ - rotation in the Z axis that should be set
- afpX - position in the X axis that should be set
- afpY - position in the Y axis that should be set
- afpZ - position in the Z axis that should be set
- body - body of the entity that the rotation should be applied to (if you're not sure, go with 0)
float GetBonePosX(string &in asEntity, string &in asBone);
float GetBonePosY(string &in asEntity, string &in asBone);
float GetBonePosZ(string &in asEntity, string &in asBone);
You can get the specific location of bones. Function by NB-Nutboi.
- asEntity - Name of the entity (must have a skeleton)
- asBone - name of the bone in the entity (get with the ModelEditor)
void SetSwingDoorOpenAmount(string& asName, float afOpenAmount, float afDuration, bool abOpenTowardsMaxAngle);
Sets the open amount for a swing door.
- asName - The name of the he SwingDoor entity
- afOpenAmount - The new amount state to set. Range: 0 - 1
- afDuration - The time in seconds until the door has changed state
- abOpenTowardsMaxAngle - If the door should open turns the max angle
void StopPropAnimation(string& asProp);
Stops the animation currently playing on a prop. Animations can be started with PlayPropAnimation.
- asProp - The name of the entity/prop
void SetPropAnimationSpeed(string& asProp, float afSpeed);
Sets the speed of an animation currently playing on a prop or entity.
- asProp - The name of the entity/prop
- afSpeed - The speed that the animation should go at, default is 1
void SetPropAnimationPosition(string& asProp, float afPos);
Jumps to a specifc point in an animation. Generally used in conjunction with PlayPropAnimation.
- asProp - The entity that is being animated
- afPos - The time within the animation, in seconds, to jump to
void PlayCurrentAnimation(string& asProp, float afFadeTime, bool abLoop);
Simliar to PlayPropAnimation but can be used to "unpause" an animation on a entity if StopPropAnimation or PauseCurrentAnimation has been called beforehand.
- asProp - The entity that is being animated
- afFadeTime - The transition time until the animation starts playing normally again
- abLoop - If the animation should loop or not
void PauseCurrentAnimation(string& asProp, float afFadeTime);
Simliar to StopPropAnimation but allows for a "transition" effect before the animation fully stops.
- asProp - The entity that is being animated
- afFadeTime - The transition time until the animation is fully paused.
void SetEnemyBlind(string& asName, bool abX);
Sets whether the enemy can see the player if they are within visible range.
- asName - Internal name of the enemy
- abX - Whether enemy is blind
void SetEnemyDeaf(string& asName, bool abX);
Sets whether the enemy can hear the player make sound if they are within audible range.
- asName - Internal name of the enemy
- abX - Whether enemy is deaf
void SetEnemyEndOfPatrolCallback(string& asName, string& asFunc, bool abRemoveWhenCalled);
Sets the function to be called when an enemy reaches the end of it's patrol.
- asName - Internal name of the enemy
- asFunc - Function to be called, Callback syntax: void MyFunc()
- abRemoveWhenCalled- determines whether the callback should be removed when the enemy reaches the end of it's path.
void MakeEnemySearchPosition(string& asName, float afX, float afY, float afZ);
Gets an enemy to search a position without searching where the player exactly is. Make sure that nodes are placed in the level!
- asName - Internal name of the enemy
- afX - X axis of the position
- afY- Y axis of the position
- afZ- Z axis of the position.
void ChangeEnemyState(string& asName, string& asState);
Changes the AI state of a specified enemy.
- asName - Internal name of the enemy
- asState - desired state, can be: Patrol, Investigate Idle, Wait, Alert, Hunt, HuntPause, HuntWander and Hurt
void GetEnemyPreviousState(string& asName);
Gets the last state that the enemy was in
- asName - Internal name of the enemy
void ForceEnemyWaitState(string& asName);
Forces the enemy's AI to change the state to "Wait" which makes the enemy wait for a short while before continuing its' normal actions. An enemy without patrol nodes defaults to the "Wait" state. Otherwise, if patrol nodes are added, the enemy will continue the path after waiting is done.
- asName - Internal name of the enemy
float GetEnemyPlayerDistance(string& asEnemyName);
Returns the distance (in HPL units) between the enemy and the player.
- asEnemyName - Internal name of the enemy
bool GetPlayerCanSeeEnemy(string& asEnemyName);
Returns whether the enemy is within visible range of the player.
- asEnemyName - Internal name of the enemy
void PlayEnemyAnimation(string& asEnemyName, string& asAnimName, bool abLoop, float afFadeTime);
Plays a specific animation for an enemy.
- asEnemyName - Internal name of the enemy (asterisk is allowed)
- asAnimName - The name of an animation registered to the enemy
- abLoop - Whether the animation loops
- afFadeTime - The transition time until the animation starts fully playing
void ChangeEnemyPatrolSpeed(string& asName, string& asSpeedType);
Changes the patrol speed of a specified enemy.
- asName - Internal name of the enemy
- asSpeedType - Name of the Patrol Speed to use. Can be "Run" or "Walk"
void SetEnemyRunSpeedMul(string& asName, float afRunSpeedMul);
float GetEnemyRunSpeedMul(string& asName);
Modifies/returns how much an enemy's run speed is multiplied by.
- asName - Internal name of the enemy
- afRunSpeedMul - The amount to multiply the run speed with
void SetEnemyDamageMul(string& asName, float afDamageMul);
float GetEnemyDamageMul(string& asName);
Modifies/returns how much an enemy's damage does.
- asName - Internal name of the enemy
- afRunSpeedMul - The amount to multiply the damage amount with
void SetEnemySearchTime(string& asName, float afSearchTime);
float GetEnemySearchTime(string& asName);
Modifies/returns how much time an enemy spends in it's Search state.
- asName - Internal name of the enemy
- afSearchTime - The amount of time an enemy spends in it's Search state
void SetEnemyHealth(string& asName, float afHealth);
float GetEnemyHealth(string& asName);
Modifies/returns the amount of health for a specific enemy.
- asName - Internal name of the enemy
- afHealth - The amount of health to change to
void SetEnemyHearVolume(string& asName, float afHearVolume);
float GetEnemyHearVolume(string& asName);
Modifies/returns the amount of volume needed for an enemy to hear sounds.
- asName - Internal name of the enemy
- afHearVolume - The hearing volume to change to
void SetEnemyRegenHealthSpeed(string& asName, float afRegenHealthSpeed);
float GetEnemyRegenHealthSpeed(string& asName);
Modifies/returns how quickly a specified enemy can regenerate health back.
- asName - Internal name of the enemy
- afRegenHealthSpeed - Speed multiplier of how quickly health is regenerated
void SetManPigIdleBehavior(string& asName, string& asBehaviorType);
Changes the Idle Behaviour type of a specified Manpig enemy.
- asName - Internal name of the enemy
- asBehaviorType - Name of the Behavior Type to use. Can be "None", "Stalk" or "Track"
void SetManPigToFlee(string& asName, bool abX);
Sets if a specific Manpig should flee from the player if they get close.
- asName - Internal name of the enemy
- abX - Enabled/disabled
void SetManPigToThreatenOnAlert(string& asName, bool abX);
Sets if a specific Manpig should perform it's screaming animation upon spotting the player and entering it's Alert state.
- asName - Internal name of the enemy
- abX - Enabled/disabled
void SetManPigCanTrackTeleport(string& asName, bool abX);
Sets if a specific Manpig is allowed to teleport around whilst in it's "Track" behavior type/state.
- asName - Internal name of the enemy
- abX - Enabled/disabled
void SetManPigFleeHealth(string& asName, float afFleeHealth);
float GetManPigFleeHealth(string& asName);
Modifies/returns the amount of health a specific Manpig has to be under to enter it's "Flee" state.
- asName - Internal name of the enemy
- afFleeHealth - The amount of health where the enemy should start fleeing from the player
void SetWraithStealthDashMode (string& asName, bool abX);
Sets if a specific Wraith is to be in Stealth Dash mode/state.
- asName - Internal name of the enemy
- abX - Enabled/disabled
void SetWraithStealthDashAtWill(string&in asName, bool abX);
Enables/disables if a Wraith is allowed to enter it's Stealth Dash mode/state automatically.
- asName - Internal name of the enemy
- abX - Enabled/disabled
void SetWraithStealthDashModeLength(string& asName, int alNodes);
Sets how many nodes will a specific Wraith stay in it's Stealth Dash mode/state before exiting.
- asName - Internal name of the enemy
- alNodes - Amount of nodes (Default: 0)
void SetWraithStealthDashEnterDistance(string& asName, float afNodeDistance);
How far away/close does a path node have to be for a Wraith to enter it's Stealth Dash mode/state.
- asName - Internal name of the enemy
- afNodeDistance - The distance from the node (Default: 15.5)
void SetWraithStealthDashExitDistance(string& asName, float afNodeDistance);
How far away/close does a path node have to be for a Wraith to exit it's Stealth Dash mode/state.
- asName - Internal name of the enemy
- afNodeDistance - The distance from the node (Default: 5.0)
void SetWraithAttackType(string& asName, string& asAttackType);
Sets the Attack Type for a Wraith to use.
- asName - Internal name of the enemy
- asAttackType - Name of the Attack Type to use. Can be "Melee", "Archvile" or "HeatRay"
void SetWraithHeatRayDamageSpeed(string& asName, float afDamageSpeed);
Sets how faster should the Wraith's Heat-Ray attack type should drain the player's health.
- asName - Internal name of the enemy
- afDamageSpeed - The speed of the damage drain (Default: 5.0).
void SetWraithHeatRayDamageLightAmount(string& asName, float afLightAmount);
Sets the amount of Light from the Wraith's Heat-Ray spotlight should the player be in before recieving damage.
- asName - Internal name of the enemy
- afLightAmount - The amount of Light from (Default: 0.75)
void SetWraithBurnDamageMinTime(string& asName, float afMinTime);
void SetWraithBurnDamageMaxTime(string& asName, float afMaxTime);
void SetWraithBurnDamageTime(string& asName, float afMinTime, float afMaxTime)l
Sets the Min and Max Times of the player recieving Burn Damage from the Wraith's attack.
- asName - Internal name of the enemy
- afMinTime - The minimum amount of time before Burn Damage can occur/be applied
- afMaxTime - The maximum amount of time before Burn Damage can occur/be applied
void SetWraithBurnMinDamage(string& asName, float afMinDamage);
void SetWraithBurnMaxDamage(string& asName, float afMaxDamage);
void SetWraithBurnDamage(string& asName, float afMinDamage, float afMaxDamage)
Sets the Min and Max amount of Burn Damage the player recieves from the Wraith's attack.
- asName - Internal name of the enemy
- afMinDamage - The minimum amount of Burn Damage that the Player recieve
- afMaxDamage - The maximum amount of Burn Damage that the Player recieve
void SetWraithCanMeele (string& asName, bool abX);
Allows a specific Wraith to meele attack the Player if close enough.
- asName - Internal name of the enemy
- abX - Enabled/disabled
void SetParticleSystemActive(string& asName, bool abActive);
Sets a particle system visible or active. The paused particle system remains frozen at this frame until reactivated or destroyed.
- asParticleSystem - The name of the particle system
- abActive - False to invisible/inactive, true to visible/active
void DestroyParticleSystemInstantly(string& asName);
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.
- asParticleSystem - The name of the particle system
void FadeLightToExt(string& asLightName, float afR, float afG, float afB, float afA, float afRadius, float afBrightness, float afTime);
Changes the properties of a light. Includes a brightness option.
- asLightName - Interal name
- afR - red value
- afG - green value
- afB - blue value
- afA - alpha value
- afRadius - radius of the light. -1 means keeping the radius
- afBrightness - brightness of the light
- afTime time in seconds until change is done
void FadeLightBrightnessTo(string& asLightName, float afBrightness, float afTime);
Changes the brightness of a light.
- asLightName - Interal name
- afBrightness - brightness of the light
- afTime time in seconds until change is done
float GetLightColorR(string& asLightName);
float GetLightColorG(string& asLightName);
float GetLightColorB(string& asLightName);
float GetLightAlpha(string& asLightName);
float GetLightBrightness(string& asLightName);
Returns the Red, Green, Blue, Alpha and Brightness value of a Light.
void SetFogAreaVisible(string& asFogAreaName, bool abVisible);
Sets a Fog Area visible or not.
- asFogAreaName - The name of the Fog Area
- abVisible - False to invisible, true to visible