https://wiki.frictionalgames.com/api.php?action=feedcontributions&user=Mudbill&feedformat=atomFrictional Wiki - User contributions [en]2024-03-29T07:33:09ZUser contributionsMediaWiki 1.34.2https://wiki.frictionalgames.com/page?title=HPL2/main_init.cfg&diff=6449HPL2/main init.cfg2023-09-14T12:11:34Z<p>Mudbill: Added ShowLocalCustomStoriesOnly</p>
<hr />
<div>{{DISPLAYTITLE:main_init.cfg}}<br />
==ConfigFiles==<br />
{| class="wikitable sortable" border="1"<br />
!Parameter!!Functionality<br />
|-<br />
|Resources||File with all resource directories<br />
|-<br />
|Materials||The file with all physics materials<br />
|-<br />
|Game||Path for [[HPL2/TDD/game.cfg|game settings]]<br />
|-<br />
|Menu||Path for [[HPL2/TDD/menu.cfg|menu settings]]<br />
|-<br />
|PreMenu||Path for [[HPL2/TDD/pre_menu.cfg|pre-menu settings]]<br />
|-<br />
|Demo||Path for [[HPL2/TDD/demo.cfg|demo settings]]<br />
|-<br />
|DefaultMainSettings||Main game settings<br />
|-<br />
|DefaultMainSettingsMedium||"Medium" game settings<br />
|-<br />
|DefaultMainSettingsHigh||"High" game settings<br />
|-<br />
|DefaultUserSettings||Default user settings<br />
|-<br />
|DefaultUserKeys||Default user keys settings<br />
|-<br />
|DefaultBaseLanguage||The base language file. Should probably remains<br />
|-<br />
|DefaultGameLanguage||The default language file to load. Note that directory below is used to find this<br />
|-<br />
|}<br />
<br />
==Directories==<br />
<br />
<br />
{| class="wikitable sortable" border="1"<br />
!Parameter!!Functionality<br />
|-<br />
|MainSaveFolder||This is very important to change. This is where the save games and user settings are stored<br />
|-<br />
|BaseLanguageFolder||Folder where the base language folder placed.<br />
|-<br />
|GameLanguageFolder||Folder where the game specific language files can be found<br />
|-<br />
|CustomStoryPath||Path for custom stories<br />
|-<br />
|}<br />
<br />
==Variables==<br />
<br />
{| class="wikitable sortable" border="1"<br />
|-<br />
|GameName||Name of the game window<br />
|-<br />
|AllowHardMode<br />
|Whether to allow the game to prompt to user to start in "Normal" mode or "Hard" mode when they start a new game. Setting this to <code>false</code> (default) skips the prompt and starts in "Normal" mode. This is only applicable to TDD, not AMFP.<br />
|-<br />
|ShowLocalCustomStoriesOnly<br />
|Whether to load custom stories only from the local "CustomStoryPath" or to load global custom stories (including Steam Workshop items).<br />
|-<br />
|}<br />
<br />
==StartMap==<br />
<br />
{| class="wikitable sortable" border="1"<br />
!Parameter!!Functionality<br />
|-<br />
|File||The map where the game starts<br />
|-<br />
|Folder||The base folder for all maps<br />
|-<br />
|Pos||The start position of the player<br />
|-<br />
|}</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&diff=6447HPL2/Engine Scripts2023-09-14T11:48:47Z<p>Mudbill: formatting</p>
<hr />
<div>{{TocRight}}<br />
<br />
This page documents all scripts available in Amnesia: The Dark Descent.<br />
<br />
{{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].}}<br />
<br />
== Directives ==<br />
<br />
First off, <code>#include "file.hps"</code> can be used to programmatically merge together multiple separate files to make organizing scripts easier.<br />
<br />
<br />
{{ReqVer|1.5}}<br />
<br />
==Engine scripts==<br />
===Main===<br />
<br />
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.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void OnStart();<br />
</syntaxhighlight><br />
<br />
The function that runs when the map is loaded for the first time.<br />
<br />
<syntaxhighlight lang="c++"><br />
void OnEnter();<br />
</syntaxhighlight><br />
<br />
The function that runs whenever the player enters a map.<br />
<br />
<syntaxhighlight lang="c++"><br />
void OnLeave();<br />
</syntaxhighlight><br />
<br />
The function that runs when the player leaves a map.<br />
<br />
<syntaxhighlight lang="c++"><br />
void OnGameStart();<br />
</syntaxhighlight><br />
<br />
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").<br />
<br />
<syntaxhighlight lang="c++"><br />
void OnUpdate(float afStep);<br />
</syntaxhighlight><br />
{{ReqVer|1.5}}<br />
<br />
This function is executed for every game update or "tick". 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.<br />
<br />
===General===<br />
<br />
<syntaxhighlight lang="c++"><br />
float RandFloat(float afMin, float afMax);<br />
</syntaxhighlight><br />
<br />
Generates a random float.<br />
<br />
#''afMin ''- minimum value<br />
#''afMax ''- maximum value<br />
<syntaxhighlight lang="c++"><br />
int RandInt(int alMin, int alMax);<br />
</syntaxhighlight><br />
<br />
Generates a random int. Note: the maximum value is ''inclusive'' - the RandInt() function may return this value.<br />
<br />
#''alMin ''- minimum value<br />
#''alMax ''- maximum value<br />
<syntaxhighlight lang="c++"><br />
bool StringContains(string& asString, string& asSubString);<br />
</syntaxhighlight><br />
<br />
Checks whether a string contains the specified string. <br />Example: searching for "hello" in "hello world" would return '''true'''.<br />
<br />
#''asString ''- the string to check<br />
#''asSubString ''- the string to search for<br />
<syntaxhighlight lang="cpp"><br />
string& StringSub(string& asString, int alStart, int alCount);<br />
</syntaxhighlight><br />
<br />
Returns the substring in a string. <br />Example: in the string "frictional games rocks", using 4 as ''alStart'' and 6 as ''alCount'' would return '''"tional"'''.<br />
<br />
#''asString ''- the string<br />
#''alStart ''- start position in the string<br />
#''alCount ''- amount of characters<br />
<syntaxhighlight lang="c++"><br />
int StringToInt(string&in asString);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
If possible, returns an integer converted from a string, else returns 0.<br />
<br />
#''asString'' - String to convert.<br />
<syntaxhighlight lang="c++"><br />
float StringToFloat(string&in asString);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
If possible, returns a float converted from a string, else returns 0.<br />
<br />
#''asString'' - String to convert.<br />
<syntaxhighlight lang="c++"><br />
bool StringToBool(string&in asString);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
If possible, returns a boolean converted from a string, else returns false.<br />
<br />
#''asString'' - String to convert.<br />
<br />
===Mathematical Operations===<br />
<br />
<syntaxhighlight lang="c++"><br />
float MathSin(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the sine of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathCos(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the cosine of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathTan(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the tangent of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathAsin(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the arc sine of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathAcos(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the arc cosine of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathAtan(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the arc tangent of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathAtan2(float afX, float afY);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Calculates and returns the arc tangent of the specified values.<br />
<br />
#''afX'' - First value to operate.<br />
#''afY'' - Second value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathSqrt(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the square root of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathPow(float afBase, float afExp);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the value of afBase raised to the power of afExp.<br />
<br />
#''afBase'' - The base value.<br />
#''afExp'' - Value to calculate the base with.<br />
<syntaxhighlight lang="c++"><br />
float MathMin(float afA, float afB);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the lowest value.<br />
<br />
#''afA'' - First value.<br />
#''afB'' - Second value.<br />
<syntaxhighlight lang="c++"><br />
float MathMax(float afA, float afB);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the highest value.<br />
<br />
#''afA'' - First value.<br />
#''afB'' - Second value.<br />
<syntaxhighlight lang="c++"><br />
float MathClamp(float afX, float afMin, float afMax);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns afX clamped between afMin and afMax. If afX < afMin, returns afMin, and if afX > afMax, returns afMax.<br />
<br />
#''afX'' - The value to clamp.<br />
#''afMin'' - The minimum value to clamp afX with.<br />
#''afMax'' - The maximum value to clamp afX with.<br />
<syntaxhighlight lang="c++"><br />
float MathAbs(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the absolute value.<br />
<br />
#''afX'' - Value to operate.<br />
<br />
===Debugging===<br />
<br />
<syntaxhighlight lang="cpp"><br />
void Print(string& asString);<br />
</syntaxhighlight><br />
<br />
Prints a string to the log file (''hpl.log'').<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddDebugMessage(string& asString, bool abCheckForDuplicates);<br />
</syntaxhighlight><br />
<br />
Prints a string to the debug console.<br />
<br />
#''asString ''- the string to print<br />
#''abCheckForDuplicates ''- if true, the string won't be printed more than once on screen until it disappears<br />
<syntaxhighlight lang="c++"><br />
void ProgLog(string& asLevel, string& asMessage);<br />
</syntaxhighlight><br />
<br />
Prints an entry to the ProgLog (progression log). <br />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. <br /> <br />This function allows to log custom messages.The messages in the ProgLog file are sorted by time elapsed since a map was loaded.<br />
<br />
ProgLog has to be enabled for a player profile in ''user_settings.cfg'' before it starts working.<br />
<br />
#''asLevel ''- can be "Low", "Medium" or "High". It's a tag which appears in each log entry, for event prioritising.<br />
#''asMessage ''- The custom message to be printed to the log.<br />
<syntaxhighlight lang="c++"><br />
bool ScriptDebugOn();<br />
</syntaxhighlight><br />
<br />
Checks whether the debug mode is enabled. <br />See [[HPL2/Development_Environment|"Setting up Development Environment"]] to setup debug mode on your own computer.<br />
<br />
===Variables===<br />
{{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 "for" loop. For variables which need to be saved, use the wrappers as described below.}}<br />
<br />
====Local====<br />
<br />
Local variables can be used throughout the same script file.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetLocalVarInt(string& asName, int alVal);<br />
void AddLocalVarInt(string& asName, int alVal);<br />
int GetLocalVarInt(string& asName);<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLocalVarFloat(string& asName, float afVal);<br />
void AddLocalVarFloat(string& asName, float afVal);<br />
float GetLocalVarFloat(string& asName);<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLocalVarString(string& asName, const string& asVal);<br />
void AddLocalVarString(string& asName, string& asVal);<br />
string& GetLocalVarString(string& asName);<br />
</syntaxhighlight><br />
<br />
====Global====<br />
<br />
Global variables can be used throughout several maps and can be accessed by several script files.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetGlobalVarInt(string& asName, int alVal);<br />
void AddGlobalVarInt(string& asName, int alVal);<br />
int GetGlobalVarInt(string& asName);<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="c++"><br />
void SetGlobalVarFloat(string& asName, float afVal);<br />
void AddGlobalVarFloat(string& asName, float afVal);<br />
float GetGlobalVarFloat(string& asName);<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="c++"><br />
void SetGlobalVarString(string& asName, const string& asVal);<br />
void AddGlobalVarString(string& asName, string& asVal);<br />
string& GetGlobalVarString(string& asName);<br />
</syntaxhighlight><br />
<br />
===Particle Systems===<br />
<br />
<syntaxhighlight lang="c++"><br />
void PreloadParticleSystem(string& asPSFile);<br />
</syntaxhighlight><br />
<br />
Preloads a particle system.<br />
<br />
#''asPSFile'' - The particle system file to load. Extension: .ps<br />
<syntaxhighlight lang="c++"><br />
void CreateParticleSystemAtEntity(string& asPSName, string& asPSFile, string& asEntity, bool abSavePS);<br />
</syntaxhighlight><br />
<br />
Creates a particle system on an entity.<br />
<br />
#''asPSName ''- internal name<br />
#''asPSFile ''- the particle system to use + extension .ps<br />
#''asEntity ''- the entity to create the particle system at<br />
#''abSavePS ''- determines whether a particle system should "remember" its shown/hidden state, so that this state can be restored when the player revisits the level<br />
<syntaxhighlight lang="c++"><br />
void CreateParticleSystemAtEntityExt(string& asPSName, string& asPSFile, string& asEntity, bool abSavePS,<br />
float afR, float afG, float afB, float afA, bool abFadeAtDistance, float afFadeMinEnd, float afFadeMinStart,<br />
float afFadeMaxStart, float afFadeMaxEnd);<br />
</syntaxhighlight><br />
<br />
Creates a particle system on an entity, extended method with more options.<br />
<br />
#''asPSName ''- internal name<br />
#''asPSFile ''- the particle system to use + extension .ps<br />
#''asEntity ''- the entity to create the particle system at<br />
#''abSavePS ''- determines whether a particle system should "remember" its shown/hidden state, so that this state can be restored when the player revisits the level<br />
#''afR ''- red value<br />
#''afG ''- green value<br />
#''afB ''- blue value<br />
#''afA ''- alpha value<br />
#''abFadeAtDistance ''- determines whether a particle system fades from a certain distance on<br />
#''afFadeMinEnd ''- minimum distance at which the particle system stops fading<br />
#''afFadeMinStart ''- minimum distance at which the particle system starts fading<br />
#''afFadeMaxStart ''- maximum distance at which the particle system starts fading<br />
#''afFadeMaxEnd ''- maximum distance at which the particle system stops fading<br />
<syntaxhighlight lang="c++"><br />
void DestroyParticleSystem(string& asName);<br />
</syntaxhighlight><br />
<br />
Destroys a particle system.<br />
<br />
#''asName'' - The internal name of the particle system<br />
<br />
===Sounds & Music===<br />
<br />
<syntaxhighlight lang="c++"><br />
void PreloadSound(string& asSoundFile);<br />
</syntaxhighlight><br />
<br />
Preloads a sound.<br />
<br />
#''asSoundFile'' - The sound file to load. Extension: .snt<br />
<syntaxhighlight lang="c++"><br />
void PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);<br />
</syntaxhighlight><br />
<br />
Creates a sound on an entity.<br />
<br />
#''asSoundName ''- internal name<br />
#''asSoundFile ''- the sound to use + extension .snt<br />
#''asEntity ''- the entity to create the sound at, can be "Player"<br />
#''afFadeTime ''- time in seconds the sound needs to fade. Avoids enemies hearing the sound if afFadeTime is at least 0.1f<br />
#''abSaveSound ''- if ''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''!<br />
<syntaxhighlight lang="c++"><br />
void FadeInSound(string& asSoundName, float afFadeTime, bool abPlayStart);<br />
</syntaxhighlight><br />
<br />
Fades in a sound.<br />
<br />
#''asSoundName ''- internal name<br />
#''afFadeTime ''- time in seconds<br />
#''abPlayStart ''- ?<br />
<syntaxhighlight lang="c++"><br />
void StopSound(string& asSoundName, float afFadeTime);<br />
</syntaxhighlight><br />
<br />
Fades out a sound.<br />
<br />
#''asSoundName ''- internal name<br />
#''afFadeTime ''- time in seconds, use 0 to immediatly stop the sound<br />
<syntaxhighlight lang="c++"><br />
void PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);<br />
</syntaxhighlight><br />
<br />
Plays music.<br />
<br />
#''asMusicFile ''- the music to play + extension .ogg<br />
#''abLoop ''- determines whether a music track should loop<br />
#''afVolume ''- volume of the music<br />
#''afFadeTime ''- time in seconds until music reaches full volume<br />
#''alPrio ''- priority of the music. Note that only the music with the highest priority can be heard! 0 - lowest, 1 - higher, etc.<br />
#''abResume'' - if ''true'', playback will be continued from where the track stopped after the call to StopMusic(); if ''false'', the track will be restarted.<br />
<syntaxhighlight lang="c++"><br />
void StopMusic(float afFadeTime, int alPrio);<br />
</syntaxhighlight><br />
<br />
Stops music.<br />
<br />
#''afFadeTime ''- time in seconds until music stops<br />
#''alPrio ''- the priority of the music that should stop<br />
<syntaxhighlight lang="c++"><br />
void FadeGlobalSoundVolume(float afDestVolume, float afTime);<br />
</syntaxhighlight><br />
<br />
Influences the global sound volume, that means everything you can hear '''from the world'''. This does not affect music of GUI sounds.<br />
<br />
#''afDestVolume ''- desired volume<br />
#''afTime ''- time in seconds until volume reaches desired volume<br />
<syntaxhighlight lang="c++"><br />
void FadeGlobalSoundSpeed(float afDestSpeed, float afTime);<br />
</syntaxhighlight><br />
<br />
Influences the global sound speed.<br />
<br />
#''afDestSpeed ''- desired speed<br />
#''afTime ''- time in seconds until volume reaches desired speed<br />
<br />
===Lights===<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLightVisible(string& asLightName, bool abVisible);<br />
</syntaxhighlight><br />
<br />
Enables/disables lights.<br />
<br />
#''asLightName ''- internal name<br />
#''abVisible ''- determines the state of the light<br />
<syntaxhighlight lang="c++"><br />
void FadeLightTo(string& asLightName, float afR, float afG, float afB, float afA, float afRadius, float afTime);<br />
</syntaxhighlight><br />
<br />
Changes the properties of a light.<br />
<br />
#''asLightName ''- internal name<br />
#''afR ''- red value<br />
#''afG ''- green value<br />
#''afB ''- blue value<br />
#''afA ''- alpha value<br />
#''afRadius ''- radius of the light. -1 means keeping the radius<br />
#''afTime ''- time in seconds until change is done<br />
<syntaxhighlight lang="c++"><br />
void SetLightFlickerActive(string& asLightName, bool abActive);<br />
</syntaxhighlight><br />
<br />
Activates flickering on a light.<br />
<br />
#''asLightName'' - The internal light name<br />
#''abActive'' - true = active, false = inactive<br />
<br />
==Game scripts==<br />
<br />
===General===<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartCredits(string& asMusic, bool abLoopMusic, string& asTextCat, string& asTextEntry, int alEndNum);<br />
</syntaxhighlight><br />
<br />
Starts the end credits screen.<br />
<br />
#''asMusic ''- the music to play (including .ogg)<br />
#''abLoopMusic ''- determines whether the music should loop<br />
#''asTextCat ''- the category to be used in the .lang file<br />
#''asTextEntry ''- the entry in the .lang file<br />
#''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.<br />
<syntaxhighlight lang="c++"><br />
void StartDemoEnd();<br />
</syntaxhighlight><br />
<br />
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)<br />
<br />
<syntaxhighlight lang="c++"><br />
void AutoSave();<br />
</syntaxhighlight><br />
<br />
Save the game to the auto save.<br />
<br />
<syntaxhighlight lang="c++"><br />
void CheckPoint (string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry);<br />
</syntaxhighlight><br />
<br />
Sets a checkpoint at which the player will respawn in case he dies. <br />Callback syntax: <code>void MyFunc(string &in asName, int alCount)</code> <br />Count is 0 on the first checkpoint load!<br />
<br />
#''asName ''- the internal name<br />
#''asStartPos ''- the name of the StartPos in the editor<br />
#''asCallback ''- the function to call when the player dies/respawns<br />
#''asDeathHintCat ''- the category of the death hint message to be used in the .lang file<br />
#''asDeathHintEntry ''- the entry in the .lang file<br />
<syntaxhighlight lang="c++"><br />
void ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);<br />
</syntaxhighlight><br />
<br />
Immediatly loads another map.<br />
<br />
#''asMapName ''- the file to load<br />
#''asStartPos ''- the name of the StartPos on the next map<br />
#''asStartSound ''- the sound that is played when the change starts<br />
#''asEndSound ''- the sound that is played when the new map is loaded<br />
<syntaxhighlight lang="c++"><br />
void ClearSavedMaps();<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
<syntaxhighlight lang="c++"><br />
void CreateDataCache();<br />
void DestroyDataCache();<br />
</syntaxhighlight><br />
<br />
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.<br />
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.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetMapDisplayNameEntry(string& asNameEntry);<br />
</syntaxhighlight><br />
<br />
Sets the map name shown in save file names. If none is set NULL is assumed.<br />
<br />
#''asNameEntry ''- the entry to display, category must be "Levels"!<br />
<syntaxhighlight lang="c++"><br />
void SetSkyBoxActive(bool abActive);<br />
</syntaxhighlight><br />
<br />
Enables/Disables the skybox.<br />
<br />
#''abActive'' - true = active, false = inactive<br />
<syntaxhighlight lang="c++"><br />
void SetSkyBoxTexture(string& asTexture);<br />
</syntaxhighlight><br />
<br />
Sets the texture of the skybox.<br />
<br />
#''asTexture'' - The texture file to set. Extension: .dds<br />
<syntaxhighlight lang="c++"><br />
void SetSkyBoxColor(float afR, float afG, float afB, float afA);<br />
</syntaxhighlight><br />
<br />
Sets the solid color of the skybox rather than a texture.<br />
<br />
#''afR ''- red value<br />
#''afG ''- green value<br />
#''afB ''- blue value<br />
#''afA ''- alpha value<br />
<syntaxhighlight lang="c++"><br />
void SetFogActive(bool abActive);<br />
</syntaxhighlight><br />
<br />
Enables/Disables the global fog.<br />
<br />
#''abActive'' - true = active, false = inactive<br />
<syntaxhighlight lang="c++"><br />
void SetFogColor(float afR, float afG, float afB, float afA);<br />
</syntaxhighlight><br />
<br />
Sets the color to use for the global fog.<br />
<br />
#''afR ''- red value<br />
#''afG ''- green value<br />
#''afB ''- blue value<br />
#''afA ''- alpha value<br />
<syntaxhighlight lang="c++"><br />
void SetFogProperties(float afStart, float afEnd, float afFalloffExp, bool abCulling);<br />
</syntaxhighlight><br />
<br />
Sets the properties for the global fog.<br />
<br />
#''afStart ''- how many meters from the camera should the fog begin<br />
#''afEnd ''- how many meters from the camera should the fog reach full thickness<br />
#''afFalloffExp ''- the amount by which the thinkness increases<br />
#''abCulling ''- whether occlusion culling is active for the fog; this prevents objects behind the fog from being loaded<br />
<syntaxhighlight lang="c++"><br />
void SetupLoadScreen(string&asTextCat, string&asTextEntry, int alRandomNum, string&asImageFile);<br />
</syntaxhighlight><br />
<br />
Determines which loading screen will be shown when changing maps.<br />
<br />
#''asTextCat ''- the category of the loading text in the .lang file to be shown on the loading screen<br />
#''asTextEntry ''- the entry in the .lang file<br />
#''alRandomNum ''- if greater 1, then it will randomize between 1 and alRandom for each LoadScreen giving entry the suffix XX (eg 01). If < =1 then no suffix is added<br />
#''asImageFile ''- the image to be shown (optional)<br />
<br />
===Game Timer===<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddTimer(string& asName, float afTime, string& asFunction);<br />
</syntaxhighlight><br />
<br />
Creates a timer which calls a function when it expires. <br />Callback syntax: <code>void MyFunc(string &in asTimer)</code><br />
<br />
#''asName ''- the name of the timer<br />
#''afTime ''- time in seconds<br />
#''asFunction ''- the function to call<br />
<syntaxhighlight lang="c++"><br />
void RemoveTimer(string& asName);<br />
</syntaxhighlight><br />
<br />
Removes a timer, no matter how much time is left.<br />
<br />
#''asName'' - the internal name of the timer.<br />
<syntaxhighlight lang="c++"><br />
float GetTimerTimeLeft(string& asName);<br />
</syntaxhighlight><br />
<br />
Returns the time left on a timer.<br />
<br />
#''asName'' - the internal name of the timer.<br />
<br />
===Screen Effects===<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadeOut(float afTime);<br />
</syntaxhighlight><br />
<br />
Fades the screen to black.<br />
<br />
''afTime ''- time in seconds until the screen is completly black<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadeIn(float afTime);<br />
</syntaxhighlight><br />
<br />
Fades the screen back to normal.<br />
<br />
''afTime ''- time in seconds until the screen back to normal<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadeImageTrailTo(float afAmount, float afSpeed);<br />
</syntaxhighlight><br />
<br />
Applies the image trail effect to the screen.<br />
<br />
''afAmount ''- intensity (default: 0) <br />''afSpeed ''- time in seconds until full effect<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadeSepiaColorTo(float afAmount, float afSpeed);<br />
</syntaxhighlight><br />
<br />
Makes the screen go dark red.<br />
<br />
''afAmount ''- intensity (default: 0) <br />''afSpeed ''- time in seconds until full effect<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadeRadialBlurTo(float afSize, float afSpeed);<br />
</syntaxhighlight><br />
<br />
Applies radial blur effects to the screen.<br />
<br />
''afSize ''- intensity (default: 0) <br />''afSpeed ''- time in seconds until full effect<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetRadialBlurStartDist(float afStartDist);<br />
</syntaxhighlight><br />
<br />
Determines at which distance the radial blur effects appear.<br />
<br />
''afStartDist ''- the distance at which the effect starts<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartEffectFlash(float afFadeIn, float afWhite, float afFadeOut);<br />
</syntaxhighlight><br />
<br />
Fades the screen to white.<br />
<br />
''afFadeIn ''- time in seconds until screen is white <br />''afWhite ''- determines to which percentage the screen fades to white (1.0 = completly white) <br />''afFadeOut ''- time in seconds until screen is back to normal again<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartEffectEmotionFlash(string& asTextCat, string& asTextEntry, string& asSound);<br />
</syntaxhighlight><br />
<br />
Fades the screen to white and shows a text message.<br />
<br />
''asTextCat ''- the category in the .lang file <br />''asTextEntry ''- the text entry in the .lang file <br />''asSound ''- the sound to play while fading<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddEffectVoice(string& asVoiceFile, string& asEffectFile, string& asTextCat, string& asTextEntry,<br />
bool abUsePosition, string& asPosEntity, float afMinDistance, float afMaxDistance);<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
''asVoiceFile ''- the voice to play <br />''asEffectFile ''- the effect to play <br />''asTextCat ''- the category in the .lang file <br />''asTextEntry ''- the text entry in the .lang file <br />''abUsePosition ''- plays using 3D from the entity, or without 3D <br />''asPosEntity ''- the entity at which the effect appears <br />''afMinDistance ''- minimum distance to see the effect <br />''afMaxDistance ''- maximum distance to see the effect<br />
<br />
<syntaxhighlight lang="c++"><br />
void StopAllEffectVoices(float afFadeOutTime);<br />
</syntaxhighlight><br />
<br />
Stops all voices and calls the EffectVoiceOverCallback.<br />
<br />
<syntaxhighlight lang="c++"><br />
bool GetEffectVoiceActive();<br />
</syntaxhighlight><br />
<br />
Checks whether EffectVoices are still active.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetEffectVoiceOverCallback(string& asFunc);<br />
</syntaxhighlight><br />
<br />
Sets the function to be called when the EffectVoices are finished. <br />Callback syntax: <code>void MyFunc()</code><br />
<br />
<syntaxhighlight lang="c++"><br />
bool GetFlashbackIsActive();<br />
</syntaxhighlight><br />
<br />
Checks whether a flashback is still in effect.<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartPlayerSpawnPS(string& asSPSFile);<br />
void StopPlayerSpawnPS();<br />
</syntaxhighlight><br />
<br />
Continuously spawn regular particle systems (''.ps'') around the player. Particles created by this script carry over from map to map. <br /> <br />''asSPSFile'' - the ''.sps'' file to use. Exemplary ''.sps'' files are located in the ''/misc'' folder in the main game directory. <br /> <br />Custom ''.sps'' files can be created by hand in a text editor (see existing ones and mimic how those are written). <br />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.<br />
<br />
<syntaxhighlight lang="c++"><br />
void PlayGuiSound(string& asSoundFile, float afVolume);<br />
</syntaxhighlight><br />
<br />
Plays a sound, not using 3D.<br />
<br />
''asSoundFile ''- the sound to play (extension is .snt) <br />''afVolume ''- the volume of the sound<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);<br />
</syntaxhighlight><br />
<br />
Shakes the screen.<br />
<br />
''afAmount ''- intensity of the shake <br />''afTime ''- duration of the shake <br />''afFadeInTime ''- time in seconds until full intensity is reached <br />''afFadeOutTime ''- time until screen is back to normal<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetInDarknessEffectsActive(bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables the sanity drain and night vision effects while in the darkness.<br />
<br />
''bool abX'' - Enable/disable effects.<br />
<br />
<syntaxhighlight lang="c++"><br />
void ShowScreenImage(string &in asImageName, float afX, float afY, float afScale, bool abUseRelativeCoordinates, float afDuration, float afFadeIn, float afFadeOut);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.5}}<br />
<br />
Displays an image file directly onto the screen.<br />
<br />
''asImageName'' - The image file to render (.jpg, .png, .tga, .dds)<br />
<br />
''afX'' - The X position of the image<br />
<br />
''afY'' - The Y position of the image<br />
<br />
''afScale'' - The scale of the image (default 1.0f)<br />
<br />
''abUseRelativeCoordinates'' - Whether or not to use relative coordinates for positioning. Use false for absolute.<br />
<br />
''afDuration'' - The duration that the image is displayed for.<br />
<br />
''afFadeIn'' - The time, in seconds, to fade in the image.<br />
<br />
''afFadeOut'' - The time, in seconds, to fade out the image.<br />
<br />
===Insanity===<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetInsanitySetEnabled(string& asSet, bool abX);<br />
</syntaxhighlight><br />
<br />
Determines which InsanitySets are enabled.<br />
<br />
''asSet ''- the set <br />''abX ''- enabled or not<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartInsanityEvent(string &in asEventName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Starts a specified insanity event.<br />
<br />
''asEventName ''- Insanity event to play.<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartRandomInsanityEvent();<br />
</syntaxhighlight><br />
<br />
Starts a random insanity event from the available sets.<br />
<br />
<syntaxhighlight lang="c++"><br />
void StopCurrentInsanityEvent();<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Stops the currently playing insanity event.<br />
<br />
<syntaxhighlight lang="c++"><br />
void InsanityEventIsActive();<br />
</syntaxhighlight><br />
<br />
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 [http://wiki.frictionalgames.com/lib/images/smileys/icon_smile.gif?nolink&15x15]<br />
<br />
===Player===<br />
<br />
Note that the player's maximum health and sanity is 100.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerActive(bool abActive);<br />
</syntaxhighlight><br />
<br />
Enabled/Disable player controlled movement.<br />
<br />
<syntaxhighlight lang="c++"><br />
void ChangePlayerStateToNormal();<br />
</syntaxhighlight><br />
<br />
Sets certain effects back to normal. It can for example make the player drop an item.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerCrouching(bool abCrouch);<br />
</syntaxhighlight><br />
<br />
Forces the player to crouch.<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddPlayerBodyForce(float afX, float afY, float afZ, bool abUseLocalCoords);<br />
</syntaxhighlight><br />
<br />
Pushes the player into a certain direction. Note that you need values above ~2000 to see any effects.<br />
<br />
''afX ''- amount along the X-axis <br />''afY ''- amount along the Y-axis <br />''afZ ''- amount along the Z-axis <br />''abUseLocalCoords ''- If true, axes are based on where the player is facing, not the world.<br />
<br />
<syntaxhighlight lang="c++"><br />
void ShowPlayerCrossHairIcons(bool abX);<br />
</syntaxhighlight><br />
<br />
Enables/Disables the icons when a player has something in focus.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerSanity(float afSanity);<br />
void AddPlayerSanity(float afSanity);<br />
float GetPlayerSanity();<br />
</syntaxhighlight><br />
<br />
Modifies/returns the sanity of the player.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerHealth(float afHealth);<br />
void AddPlayerHealth(float afHealth);<br />
float GetPlayerHealth();<br />
</syntaxhighlight><br />
<br />
Modifies/returns the health of the player.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerLampOil(float afOil);<br />
void AddPlayerLampOil(float afOil);<br />
float GetPlayerLampOil();<br />
</syntaxhighlight><br />
<br />
Modifies/returns the lamp oil of the player.<br />
<br />
<syntaxhighlight lang="c++"><br />
float GetPlayerSpeed();<br />
float GetPlayerYSpeed();<br />
</syntaxhighlight><br />
<br />
Returns the current speed of the player.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetSanityDrainDisabled(bool abX);<br />
</syntaxhighlight><br />
<br />
Enables/Disables sanity drain from darkness, monsters, etc.<br />
<br />
<syntaxhighlight lang="c++"><br />
void GiveSanityBoost();<br />
void GiveSanityBoostSmall();<br />
</syntaxhighlight><br />
<br />
Boosts the player's sanity by a fixed amount.<br />
<br />
<syntaxhighlight lang="c++"><br />
void GiveSanityDamage(float afAmount, bool abUseEffect);<br />
</syntaxhighlight><br />
<br />
Reduces the sanity of the player.<br />
<br />
''afAmount ''- amount of sanity damage done <br />''abUseEffect ''- determines whether an effect is played when the sanity damage is dealt<br />
<br />
<syntaxhighlight lang="c++"><br />
void GivePlayerDamage(float afAmount, string& asType, bool abSpinHead, bool abLethal);<br />
</syntaxhighlight><br />
<br />
Reduces the health of the player.<br />
<br />
''afAmount ''- amount of damage done to health <br />''asType ''- plays a certain effect on the screen when the damage is dealt (BloodSplat, Claws or Slash) <br />''abSpinHead ''- changes the camera view when damage is dealt <br />''abLethal ''- set to true if player can die from given damage<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadePlayerFOVMulTo(float afX, float afSpeed);<br />
</syntaxhighlight><br />
<br />
Changes the field of view of the player. A shorter FOV will create a zoom effect.<br />
<br />
''afX ''- multiplier of default FOV (1 is default) <br />''afSpeed ''- the speed of change between FOV's<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadePlayerAspectMulTo(float afX, float afSpeed);<br />
</syntaxhighlight><br />
<br />
Changes the aspect ratio of the player. Basically stretches or narrows the screen horizontally.<br />
<br />
''afX ''- multiplier of default aspect (default is 1) <br />''afSpeed ''- the speed of change between FOV's<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed);<br />
</syntaxhighlight><br />
<br />
Rotates the position of the camera on the player's body.<br />
<br />
''afX ''- angle of rotation of head, positive being counter-clockwise <br />''afSpeedMul ''- speed (possibly acceleration) multiplier of the rotation (default 1, which is really slow) <br />''afMaxSpeed ''- maximum speed of rotation<br />
<br />
<syntaxhighlight lang="c++"><br />
void MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist);<br />
</syntaxhighlight><br />
<br />
Changes the position of the camera on the player's body.<br />
<br />
''afX ''- amount along the X-axis <br />''afY ''- amount along the Y-axis <br />''afZ ''- amount along the Z-axis <br />''afSpeed ''- speed at which the change happens <br />''afSlowDownDist ''- distance at which to start slowing down (prevents the head from abruptly stopping)<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartPlayerLookAt(string& asEntityName, float afSpeedMul, float afMaxSpeed, string& asAtTargetCallback);<br />
void StopPlayerLookAt();<br />
</syntaxhighlight><br />
<br />
Forces the player to look at a certain entity until StopPlayerLookAt is used.<br />
<br />
''asEntityName ''- the entity to look at <br />''afSpeedMul ''- how fast should the player look at the entity <br />''afMaxSpeed ''- maximum speed allowed <br />''asAtTargetCallback ''- function to call when player looks at target<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerMoveSpeedMul(float afMul);<br />
void SetPlayerRunSpeedMul(float afMul);<br />
void SetPlayerLookSpeedMul(float afMul);<br />
</syntaxhighlight><br />
<br />
Changes the player's move/run/look speed. Default is 1.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerJumpForceMul(float afMul);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Changes the player's jump multiplier. Higher values = higher jumps. Default is 1.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerJumpDisabled(bool abX);<br />
void SetPlayerCrouchDisabled(bool abX);<br />
</syntaxhighlight><br />
<br />
Enables/Disables the player's ability to jump/crouch.<br />
<br />
<syntaxhighlight lang="c++"><br />
void TeleportPlayer(string& asStartPosName);<br />
</syntaxhighlight><br />
<br />
Instantly teleports the player to the target StartPos.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLanternActive(bool abX, bool abUseEffects);<br />
</syntaxhighlight><br />
<br />
Makes the player use his lantern.<br />
<br />
<syntaxhighlight lang="c++"><br />
bool GetLanternActive();<br />
</syntaxhighlight><br />
<br />
Checks whether the player currently uses his lantern.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLanternDisabled(bool abX);<br />
</syntaxhighlight><br />
<br />
Enables/Disables the player's ability to use his lantern.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLanternLitCallback(string& asCallback);<br />
</syntaxhighlight><br />
<br />
Sets the function to call when the player uses his lantern. <br />Callback syntax: <code>MyFunc(bool abLit)</code><br />
<br />
<syntaxhighlight lang="c++"><br />
void SetMessage(string& asTextCategory, string& asTextEntry, float afTime);<br />
</syntaxhighlight><br />
<br />
Displays a message on the screen.<br />
<br />
''asTextCategory ''- the category in the .lang file <br />''asTextEntry ''- the entry in the .lang file <br />''afTime ''- determines how long the message is displayed. If time is < =0 then the life time is calculated based on string length.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetDeathHint(string& asTextCategory, string& asTextEntry);<br />
</syntaxhighlight><br />
<br />
Sets the message that appears when the player dies.<br />
<br />
''asTextCategory ''- the category in the .lang file <br />''asTextEntry ''- the entry in the .lang file<br />
<br />
<syntaxhighlight lang="c++"><br />
void DisableDeathStartSound();<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
<syntaxhighlight lang=""><br />
void MovePlayerForward(float afAmount)<br />
</syntaxhighlight><br />
<br />
"REQUIRES THE 1.2 PATCH: JUSTINE" Moves the player forward. It needs to be called in a timer that updates 60 times / second.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerFallDamageDisabled(bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables the player's ability to take fall damage.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerPos(float afX, float afY, float afZ);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Sets the player's position within the level.<br />
<br />
''afX'' - X co-ordinate position. <br />''afY'' - Y co-ordinate position. <br />''afZ'' - Z co-ordinate position.<br />
<br />
<syntaxhighlight lang="c++"><br />
float GetPlayerPosX();<br />
float GetPlayerPosY();<br />
float GetPlayerPosZ();<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the player's position within the level on the specified axis.<br />
<br />
===Journal===<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddNote(string& asNameAndTextEntry, string& asImage);<br />
</syntaxhighlight><br />
<br />
Adds a note to the player's journal.<br />
<br />
''asNameAndTextEntry ''- entries in the .lang file. Must end with _Name and _Text and be in category "Journal"! <br />''asImage ''- the background image to be used<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddDiary(string& asNameAndTextEntry, string& asImage);<br />
</syntaxhighlight><br />
<br />
Adds a diary to the player's journal.<br />
<br />
''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"! <br />''asImage ''- the background image to be used<br />
<br />
<syntaxhighlight lang="c++"><br />
void ReturnOpenJournal(bool abOpenJournal);<br />
</syntaxhighlight><br />
<br />
Only called in the pickup diary callback! If true the journal displays the entry else not.<br />
<br />
===Quests===<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddQuest(string& asName, string& asNameAndTextEntry);<br />
</syntaxhighlight><br />
<br />
Adds a quest to the player's journal under mementos.<br />
<br />
''asName ''- the internal name to be used <br />''asNameAndTextEntry ''- entry in the .lang file. Must start with "Quest_<texthere>_Text”, and be in category “Journal”!<br />
<br />
<syntaxhighlight lang="c++"><br />
void CompleteQuest(string& asName, string& asNameAndTextEntry);<br />
</syntaxhighlight><br />
<br />
Completes a quest.<br />
<br />
''asName ''- the internal name of the quest <br />''asNameAndTextEntry ''- entry in the .lang file. Must start with " Quest_<texthere>_Text ”, and be in category “Journal”!<br />
<br />
<syntaxhighlight lang="c++"><br />
bool QuestIsCompleted(string& asName);<br />
bool QuestIsAdded(string& asName);<br />
</syntaxhighlight><br />
<br />
Checks whether a quest is completed/added.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetNumberOfQuestsInMap(int alNumberOfQuests);<br />
</syntaxhighlight><br />
<br />
Sets the number of quests in the map.<br />
<br />
''alNumberOfQuests ''- Amount of Quests<br />
<br />
<syntaxhighlight lang="c++"><br />
void GiveHint (string& asName, string& asMessageCat, string& asMessageEntry, float afTimeShown);<br />
</syntaxhighlight><br />
<br />
Displays a hint on the player's screen.<br />
<br />
''asName ''- the internal name <br />''asMessageCat ''- the category in the .lang file <br />''asMessageEntry ''- the entry in the .lang file <br />''afTimeShown ''- time in seconds until the message disappears. If time is <= 0 then the life time is calculated based on string length.<br />
<br />
<syntaxhighlight lang="c++"><br />
void RemoveHint (string& asName);<br />
void BlockHint (string& asName);<br />
void UnBlockHint (string& asName);<br />
</syntaxhighlight><br />
<br />
Removes<nowiki>\</nowiki>Blocks<nowiki>\</nowiki>Unblocks a hint.<br />
<br />
===Inventory===<br />
<br />
<syntaxhighlight lang="c++"><br />
void ExitInventory();<br />
</syntaxhighlight><br />
<br />
Exits the inventory by force.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetInventoryDisabled(bool abX);<br />
</syntaxhighlight><br />
<br />
Disables the player's ability to open his inventory.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetInventoryMessage(string& asTextCategory, string& asTextEntry, float afTime);<br />
</syntaxhighlight><br />
<br />
Adds a message at the bottom of the inventory screen.<br />
<br />
''asTextCategory ''- the category in the .lang file <br />''asTextEntry ''- the entry in the .lang file <br />''afTime ''- time in seconds until the message disappears. If life time is <= 0 then the life time is calculated based on string length.<br />
<br />
<syntaxhighlight lang="c++"><br />
void GiveItem(string& asName, string& asType, string& asSubTypeName, string& asImageName, float afAmount);<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
''asName ''- internal name <br />''asType ''- item type to give, Available types are: <br /><br />
<br />
*Puzzle<br />
*Lantern<br />
*Health<br />
*Sanity<br />
*LampOil<br />
*Tinderbox<br />
<br />
''asSubTypeName ''- item name for .lang file <br />''asImageName ''- the image which will appear in inventory. For example: <code>void GiveItem("chemical_container_full_1", "Puzzle", "chemical_container_full", "chemical_container_full.tga", 1);</code> will use the image from <code>graphics/item/chemical_container_full.tga</code> <br />
<br />
''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.<br />
<br />
<syntaxhighlight lang="c++"><br />
void RemoveItem(string& asName);<br />
</syntaxhighlight><br />
<br />
Removes an item from the player's inventory.<br />
<br />
<syntaxhighlight lang="c++"><br />
bool HasItem(string& asName);<br />
</syntaxhighlight><br />
<br />
Checks whether the player has an item in his inventory.<br />
<br />
<syntaxhighlight lang="c++"><br />
void GiveItemFromFile(string& asName, string& asFileName);<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
''asName ''- internal name <br />''asFileName ''- item to give + extension (.ent)<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddCombineCallback(string& asName, string& asItemA, string& asItemB, string& asFunction, bool abAutoRemove);<br />
</syntaxhighlight><br />
<br />
Allows the player to combine items in his inventory. <br />Callback syntax: <code>void MyFunc(string &in asItemA, string &in asItemB)</code><br />
<br />
''asName ''- internal name for the callback <br />''asItemA ''- internal name of first item <br />''asItemB ''- internal name of second item <br />''asFunction ''- the function to call <br />''abAutoRemove ''- determines whether the callback should be removed when the items are combined<br />
<br />
<syntaxhighlight lang="c++"><br />
void RemoveCombineCallback(string& asName);<br />
</syntaxhighlight><br />
<br />
Removes a combine callback. <br />''asName'' - the internal name of the callback to be removed (as specified in AddCombineCallback)<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddUseItemCallback(string& asName, string& asItem, string& asEntity, string& asFunction, bool abAutoDestroy);<br />
</syntaxhighlight><br />
<br />
Allows the player to use items on the world. <br />Callback syntax: <code>void MyFunc(string &in asItem, string &in asEntity)</code><br />
<br />
''asName ''- internal name <br />''asItem ''- internal name of the item <br />''asEntity ''- entity to be able to use the item on <br />''asFunction ''- function to call <br />''abAutoDestroy ''- determines whether the item is destroyed when used<br />
<br />
<syntaxhighlight lang="c++"><br />
void RemoveUseItemCallback(string& asName);<br />
</syntaxhighlight><br />
<br />
Removes an item callback.<br />
<br />
===Entities===<br />
<br />
====General====<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityActive(string& asName, bool abActive);<br />
</syntaxhighlight><br />
<br />
Activates/deactivates an entity.<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityVisible(string &in asName, bool abVisible);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Activates/deactivates an entity's visual mesh. The collision body remains.<br />
<br />
''asName'' - Name of the entity. <br />''abActive'' - Activate/deactivate mesh.<br />
<br />
<syntaxhighlight lang="c"><br />
bool GetEntityExists(string& asName);<br />
</syntaxhighlight><br />
<br />
Checks whether an entity exists.<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityCustomFocusCrossHair(string& asName, string& asCrossHair);<br />
</syntaxhighlight><br />
<br />
Changes the crosshair that is used when focusing an entity.<br />
<br />
''asName ''- internal name <br />''asCrossHair ''- desired crosshair, can be: Default (uses default), Grab, Push, Ignite, Pick, LevelDoor, Ladder<br />
<br />
<syntaxhighlight lang="c"><br />
void CreateEntityAtArea(string& asEntityName, string& asEntityFile, string& asAreaName, bool abFullGameSave);<br />
</syntaxhighlight><br />
<br />
Creates an entity at an area. When creating an enemy though, it cannot chase properly along PathNodes(using for example ShowEnemyPlayerPosition).<br />
<br />
''asEntityName ''- internal name <br />''asEntityFile ''- entity to be used extension .ent <br />''asAreaName ''- the area to create the entity at <br />''abFullGameSave ''- determines whether an entity "remembers" its state<br />
<br />
<syntaxhighlight lang="c"><br />
void ReplaceEntity(string &in asName, string &in asBodyName, string &in asNewEntityName, string &in asNewEntityFile, bool abFullGameSave);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Removes an entity and places a new one in its place.<br />
<br />
''asName'' - Name of the entity to replace. <br />''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). <br />''asNewEntityName'' - Name of the new entity. <br />''asNewEntityFile'' - Name of the new entity file. Extension .ent. <br />''abFullGameSave'' - Whether ALL properties of this entity should be saved throughout levels.<br />
<br />
<syntaxhighlight lang="c++"><br />
void PlaceEntityAtEntity(string &in asName, string &in asTargetEntity, string &in asTargetBodyName, bool abUseRotation);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Places an entity at the position of another entity. Does not work for enemies, use TeleportEnemyToEntity instead.<br />
<br />
''asName'' - Name of the entity to place. <br />''asTargetEntity'' - Name of the other entity to place the first entity at. <br />''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). <br />''abUseRotation'' - Whether the entity should be rotated like the target entity.<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityPos(string &in asName, float afX, float afY, float afZ);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Moves an entity to a position in the level.<br />
<br />
''asName'' - Name of the entity to move. <br />''afX'' - X co-ordinate position. <br />''afY'' - Y co-ordinate position. <br />''afZ'' - Z co-ordinate position.<br />
<br />
<syntaxhighlight lang="c"><br />
float GetEntityPosX(string &in asName);<br />
float GetEntityPosY(string &in asName);<br />
float GetEntityPosZ(string &in asName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns an entity's position in the level on the specified axis.<br />
<br />
''asName'' - Name of the entity.<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityPlayerLookAtCallback(string& asName, string& asCallback, bool abRemoveWhenLookedAt);<br />
</syntaxhighlight><br />
<br />
Calls a function when the player looks at a certain entity. <br />Callback syntax: <code>void MyFunc(string &in asEntity, int alState)</code> <br />alState: 1 = looking, -1 = not looking<br />
<br />
''asName ''- internal name <br />''asCallback ''- function to call <br />''abRemoveWhenLookedAt ''- determines whether the callback should be removed when the player looked at the entity<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction);<br />
</syntaxhighlight><br />
<br />
Calls a function when the player interacts with a certain entity. <br />Callback syntax: <code>void MyFunc(string &in asEntity)</code><br />
<br />
''asName ''- internal name <br />''asCallback ''- function to call <br />''abRemoveOnInteraction ''- determines whether the callback should be removed when the player interacts with the entity<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityCallbackFunc(string& asName, string& asCallback);<br />
</syntaxhighlight><br />
<br />
Calls a function when the player interacts with a certain entity. <br />Callback syntax: <code>void MyFunc(string &in asEntity, string &in type)</code> <br />Type depends on entity type and includes: "OnPickup", "Break", "OnIgnite", etc<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityConnectionStateChangeCallback(string& asName, string& asCallback);<br />
</syntaxhighlight><br />
<br />
A callback called when ever the connection state changes (button being switched on, lever switched, etc). <br />Callback syntax: <code>void Func(string &in asEntity, int alState)</code> <br />alState: -1 = off, 0 = between, 1 = on<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityInteractionDisabled(string& asName, bool abDisabled);<br />
</syntaxhighlight><br />
<br />
Disallows interaction with an entity.<br />
<br />
<syntaxhighlight lang="c"><br />
void BreakJoint (string& asName);<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
<syntaxhighlight lang="c"><br />
void AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);<br />
</syntaxhighlight><br />
<br />
Calls a function when two entites collide. <br />Callback syntax: <code>void MyFunc(string &in asParent, string &in asChild, int alState)</code> <br />alState: 1 = enter, -1 = leave<br />
<br />
''asParentName ''- internal name of main object <br />''asChildName ''- internal name of object that collides with main object (asterix (<nowiki>*</nowiki>) NOT supported!) <br />''asFunction ''- function to call <br />''abDeleteOnCollide ''- determines whether the callback after it was called <br />''alStates ''- 1 = only enter, -1 = only leave, 0 = both<br />
<br />
<syntaxhighlight lang="c"><br />
void RemoveEntityCollideCallback(string& asParentName, string& asChildName);<br />
</syntaxhighlight><br />
<br />
Removes an EntityCollideCallback. Asterix (<nowiki>*</nowiki>) not supported in ''asChildName''.<br />
<br />
<syntaxhighlight lang="c"><br />
bool GetEntitiesCollide(string& asEntityA, string& asEntityB);<br />
</syntaxhighlight><br />
<br />
Checks whether two entites collide. This function does NOT support asterix (<nowiki>*</nowiki>) or "Player"!<br />
<br />
<syntaxhighlight lang="c"><br />
void SetBodyMass(string &in asName, float afMass);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Sets the mass of an entity's body.<br />
<br />
''asName'' - Name of the body of an entity. The body name of an entity is EntityName_BodyName. <br />''afMass'' - The mass to set.<br />
<br />
<syntaxhighlight lang="c"><br />
float GetBodyMass(string &in asName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Gets the mass of an entity's body.<br />
<br />
''asName'' - Name of the body of an entity. The body name of an entity is EntityName_BodyName. <br />''afMass'' - The mass to get.<br />
<br />
====Props====<br />
<br />
<syntaxhighlight lang="c"><br />
void SetPropEffectActive(string& asName, bool abActive, bool abFadeAndPlaySounds);<br />
</syntaxhighlight><br />
<br />
Can be used on coal to give it the black color it should have.<br />
<br />
<syntaxhighlight lang="c"><br />
void SetPropActiveAndFade(string& asName, bool abActive, float afFadeTime);<br />
</syntaxhighlight><br />
<br />
Activates/deactivates a prop.<br />
<br />
''asName ''- internal name <br />''abActive ''- nothing to add <br />''afFadeTime ''- time in seconds until prop fully fades<br />
<br />
<syntaxhighlight lang="c"><br />
void SetPropStaticPhysics(string& asName, bool abX);<br />
</syntaxhighlight><br />
<br />
Activates/deactivates the physics of a prop. Setting as true will make entities static in midair.<br />
<br />
<syntaxhighlight lang="c"><br />
bool GetPropIsInteractedWith(string& asName);<br />
</syntaxhighlight><br />
<br />
Checks whether a prop is interacted with.<br />
<br />
<syntaxhighlight lang="c"><br />
void RotatePropToSpeed(string& asName, float afAcc, float afGoalSpeed, float afAxisX, float afAxisY, float afAxisZ, bool abResetSpeed, string& asOffsetArea);<br />
</syntaxhighlight><br />
<br />
Rotates the prop up to a set speed.<br />
<br />
''asName ''- internal name <br />''afAcc ''- acceleration <br />''afGoalSpeed ''- desired speed <br />''afAxisX ''- rotation around X axis <br />''afAxisY ''- rotation around Y axis <br />''afAxisZ ''- rotation around Z axis <br />''abResetSpeed ''- determines whether the speed is resetted after goal speed is reached <br />''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 "StaticObject" entity!<br />
<br />
<syntaxhighlight lang="cpp"><br />
void StopPropMovement(string& asName);<br />
</syntaxhighlight><br />
<br />
Stops all movement of a prop.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AddAttachedPropToProp(string& asPropName, string& asAttachName, string& asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);<br />
</syntaxhighlight><br />
<br />
Attaches a prop to another prop.<br />
<br />
a''sPropName''- the prop to attach another prop at <br />''asAttachName ''- internal name of the prop that gets attached <br />''asAttachFile ''- the prop that gets attached extension .ent <br />''afPosX ''- X position of the attach from the prop <br />''afPosY ''- Y position of the attach from the prop <br />''afPosZ ''- Z position of the attach from the prop <br />''afRotX ''- rotation around X axis of the attach <br />''afRotY ''- rotation around Y axis of the attach <br />''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of "AddEntityCollideCallback", attached props will not call the callback function if they collide with a "static_object" or a "StaticProp" entity type!<br />
<br />
{{bug|''afRotZ '' is used for both the ZX rotation and the Z position of the attached prop. Unwanted rotation can be avoided by using: <br />''AddAttachedPropToProp(asPropName, asAttachName, asAttachFile, afPosX, afPosY, '''0''', afPosZ, '''90.0f''', afPosZ)''}}<br />
<br />
{{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.}}<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AttachPropToProp(string& asPropName, string& asAttachName, string& asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Attaches a prop to another prop. Fixed version of AddAttachedPropToProp.<br />
<br />
''asPropName ''- the prop to attach another prop at <br />''asAttachName ''- internal name of the prop that gets attached <br />''asAttachFile ''- the prop that gets attached extension .ent <br />''afPosX ''- X position of the attach from the prop <br />''afPosY ''- Y position of the attach from the prop <br />''afPosZ ''- Z position of the attach from the prop <br />''afRotX ''- rotation around X axis of the attach <br />''afRotY ''- rotation around Y axis of the attach <br />''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of "AddEntityCollideCallback", attached props will not call the callback function if they collide with a "static_object" or a "StaticProp" entity type!<br />
<br />
<syntaxhighlight lang="cpp"><br />
void RemoveAttachedPropFromProp(string& asPropName, string& asAttachName);<br />
</syntaxhighlight><br />
<br />
Detaches a prop from a prop.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetPropHealth(string& asName, float afHealth);<br />
void AddPropHealth(string& asName, float afHealth);<br />
float GetPropHealth(string& asName);<br />
</syntaxhighlight><br />
<br />
Modifies/returns the health of a prop.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void ResetProp(string& asName);<br />
</syntaxhighlight><br />
<br />
Resets a prop's state to the original one when the map was loaded.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void PlayPropAnimation(string& asProp, string& asAnimation, float afFadeTime, bool abLoop, string& asCallback);<br />
</syntaxhighlight><br />
<br />
Makes the prop play an animation and calls a function. <br />Callback syntax: <code>void MyFunc(string &in asProp)</code><br />
<br />
''asProp ''- internal name of the prop <br />''asAnimation ''- animation to play <br />''afFadeTime ''- ? <br />''abLoop ''- determines whether the animation loops <br />''asCallback ''- function to call<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AddPropForce(string& asName, float afX, float afY, float afZ, string& asCoordSystem);<br />
void AddPropImpulse(string& asName, float afX, float afY, float afZ, string& asCoordSystem);<br />
void AddBodyForce(string& asName, float afX, float afY, float afZ, string& asCoordSystem);<br />
void AddBodyImpulse(string& asName, float afX, float afY, float afZ, string& asCoordSystem);<br />
</syntaxhighlight><br />
<br />
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 "Body" 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).<br />
<br />
''asName ''- the object to push; for bodies, use this format: "''entityName''_''bodyName''" <br />''afX ''- magnitude along the X-axis <br />''afY ''- magnitude along the Y-axis <br />''afZ ''- magnitude along the Z-axis <br />''asCoordSystem ''- determines which coordinate system is used, usually "world" 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.<br />
<br />
====Connections====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void InteractConnectPropWithRope(string& asName, string& asPropName, string& asRopeName, bool abInteractOnly, float afSpeedMul, float afToMinSpeed, float afToMaxSpeed, bool abInvert, int alStatesUsed);<br />
</syntaxhighlight><br />
<br />
Connects a prop with the movement of a rope (ie. turn wheel to move rope).<br />
<br />
''asName ''- connection name <br />''asPropName ''- name of prop <br />''asRopeName ''- name of rope <br />''abInteractOnly ''- ? <br />''afSpeedMul ''- speed multiplier of how quickly the rope moves <br />''afToMinSpeed ''- the slowest the rope will move when moving the prop <br />''afToMaxSpeed ''- the fastest the rope will move when moving the prop <br />''abInvert ''- whether to invert the direction the rope moves <br />''alStatesUsed ''- which states of the prop can interact with the rope?<br />
<br />
<syntaxhighlight lang="cpp"><br />
void InteractConnectPropWithMoveObject(string& asName, string& asPropName, string& asMoveObjectName, bool abInteractOnly, bool abInvert, int alStatesUsed);<br />
</syntaxhighlight><br />
<br />
This one should only be used if there must be an exact correspondance to prope "amount" and the moveobject open amount. It is best used for Wheel-door connections!<br />
<br />
<syntaxhighlight lang="cpp"><br />
void ConnectEntities(string& asName, string& asMainEntity, string& asConnectEntity, bool abInvertStateSent, int alStatesUsed, string& asCallbackFunc);<br />
</syntaxhighlight><br />
<br />
Callback syntax: <code>void MyFunc(string &in asConnectionName, string &in asMainEntity, string &in asConnectEntity, int alState)</code> <br />State is what is sent to connection entity and will be inverted if abInvertStateSent = true!<br />
<br />
====Lamps====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetLampLit(string& asName, bool abLit, bool abEffects);<br />
</syntaxhighlight><br />
<br />
(Un)lits a lamp.<br />
<br />
''asName ''- Name of the lamp <br />''abLit ''- Set true if you want the lamp to be lit, set to false if you want the lamp to be unlit <br />''abEffects ''- If you want to have the lamp fade in/out when it gets (un)lit<br />
<br />
====Doors====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetSwingDoorLocked(string& asName, bool abLocked, bool abEffects);<br />
void SetSwingDoorClosed(string& asName, bool abClosed, bool abEffects);<br />
</syntaxhighlight><br />
<br />
Locks/closes a swing door.<br />
<br />
<syntaxhighlight lang="cpp"><br />
bool GetSwingDoorLocked(string& asName);<br />
bool GetSwingDoorClosed(string& asName);<br />
</syntaxhighlight><br />
<br />
Checks whether a swing door is locked/closed.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetSwingDoorDisableAutoClose(string& asName, bool abDisableAutoClose);<br />
</syntaxhighlight><br />
<br />
Deactivates the "auto-close" when a door is nearly closed.<br />
<br />
<syntaxhighlight lang="cpp"><br />
int GetSwingDoorState(string& asName);<br />
</syntaxhighlight><br />
<br />
Returns an integer depending on how far the door is opened. <br />-1 = angle is close to 0°, 1 = angle is 70% or higher of max, 0 = inbetween -1 and 1.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetLevelDoorLocked(string& asName, bool abLocked);<br />
</syntaxhighlight><br />
<br />
Locks a level door. Note that level doors are NOT swing doors.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetLevelDoorLockedSound(string& asName, string& asSound);<br />
</syntaxhighlight><br />
<br />
Determines which sound is played when interacting with a locked level door.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetLevelDoorLockedText(string& asName, string& asTextCat, string& asTextEntry);<br />
</syntaxhighlight><br />
<br />
Displays a message when interacting with a locked level door.<br />
<br />
''asName ''- internal name <br />''asTextCat ''- the category in the .lang file <br />''asTextEntry ''- the entry in the .lang file<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetMoveObjectState(string& asName, float afState);<br />
</syntaxhighlight><br />
<br />
Moves an object to a certain state.<br />
<br />
''asName ''- internal name <br />''afState ''- state of the object, 0 = closed, 1 = open, values inbetween (and above, for example, the bridge_metal_vert) are valid too!<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetMoveObjectStateExt(string& asName, float afState, float afAcc, float afMaxSpeed, float afSlowdownDist, bool abResetSpeed);<br />
</syntaxhighlight><br />
<br />
Moves an object to a certain state, extended method.<br />
<br />
''asName ''- internal name <br />''afState ''- state of the object, 0 = closed, 1 = open, values inbetween are valid too! <br />''afAcc ''- acceleration <br />''afMaxSpeed ''- maximum speed <br />''afSlowdownDist ''- Distance to the target state before decceleration occurs. <br />''abResetSpeed ''- Set to True if the prop's speed should be reset before performing the movement, else the prop will accelerate from it's current speed to afMaxSpeed.<br />
<br />
====Levers, wheels and buttons====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetPropObjectStuckState(string& asName, int alState);<br />
void SetWheelStuckState(string& asName, int alState, bool abEffects);<br />
void SetLeverStuckState(string& asName, int alState, bool abEffects);<br />
</syntaxhighlight><br />
<br />
Makes a prop<nowiki>\</nowiki>wheel<nowiki>\</nowiki>lever stuck in a certain state.<br />
<br />
''asName ''- internal name <br />''alState ''- 0 = not stuck, 1 = at max, -1 = at min <br />''abEffects ''- use effects<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetWheelAngle(string& asName, float afAngle, bool abAutoMove);<br />
</syntaxhighlight><br />
<br />
Moves a wheel to a certain angle.<br />
<br />
''asName ''- internal name <br />''afAngle ''- angle <br />''abAutoMove ''- determines whether the wheel should move on its own<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetWheelInteractionDisablesStuck(string& asName, bool abX);<br />
void SetLeverInteractionDisablesStuck(string& asName, bool abX);<br />
</syntaxhighlight><br />
<br />
Allows the player to make a wheel/lever unstuck when interacted with.<br />
<br />
<syntaxhighlight lang="cpp"><br />
int GetLeverState(string& asName);<br />
</syntaxhighlight><br />
<br />
Returns the state of the lever. <br />0 = not stuck, 1 = at max, -1 = at min<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetMultiSliderStuckState(string& asName, int alStuckState, bool abEffects);<br />
</syntaxhighlight><br />
<br />
Makes a MultiSlider stuck in a certain state.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetMultiSliderCallback(string& asName, string& asCallback);<br />
</syntaxhighlight><br />
<br />
Calls a function when state changes. <br />Callback syntax: <code>void MyFunc(string &in asEntity, int alState)</code><br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetButtonSwitchedOn(string& asName, bool abSwitchedOn, bool abEffects);<br />
</syntaxhighlight><br />
<br />
====Sticky areas====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetAllowStickyAreaAttachment(bool abX);<br />
</syntaxhighlight><br />
<br />
Allows entites to stick to a StickyArea.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AttachPropToStickyArea(string& asAreaName, string& asProp);<br />
void AttachBodyToStickyArea(string& asAreaName, string& asBody);<br />
</syntaxhighlight><br />
<br />
Attaches a prop/body to a StickyArea.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void DetachFromStickyArea(string& asAreaName);<br />
</syntaxhighlight><br />
<br />
Detaches everything from a StickyArea.<br />
<br />
====Enemies====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetNPCAwake(string& asName, bool abAwake, bool abEffects);<br />
</syntaxhighlight><br />
<br />
Activates the npc<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetNPCFollowPlayer(string& asName, bool abX);<br />
</syntaxhighlight><br />
<br />
Sets an NPC's head to follow the player's movement's.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetEnemyDisabled(string& asName, bool abDisabled);<br />
</syntaxhighlight><br />
<br />
Disables an enemy.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetEnemyIsHallucination(string& asName, bool abX);<br />
</syntaxhighlight><br />
<br />
Makes an enemy a hallucination. Hallucinations fade to smoke when they get near the player.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void FadeEnemyToSmoke(string& asName, bool abPlaySound);<br />
</syntaxhighlight><br />
<br />
Instantly fades an enemy to smoke.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void ShowEnemyPlayerPosition(string& asName);<br />
</syntaxhighlight><br />
<br />
Makes the enemy run to the player, no matter where he is.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AlertEnemyOfPlayerPresence(string &in asName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Gives the specified enemy the player's current position and makes it search the area.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetEnemyDisableTriggers(string& asName, bool abX);<br />
</syntaxhighlight><br />
<br />
Enables or disables enemy triggers. If disabled, enemy will not react to player or attack.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AddEnemyPatrolNode(string& asName, string& asNodeName, float afWaitTime, string& asAnimation);<br />
</syntaxhighlight><br />
<br />
Adds a patrol node to the enemy's path.<br />
<br />
''asName ''- internal name of the enemy <br />''asNodeName ''- path node <br />''afWaitTime ''- time in seconds that the enemy waits at the path node before continuing <br />''asAnimation ''- the animation the enemy uses when reaching the path node<br />
<br />
<syntaxhighlight lang="cpp"><br />
void ClearEnemyPatrolNodes(string& asEnemyName);<br />
</syntaxhighlight><br />
<br />
Clears the current path of patrol nodes of the enemy.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetEnemySanityDecreaseActive(string &in asName, bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables whether an enemy activates the player's sanity drain when stared at.<br />
<br />
''asName ''- Internal name of the enemy <br />''abX ''- Enabled/disabled<br />
<br />
<syntaxhighlight lang="cpp"><br />
void TeleportEnemyToNode(string &in asEnemyName, string &in asNodeName, bool abChangeY);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Teleports an enemy to a specific PathNode.<br />
<br />
''asEnemyName ''- Internal name of the enemy <br />''asNodeName ''- Internal name of the node to teleport to <br />''abChangeY ''- Whether the Y position of the node will be used when teleporting the enemy<br />
<br />
<syntaxhighlight lang="cpp"><br />
void TeleportEnemyToEntity(string &in asEnemyName, string &in asTargetEntity, string &in asTargetBody, bool abChangeY);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Teleports an enemy to a specific entity.<br />
<br />
''asEnemyName ''- Internal name of the enemy <br />''asTargetEntity ''- Internal name of the entity to teleport to <br />''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) <br />''abChangeY ''- Whether the Y position of the node will be used when teleporting the enemy<br />
<br />
<syntaxhighlight lang="c"><br />
void ChangeManPigPose(string&in asName, string&in asPoseType);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Changes the pose a specified ManPig.<br />
<br />
''asName ''- Internal name of the enemy <br />''asPoseType''- Name of the ManPig pose to use. Can be "Biped" or "Quadruped"<br />
<br />
<syntaxhighlight lang="c"><br />
void SetTeslaPigFadeDisabled(string&in asName, bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables whether a specified TeslaPig should fade the player's view in and out.<br />
<br />
''asName ''- Internal name of the enemy <br />''abX''- Enabled/disabled<br />
<br />
<syntaxhighlight lang="c"><br />
void SetTeslaPigSoundDisabled(string&in asName, bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables whether a specified TeslaPig should play the proximity sounds.<br />
<br />
''asName ''- Internal name of the enemy <br />''abX''- Enabled/disabled<br />
<br />
<syntaxhighlight lang="c"><br />
void SetTeslaPigEasyEscapeDisabled(string&in asName, bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables whether a specified TeslaPig should be easier to escape from when hunted.<br />
<br />
''asName ''- Internal name of the enemy <br />''abX''- Enabled/disabled<br />
<br />
<syntaxhighlight lang="c"><br />
void ForceTeslaPigSighting(string&in asName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Forces a TeslaPig to be visible for a short time.<br />
<br />
''asName ''- Internal name of the enemy<br />
<br />
<syntaxhighlight lang="c"><br />
string& GetEnemyStateName(string &in asName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the name of the state a specified enemy is current in. States can be Hunt, Search, Patrol, Wait, Alert, Investigate, Track and BreakDoor.<br />
<br />
''asName ''- Internal name of the enemy</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&diff=6446HPL2/Engine Scripts2023-09-14T11:47:59Z<p>Mudbill: Added #include</p>
<hr />
<div>{{TocRight}}<br />
<br />
This page documents all scripts available in Amnesia: The Dark Descent.<br />
<br />
{{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].}}<br />
<br />
== Directives ==<br />
<br />
First off, <code>#include "file.hps"</code> can be used to programmatically merge together multiple separate files to make organizing scripts easier.<br />
{{ReqVer|1.5}}<br />
<br />
==Engine scripts==<br />
===Main===<br />
<br />
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.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void OnStart();<br />
</syntaxhighlight><br />
<br />
The function that runs when the map is loaded for the first time.<br />
<br />
<syntaxhighlight lang="c++"><br />
void OnEnter();<br />
</syntaxhighlight><br />
<br />
The function that runs whenever the player enters a map.<br />
<br />
<syntaxhighlight lang="c++"><br />
void OnLeave();<br />
</syntaxhighlight><br />
<br />
The function that runs when the player leaves a map.<br />
<br />
<syntaxhighlight lang="c++"><br />
void OnGameStart();<br />
</syntaxhighlight><br />
<br />
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").<br />
<br />
<syntaxhighlight lang="c++"><br />
void OnUpdate(float afStep);<br />
</syntaxhighlight><br />
{{ReqVer|1.5}}<br />
<br />
This function is executed for every game update or "tick". 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.<br />
<br />
===General===<br />
<br />
<syntaxhighlight lang="c++"><br />
float RandFloat(float afMin, float afMax);<br />
</syntaxhighlight><br />
<br />
Generates a random float.<br />
<br />
#''afMin ''- minimum value<br />
#''afMax ''- maximum value<br />
<syntaxhighlight lang="c++"><br />
int RandInt(int alMin, int alMax);<br />
</syntaxhighlight><br />
<br />
Generates a random int. Note: the maximum value is ''inclusive'' - the RandInt() function may return this value.<br />
<br />
#''alMin ''- minimum value<br />
#''alMax ''- maximum value<br />
<syntaxhighlight lang="c++"><br />
bool StringContains(string& asString, string& asSubString);<br />
</syntaxhighlight><br />
<br />
Checks whether a string contains the specified string. <br />Example: searching for "hello" in "hello world" would return '''true'''.<br />
<br />
#''asString ''- the string to check<br />
#''asSubString ''- the string to search for<br />
<syntaxhighlight lang="cpp"><br />
string& StringSub(string& asString, int alStart, int alCount);<br />
</syntaxhighlight><br />
<br />
Returns the substring in a string. <br />Example: in the string "frictional games rocks", using 4 as ''alStart'' and 6 as ''alCount'' would return '''"tional"'''.<br />
<br />
#''asString ''- the string<br />
#''alStart ''- start position in the string<br />
#''alCount ''- amount of characters<br />
<syntaxhighlight lang="c++"><br />
int StringToInt(string&in asString);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
If possible, returns an integer converted from a string, else returns 0.<br />
<br />
#''asString'' - String to convert.<br />
<syntaxhighlight lang="c++"><br />
float StringToFloat(string&in asString);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
If possible, returns a float converted from a string, else returns 0.<br />
<br />
#''asString'' - String to convert.<br />
<syntaxhighlight lang="c++"><br />
bool StringToBool(string&in asString);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
If possible, returns a boolean converted from a string, else returns false.<br />
<br />
#''asString'' - String to convert.<br />
<br />
===Mathematical Operations===<br />
<br />
<syntaxhighlight lang="c++"><br />
float MathSin(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the sine of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathCos(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the cosine of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathTan(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the tangent of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathAsin(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the arc sine of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathAcos(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the arc cosine of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathAtan(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the arc tangent of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathAtan2(float afX, float afY);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Calculates and returns the arc tangent of the specified values.<br />
<br />
#''afX'' - First value to operate.<br />
#''afY'' - Second value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathSqrt(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the square root of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathPow(float afBase, float afExp);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the value of afBase raised to the power of afExp.<br />
<br />
#''afBase'' - The base value.<br />
#''afExp'' - Value to calculate the base with.<br />
<syntaxhighlight lang="c++"><br />
float MathMin(float afA, float afB);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the lowest value.<br />
<br />
#''afA'' - First value.<br />
#''afB'' - Second value.<br />
<syntaxhighlight lang="c++"><br />
float MathMax(float afA, float afB);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the highest value.<br />
<br />
#''afA'' - First value.<br />
#''afB'' - Second value.<br />
<syntaxhighlight lang="c++"><br />
float MathClamp(float afX, float afMin, float afMax);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns afX clamped between afMin and afMax. If afX < afMin, returns afMin, and if afX > afMax, returns afMax.<br />
<br />
#''afX'' - The value to clamp.<br />
#''afMin'' - The minimum value to clamp afX with.<br />
#''afMax'' - The maximum value to clamp afX with.<br />
<syntaxhighlight lang="c++"><br />
float MathAbs(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the absolute value.<br />
<br />
#''afX'' - Value to operate.<br />
<br />
===Debugging===<br />
<br />
<syntaxhighlight lang="cpp"><br />
void Print(string& asString);<br />
</syntaxhighlight><br />
<br />
Prints a string to the log file (''hpl.log'').<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddDebugMessage(string& asString, bool abCheckForDuplicates);<br />
</syntaxhighlight><br />
<br />
Prints a string to the debug console.<br />
<br />
#''asString ''- the string to print<br />
#''abCheckForDuplicates ''- if true, the string won't be printed more than once on screen until it disappears<br />
<syntaxhighlight lang="c++"><br />
void ProgLog(string& asLevel, string& asMessage);<br />
</syntaxhighlight><br />
<br />
Prints an entry to the ProgLog (progression log). <br />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. <br /> <br />This function allows to log custom messages.The messages in the ProgLog file are sorted by time elapsed since a map was loaded.<br />
<br />
ProgLog has to be enabled for a player profile in ''user_settings.cfg'' before it starts working.<br />
<br />
#''asLevel ''- can be "Low", "Medium" or "High". It's a tag which appears in each log entry, for event prioritising.<br />
#''asMessage ''- The custom message to be printed to the log.<br />
<syntaxhighlight lang="c++"><br />
bool ScriptDebugOn();<br />
</syntaxhighlight><br />
<br />
Checks whether the debug mode is enabled. <br />See [[HPL2/Development_Environment|"Setting up Development Environment"]] to setup debug mode on your own computer.<br />
<br />
===Variables===<br />
{{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 "for" loop. For variables which need to be saved, use the wrappers as described below.}}<br />
<br />
====Local====<br />
<br />
Local variables can be used throughout the same script file.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetLocalVarInt(string& asName, int alVal);<br />
void AddLocalVarInt(string& asName, int alVal);<br />
int GetLocalVarInt(string& asName);<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLocalVarFloat(string& asName, float afVal);<br />
void AddLocalVarFloat(string& asName, float afVal);<br />
float GetLocalVarFloat(string& asName);<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLocalVarString(string& asName, const string& asVal);<br />
void AddLocalVarString(string& asName, string& asVal);<br />
string& GetLocalVarString(string& asName);<br />
</syntaxhighlight><br />
<br />
====Global====<br />
<br />
Global variables can be used throughout several maps and can be accessed by several script files.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetGlobalVarInt(string& asName, int alVal);<br />
void AddGlobalVarInt(string& asName, int alVal);<br />
int GetGlobalVarInt(string& asName);<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="c++"><br />
void SetGlobalVarFloat(string& asName, float afVal);<br />
void AddGlobalVarFloat(string& asName, float afVal);<br />
float GetGlobalVarFloat(string& asName);<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="c++"><br />
void SetGlobalVarString(string& asName, const string& asVal);<br />
void AddGlobalVarString(string& asName, string& asVal);<br />
string& GetGlobalVarString(string& asName);<br />
</syntaxhighlight><br />
<br />
===Particle Systems===<br />
<br />
<syntaxhighlight lang="c++"><br />
void PreloadParticleSystem(string& asPSFile);<br />
</syntaxhighlight><br />
<br />
Preloads a particle system.<br />
<br />
#''asPSFile'' - The particle system file to load. Extension: .ps<br />
<syntaxhighlight lang="c++"><br />
void CreateParticleSystemAtEntity(string& asPSName, string& asPSFile, string& asEntity, bool abSavePS);<br />
</syntaxhighlight><br />
<br />
Creates a particle system on an entity.<br />
<br />
#''asPSName ''- internal name<br />
#''asPSFile ''- the particle system to use + extension .ps<br />
#''asEntity ''- the entity to create the particle system at<br />
#''abSavePS ''- determines whether a particle system should "remember" its shown/hidden state, so that this state can be restored when the player revisits the level<br />
<syntaxhighlight lang="c++"><br />
void CreateParticleSystemAtEntityExt(string& asPSName, string& asPSFile, string& asEntity, bool abSavePS,<br />
float afR, float afG, float afB, float afA, bool abFadeAtDistance, float afFadeMinEnd, float afFadeMinStart,<br />
float afFadeMaxStart, float afFadeMaxEnd);<br />
</syntaxhighlight><br />
<br />
Creates a particle system on an entity, extended method with more options.<br />
<br />
#''asPSName ''- internal name<br />
#''asPSFile ''- the particle system to use + extension .ps<br />
#''asEntity ''- the entity to create the particle system at<br />
#''abSavePS ''- determines whether a particle system should "remember" its shown/hidden state, so that this state can be restored when the player revisits the level<br />
#''afR ''- red value<br />
#''afG ''- green value<br />
#''afB ''- blue value<br />
#''afA ''- alpha value<br />
#''abFadeAtDistance ''- determines whether a particle system fades from a certain distance on<br />
#''afFadeMinEnd ''- minimum distance at which the particle system stops fading<br />
#''afFadeMinStart ''- minimum distance at which the particle system starts fading<br />
#''afFadeMaxStart ''- maximum distance at which the particle system starts fading<br />
#''afFadeMaxEnd ''- maximum distance at which the particle system stops fading<br />
<syntaxhighlight lang="c++"><br />
void DestroyParticleSystem(string& asName);<br />
</syntaxhighlight><br />
<br />
Destroys a particle system.<br />
<br />
#''asName'' - The internal name of the particle system<br />
<br />
===Sounds & Music===<br />
<br />
<syntaxhighlight lang="c++"><br />
void PreloadSound(string& asSoundFile);<br />
</syntaxhighlight><br />
<br />
Preloads a sound.<br />
<br />
#''asSoundFile'' - The sound file to load. Extension: .snt<br />
<syntaxhighlight lang="c++"><br />
void PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);<br />
</syntaxhighlight><br />
<br />
Creates a sound on an entity.<br />
<br />
#''asSoundName ''- internal name<br />
#''asSoundFile ''- the sound to use + extension .snt<br />
#''asEntity ''- the entity to create the sound at, can be "Player"<br />
#''afFadeTime ''- time in seconds the sound needs to fade. Avoids enemies hearing the sound if afFadeTime is at least 0.1f<br />
#''abSaveSound ''- if ''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''!<br />
<syntaxhighlight lang="c++"><br />
void FadeInSound(string& asSoundName, float afFadeTime, bool abPlayStart);<br />
</syntaxhighlight><br />
<br />
Fades in a sound.<br />
<br />
#''asSoundName ''- internal name<br />
#''afFadeTime ''- time in seconds<br />
#''abPlayStart ''- ?<br />
<syntaxhighlight lang="c++"><br />
void StopSound(string& asSoundName, float afFadeTime);<br />
</syntaxhighlight><br />
<br />
Fades out a sound.<br />
<br />
#''asSoundName ''- internal name<br />
#''afFadeTime ''- time in seconds, use 0 to immediatly stop the sound<br />
<syntaxhighlight lang="c++"><br />
void PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);<br />
</syntaxhighlight><br />
<br />
Plays music.<br />
<br />
#''asMusicFile ''- the music to play + extension .ogg<br />
#''abLoop ''- determines whether a music track should loop<br />
#''afVolume ''- volume of the music<br />
#''afFadeTime ''- time in seconds until music reaches full volume<br />
#''alPrio ''- priority of the music. Note that only the music with the highest priority can be heard! 0 - lowest, 1 - higher, etc.<br />
#''abResume'' - if ''true'', playback will be continued from where the track stopped after the call to StopMusic(); if ''false'', the track will be restarted.<br />
<syntaxhighlight lang="c++"><br />
void StopMusic(float afFadeTime, int alPrio);<br />
</syntaxhighlight><br />
<br />
Stops music.<br />
<br />
#''afFadeTime ''- time in seconds until music stops<br />
#''alPrio ''- the priority of the music that should stop<br />
<syntaxhighlight lang="c++"><br />
void FadeGlobalSoundVolume(float afDestVolume, float afTime);<br />
</syntaxhighlight><br />
<br />
Influences the global sound volume, that means everything you can hear '''from the world'''. This does not affect music of GUI sounds.<br />
<br />
#''afDestVolume ''- desired volume<br />
#''afTime ''- time in seconds until volume reaches desired volume<br />
<syntaxhighlight lang="c++"><br />
void FadeGlobalSoundSpeed(float afDestSpeed, float afTime);<br />
</syntaxhighlight><br />
<br />
Influences the global sound speed.<br />
<br />
#''afDestSpeed ''- desired speed<br />
#''afTime ''- time in seconds until volume reaches desired speed<br />
<br />
===Lights===<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLightVisible(string& asLightName, bool abVisible);<br />
</syntaxhighlight><br />
<br />
Enables/disables lights.<br />
<br />
#''asLightName ''- internal name<br />
#''abVisible ''- determines the state of the light<br />
<syntaxhighlight lang="c++"><br />
void FadeLightTo(string& asLightName, float afR, float afG, float afB, float afA, float afRadius, float afTime);<br />
</syntaxhighlight><br />
<br />
Changes the properties of a light.<br />
<br />
#''asLightName ''- internal name<br />
#''afR ''- red value<br />
#''afG ''- green value<br />
#''afB ''- blue value<br />
#''afA ''- alpha value<br />
#''afRadius ''- radius of the light. -1 means keeping the radius<br />
#''afTime ''- time in seconds until change is done<br />
<syntaxhighlight lang="c++"><br />
void SetLightFlickerActive(string& asLightName, bool abActive);<br />
</syntaxhighlight><br />
<br />
Activates flickering on a light.<br />
<br />
#''asLightName'' - The internal light name<br />
#''abActive'' - true = active, false = inactive<br />
<br />
==Game scripts==<br />
<br />
===General===<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartCredits(string& asMusic, bool abLoopMusic, string& asTextCat, string& asTextEntry, int alEndNum);<br />
</syntaxhighlight><br />
<br />
Starts the end credits screen.<br />
<br />
#''asMusic ''- the music to play (including .ogg)<br />
#''abLoopMusic ''- determines whether the music should loop<br />
#''asTextCat ''- the category to be used in the .lang file<br />
#''asTextEntry ''- the entry in the .lang file<br />
#''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.<br />
<syntaxhighlight lang="c++"><br />
void StartDemoEnd();<br />
</syntaxhighlight><br />
<br />
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)<br />
<br />
<syntaxhighlight lang="c++"><br />
void AutoSave();<br />
</syntaxhighlight><br />
<br />
Save the game to the auto save.<br />
<br />
<syntaxhighlight lang="c++"><br />
void CheckPoint (string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry);<br />
</syntaxhighlight><br />
<br />
Sets a checkpoint at which the player will respawn in case he dies. <br />Callback syntax: <code>void MyFunc(string &in asName, int alCount)</code> <br />Count is 0 on the first checkpoint load!<br />
<br />
#''asName ''- the internal name<br />
#''asStartPos ''- the name of the StartPos in the editor<br />
#''asCallback ''- the function to call when the player dies/respawns<br />
#''asDeathHintCat ''- the category of the death hint message to be used in the .lang file<br />
#''asDeathHintEntry ''- the entry in the .lang file<br />
<syntaxhighlight lang="c++"><br />
void ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);<br />
</syntaxhighlight><br />
<br />
Immediatly loads another map.<br />
<br />
#''asMapName ''- the file to load<br />
#''asStartPos ''- the name of the StartPos on the next map<br />
#''asStartSound ''- the sound that is played when the change starts<br />
#''asEndSound ''- the sound that is played when the new map is loaded<br />
<syntaxhighlight lang="c++"><br />
void ClearSavedMaps();<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
<syntaxhighlight lang="c++"><br />
void CreateDataCache();<br />
void DestroyDataCache();<br />
</syntaxhighlight><br />
<br />
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.<br />
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.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetMapDisplayNameEntry(string& asNameEntry);<br />
</syntaxhighlight><br />
<br />
Sets the map name shown in save file names. If none is set NULL is assumed.<br />
<br />
#''asNameEntry ''- the entry to display, category must be "Levels"!<br />
<syntaxhighlight lang="c++"><br />
void SetSkyBoxActive(bool abActive);<br />
</syntaxhighlight><br />
<br />
Enables/Disables the skybox.<br />
<br />
#''abActive'' - true = active, false = inactive<br />
<syntaxhighlight lang="c++"><br />
void SetSkyBoxTexture(string& asTexture);<br />
</syntaxhighlight><br />
<br />
Sets the texture of the skybox.<br />
<br />
#''asTexture'' - The texture file to set. Extension: .dds<br />
<syntaxhighlight lang="c++"><br />
void SetSkyBoxColor(float afR, float afG, float afB, float afA);<br />
</syntaxhighlight><br />
<br />
Sets the solid color of the skybox rather than a texture.<br />
<br />
#''afR ''- red value<br />
#''afG ''- green value<br />
#''afB ''- blue value<br />
#''afA ''- alpha value<br />
<syntaxhighlight lang="c++"><br />
void SetFogActive(bool abActive);<br />
</syntaxhighlight><br />
<br />
Enables/Disables the global fog.<br />
<br />
#''abActive'' - true = active, false = inactive<br />
<syntaxhighlight lang="c++"><br />
void SetFogColor(float afR, float afG, float afB, float afA);<br />
</syntaxhighlight><br />
<br />
Sets the color to use for the global fog.<br />
<br />
#''afR ''- red value<br />
#''afG ''- green value<br />
#''afB ''- blue value<br />
#''afA ''- alpha value<br />
<syntaxhighlight lang="c++"><br />
void SetFogProperties(float afStart, float afEnd, float afFalloffExp, bool abCulling);<br />
</syntaxhighlight><br />
<br />
Sets the properties for the global fog.<br />
<br />
#''afStart ''- how many meters from the camera should the fog begin<br />
#''afEnd ''- how many meters from the camera should the fog reach full thickness<br />
#''afFalloffExp ''- the amount by which the thinkness increases<br />
#''abCulling ''- whether occlusion culling is active for the fog; this prevents objects behind the fog from being loaded<br />
<syntaxhighlight lang="c++"><br />
void SetupLoadScreen(string&asTextCat, string&asTextEntry, int alRandomNum, string&asImageFile);<br />
</syntaxhighlight><br />
<br />
Determines which loading screen will be shown when changing maps.<br />
<br />
#''asTextCat ''- the category of the loading text in the .lang file to be shown on the loading screen<br />
#''asTextEntry ''- the entry in the .lang file<br />
#''alRandomNum ''- if greater 1, then it will randomize between 1 and alRandom for each LoadScreen giving entry the suffix XX (eg 01). If < =1 then no suffix is added<br />
#''asImageFile ''- the image to be shown (optional)<br />
<br />
===Game Timer===<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddTimer(string& asName, float afTime, string& asFunction);<br />
</syntaxhighlight><br />
<br />
Creates a timer which calls a function when it expires. <br />Callback syntax: <code>void MyFunc(string &in asTimer)</code><br />
<br />
#''asName ''- the name of the timer<br />
#''afTime ''- time in seconds<br />
#''asFunction ''- the function to call<br />
<syntaxhighlight lang="c++"><br />
void RemoveTimer(string& asName);<br />
</syntaxhighlight><br />
<br />
Removes a timer, no matter how much time is left.<br />
<br />
#''asName'' - the internal name of the timer.<br />
<syntaxhighlight lang="c++"><br />
float GetTimerTimeLeft(string& asName);<br />
</syntaxhighlight><br />
<br />
Returns the time left on a timer.<br />
<br />
#''asName'' - the internal name of the timer.<br />
<br />
===Screen Effects===<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadeOut(float afTime);<br />
</syntaxhighlight><br />
<br />
Fades the screen to black.<br />
<br />
''afTime ''- time in seconds until the screen is completly black<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadeIn(float afTime);<br />
</syntaxhighlight><br />
<br />
Fades the screen back to normal.<br />
<br />
''afTime ''- time in seconds until the screen back to normal<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadeImageTrailTo(float afAmount, float afSpeed);<br />
</syntaxhighlight><br />
<br />
Applies the image trail effect to the screen.<br />
<br />
''afAmount ''- intensity (default: 0) <br />''afSpeed ''- time in seconds until full effect<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadeSepiaColorTo(float afAmount, float afSpeed);<br />
</syntaxhighlight><br />
<br />
Makes the screen go dark red.<br />
<br />
''afAmount ''- intensity (default: 0) <br />''afSpeed ''- time in seconds until full effect<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadeRadialBlurTo(float afSize, float afSpeed);<br />
</syntaxhighlight><br />
<br />
Applies radial blur effects to the screen.<br />
<br />
''afSize ''- intensity (default: 0) <br />''afSpeed ''- time in seconds until full effect<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetRadialBlurStartDist(float afStartDist);<br />
</syntaxhighlight><br />
<br />
Determines at which distance the radial blur effects appear.<br />
<br />
''afStartDist ''- the distance at which the effect starts<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartEffectFlash(float afFadeIn, float afWhite, float afFadeOut);<br />
</syntaxhighlight><br />
<br />
Fades the screen to white.<br />
<br />
''afFadeIn ''- time in seconds until screen is white <br />''afWhite ''- determines to which percentage the screen fades to white (1.0 = completly white) <br />''afFadeOut ''- time in seconds until screen is back to normal again<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartEffectEmotionFlash(string& asTextCat, string& asTextEntry, string& asSound);<br />
</syntaxhighlight><br />
<br />
Fades the screen to white and shows a text message.<br />
<br />
''asTextCat ''- the category in the .lang file <br />''asTextEntry ''- the text entry in the .lang file <br />''asSound ''- the sound to play while fading<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddEffectVoice(string& asVoiceFile, string& asEffectFile, string& asTextCat, string& asTextEntry,<br />
bool abUsePosition, string& asPosEntity, float afMinDistance, float afMaxDistance);<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
''asVoiceFile ''- the voice to play <br />''asEffectFile ''- the effect to play <br />''asTextCat ''- the category in the .lang file <br />''asTextEntry ''- the text entry in the .lang file <br />''abUsePosition ''- plays using 3D from the entity, or without 3D <br />''asPosEntity ''- the entity at which the effect appears <br />''afMinDistance ''- minimum distance to see the effect <br />''afMaxDistance ''- maximum distance to see the effect<br />
<br />
<syntaxhighlight lang="c++"><br />
void StopAllEffectVoices(float afFadeOutTime);<br />
</syntaxhighlight><br />
<br />
Stops all voices and calls the EffectVoiceOverCallback.<br />
<br />
<syntaxhighlight lang="c++"><br />
bool GetEffectVoiceActive();<br />
</syntaxhighlight><br />
<br />
Checks whether EffectVoices are still active.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetEffectVoiceOverCallback(string& asFunc);<br />
</syntaxhighlight><br />
<br />
Sets the function to be called when the EffectVoices are finished. <br />Callback syntax: <code>void MyFunc()</code><br />
<br />
<syntaxhighlight lang="c++"><br />
bool GetFlashbackIsActive();<br />
</syntaxhighlight><br />
<br />
Checks whether a flashback is still in effect.<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartPlayerSpawnPS(string& asSPSFile);<br />
void StopPlayerSpawnPS();<br />
</syntaxhighlight><br />
<br />
Continuously spawn regular particle systems (''.ps'') around the player. Particles created by this script carry over from map to map. <br /> <br />''asSPSFile'' - the ''.sps'' file to use. Exemplary ''.sps'' files are located in the ''/misc'' folder in the main game directory. <br /> <br />Custom ''.sps'' files can be created by hand in a text editor (see existing ones and mimic how those are written). <br />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.<br />
<br />
<syntaxhighlight lang="c++"><br />
void PlayGuiSound(string& asSoundFile, float afVolume);<br />
</syntaxhighlight><br />
<br />
Plays a sound, not using 3D.<br />
<br />
''asSoundFile ''- the sound to play (extension is .snt) <br />''afVolume ''- the volume of the sound<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);<br />
</syntaxhighlight><br />
<br />
Shakes the screen.<br />
<br />
''afAmount ''- intensity of the shake <br />''afTime ''- duration of the shake <br />''afFadeInTime ''- time in seconds until full intensity is reached <br />''afFadeOutTime ''- time until screen is back to normal<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetInDarknessEffectsActive(bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables the sanity drain and night vision effects while in the darkness.<br />
<br />
''bool abX'' - Enable/disable effects.<br />
<br />
<syntaxhighlight lang="c++"><br />
void ShowScreenImage(string &in asImageName, float afX, float afY, float afScale, bool abUseRelativeCoordinates, float afDuration, float afFadeIn, float afFadeOut);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.5}}<br />
<br />
Displays an image file directly onto the screen.<br />
<br />
''asImageName'' - The image file to render (.jpg, .png, .tga, .dds)<br />
<br />
''afX'' - The X position of the image<br />
<br />
''afY'' - The Y position of the image<br />
<br />
''afScale'' - The scale of the image (default 1.0f)<br />
<br />
''abUseRelativeCoordinates'' - Whether or not to use relative coordinates for positioning. Use false for absolute.<br />
<br />
''afDuration'' - The duration that the image is displayed for.<br />
<br />
''afFadeIn'' - The time, in seconds, to fade in the image.<br />
<br />
''afFadeOut'' - The time, in seconds, to fade out the image.<br />
<br />
===Insanity===<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetInsanitySetEnabled(string& asSet, bool abX);<br />
</syntaxhighlight><br />
<br />
Determines which InsanitySets are enabled.<br />
<br />
''asSet ''- the set <br />''abX ''- enabled or not<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartInsanityEvent(string &in asEventName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Starts a specified insanity event.<br />
<br />
''asEventName ''- Insanity event to play.<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartRandomInsanityEvent();<br />
</syntaxhighlight><br />
<br />
Starts a random insanity event from the available sets.<br />
<br />
<syntaxhighlight lang="c++"><br />
void StopCurrentInsanityEvent();<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Stops the currently playing insanity event.<br />
<br />
<syntaxhighlight lang="c++"><br />
void InsanityEventIsActive();<br />
</syntaxhighlight><br />
<br />
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 [http://wiki.frictionalgames.com/lib/images/smileys/icon_smile.gif?nolink&15x15]<br />
<br />
===Player===<br />
<br />
Note that the player's maximum health and sanity is 100.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerActive(bool abActive);<br />
</syntaxhighlight><br />
<br />
Enabled/Disable player controlled movement.<br />
<br />
<syntaxhighlight lang="c++"><br />
void ChangePlayerStateToNormal();<br />
</syntaxhighlight><br />
<br />
Sets certain effects back to normal. It can for example make the player drop an item.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerCrouching(bool abCrouch);<br />
</syntaxhighlight><br />
<br />
Forces the player to crouch.<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddPlayerBodyForce(float afX, float afY, float afZ, bool abUseLocalCoords);<br />
</syntaxhighlight><br />
<br />
Pushes the player into a certain direction. Note that you need values above ~2000 to see any effects.<br />
<br />
''afX ''- amount along the X-axis <br />''afY ''- amount along the Y-axis <br />''afZ ''- amount along the Z-axis <br />''abUseLocalCoords ''- If true, axes are based on where the player is facing, not the world.<br />
<br />
<syntaxhighlight lang="c++"><br />
void ShowPlayerCrossHairIcons(bool abX);<br />
</syntaxhighlight><br />
<br />
Enables/Disables the icons when a player has something in focus.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerSanity(float afSanity);<br />
void AddPlayerSanity(float afSanity);<br />
float GetPlayerSanity();<br />
</syntaxhighlight><br />
<br />
Modifies/returns the sanity of the player.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerHealth(float afHealth);<br />
void AddPlayerHealth(float afHealth);<br />
float GetPlayerHealth();<br />
</syntaxhighlight><br />
<br />
Modifies/returns the health of the player.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerLampOil(float afOil);<br />
void AddPlayerLampOil(float afOil);<br />
float GetPlayerLampOil();<br />
</syntaxhighlight><br />
<br />
Modifies/returns the lamp oil of the player.<br />
<br />
<syntaxhighlight lang="c++"><br />
float GetPlayerSpeed();<br />
float GetPlayerYSpeed();<br />
</syntaxhighlight><br />
<br />
Returns the current speed of the player.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetSanityDrainDisabled(bool abX);<br />
</syntaxhighlight><br />
<br />
Enables/Disables sanity drain from darkness, monsters, etc.<br />
<br />
<syntaxhighlight lang="c++"><br />
void GiveSanityBoost();<br />
void GiveSanityBoostSmall();<br />
</syntaxhighlight><br />
<br />
Boosts the player's sanity by a fixed amount.<br />
<br />
<syntaxhighlight lang="c++"><br />
void GiveSanityDamage(float afAmount, bool abUseEffect);<br />
</syntaxhighlight><br />
<br />
Reduces the sanity of the player.<br />
<br />
''afAmount ''- amount of sanity damage done <br />''abUseEffect ''- determines whether an effect is played when the sanity damage is dealt<br />
<br />
<syntaxhighlight lang="c++"><br />
void GivePlayerDamage(float afAmount, string& asType, bool abSpinHead, bool abLethal);<br />
</syntaxhighlight><br />
<br />
Reduces the health of the player.<br />
<br />
''afAmount ''- amount of damage done to health <br />''asType ''- plays a certain effect on the screen when the damage is dealt (BloodSplat, Claws or Slash) <br />''abSpinHead ''- changes the camera view when damage is dealt <br />''abLethal ''- set to true if player can die from given damage<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadePlayerFOVMulTo(float afX, float afSpeed);<br />
</syntaxhighlight><br />
<br />
Changes the field of view of the player. A shorter FOV will create a zoom effect.<br />
<br />
''afX ''- multiplier of default FOV (1 is default) <br />''afSpeed ''- the speed of change between FOV's<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadePlayerAspectMulTo(float afX, float afSpeed);<br />
</syntaxhighlight><br />
<br />
Changes the aspect ratio of the player. Basically stretches or narrows the screen horizontally.<br />
<br />
''afX ''- multiplier of default aspect (default is 1) <br />''afSpeed ''- the speed of change between FOV's<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed);<br />
</syntaxhighlight><br />
<br />
Rotates the position of the camera on the player's body.<br />
<br />
''afX ''- angle of rotation of head, positive being counter-clockwise <br />''afSpeedMul ''- speed (possibly acceleration) multiplier of the rotation (default 1, which is really slow) <br />''afMaxSpeed ''- maximum speed of rotation<br />
<br />
<syntaxhighlight lang="c++"><br />
void MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist);<br />
</syntaxhighlight><br />
<br />
Changes the position of the camera on the player's body.<br />
<br />
''afX ''- amount along the X-axis <br />''afY ''- amount along the Y-axis <br />''afZ ''- amount along the Z-axis <br />''afSpeed ''- speed at which the change happens <br />''afSlowDownDist ''- distance at which to start slowing down (prevents the head from abruptly stopping)<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartPlayerLookAt(string& asEntityName, float afSpeedMul, float afMaxSpeed, string& asAtTargetCallback);<br />
void StopPlayerLookAt();<br />
</syntaxhighlight><br />
<br />
Forces the player to look at a certain entity until StopPlayerLookAt is used.<br />
<br />
''asEntityName ''- the entity to look at <br />''afSpeedMul ''- how fast should the player look at the entity <br />''afMaxSpeed ''- maximum speed allowed <br />''asAtTargetCallback ''- function to call when player looks at target<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerMoveSpeedMul(float afMul);<br />
void SetPlayerRunSpeedMul(float afMul);<br />
void SetPlayerLookSpeedMul(float afMul);<br />
</syntaxhighlight><br />
<br />
Changes the player's move/run/look speed. Default is 1.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerJumpForceMul(float afMul);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Changes the player's jump multiplier. Higher values = higher jumps. Default is 1.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerJumpDisabled(bool abX);<br />
void SetPlayerCrouchDisabled(bool abX);<br />
</syntaxhighlight><br />
<br />
Enables/Disables the player's ability to jump/crouch.<br />
<br />
<syntaxhighlight lang="c++"><br />
void TeleportPlayer(string& asStartPosName);<br />
</syntaxhighlight><br />
<br />
Instantly teleports the player to the target StartPos.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLanternActive(bool abX, bool abUseEffects);<br />
</syntaxhighlight><br />
<br />
Makes the player use his lantern.<br />
<br />
<syntaxhighlight lang="c++"><br />
bool GetLanternActive();<br />
</syntaxhighlight><br />
<br />
Checks whether the player currently uses his lantern.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLanternDisabled(bool abX);<br />
</syntaxhighlight><br />
<br />
Enables/Disables the player's ability to use his lantern.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLanternLitCallback(string& asCallback);<br />
</syntaxhighlight><br />
<br />
Sets the function to call when the player uses his lantern. <br />Callback syntax: <code>MyFunc(bool abLit)</code><br />
<br />
<syntaxhighlight lang="c++"><br />
void SetMessage(string& asTextCategory, string& asTextEntry, float afTime);<br />
</syntaxhighlight><br />
<br />
Displays a message on the screen.<br />
<br />
''asTextCategory ''- the category in the .lang file <br />''asTextEntry ''- the entry in the .lang file <br />''afTime ''- determines how long the message is displayed. If time is < =0 then the life time is calculated based on string length.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetDeathHint(string& asTextCategory, string& asTextEntry);<br />
</syntaxhighlight><br />
<br />
Sets the message that appears when the player dies.<br />
<br />
''asTextCategory ''- the category in the .lang file <br />''asTextEntry ''- the entry in the .lang file<br />
<br />
<syntaxhighlight lang="c++"><br />
void DisableDeathStartSound();<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
<syntaxhighlight lang=""><br />
void MovePlayerForward(float afAmount)<br />
</syntaxhighlight><br />
<br />
"REQUIRES THE 1.2 PATCH: JUSTINE" Moves the player forward. It needs to be called in a timer that updates 60 times / second.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerFallDamageDisabled(bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables the player's ability to take fall damage.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerPos(float afX, float afY, float afZ);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Sets the player's position within the level.<br />
<br />
''afX'' - X co-ordinate position. <br />''afY'' - Y co-ordinate position. <br />''afZ'' - Z co-ordinate position.<br />
<br />
<syntaxhighlight lang="c++"><br />
float GetPlayerPosX();<br />
float GetPlayerPosY();<br />
float GetPlayerPosZ();<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the player's position within the level on the specified axis.<br />
<br />
===Journal===<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddNote(string& asNameAndTextEntry, string& asImage);<br />
</syntaxhighlight><br />
<br />
Adds a note to the player's journal.<br />
<br />
''asNameAndTextEntry ''- entries in the .lang file. Must end with _Name and _Text and be in category "Journal"! <br />''asImage ''- the background image to be used<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddDiary(string& asNameAndTextEntry, string& asImage);<br />
</syntaxhighlight><br />
<br />
Adds a diary to the player's journal.<br />
<br />
''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"! <br />''asImage ''- the background image to be used<br />
<br />
<syntaxhighlight lang="c++"><br />
void ReturnOpenJournal(bool abOpenJournal);<br />
</syntaxhighlight><br />
<br />
Only called in the pickup diary callback! If true the journal displays the entry else not.<br />
<br />
===Quests===<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddQuest(string& asName, string& asNameAndTextEntry);<br />
</syntaxhighlight><br />
<br />
Adds a quest to the player's journal under mementos.<br />
<br />
''asName ''- the internal name to be used <br />''asNameAndTextEntry ''- entry in the .lang file. Must start with "Quest_<texthere>_Text”, and be in category “Journal”!<br />
<br />
<syntaxhighlight lang="c++"><br />
void CompleteQuest(string& asName, string& asNameAndTextEntry);<br />
</syntaxhighlight><br />
<br />
Completes a quest.<br />
<br />
''asName ''- the internal name of the quest <br />''asNameAndTextEntry ''- entry in the .lang file. Must start with " Quest_<texthere>_Text ”, and be in category “Journal”!<br />
<br />
<syntaxhighlight lang="c++"><br />
bool QuestIsCompleted(string& asName);<br />
bool QuestIsAdded(string& asName);<br />
</syntaxhighlight><br />
<br />
Checks whether a quest is completed/added.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetNumberOfQuestsInMap(int alNumberOfQuests);<br />
</syntaxhighlight><br />
<br />
Sets the number of quests in the map.<br />
<br />
''alNumberOfQuests ''- Amount of Quests<br />
<br />
<syntaxhighlight lang="c++"><br />
void GiveHint (string& asName, string& asMessageCat, string& asMessageEntry, float afTimeShown);<br />
</syntaxhighlight><br />
<br />
Displays a hint on the player's screen.<br />
<br />
''asName ''- the internal name <br />''asMessageCat ''- the category in the .lang file <br />''asMessageEntry ''- the entry in the .lang file <br />''afTimeShown ''- time in seconds until the message disappears. If time is <= 0 then the life time is calculated based on string length.<br />
<br />
<syntaxhighlight lang="c++"><br />
void RemoveHint (string& asName);<br />
void BlockHint (string& asName);<br />
void UnBlockHint (string& asName);<br />
</syntaxhighlight><br />
<br />
Removes<nowiki>\</nowiki>Blocks<nowiki>\</nowiki>Unblocks a hint.<br />
<br />
===Inventory===<br />
<br />
<syntaxhighlight lang="c++"><br />
void ExitInventory();<br />
</syntaxhighlight><br />
<br />
Exits the inventory by force.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetInventoryDisabled(bool abX);<br />
</syntaxhighlight><br />
<br />
Disables the player's ability to open his inventory.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetInventoryMessage(string& asTextCategory, string& asTextEntry, float afTime);<br />
</syntaxhighlight><br />
<br />
Adds a message at the bottom of the inventory screen.<br />
<br />
''asTextCategory ''- the category in the .lang file <br />''asTextEntry ''- the entry in the .lang file <br />''afTime ''- time in seconds until the message disappears. If life time is <= 0 then the life time is calculated based on string length.<br />
<br />
<syntaxhighlight lang="c++"><br />
void GiveItem(string& asName, string& asType, string& asSubTypeName, string& asImageName, float afAmount);<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
''asName ''- internal name <br />''asType ''- item type to give, Available types are: <br /><br />
<br />
*Puzzle<br />
*Lantern<br />
*Health<br />
*Sanity<br />
*LampOil<br />
*Tinderbox<br />
<br />
''asSubTypeName ''- item name for .lang file <br />''asImageName ''- the image which will appear in inventory. For example: <code>void GiveItem("chemical_container_full_1", "Puzzle", "chemical_container_full", "chemical_container_full.tga", 1);</code> will use the image from <code>graphics/item/chemical_container_full.tga</code> <br />
<br />
''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.<br />
<br />
<syntaxhighlight lang="c++"><br />
void RemoveItem(string& asName);<br />
</syntaxhighlight><br />
<br />
Removes an item from the player's inventory.<br />
<br />
<syntaxhighlight lang="c++"><br />
bool HasItem(string& asName);<br />
</syntaxhighlight><br />
<br />
Checks whether the player has an item in his inventory.<br />
<br />
<syntaxhighlight lang="c++"><br />
void GiveItemFromFile(string& asName, string& asFileName);<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
''asName ''- internal name <br />''asFileName ''- item to give + extension (.ent)<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddCombineCallback(string& asName, string& asItemA, string& asItemB, string& asFunction, bool abAutoRemove);<br />
</syntaxhighlight><br />
<br />
Allows the player to combine items in his inventory. <br />Callback syntax: <code>void MyFunc(string &in asItemA, string &in asItemB)</code><br />
<br />
''asName ''- internal name for the callback <br />''asItemA ''- internal name of first item <br />''asItemB ''- internal name of second item <br />''asFunction ''- the function to call <br />''abAutoRemove ''- determines whether the callback should be removed when the items are combined<br />
<br />
<syntaxhighlight lang="c++"><br />
void RemoveCombineCallback(string& asName);<br />
</syntaxhighlight><br />
<br />
Removes a combine callback. <br />''asName'' - the internal name of the callback to be removed (as specified in AddCombineCallback)<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddUseItemCallback(string& asName, string& asItem, string& asEntity, string& asFunction, bool abAutoDestroy);<br />
</syntaxhighlight><br />
<br />
Allows the player to use items on the world. <br />Callback syntax: <code>void MyFunc(string &in asItem, string &in asEntity)</code><br />
<br />
''asName ''- internal name <br />''asItem ''- internal name of the item <br />''asEntity ''- entity to be able to use the item on <br />''asFunction ''- function to call <br />''abAutoDestroy ''- determines whether the item is destroyed when used<br />
<br />
<syntaxhighlight lang="c++"><br />
void RemoveUseItemCallback(string& asName);<br />
</syntaxhighlight><br />
<br />
Removes an item callback.<br />
<br />
===Entities===<br />
<br />
====General====<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityActive(string& asName, bool abActive);<br />
</syntaxhighlight><br />
<br />
Activates/deactivates an entity.<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityVisible(string &in asName, bool abVisible);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Activates/deactivates an entity's visual mesh. The collision body remains.<br />
<br />
''asName'' - Name of the entity. <br />''abActive'' - Activate/deactivate mesh.<br />
<br />
<syntaxhighlight lang="c"><br />
bool GetEntityExists(string& asName);<br />
</syntaxhighlight><br />
<br />
Checks whether an entity exists.<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityCustomFocusCrossHair(string& asName, string& asCrossHair);<br />
</syntaxhighlight><br />
<br />
Changes the crosshair that is used when focusing an entity.<br />
<br />
''asName ''- internal name <br />''asCrossHair ''- desired crosshair, can be: Default (uses default), Grab, Push, Ignite, Pick, LevelDoor, Ladder<br />
<br />
<syntaxhighlight lang="c"><br />
void CreateEntityAtArea(string& asEntityName, string& asEntityFile, string& asAreaName, bool abFullGameSave);<br />
</syntaxhighlight><br />
<br />
Creates an entity at an area. When creating an enemy though, it cannot chase properly along PathNodes(using for example ShowEnemyPlayerPosition).<br />
<br />
''asEntityName ''- internal name <br />''asEntityFile ''- entity to be used extension .ent <br />''asAreaName ''- the area to create the entity at <br />''abFullGameSave ''- determines whether an entity "remembers" its state<br />
<br />
<syntaxhighlight lang="c"><br />
void ReplaceEntity(string &in asName, string &in asBodyName, string &in asNewEntityName, string &in asNewEntityFile, bool abFullGameSave);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Removes an entity and places a new one in its place.<br />
<br />
''asName'' - Name of the entity to replace. <br />''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). <br />''asNewEntityName'' - Name of the new entity. <br />''asNewEntityFile'' - Name of the new entity file. Extension .ent. <br />''abFullGameSave'' - Whether ALL properties of this entity should be saved throughout levels.<br />
<br />
<syntaxhighlight lang="c++"><br />
void PlaceEntityAtEntity(string &in asName, string &in asTargetEntity, string &in asTargetBodyName, bool abUseRotation);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Places an entity at the position of another entity. Does not work for enemies, use TeleportEnemyToEntity instead.<br />
<br />
''asName'' - Name of the entity to place. <br />''asTargetEntity'' - Name of the other entity to place the first entity at. <br />''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). <br />''abUseRotation'' - Whether the entity should be rotated like the target entity.<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityPos(string &in asName, float afX, float afY, float afZ);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Moves an entity to a position in the level.<br />
<br />
''asName'' - Name of the entity to move. <br />''afX'' - X co-ordinate position. <br />''afY'' - Y co-ordinate position. <br />''afZ'' - Z co-ordinate position.<br />
<br />
<syntaxhighlight lang="c"><br />
float GetEntityPosX(string &in asName);<br />
float GetEntityPosY(string &in asName);<br />
float GetEntityPosZ(string &in asName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns an entity's position in the level on the specified axis.<br />
<br />
''asName'' - Name of the entity.<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityPlayerLookAtCallback(string& asName, string& asCallback, bool abRemoveWhenLookedAt);<br />
</syntaxhighlight><br />
<br />
Calls a function when the player looks at a certain entity. <br />Callback syntax: <code>void MyFunc(string &in asEntity, int alState)</code> <br />alState: 1 = looking, -1 = not looking<br />
<br />
''asName ''- internal name <br />''asCallback ''- function to call <br />''abRemoveWhenLookedAt ''- determines whether the callback should be removed when the player looked at the entity<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction);<br />
</syntaxhighlight><br />
<br />
Calls a function when the player interacts with a certain entity. <br />Callback syntax: <code>void MyFunc(string &in asEntity)</code><br />
<br />
''asName ''- internal name <br />''asCallback ''- function to call <br />''abRemoveOnInteraction ''- determines whether the callback should be removed when the player interacts with the entity<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityCallbackFunc(string& asName, string& asCallback);<br />
</syntaxhighlight><br />
<br />
Calls a function when the player interacts with a certain entity. <br />Callback syntax: <code>void MyFunc(string &in asEntity, string &in type)</code> <br />Type depends on entity type and includes: "OnPickup", "Break", "OnIgnite", etc<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityConnectionStateChangeCallback(string& asName, string& asCallback);<br />
</syntaxhighlight><br />
<br />
A callback called when ever the connection state changes (button being switched on, lever switched, etc). <br />Callback syntax: <code>void Func(string &in asEntity, int alState)</code> <br />alState: -1 = off, 0 = between, 1 = on<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityInteractionDisabled(string& asName, bool abDisabled);<br />
</syntaxhighlight><br />
<br />
Disallows interaction with an entity.<br />
<br />
<syntaxhighlight lang="c"><br />
void BreakJoint (string& asName);<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
<syntaxhighlight lang="c"><br />
void AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);<br />
</syntaxhighlight><br />
<br />
Calls a function when two entites collide. <br />Callback syntax: <code>void MyFunc(string &in asParent, string &in asChild, int alState)</code> <br />alState: 1 = enter, -1 = leave<br />
<br />
''asParentName ''- internal name of main object <br />''asChildName ''- internal name of object that collides with main object (asterix (<nowiki>*</nowiki>) NOT supported!) <br />''asFunction ''- function to call <br />''abDeleteOnCollide ''- determines whether the callback after it was called <br />''alStates ''- 1 = only enter, -1 = only leave, 0 = both<br />
<br />
<syntaxhighlight lang="c"><br />
void RemoveEntityCollideCallback(string& asParentName, string& asChildName);<br />
</syntaxhighlight><br />
<br />
Removes an EntityCollideCallback. Asterix (<nowiki>*</nowiki>) not supported in ''asChildName''.<br />
<br />
<syntaxhighlight lang="c"><br />
bool GetEntitiesCollide(string& asEntityA, string& asEntityB);<br />
</syntaxhighlight><br />
<br />
Checks whether two entites collide. This function does NOT support asterix (<nowiki>*</nowiki>) or "Player"!<br />
<br />
<syntaxhighlight lang="c"><br />
void SetBodyMass(string &in asName, float afMass);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Sets the mass of an entity's body.<br />
<br />
''asName'' - Name of the body of an entity. The body name of an entity is EntityName_BodyName. <br />''afMass'' - The mass to set.<br />
<br />
<syntaxhighlight lang="c"><br />
float GetBodyMass(string &in asName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Gets the mass of an entity's body.<br />
<br />
''asName'' - Name of the body of an entity. The body name of an entity is EntityName_BodyName. <br />''afMass'' - The mass to get.<br />
<br />
====Props====<br />
<br />
<syntaxhighlight lang="c"><br />
void SetPropEffectActive(string& asName, bool abActive, bool abFadeAndPlaySounds);<br />
</syntaxhighlight><br />
<br />
Can be used on coal to give it the black color it should have.<br />
<br />
<syntaxhighlight lang="c"><br />
void SetPropActiveAndFade(string& asName, bool abActive, float afFadeTime);<br />
</syntaxhighlight><br />
<br />
Activates/deactivates a prop.<br />
<br />
''asName ''- internal name <br />''abActive ''- nothing to add <br />''afFadeTime ''- time in seconds until prop fully fades<br />
<br />
<syntaxhighlight lang="c"><br />
void SetPropStaticPhysics(string& asName, bool abX);<br />
</syntaxhighlight><br />
<br />
Activates/deactivates the physics of a prop. Setting as true will make entities static in midair.<br />
<br />
<syntaxhighlight lang="c"><br />
bool GetPropIsInteractedWith(string& asName);<br />
</syntaxhighlight><br />
<br />
Checks whether a prop is interacted with.<br />
<br />
<syntaxhighlight lang="c"><br />
void RotatePropToSpeed(string& asName, float afAcc, float afGoalSpeed, float afAxisX, float afAxisY, float afAxisZ, bool abResetSpeed, string& asOffsetArea);<br />
</syntaxhighlight><br />
<br />
Rotates the prop up to a set speed.<br />
<br />
''asName ''- internal name <br />''afAcc ''- acceleration <br />''afGoalSpeed ''- desired speed <br />''afAxisX ''- rotation around X axis <br />''afAxisY ''- rotation around Y axis <br />''afAxisZ ''- rotation around Z axis <br />''abResetSpeed ''- determines whether the speed is resetted after goal speed is reached <br />''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 "StaticObject" entity!<br />
<br />
<syntaxhighlight lang="cpp"><br />
void StopPropMovement(string& asName);<br />
</syntaxhighlight><br />
<br />
Stops all movement of a prop.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AddAttachedPropToProp(string& asPropName, string& asAttachName, string& asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);<br />
</syntaxhighlight><br />
<br />
Attaches a prop to another prop.<br />
<br />
a''sPropName''- the prop to attach another prop at <br />''asAttachName ''- internal name of the prop that gets attached <br />''asAttachFile ''- the prop that gets attached extension .ent <br />''afPosX ''- X position of the attach from the prop <br />''afPosY ''- Y position of the attach from the prop <br />''afPosZ ''- Z position of the attach from the prop <br />''afRotX ''- rotation around X axis of the attach <br />''afRotY ''- rotation around Y axis of the attach <br />''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of "AddEntityCollideCallback", attached props will not call the callback function if they collide with a "static_object" or a "StaticProp" entity type!<br />
<br />
{{bug|''afRotZ '' is used for both the ZX rotation and the Z position of the attached prop. Unwanted rotation can be avoided by using: <br />''AddAttachedPropToProp(asPropName, asAttachName, asAttachFile, afPosX, afPosY, '''0''', afPosZ, '''90.0f''', afPosZ)''}}<br />
<br />
{{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.}}<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AttachPropToProp(string& asPropName, string& asAttachName, string& asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Attaches a prop to another prop. Fixed version of AddAttachedPropToProp.<br />
<br />
''asPropName ''- the prop to attach another prop at <br />''asAttachName ''- internal name of the prop that gets attached <br />''asAttachFile ''- the prop that gets attached extension .ent <br />''afPosX ''- X position of the attach from the prop <br />''afPosY ''- Y position of the attach from the prop <br />''afPosZ ''- Z position of the attach from the prop <br />''afRotX ''- rotation around X axis of the attach <br />''afRotY ''- rotation around Y axis of the attach <br />''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of "AddEntityCollideCallback", attached props will not call the callback function if they collide with a "static_object" or a "StaticProp" entity type!<br />
<br />
<syntaxhighlight lang="cpp"><br />
void RemoveAttachedPropFromProp(string& asPropName, string& asAttachName);<br />
</syntaxhighlight><br />
<br />
Detaches a prop from a prop.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetPropHealth(string& asName, float afHealth);<br />
void AddPropHealth(string& asName, float afHealth);<br />
float GetPropHealth(string& asName);<br />
</syntaxhighlight><br />
<br />
Modifies/returns the health of a prop.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void ResetProp(string& asName);<br />
</syntaxhighlight><br />
<br />
Resets a prop's state to the original one when the map was loaded.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void PlayPropAnimation(string& asProp, string& asAnimation, float afFadeTime, bool abLoop, string& asCallback);<br />
</syntaxhighlight><br />
<br />
Makes the prop play an animation and calls a function. <br />Callback syntax: <code>void MyFunc(string &in asProp)</code><br />
<br />
''asProp ''- internal name of the prop <br />''asAnimation ''- animation to play <br />''afFadeTime ''- ? <br />''abLoop ''- determines whether the animation loops <br />''asCallback ''- function to call<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AddPropForce(string& asName, float afX, float afY, float afZ, string& asCoordSystem);<br />
void AddPropImpulse(string& asName, float afX, float afY, float afZ, string& asCoordSystem);<br />
void AddBodyForce(string& asName, float afX, float afY, float afZ, string& asCoordSystem);<br />
void AddBodyImpulse(string& asName, float afX, float afY, float afZ, string& asCoordSystem);<br />
</syntaxhighlight><br />
<br />
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 "Body" 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).<br />
<br />
''asName ''- the object to push; for bodies, use this format: "''entityName''_''bodyName''" <br />''afX ''- magnitude along the X-axis <br />''afY ''- magnitude along the Y-axis <br />''afZ ''- magnitude along the Z-axis <br />''asCoordSystem ''- determines which coordinate system is used, usually "world" 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.<br />
<br />
====Connections====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void InteractConnectPropWithRope(string& asName, string& asPropName, string& asRopeName, bool abInteractOnly, float afSpeedMul, float afToMinSpeed, float afToMaxSpeed, bool abInvert, int alStatesUsed);<br />
</syntaxhighlight><br />
<br />
Connects a prop with the movement of a rope (ie. turn wheel to move rope).<br />
<br />
''asName ''- connection name <br />''asPropName ''- name of prop <br />''asRopeName ''- name of rope <br />''abInteractOnly ''- ? <br />''afSpeedMul ''- speed multiplier of how quickly the rope moves <br />''afToMinSpeed ''- the slowest the rope will move when moving the prop <br />''afToMaxSpeed ''- the fastest the rope will move when moving the prop <br />''abInvert ''- whether to invert the direction the rope moves <br />''alStatesUsed ''- which states of the prop can interact with the rope?<br />
<br />
<syntaxhighlight lang="cpp"><br />
void InteractConnectPropWithMoveObject(string& asName, string& asPropName, string& asMoveObjectName, bool abInteractOnly, bool abInvert, int alStatesUsed);<br />
</syntaxhighlight><br />
<br />
This one should only be used if there must be an exact correspondance to prope "amount" and the moveobject open amount. It is best used for Wheel-door connections!<br />
<br />
<syntaxhighlight lang="cpp"><br />
void ConnectEntities(string& asName, string& asMainEntity, string& asConnectEntity, bool abInvertStateSent, int alStatesUsed, string& asCallbackFunc);<br />
</syntaxhighlight><br />
<br />
Callback syntax: <code>void MyFunc(string &in asConnectionName, string &in asMainEntity, string &in asConnectEntity, int alState)</code> <br />State is what is sent to connection entity and will be inverted if abInvertStateSent = true!<br />
<br />
====Lamps====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetLampLit(string& asName, bool abLit, bool abEffects);<br />
</syntaxhighlight><br />
<br />
(Un)lits a lamp.<br />
<br />
''asName ''- Name of the lamp <br />''abLit ''- Set true if you want the lamp to be lit, set to false if you want the lamp to be unlit <br />''abEffects ''- If you want to have the lamp fade in/out when it gets (un)lit<br />
<br />
====Doors====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetSwingDoorLocked(string& asName, bool abLocked, bool abEffects);<br />
void SetSwingDoorClosed(string& asName, bool abClosed, bool abEffects);<br />
</syntaxhighlight><br />
<br />
Locks/closes a swing door.<br />
<br />
<syntaxhighlight lang="cpp"><br />
bool GetSwingDoorLocked(string& asName);<br />
bool GetSwingDoorClosed(string& asName);<br />
</syntaxhighlight><br />
<br />
Checks whether a swing door is locked/closed.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetSwingDoorDisableAutoClose(string& asName, bool abDisableAutoClose);<br />
</syntaxhighlight><br />
<br />
Deactivates the "auto-close" when a door is nearly closed.<br />
<br />
<syntaxhighlight lang="cpp"><br />
int GetSwingDoorState(string& asName);<br />
</syntaxhighlight><br />
<br />
Returns an integer depending on how far the door is opened. <br />-1 = angle is close to 0°, 1 = angle is 70% or higher of max, 0 = inbetween -1 and 1.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetLevelDoorLocked(string& asName, bool abLocked);<br />
</syntaxhighlight><br />
<br />
Locks a level door. Note that level doors are NOT swing doors.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetLevelDoorLockedSound(string& asName, string& asSound);<br />
</syntaxhighlight><br />
<br />
Determines which sound is played when interacting with a locked level door.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetLevelDoorLockedText(string& asName, string& asTextCat, string& asTextEntry);<br />
</syntaxhighlight><br />
<br />
Displays a message when interacting with a locked level door.<br />
<br />
''asName ''- internal name <br />''asTextCat ''- the category in the .lang file <br />''asTextEntry ''- the entry in the .lang file<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetMoveObjectState(string& asName, float afState);<br />
</syntaxhighlight><br />
<br />
Moves an object to a certain state.<br />
<br />
''asName ''- internal name <br />''afState ''- state of the object, 0 = closed, 1 = open, values inbetween (and above, for example, the bridge_metal_vert) are valid too!<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetMoveObjectStateExt(string& asName, float afState, float afAcc, float afMaxSpeed, float afSlowdownDist, bool abResetSpeed);<br />
</syntaxhighlight><br />
<br />
Moves an object to a certain state, extended method.<br />
<br />
''asName ''- internal name <br />''afState ''- state of the object, 0 = closed, 1 = open, values inbetween are valid too! <br />''afAcc ''- acceleration <br />''afMaxSpeed ''- maximum speed <br />''afSlowdownDist ''- Distance to the target state before decceleration occurs. <br />''abResetSpeed ''- Set to True if the prop's speed should be reset before performing the movement, else the prop will accelerate from it's current speed to afMaxSpeed.<br />
<br />
====Levers, wheels and buttons====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetPropObjectStuckState(string& asName, int alState);<br />
void SetWheelStuckState(string& asName, int alState, bool abEffects);<br />
void SetLeverStuckState(string& asName, int alState, bool abEffects);<br />
</syntaxhighlight><br />
<br />
Makes a prop<nowiki>\</nowiki>wheel<nowiki>\</nowiki>lever stuck in a certain state.<br />
<br />
''asName ''- internal name <br />''alState ''- 0 = not stuck, 1 = at max, -1 = at min <br />''abEffects ''- use effects<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetWheelAngle(string& asName, float afAngle, bool abAutoMove);<br />
</syntaxhighlight><br />
<br />
Moves a wheel to a certain angle.<br />
<br />
''asName ''- internal name <br />''afAngle ''- angle <br />''abAutoMove ''- determines whether the wheel should move on its own<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetWheelInteractionDisablesStuck(string& asName, bool abX);<br />
void SetLeverInteractionDisablesStuck(string& asName, bool abX);<br />
</syntaxhighlight><br />
<br />
Allows the player to make a wheel/lever unstuck when interacted with.<br />
<br />
<syntaxhighlight lang="cpp"><br />
int GetLeverState(string& asName);<br />
</syntaxhighlight><br />
<br />
Returns the state of the lever. <br />0 = not stuck, 1 = at max, -1 = at min<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetMultiSliderStuckState(string& asName, int alStuckState, bool abEffects);<br />
</syntaxhighlight><br />
<br />
Makes a MultiSlider stuck in a certain state.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetMultiSliderCallback(string& asName, string& asCallback);<br />
</syntaxhighlight><br />
<br />
Calls a function when state changes. <br />Callback syntax: <code>void MyFunc(string &in asEntity, int alState)</code><br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetButtonSwitchedOn(string& asName, bool abSwitchedOn, bool abEffects);<br />
</syntaxhighlight><br />
<br />
====Sticky areas====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetAllowStickyAreaAttachment(bool abX);<br />
</syntaxhighlight><br />
<br />
Allows entites to stick to a StickyArea.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AttachPropToStickyArea(string& asAreaName, string& asProp);<br />
void AttachBodyToStickyArea(string& asAreaName, string& asBody);<br />
</syntaxhighlight><br />
<br />
Attaches a prop/body to a StickyArea.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void DetachFromStickyArea(string& asAreaName);<br />
</syntaxhighlight><br />
<br />
Detaches everything from a StickyArea.<br />
<br />
====Enemies====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetNPCAwake(string& asName, bool abAwake, bool abEffects);<br />
</syntaxhighlight><br />
<br />
Activates the npc<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetNPCFollowPlayer(string& asName, bool abX);<br />
</syntaxhighlight><br />
<br />
Sets an NPC's head to follow the player's movement's.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetEnemyDisabled(string& asName, bool abDisabled);<br />
</syntaxhighlight><br />
<br />
Disables an enemy.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetEnemyIsHallucination(string& asName, bool abX);<br />
</syntaxhighlight><br />
<br />
Makes an enemy a hallucination. Hallucinations fade to smoke when they get near the player.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void FadeEnemyToSmoke(string& asName, bool abPlaySound);<br />
</syntaxhighlight><br />
<br />
Instantly fades an enemy to smoke.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void ShowEnemyPlayerPosition(string& asName);<br />
</syntaxhighlight><br />
<br />
Makes the enemy run to the player, no matter where he is.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AlertEnemyOfPlayerPresence(string &in asName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Gives the specified enemy the player's current position and makes it search the area.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetEnemyDisableTriggers(string& asName, bool abX);<br />
</syntaxhighlight><br />
<br />
Enables or disables enemy triggers. If disabled, enemy will not react to player or attack.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AddEnemyPatrolNode(string& asName, string& asNodeName, float afWaitTime, string& asAnimation);<br />
</syntaxhighlight><br />
<br />
Adds a patrol node to the enemy's path.<br />
<br />
''asName ''- internal name of the enemy <br />''asNodeName ''- path node <br />''afWaitTime ''- time in seconds that the enemy waits at the path node before continuing <br />''asAnimation ''- the animation the enemy uses when reaching the path node<br />
<br />
<syntaxhighlight lang="cpp"><br />
void ClearEnemyPatrolNodes(string& asEnemyName);<br />
</syntaxhighlight><br />
<br />
Clears the current path of patrol nodes of the enemy.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetEnemySanityDecreaseActive(string &in asName, bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables whether an enemy activates the player's sanity drain when stared at.<br />
<br />
''asName ''- Internal name of the enemy <br />''abX ''- Enabled/disabled<br />
<br />
<syntaxhighlight lang="cpp"><br />
void TeleportEnemyToNode(string &in asEnemyName, string &in asNodeName, bool abChangeY);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Teleports an enemy to a specific PathNode.<br />
<br />
''asEnemyName ''- Internal name of the enemy <br />''asNodeName ''- Internal name of the node to teleport to <br />''abChangeY ''- Whether the Y position of the node will be used when teleporting the enemy<br />
<br />
<syntaxhighlight lang="cpp"><br />
void TeleportEnemyToEntity(string &in asEnemyName, string &in asTargetEntity, string &in asTargetBody, bool abChangeY);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Teleports an enemy to a specific entity.<br />
<br />
''asEnemyName ''- Internal name of the enemy <br />''asTargetEntity ''- Internal name of the entity to teleport to <br />''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) <br />''abChangeY ''- Whether the Y position of the node will be used when teleporting the enemy<br />
<br />
<syntaxhighlight lang="c"><br />
void ChangeManPigPose(string&in asName, string&in asPoseType);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Changes the pose a specified ManPig.<br />
<br />
''asName ''- Internal name of the enemy <br />''asPoseType''- Name of the ManPig pose to use. Can be "Biped" or "Quadruped"<br />
<br />
<syntaxhighlight lang="c"><br />
void SetTeslaPigFadeDisabled(string&in asName, bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables whether a specified TeslaPig should fade the player's view in and out.<br />
<br />
''asName ''- Internal name of the enemy <br />''abX''- Enabled/disabled<br />
<br />
<syntaxhighlight lang="c"><br />
void SetTeslaPigSoundDisabled(string&in asName, bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables whether a specified TeslaPig should play the proximity sounds.<br />
<br />
''asName ''- Internal name of the enemy <br />''abX''- Enabled/disabled<br />
<br />
<syntaxhighlight lang="c"><br />
void SetTeslaPigEasyEscapeDisabled(string&in asName, bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables whether a specified TeslaPig should be easier to escape from when hunted.<br />
<br />
''asName ''- Internal name of the enemy <br />''abX''- Enabled/disabled<br />
<br />
<syntaxhighlight lang="c"><br />
void ForceTeslaPigSighting(string&in asName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Forces a TeslaPig to be visible for a short time.<br />
<br />
''asName ''- Internal name of the enemy<br />
<br />
<syntaxhighlight lang="c"><br />
string& GetEnemyStateName(string &in asName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the name of the state a specified enemy is current in. States can be Hunt, Search, Patrol, Wait, Alert, Investigate, Track and BreakDoor.<br />
<br />
''asName ''- Internal name of the enemy</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&diff=6444HPL2/Engine Scripts2023-08-28T13:30:12Z<p>Mudbill: Fix formatting</p>
<hr />
<div>{{TocRight}}<br />
<br />
This page documents all scripts available in Amnesia: The Dark Descent.<br />
<br />
{{note|'''Note''': Some of the functions require the Amnesia 1.3 update. Steam and other online store copies should be automatically updated. Other copies can get it [http://www.frictionalgames.com/forum/thread-24334.html here].}}<br />
<br />
==Engine scripts==<br />
===Main===<br />
<br />
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.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void OnStart();<br />
</syntaxhighlight><br />
<br />
The function that runs when the map is loaded for the first time.<br />
<br />
<syntaxhighlight lang="c++"><br />
void OnEnter();<br />
</syntaxhighlight><br />
<br />
The function that runs whenever the player enters a map.<br />
<br />
<syntaxhighlight lang="c++"><br />
void OnLeave();<br />
</syntaxhighlight><br />
<br />
The function that runs when the player leaves a map.<br />
<br />
<syntaxhighlight lang="c++"><br />
void OnGameStart();<br />
</syntaxhighlight><br />
<br />
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").<br />
<br />
<syntaxhighlight lang="c++"><br />
void OnUpdate(float afStep);<br />
</syntaxhighlight><br />
{{ReqVer|1.5}}<br />
<br />
This function is executed for every game update or "tick". 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.<br />
<br />
===General===<br />
<br />
<syntaxhighlight lang="c++"><br />
float RandFloat(float afMin, float afMax);<br />
</syntaxhighlight><br />
<br />
Generates a random float.<br />
<br />
#''afMin ''- minimum value<br />
#''afMax ''- maximum value<br />
<syntaxhighlight lang="c++"><br />
int RandInt(int alMin, int alMax);<br />
</syntaxhighlight><br />
<br />
Generates a random int. Note: the maximum value is ''inclusive'' - the RandInt() function may return this value.<br />
<br />
#''alMin ''- minimum value<br />
#''alMax ''- maximum value<br />
<syntaxhighlight lang="c++"><br />
bool StringContains(string& asString, string& asSubString);<br />
</syntaxhighlight><br />
<br />
Checks whether a string contains the specified string. <br />Example: searching for "hello" in "hello world" would return '''true'''.<br />
<br />
#''asString ''- the string to check<br />
#''asSubString ''- the string to search for<br />
<syntaxhighlight lang="cpp"><br />
string& StringSub(string& asString, int alStart, int alCount);<br />
</syntaxhighlight><br />
<br />
Returns the substring in a string. <br />Example: in the string "frictional games rocks", using 4 as ''alStart'' and 6 as ''alCount'' would return '''"tional"'''.<br />
<br />
#''asString ''- the string<br />
#''alStart ''- start position in the string<br />
#''alCount ''- amount of characters<br />
<syntaxhighlight lang="c++"><br />
int StringToInt(string&in asString);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
If possible, returns an integer converted from a string, else returns 0.<br />
<br />
#''asString'' - String to convert.<br />
<syntaxhighlight lang="c++"><br />
float StringToFloat(string&in asString);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
If possible, returns a float converted from a string, else returns 0.<br />
<br />
#''asString'' - String to convert.<br />
<syntaxhighlight lang="c++"><br />
bool StringToBool(string&in asString);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
If possible, returns a boolean converted from a string, else returns false.<br />
<br />
#''asString'' - String to convert.<br />
<br />
===Mathematical Operations===<br />
<br />
<syntaxhighlight lang="c++"><br />
float MathSin(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the sine of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathCos(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the cosine of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathTan(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the tangent of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathAsin(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the arc sine of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathAcos(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the arc cosine of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathAtan(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the arc tangent of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathAtan2(float afX, float afY);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Calculates and returns the arc tangent of the specified values.<br />
<br />
#''afX'' - First value to operate.<br />
#''afY'' - Second value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathSqrt(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the square root of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathPow(float afBase, float afExp);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the value of afBase raised to the power of afExp.<br />
<br />
#''afBase'' - The base value.<br />
#''afExp'' - Value to calculate the base with.<br />
<syntaxhighlight lang="c++"><br />
float MathMin(float afA, float afB);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the lowest value.<br />
<br />
#''afA'' - First value.<br />
#''afB'' - Second value.<br />
<syntaxhighlight lang="c++"><br />
float MathMax(float afA, float afB);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the highest value.<br />
<br />
#''afA'' - First value.<br />
#''afB'' - Second value.<br />
<syntaxhighlight lang="c++"><br />
float MathClamp(float afX, float afMin, float afMax);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns afX clamped between afMin and afMax. If afX < afMin, returns afMin, and if afX > afMax, returns afMax.<br />
<br />
#''afX'' - The value to clamp.<br />
#''afMin'' - The minimum value to clamp afX with.<br />
#''afMax'' - The maximum value to clamp afX with.<br />
<syntaxhighlight lang="c++"><br />
float MathAbs(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the absolute value.<br />
<br />
#''afX'' - Value to operate.<br />
<br />
===Debugging===<br />
<br />
<syntaxhighlight lang="cpp"><br />
void Print(string& asString);<br />
</syntaxhighlight><br />
<br />
Prints a string to the log file (''hpl.log'').<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddDebugMessage(string& asString, bool abCheckForDuplicates);<br />
</syntaxhighlight><br />
<br />
Prints a string to the debug console.<br />
<br />
#''asString ''- the string to print<br />
#''abCheckForDuplicates ''- if true, the string won't be printed more than once on screen until it disappears<br />
<syntaxhighlight lang="c++"><br />
void ProgLog(string& asLevel, string& asMessage);<br />
</syntaxhighlight><br />
<br />
Prints an entry to the ProgLog (progression log). <br />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. <br /> <br />This function allows to log custom messages.The messages in the ProgLog file are sorted by time elapsed since a map was loaded.<br />
<br />
ProgLog has to be enabled for a player profile in ''user_settings.cfg'' before it starts working.<br />
<br />
#''asLevel ''- can be "Low", "Medium" or "High". It's a tag which appears in each log entry, for event prioritising.<br />
#''asMessage ''- The custom message to be printed to the log.<br />
<syntaxhighlight lang="c++"><br />
bool ScriptDebugOn();<br />
</syntaxhighlight><br />
<br />
Checks whether the debug mode is enabled. <br />See [[HPL2/Development_Environment|"Setting up Development Environment"]] to setup debug mode on your own computer.<br />
<br />
===Variables===<br />
{{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 "for" loop. For variables which need to be saved, use the wrappers as described below.}}<br />
<br />
====Local====<br />
<br />
Local variables can be used throughout the same script file.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetLocalVarInt(string& asName, int alVal);<br />
void AddLocalVarInt(string& asName, int alVal);<br />
int GetLocalVarInt(string& asName);<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLocalVarFloat(string& asName, float afVal);<br />
void AddLocalVarFloat(string& asName, float afVal);<br />
float GetLocalVarFloat(string& asName);<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLocalVarString(string& asName, const string& asVal);<br />
void AddLocalVarString(string& asName, string& asVal);<br />
string& GetLocalVarString(string& asName);<br />
</syntaxhighlight><br />
<br />
====Global====<br />
<br />
Global variables can be used throughout several maps and can be accessed by several script files.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetGlobalVarInt(string& asName, int alVal);<br />
void AddGlobalVarInt(string& asName, int alVal);<br />
int GetGlobalVarInt(string& asName);<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="c++"><br />
void SetGlobalVarFloat(string& asName, float afVal);<br />
void AddGlobalVarFloat(string& asName, float afVal);<br />
float GetGlobalVarFloat(string& asName);<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="c++"><br />
void SetGlobalVarString(string& asName, const string& asVal);<br />
void AddGlobalVarString(string& asName, string& asVal);<br />
string& GetGlobalVarString(string& asName);<br />
</syntaxhighlight><br />
<br />
===Particle Systems===<br />
<br />
<syntaxhighlight lang="c++"><br />
void PreloadParticleSystem(string& asPSFile);<br />
</syntaxhighlight><br />
<br />
Preloads a particle system.<br />
<br />
#''asPSFile'' - The particle system file to load. Extension: .ps<br />
<syntaxhighlight lang="c++"><br />
void CreateParticleSystemAtEntity(string& asPSName, string& asPSFile, string& asEntity, bool abSavePS);<br />
</syntaxhighlight><br />
<br />
Creates a particle system on an entity.<br />
<br />
#''asPSName ''- internal name<br />
#''asPSFile ''- the particle system to use + extension .ps<br />
#''asEntity ''- the entity to create the particle system at<br />
#''abSavePS ''- determines whether a particle system should "remember" its shown/hidden state, so that this state can be restored when the player revisits the level<br />
<syntaxhighlight lang="c++"><br />
void CreateParticleSystemAtEntityExt(string& asPSName, string& asPSFile, string& asEntity, bool abSavePS,<br />
float afR, float afG, float afB, float afA, bool abFadeAtDistance, float afFadeMinEnd, float afFadeMinStart,<br />
float afFadeMaxStart, float afFadeMaxEnd);<br />
</syntaxhighlight><br />
<br />
Creates a particle system on an entity, extended method with more options.<br />
<br />
#''asPSName ''- internal name<br />
#''asPSFile ''- the particle system to use + extension .ps<br />
#''asEntity ''- the entity to create the particle system at<br />
#''abSavePS ''- determines whether a particle system should "remember" its shown/hidden state, so that this state can be restored when the player revisits the level<br />
#''afR ''- red value<br />
#''afG ''- green value<br />
#''afB ''- blue value<br />
#''afA ''- alpha value<br />
#''abFadeAtDistance ''- determines whether a particle system fades from a certain distance on<br />
#''afFadeMinEnd ''- minimum distance at which the particle system stops fading<br />
#''afFadeMinStart ''- minimum distance at which the particle system starts fading<br />
#''afFadeMaxStart ''- maximum distance at which the particle system starts fading<br />
#''afFadeMaxEnd ''- maximum distance at which the particle system stops fading<br />
<syntaxhighlight lang="c++"><br />
void DestroyParticleSystem(string& asName);<br />
</syntaxhighlight><br />
<br />
Destroys a particle system.<br />
<br />
#''asName'' - The internal name of the particle system<br />
<br />
===Sounds & Music===<br />
<br />
<syntaxhighlight lang="c++"><br />
void PreloadSound(string& asSoundFile);<br />
</syntaxhighlight><br />
<br />
Preloads a sound.<br />
<br />
#''asSoundFile'' - The sound file to load. Extension: .snt<br />
<syntaxhighlight lang="c++"><br />
void PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);<br />
</syntaxhighlight><br />
<br />
Creates a sound on an entity.<br />
<br />
#''asSoundName ''- internal name<br />
#''asSoundFile ''- the sound to use + extension .snt<br />
#''asEntity ''- the entity to create the sound at, can be "Player"<br />
#''afFadeTime ''- time in seconds the sound needs to fade. Avoids enemies hearing the sound if afFadeTime is at least 0.1f<br />
#''abSaveSound ''- if ''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''!<br />
<syntaxhighlight lang="c++"><br />
void FadeInSound(string& asSoundName, float afFadeTime, bool abPlayStart);<br />
</syntaxhighlight><br />
<br />
Fades in a sound.<br />
<br />
#''asSoundName ''- internal name<br />
#''afFadeTime ''- time in seconds<br />
#''abPlayStart ''- ?<br />
<syntaxhighlight lang="c++"><br />
void StopSound(string& asSoundName, float afFadeTime);<br />
</syntaxhighlight><br />
<br />
Fades out a sound.<br />
<br />
#''asSoundName ''- internal name<br />
#''afFadeTime ''- time in seconds, use 0 to immediatly stop the sound<br />
<syntaxhighlight lang="c++"><br />
void PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);<br />
</syntaxhighlight><br />
<br />
Plays music.<br />
<br />
#''asMusicFile ''- the music to play + extension .ogg<br />
#''abLoop ''- determines whether a music track should loop<br />
#''afVolume ''- volume of the music<br />
#''afFadeTime ''- time in seconds until music reaches full volume<br />
#''alPrio ''- priority of the music. Note that only the music with the highest priority can be heard! 0 - lowest, 1 - higher, etc.<br />
#''abResume'' - if ''true'', playback will be continued from where the track stopped after the call to StopMusic(); if ''false'', the track will be restarted.<br />
<syntaxhighlight lang="c++"><br />
void StopMusic(float afFadeTime, int alPrio);<br />
</syntaxhighlight><br />
<br />
Stops music.<br />
<br />
#''afFadeTime ''- time in seconds until music stops<br />
#''alPrio ''- the priority of the music that should stop<br />
<syntaxhighlight lang="c++"><br />
void FadeGlobalSoundVolume(float afDestVolume, float afTime);<br />
</syntaxhighlight><br />
<br />
Influences the global sound volume, that means everything you can hear '''from the world'''. This does not affect music of GUI sounds.<br />
<br />
#''afDestVolume ''- desired volume<br />
#''afTime ''- time in seconds until volume reaches desired volume<br />
<syntaxhighlight lang="c++"><br />
void FadeGlobalSoundSpeed(float afDestSpeed, float afTime);<br />
</syntaxhighlight><br />
<br />
Influences the global sound speed.<br />
<br />
#''afDestSpeed ''- desired speed<br />
#''afTime ''- time in seconds until volume reaches desired speed<br />
<br />
===Lights===<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLightVisible(string& asLightName, bool abVisible);<br />
</syntaxhighlight><br />
<br />
Enables/disables lights.<br />
<br />
#''asLightName ''- internal name<br />
#''abVisible ''- determines the state of the light<br />
<syntaxhighlight lang="c++"><br />
void FadeLightTo(string& asLightName, float afR, float afG, float afB, float afA, float afRadius, float afTime);<br />
</syntaxhighlight><br />
<br />
Changes the properties of a light.<br />
<br />
#''asLightName ''- internal name<br />
#''afR ''- red value<br />
#''afG ''- green value<br />
#''afB ''- blue value<br />
#''afA ''- alpha value<br />
#''afRadius ''- radius of the light. -1 means keeping the radius<br />
#''afTime ''- time in seconds until change is done<br />
<syntaxhighlight lang="c++"><br />
void SetLightFlickerActive(string& asLightName, bool abActive);<br />
</syntaxhighlight><br />
<br />
Activates flickering on a light.<br />
<br />
#''asLightName'' - The internal light name<br />
#''abActive'' - true = active, false = inactive<br />
<br />
==Game scripts==<br />
<br />
===General===<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartCredits(string& asMusic, bool abLoopMusic, string& asTextCat, string& asTextEntry, int alEndNum);<br />
</syntaxhighlight><br />
<br />
Starts the end credits screen.<br />
<br />
#''asMusic ''- the music to play (including .ogg)<br />
#''abLoopMusic ''- determines whether the music should loop<br />
#''asTextCat ''- the category to be used in the .lang file<br />
#''asTextEntry ''- the entry in the .lang file<br />
#''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.<br />
<syntaxhighlight lang="c++"><br />
void StartDemoEnd();<br />
</syntaxhighlight><br />
<br />
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)<br />
<br />
<syntaxhighlight lang="c++"><br />
void AutoSave();<br />
</syntaxhighlight><br />
<br />
Save the game to the auto save.<br />
<br />
<syntaxhighlight lang="c++"><br />
void CheckPoint (string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry);<br />
</syntaxhighlight><br />
<br />
Sets a checkpoint at which the player will respawn in case he dies. <br />Callback syntax: <code>void MyFunc(string &in asName, int alCount)</code> <br />Count is 0 on the first checkpoint load!<br />
<br />
#''asName ''- the internal name<br />
#''asStartPos ''- the name of the StartPos in the editor<br />
#''asCallback ''- the function to call when the player dies/respawns<br />
#''asDeathHintCat ''- the category of the death hint message to be used in the .lang file<br />
#''asDeathHintEntry ''- the entry in the .lang file<br />
<syntaxhighlight lang="c++"><br />
void ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);<br />
</syntaxhighlight><br />
<br />
Immediatly loads another map.<br />
<br />
#''asMapName ''- the file to load<br />
#''asStartPos ''- the name of the StartPos on the next map<br />
#''asStartSound ''- the sound that is played when the change starts<br />
#''asEndSound ''- the sound that is played when the new map is loaded<br />
<syntaxhighlight lang="c++"><br />
void ClearSavedMaps();<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
<syntaxhighlight lang="c++"><br />
void CreateDataCache();<br />
void DestroyDataCache();<br />
</syntaxhighlight><br />
<br />
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.<br />
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.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetMapDisplayNameEntry(string& asNameEntry);<br />
</syntaxhighlight><br />
<br />
Sets the map name shown in save file names. If none is set NULL is assumed.<br />
<br />
#''asNameEntry ''- the entry to display, category must be "Levels"!<br />
<syntaxhighlight lang="c++"><br />
void SetSkyBoxActive(bool abActive);<br />
</syntaxhighlight><br />
<br />
Enables/Disables the skybox.<br />
<br />
#''abActive'' - true = active, false = inactive<br />
<syntaxhighlight lang="c++"><br />
void SetSkyBoxTexture(string& asTexture);<br />
</syntaxhighlight><br />
<br />
Sets the texture of the skybox.<br />
<br />
#''asTexture'' - The texture file to set. Extension: .dds<br />
<syntaxhighlight lang="c++"><br />
void SetSkyBoxColor(float afR, float afG, float afB, float afA);<br />
</syntaxhighlight><br />
<br />
Sets the solid color of the skybox rather than a texture.<br />
<br />
#''afR ''- red value<br />
#''afG ''- green value<br />
#''afB ''- blue value<br />
#''afA ''- alpha value<br />
<syntaxhighlight lang="c++"><br />
void SetFogActive(bool abActive);<br />
</syntaxhighlight><br />
<br />
Enables/Disables the global fog.<br />
<br />
#''abActive'' - true = active, false = inactive<br />
<syntaxhighlight lang="c++"><br />
void SetFogColor(float afR, float afG, float afB, float afA);<br />
</syntaxhighlight><br />
<br />
Sets the color to use for the global fog.<br />
<br />
#''afR ''- red value<br />
#''afG ''- green value<br />
#''afB ''- blue value<br />
#''afA ''- alpha value<br />
<syntaxhighlight lang="c++"><br />
void SetFogProperties(float afStart, float afEnd, float afFalloffExp, bool abCulling);<br />
</syntaxhighlight><br />
<br />
Sets the properties for the global fog.<br />
<br />
#''afStart ''- how many meters from the camera should the fog begin<br />
#''afEnd ''- how many meters from the camera should the fog reach full thickness<br />
#''afFalloffExp ''- the amount by which the thinkness increases<br />
#''abCulling ''- whether occlusion culling is active for the fog; this prevents objects behind the fog from being loaded<br />
<syntaxhighlight lang="c++"><br />
void SetupLoadScreen(string&asTextCat, string&asTextEntry, int alRandomNum, string&asImageFile);<br />
</syntaxhighlight><br />
<br />
Determines which loading screen will be shown when changing maps.<br />
<br />
#''asTextCat ''- the category of the loading text in the .lang file to be shown on the loading screen<br />
#''asTextEntry ''- the entry in the .lang file<br />
#''alRandomNum ''- if greater 1, then it will randomize between 1 and alRandom for each LoadScreen giving entry the suffix XX (eg 01). If < =1 then no suffix is added<br />
#''asImageFile ''- the image to be shown (optional)<br />
<br />
===Game Timer===<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddTimer(string& asName, float afTime, string& asFunction);<br />
</syntaxhighlight><br />
<br />
Creates a timer which calls a function when it expires. <br />Callback syntax: <code>void MyFunc(string &in asTimer)</code><br />
<br />
#''asName ''- the name of the timer<br />
#''afTime ''- time in seconds<br />
#''asFunction ''- the function to call<br />
<syntaxhighlight lang="c++"><br />
void RemoveTimer(string& asName);<br />
</syntaxhighlight><br />
<br />
Removes a timer, no matter how much time is left.<br />
<br />
#''asName'' - the internal name of the timer.<br />
<syntaxhighlight lang="c++"><br />
float GetTimerTimeLeft(string& asName);<br />
</syntaxhighlight><br />
<br />
Returns the time left on a timer.<br />
<br />
#''asName'' - the internal name of the timer.<br />
<br />
===Screen Effects===<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadeOut(float afTime);<br />
</syntaxhighlight><br />
<br />
Fades the screen to black.<br />
<br />
''afTime ''- time in seconds until the screen is completly black<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadeIn(float afTime);<br />
</syntaxhighlight><br />
<br />
Fades the screen back to normal.<br />
<br />
''afTime ''- time in seconds until the screen back to normal<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadeImageTrailTo(float afAmount, float afSpeed);<br />
</syntaxhighlight><br />
<br />
Applies the image trail effect to the screen.<br />
<br />
''afAmount ''- intensity (default: 0) <br />''afSpeed ''- time in seconds until full effect<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadeSepiaColorTo(float afAmount, float afSpeed);<br />
</syntaxhighlight><br />
<br />
Makes the screen go dark red.<br />
<br />
''afAmount ''- intensity (default: 0) <br />''afSpeed ''- time in seconds until full effect<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadeRadialBlurTo(float afSize, float afSpeed);<br />
</syntaxhighlight><br />
<br />
Applies radial blur effects to the screen.<br />
<br />
''afSize ''- intensity (default: 0) <br />''afSpeed ''- time in seconds until full effect<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetRadialBlurStartDist(float afStartDist);<br />
</syntaxhighlight><br />
<br />
Determines at which distance the radial blur effects appear.<br />
<br />
''afStartDist ''- the distance at which the effect starts<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartEffectFlash(float afFadeIn, float afWhite, float afFadeOut);<br />
</syntaxhighlight><br />
<br />
Fades the screen to white.<br />
<br />
''afFadeIn ''- time in seconds until screen is white <br />''afWhite ''- determines to which percentage the screen fades to white (1.0 = completly white) <br />''afFadeOut ''- time in seconds until screen is back to normal again<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartEffectEmotionFlash(string& asTextCat, string& asTextEntry, string& asSound);<br />
</syntaxhighlight><br />
<br />
Fades the screen to white and shows a text message.<br />
<br />
''asTextCat ''- the category in the .lang file <br />''asTextEntry ''- the text entry in the .lang file <br />''asSound ''- the sound to play while fading<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddEffectVoice(string& asVoiceFile, string& asEffectFile, string& asTextCat, string& asTextEntry,<br />
bool abUsePosition, string& asPosEntity, float afMinDistance, float afMaxDistance);<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
''asVoiceFile ''- the voice to play <br />''asEffectFile ''- the effect to play <br />''asTextCat ''- the category in the .lang file <br />''asTextEntry ''- the text entry in the .lang file <br />''abUsePosition ''- plays using 3D from the entity, or without 3D <br />''asPosEntity ''- the entity at which the effect appears <br />''afMinDistance ''- minimum distance to see the effect <br />''afMaxDistance ''- maximum distance to see the effect<br />
<br />
<syntaxhighlight lang="c++"><br />
void StopAllEffectVoices(float afFadeOutTime);<br />
</syntaxhighlight><br />
<br />
Stops all voices and calls the EffectVoiceOverCallback.<br />
<br />
<syntaxhighlight lang="c++"><br />
bool GetEffectVoiceActive();<br />
</syntaxhighlight><br />
<br />
Checks whether EffectVoices are still active.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetEffectVoiceOverCallback(string& asFunc);<br />
</syntaxhighlight><br />
<br />
Sets the function to be called when the EffectVoices are finished. <br />Callback syntax: <code>void MyFunc()</code><br />
<br />
<syntaxhighlight lang="c++"><br />
bool GetFlashbackIsActive();<br />
</syntaxhighlight><br />
<br />
Checks whether a flashback is still in effect.<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartPlayerSpawnPS(string& asSPSFile);<br />
void StopPlayerSpawnPS();<br />
</syntaxhighlight><br />
<br />
Continuously spawn regular particle systems (''.ps'') around the player. Particles created by this script carry over from map to map. <br /> <br />''asSPSFile'' - the ''.sps'' file to use. Exemplary ''.sps'' files are located in the ''/misc'' folder in the main game directory. <br /> <br />Custom ''.sps'' files can be created by hand in a text editor (see existing ones and mimic how those are written). <br />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.<br />
<br />
<syntaxhighlight lang="c++"><br />
void PlayGuiSound(string& asSoundFile, float afVolume);<br />
</syntaxhighlight><br />
<br />
Plays a sound, not using 3D.<br />
<br />
''asSoundFile ''- the sound to play (extension is .snt) <br />''afVolume ''- the volume of the sound<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);<br />
</syntaxhighlight><br />
<br />
Shakes the screen.<br />
<br />
''afAmount ''- intensity of the shake <br />''afTime ''- duration of the shake <br />''afFadeInTime ''- time in seconds until full intensity is reached <br />''afFadeOutTime ''- time until screen is back to normal<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetInDarknessEffectsActive(bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables the sanity drain and night vision effects while in the darkness.<br />
<br />
''bool abX'' - Enable/disable effects.<br />
<br />
<syntaxhighlight lang="c++"><br />
void ShowScreenImage(string &in asImageName, float afX, float afY, float afScale, bool abUseRelativeCoordinates, float afDuration, float afFadeIn, float afFadeOut);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.5}}<br />
<br />
Displays an image file directly onto the screen.<br />
<br />
''asImageName'' - The image file to render (.jpg, .png, .tga, .dds)<br />
<br />
''afX'' - The X position of the image<br />
<br />
''afY'' - The Y position of the image<br />
<br />
''afScale'' - The scale of the image (default 1.0f)<br />
<br />
''abUseRelativeCoordinates'' - Whether or not to use relative coordinates for positioning. Use false for absolute.<br />
<br />
''afDuration'' - The duration that the image is displayed for.<br />
<br />
''afFadeIn'' - The time, in seconds, to fade in the image.<br />
<br />
''afFadeOut'' - The time, in seconds, to fade out the image.<br />
<br />
===Insanity===<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetInsanitySetEnabled(string& asSet, bool abX);<br />
</syntaxhighlight><br />
<br />
Determines which InsanitySets are enabled.<br />
<br />
''asSet ''- the set <br />''abX ''- enabled or not<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartInsanityEvent(string &in asEventName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Starts a specified insanity event.<br />
<br />
''asEventName ''- Insanity event to play.<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartRandomInsanityEvent();<br />
</syntaxhighlight><br />
<br />
Starts a random insanity event from the available sets.<br />
<br />
<syntaxhighlight lang="c++"><br />
void StopCurrentInsanityEvent();<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Stops the currently playing insanity event.<br />
<br />
<syntaxhighlight lang="c++"><br />
void InsanityEventIsActive();<br />
</syntaxhighlight><br />
<br />
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 [http://wiki.frictionalgames.com/lib/images/smileys/icon_smile.gif?nolink&15x15]<br />
<br />
===Player===<br />
<br />
Note that the player's maximum health and sanity is 100.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerActive(bool abActive);<br />
</syntaxhighlight><br />
<br />
Enabled/Disable player controlled movement.<br />
<br />
<syntaxhighlight lang="c++"><br />
void ChangePlayerStateToNormal();<br />
</syntaxhighlight><br />
<br />
Sets certain effects back to normal. It can for example make the player drop an item.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerCrouching(bool abCrouch);<br />
</syntaxhighlight><br />
<br />
Forces the player to crouch.<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddPlayerBodyForce(float afX, float afY, float afZ, bool abUseLocalCoords);<br />
</syntaxhighlight><br />
<br />
Pushes the player into a certain direction. Note that you need values above ~2000 to see any effects.<br />
<br />
''afX ''- amount along the X-axis <br />''afY ''- amount along the Y-axis <br />''afZ ''- amount along the Z-axis <br />''abUseLocalCoords ''- If true, axes are based on where the player is facing, not the world.<br />
<br />
<syntaxhighlight lang="c++"><br />
void ShowPlayerCrossHairIcons(bool abX);<br />
</syntaxhighlight><br />
<br />
Enables/Disables the icons when a player has something in focus.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerSanity(float afSanity);<br />
void AddPlayerSanity(float afSanity);<br />
float GetPlayerSanity();<br />
</syntaxhighlight><br />
<br />
Modifies/returns the sanity of the player.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerHealth(float afHealth);<br />
void AddPlayerHealth(float afHealth);<br />
float GetPlayerHealth();<br />
</syntaxhighlight><br />
<br />
Modifies/returns the health of the player.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerLampOil(float afOil);<br />
void AddPlayerLampOil(float afOil);<br />
float GetPlayerLampOil();<br />
</syntaxhighlight><br />
<br />
Modifies/returns the lamp oil of the player.<br />
<br />
<syntaxhighlight lang="c++"><br />
float GetPlayerSpeed();<br />
float GetPlayerYSpeed();<br />
</syntaxhighlight><br />
<br />
Returns the current speed of the player.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetSanityDrainDisabled(bool abX);<br />
</syntaxhighlight><br />
<br />
Enables/Disables sanity drain from darkness, monsters, etc.<br />
<br />
<syntaxhighlight lang="c++"><br />
void GiveSanityBoost();<br />
void GiveSanityBoostSmall();<br />
</syntaxhighlight><br />
<br />
Boosts the player's sanity by a fixed amount.<br />
<br />
<syntaxhighlight lang="c++"><br />
void GiveSanityDamage(float afAmount, bool abUseEffect);<br />
</syntaxhighlight><br />
<br />
Reduces the sanity of the player.<br />
<br />
''afAmount ''- amount of sanity damage done <br />''abUseEffect ''- determines whether an effect is played when the sanity damage is dealt<br />
<br />
<syntaxhighlight lang="c++"><br />
void GivePlayerDamage(float afAmount, string& asType, bool abSpinHead, bool abLethal);<br />
</syntaxhighlight><br />
<br />
Reduces the health of the player.<br />
<br />
''afAmount ''- amount of damage done to health <br />''asType ''- plays a certain effect on the screen when the damage is dealt (BloodSplat, Claws or Slash) <br />''abSpinHead ''- changes the camera view when damage is dealt <br />''abLethal ''- set to true if player can die from given damage<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadePlayerFOVMulTo(float afX, float afSpeed);<br />
</syntaxhighlight><br />
<br />
Changes the field of view of the player. A shorter FOV will create a zoom effect.<br />
<br />
''afX ''- multiplier of default FOV (1 is default) <br />''afSpeed ''- the speed of change between FOV's<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadePlayerAspectMulTo(float afX, float afSpeed);<br />
</syntaxhighlight><br />
<br />
Changes the aspect ratio of the player. Basically stretches or narrows the screen horizontally.<br />
<br />
''afX ''- multiplier of default aspect (default is 1) <br />''afSpeed ''- the speed of change between FOV's<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed);<br />
</syntaxhighlight><br />
<br />
Rotates the position of the camera on the player's body.<br />
<br />
''afX ''- angle of rotation of head, positive being counter-clockwise <br />''afSpeedMul ''- speed (possibly acceleration) multiplier of the rotation (default 1, which is really slow) <br />''afMaxSpeed ''- maximum speed of rotation<br />
<br />
<syntaxhighlight lang="c++"><br />
void MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist);<br />
</syntaxhighlight><br />
<br />
Changes the position of the camera on the player's body.<br />
<br />
''afX ''- amount along the X-axis <br />''afY ''- amount along the Y-axis <br />''afZ ''- amount along the Z-axis <br />''afSpeed ''- speed at which the change happens <br />''afSlowDownDist ''- distance at which to start slowing down (prevents the head from abruptly stopping)<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartPlayerLookAt(string& asEntityName, float afSpeedMul, float afMaxSpeed, string& asAtTargetCallback);<br />
void StopPlayerLookAt();<br />
</syntaxhighlight><br />
<br />
Forces the player to look at a certain entity until StopPlayerLookAt is used.<br />
<br />
''asEntityName ''- the entity to look at <br />''afSpeedMul ''- how fast should the player look at the entity <br />''afMaxSpeed ''- maximum speed allowed <br />''asAtTargetCallback ''- function to call when player looks at target<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerMoveSpeedMul(float afMul);<br />
void SetPlayerRunSpeedMul(float afMul);<br />
void SetPlayerLookSpeedMul(float afMul);<br />
</syntaxhighlight><br />
<br />
Changes the player's move/run/look speed. Default is 1.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerJumpForceMul(float afMul);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Changes the player's jump multiplier. Higher values = higher jumps. Default is 1.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerJumpDisabled(bool abX);<br />
void SetPlayerCrouchDisabled(bool abX);<br />
</syntaxhighlight><br />
<br />
Enables/Disables the player's ability to jump/crouch.<br />
<br />
<syntaxhighlight lang="c++"><br />
void TeleportPlayer(string& asStartPosName);<br />
</syntaxhighlight><br />
<br />
Instantly teleports the player to the target StartPos.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLanternActive(bool abX, bool abUseEffects);<br />
</syntaxhighlight><br />
<br />
Makes the player use his lantern.<br />
<br />
<syntaxhighlight lang="c++"><br />
bool GetLanternActive();<br />
</syntaxhighlight><br />
<br />
Checks whether the player currently uses his lantern.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLanternDisabled(bool abX);<br />
</syntaxhighlight><br />
<br />
Enables/Disables the player's ability to use his lantern.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLanternLitCallback(string& asCallback);<br />
</syntaxhighlight><br />
<br />
Sets the function to call when the player uses his lantern. <br />Callback syntax: <code>MyFunc(bool abLit)</code><br />
<br />
<syntaxhighlight lang="c++"><br />
void SetMessage(string& asTextCategory, string& asTextEntry, float afTime);<br />
</syntaxhighlight><br />
<br />
Displays a message on the screen.<br />
<br />
''asTextCategory ''- the category in the .lang file <br />''asTextEntry ''- the entry in the .lang file <br />''afTime ''- determines how long the message is displayed. If time is < =0 then the life time is calculated based on string length.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetDeathHint(string& asTextCategory, string& asTextEntry);<br />
</syntaxhighlight><br />
<br />
Sets the message that appears when the player dies.<br />
<br />
''asTextCategory ''- the category in the .lang file <br />''asTextEntry ''- the entry in the .lang file<br />
<br />
<syntaxhighlight lang="c++"><br />
void DisableDeathStartSound();<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
<syntaxhighlight lang=""><br />
void MovePlayerForward(float afAmount)<br />
</syntaxhighlight><br />
<br />
"REQUIRES THE 1.2 PATCH: JUSTINE" Moves the player forward. It needs to be called in a timer that updates 60 times / second.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerFallDamageDisabled(bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables the player's ability to take fall damage.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerPos(float afX, float afY, float afZ);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Sets the player's position within the level.<br />
<br />
''afX'' - X co-ordinate position. <br />''afY'' - Y co-ordinate position. <br />''afZ'' - Z co-ordinate position.<br />
<br />
<syntaxhighlight lang="c++"><br />
float GetPlayerPosX();<br />
float GetPlayerPosY();<br />
float GetPlayerPosZ();<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the player's position within the level on the specified axis.<br />
<br />
===Journal===<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddNote(string& asNameAndTextEntry, string& asImage);<br />
</syntaxhighlight><br />
<br />
Adds a note to the player's journal.<br />
<br />
''asNameAndTextEntry ''- entries in the .lang file. Must end with _Name and _Text and be in category "Journal"! <br />''asImage ''- the background image to be used<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddDiary(string& asNameAndTextEntry, string& asImage);<br />
</syntaxhighlight><br />
<br />
Adds a diary to the player's journal.<br />
<br />
''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"! <br />''asImage ''- the background image to be used<br />
<br />
<syntaxhighlight lang="c++"><br />
void ReturnOpenJournal(bool abOpenJournal);<br />
</syntaxhighlight><br />
<br />
Only called in the pickup diary callback! If true the journal displays the entry else not.<br />
<br />
===Quests===<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddQuest(string& asName, string& asNameAndTextEntry);<br />
</syntaxhighlight><br />
<br />
Adds a quest to the player's journal under mementos.<br />
<br />
''asName ''- the internal name to be used <br />''asNameAndTextEntry ''- entry in the .lang file. Must start with "Quest_<texthere>_Text”, and be in category “Journal”!<br />
<br />
<syntaxhighlight lang="c++"><br />
void CompleteQuest(string& asName, string& asNameAndTextEntry);<br />
</syntaxhighlight><br />
<br />
Completes a quest.<br />
<br />
''asName ''- the internal name of the quest <br />''asNameAndTextEntry ''- entry in the .lang file. Must start with " Quest_<texthere>_Text ”, and be in category “Journal”!<br />
<br />
<syntaxhighlight lang="c++"><br />
bool QuestIsCompleted(string& asName);<br />
bool QuestIsAdded(string& asName);<br />
</syntaxhighlight><br />
<br />
Checks whether a quest is completed/added.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetNumberOfQuestsInMap(int alNumberOfQuests);<br />
</syntaxhighlight><br />
<br />
Sets the number of quests in the map.<br />
<br />
''alNumberOfQuests ''- Amount of Quests<br />
<br />
<syntaxhighlight lang="c++"><br />
void GiveHint (string& asName, string& asMessageCat, string& asMessageEntry, float afTimeShown);<br />
</syntaxhighlight><br />
<br />
Displays a hint on the player's screen.<br />
<br />
''asName ''- the internal name <br />''asMessageCat ''- the category in the .lang file <br />''asMessageEntry ''- the entry in the .lang file <br />''afTimeShown ''- time in seconds until the message disappears. If time is <= 0 then the life time is calculated based on string length.<br />
<br />
<syntaxhighlight lang="c++"><br />
void RemoveHint (string& asName);<br />
void BlockHint (string& asName);<br />
void UnBlockHint (string& asName);<br />
</syntaxhighlight><br />
<br />
Removes<nowiki>\</nowiki>Blocks<nowiki>\</nowiki>Unblocks a hint.<br />
<br />
===Inventory===<br />
<br />
<syntaxhighlight lang="c++"><br />
void ExitInventory();<br />
</syntaxhighlight><br />
<br />
Exits the inventory by force.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetInventoryDisabled(bool abX);<br />
</syntaxhighlight><br />
<br />
Disables the player's ability to open his inventory.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetInventoryMessage(string& asTextCategory, string& asTextEntry, float afTime);<br />
</syntaxhighlight><br />
<br />
Adds a message at the bottom of the inventory screen.<br />
<br />
''asTextCategory ''- the category in the .lang file <br />''asTextEntry ''- the entry in the .lang file <br />''afTime ''- time in seconds until the message disappears. If life time is <= 0 then the life time is calculated based on string length.<br />
<br />
<syntaxhighlight lang="c++"><br />
void GiveItem(string& asName, string& asType, string& asSubTypeName, string& asImageName, float afAmount);<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
''asName ''- internal name <br />''asType ''- item type to give, Available types are: <br /><br />
<br />
*Puzzle<br />
*Lantern<br />
*Health<br />
*Sanity<br />
*LampOil<br />
*Tinderbox<br />
<br />
''asSubTypeName ''- item name for .lang file <br />''asImageName ''- the image which will appear in inventory. For example: <code>void GiveItem("chemical_container_full_1", "Puzzle", "chemical_container_full", "chemical_container_full.tga", 1);</code> will use the image from <code>graphics/item/chemical_container_full.tga</code> <br />
<br />
''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.<br />
<br />
<syntaxhighlight lang="c++"><br />
void RemoveItem(string& asName);<br />
</syntaxhighlight><br />
<br />
Removes an item from the player's inventory.<br />
<br />
<syntaxhighlight lang="c++"><br />
bool HasItem(string& asName);<br />
</syntaxhighlight><br />
<br />
Checks whether the player has an item in his inventory.<br />
<br />
<syntaxhighlight lang="c++"><br />
void GiveItemFromFile(string& asName, string& asFileName);<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
''asName ''- internal name <br />''asFileName ''- item to give + extension (.ent)<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddCombineCallback(string& asName, string& asItemA, string& asItemB, string& asFunction, bool abAutoRemove);<br />
</syntaxhighlight><br />
<br />
Allows the player to combine items in his inventory. <br />Callback syntax: <code>void MyFunc(string &in asItemA, string &in asItemB)</code><br />
<br />
''asName ''- internal name for the callback <br />''asItemA ''- internal name of first item <br />''asItemB ''- internal name of second item <br />''asFunction ''- the function to call <br />''abAutoRemove ''- determines whether the callback should be removed when the items are combined<br />
<br />
<syntaxhighlight lang="c++"><br />
void RemoveCombineCallback(string& asName);<br />
</syntaxhighlight><br />
<br />
Removes a combine callback. <br />''asName'' - the internal name of the callback to be removed (as specified in AddCombineCallback)<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddUseItemCallback(string& asName, string& asItem, string& asEntity, string& asFunction, bool abAutoDestroy);<br />
</syntaxhighlight><br />
<br />
Allows the player to use items on the world. <br />Callback syntax: <code>void MyFunc(string &in asItem, string &in asEntity)</code><br />
<br />
''asName ''- internal name <br />''asItem ''- internal name of the item <br />''asEntity ''- entity to be able to use the item on <br />''asFunction ''- function to call <br />''abAutoDestroy ''- determines whether the item is destroyed when used<br />
<br />
<syntaxhighlight lang="c++"><br />
void RemoveUseItemCallback(string& asName);<br />
</syntaxhighlight><br />
<br />
Removes an item callback.<br />
<br />
===Entities===<br />
<br />
====General====<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityActive(string& asName, bool abActive);<br />
</syntaxhighlight><br />
<br />
Activates/deactivates an entity.<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityVisible(string &in asName, bool abVisible);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Activates/deactivates an entity's visual mesh. The collision body remains.<br />
<br />
''asName'' - Name of the entity. <br />''abActive'' - Activate/deactivate mesh.<br />
<br />
<syntaxhighlight lang="c"><br />
bool GetEntityExists(string& asName);<br />
</syntaxhighlight><br />
<br />
Checks whether an entity exists.<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityCustomFocusCrossHair(string& asName, string& asCrossHair);<br />
</syntaxhighlight><br />
<br />
Changes the crosshair that is used when focusing an entity.<br />
<br />
''asName ''- internal name <br />''asCrossHair ''- desired crosshair, can be: Default (uses default), Grab, Push, Ignite, Pick, LevelDoor, Ladder<br />
<br />
<syntaxhighlight lang="c"><br />
void CreateEntityAtArea(string& asEntityName, string& asEntityFile, string& asAreaName, bool abFullGameSave);<br />
</syntaxhighlight><br />
<br />
Creates an entity at an area. When creating an enemy though, it cannot chase properly along PathNodes(using for example ShowEnemyPlayerPosition).<br />
<br />
''asEntityName ''- internal name <br />''asEntityFile ''- entity to be used extension .ent <br />''asAreaName ''- the area to create the entity at <br />''abFullGameSave ''- determines whether an entity "remembers" its state<br />
<br />
<syntaxhighlight lang="c"><br />
void ReplaceEntity(string &in asName, string &in asBodyName, string &in asNewEntityName, string &in asNewEntityFile, bool abFullGameSave);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Removes an entity and places a new one in its place.<br />
<br />
''asName'' - Name of the entity to replace. <br />''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). <br />''asNewEntityName'' - Name of the new entity. <br />''asNewEntityFile'' - Name of the new entity file. Extension .ent. <br />''abFullGameSave'' - Whether ALL properties of this entity should be saved throughout levels.<br />
<br />
<syntaxhighlight lang="c++"><br />
void PlaceEntityAtEntity(string &in asName, string &in asTargetEntity, string &in asTargetBodyName, bool abUseRotation);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Places an entity at the position of another entity. Does not work for enemies, use TeleportEnemyToEntity instead.<br />
<br />
''asName'' - Name of the entity to place. <br />''asTargetEntity'' - Name of the other entity to place the first entity at. <br />''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). <br />''abUseRotation'' - Whether the entity should be rotated like the target entity.<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityPos(string &in asName, float afX, float afY, float afZ);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Moves an entity to a position in the level.<br />
<br />
''asName'' - Name of the entity to move. <br />''afX'' - X co-ordinate position. <br />''afY'' - Y co-ordinate position. <br />''afZ'' - Z co-ordinate position.<br />
<br />
<syntaxhighlight lang="c"><br />
float GetEntityPosX(string &in asName);<br />
float GetEntityPosY(string &in asName);<br />
float GetEntityPosZ(string &in asName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns an entity's position in the level on the specified axis.<br />
<br />
''asName'' - Name of the entity.<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityPlayerLookAtCallback(string& asName, string& asCallback, bool abRemoveWhenLookedAt);<br />
</syntaxhighlight><br />
<br />
Calls a function when the player looks at a certain entity. <br />Callback syntax: <code>void MyFunc(string &in asEntity, int alState)</code> <br />alState: 1 = looking, -1 = not looking<br />
<br />
''asName ''- internal name <br />''asCallback ''- function to call <br />''abRemoveWhenLookedAt ''- determines whether the callback should be removed when the player looked at the entity<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction);<br />
</syntaxhighlight><br />
<br />
Calls a function when the player interacts with a certain entity. <br />Callback syntax: <code>void MyFunc(string &in asEntity)</code><br />
<br />
''asName ''- internal name <br />''asCallback ''- function to call <br />''abRemoveOnInteraction ''- determines whether the callback should be removed when the player interacts with the entity<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityCallbackFunc(string& asName, string& asCallback);<br />
</syntaxhighlight><br />
<br />
Calls a function when the player interacts with a certain entity. <br />Callback syntax: <code>void MyFunc(string &in asEntity, string &in type)</code> <br />Type depends on entity type and includes: "OnPickup", "Break", "OnIgnite", etc<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityConnectionStateChangeCallback(string& asName, string& asCallback);<br />
</syntaxhighlight><br />
<br />
A callback called when ever the connection state changes (button being switched on, lever switched, etc). <br />Callback syntax: <code>void Func(string &in asEntity, int alState)</code> <br />alState: -1 = off, 0 = between, 1 = on<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityInteractionDisabled(string& asName, bool abDisabled);<br />
</syntaxhighlight><br />
<br />
Disallows interaction with an entity.<br />
<br />
<syntaxhighlight lang="c"><br />
void BreakJoint (string& asName);<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
<syntaxhighlight lang="c"><br />
void AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);<br />
</syntaxhighlight><br />
<br />
Calls a function when two entites collide. <br />Callback syntax: <code>void MyFunc(string &in asParent, string &in asChild, int alState)</code> <br />alState: 1 = enter, -1 = leave<br />
<br />
''asParentName ''- internal name of main object <br />''asChildName ''- internal name of object that collides with main object (asterix (<nowiki>*</nowiki>) NOT supported!) <br />''asFunction ''- function to call <br />''abDeleteOnCollide ''- determines whether the callback after it was called <br />''alStates ''- 1 = only enter, -1 = only leave, 0 = both<br />
<br />
<syntaxhighlight lang="c"><br />
void RemoveEntityCollideCallback(string& asParentName, string& asChildName);<br />
</syntaxhighlight><br />
<br />
Removes an EntityCollideCallback. Asterix (<nowiki>*</nowiki>) not supported in ''asChildName''.<br />
<br />
<syntaxhighlight lang="c"><br />
bool GetEntitiesCollide(string& asEntityA, string& asEntityB);<br />
</syntaxhighlight><br />
<br />
Checks whether two entites collide. This function does NOT support asterix (<nowiki>*</nowiki>) or "Player"!<br />
<br />
<syntaxhighlight lang="c"><br />
void SetBodyMass(string &in asName, float afMass);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Sets the mass of an entity's body.<br />
<br />
''asName'' - Name of the body of an entity. The body name of an entity is EntityName_BodyName. <br />''afMass'' - The mass to set.<br />
<br />
<syntaxhighlight lang="c"><br />
float GetBodyMass(string &in asName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Gets the mass of an entity's body.<br />
<br />
''asName'' - Name of the body of an entity. The body name of an entity is EntityName_BodyName. <br />''afMass'' - The mass to get.<br />
<br />
====Props====<br />
<br />
<syntaxhighlight lang="c"><br />
void SetPropEffectActive(string& asName, bool abActive, bool abFadeAndPlaySounds);<br />
</syntaxhighlight><br />
<br />
Can be used on coal to give it the black color it should have.<br />
<br />
<syntaxhighlight lang="c"><br />
void SetPropActiveAndFade(string& asName, bool abActive, float afFadeTime);<br />
</syntaxhighlight><br />
<br />
Activates/deactivates a prop.<br />
<br />
''asName ''- internal name <br />''abActive ''- nothing to add <br />''afFadeTime ''- time in seconds until prop fully fades<br />
<br />
<syntaxhighlight lang="c"><br />
void SetPropStaticPhysics(string& asName, bool abX);<br />
</syntaxhighlight><br />
<br />
Activates/deactivates the physics of a prop. Setting as true will make entities static in midair.<br />
<br />
<syntaxhighlight lang="c"><br />
bool GetPropIsInteractedWith(string& asName);<br />
</syntaxhighlight><br />
<br />
Checks whether a prop is interacted with.<br />
<br />
<syntaxhighlight lang="c"><br />
void RotatePropToSpeed(string& asName, float afAcc, float afGoalSpeed, float afAxisX, float afAxisY, float afAxisZ, bool abResetSpeed, string& asOffsetArea);<br />
</syntaxhighlight><br />
<br />
Rotates the prop up to a set speed.<br />
<br />
''asName ''- internal name <br />''afAcc ''- acceleration <br />''afGoalSpeed ''- desired speed <br />''afAxisX ''- rotation around X axis <br />''afAxisY ''- rotation around Y axis <br />''afAxisZ ''- rotation around Z axis <br />''abResetSpeed ''- determines whether the speed is resetted after goal speed is reached <br />''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 "StaticObject" entity!<br />
<br />
<syntaxhighlight lang="cpp"><br />
void StopPropMovement(string& asName);<br />
</syntaxhighlight><br />
<br />
Stops all movement of a prop.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AddAttachedPropToProp(string& asPropName, string& asAttachName, string& asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);<br />
</syntaxhighlight><br />
<br />
Attaches a prop to another prop.<br />
<br />
a''sPropName''- the prop to attach another prop at <br />''asAttachName ''- internal name of the prop that gets attached <br />''asAttachFile ''- the prop that gets attached extension .ent <br />''afPosX ''- X position of the attach from the prop <br />''afPosY ''- Y position of the attach from the prop <br />''afPosZ ''- Z position of the attach from the prop <br />''afRotX ''- rotation around X axis of the attach <br />''afRotY ''- rotation around Y axis of the attach <br />''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of "AddEntityCollideCallback", attached props will not call the callback function if they collide with a "static_object" or a "StaticProp" entity type!<br />
<br />
{{bug|''afRotZ '' is used for both the ZX rotation and the Z position of the attached prop. Unwanted rotation can be avoided by using: <br />''AddAttachedPropToProp(asPropName, asAttachName, asAttachFile, afPosX, afPosY, '''0''', afPosZ, '''90.0f''', afPosZ)''}}<br />
<br />
{{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.}}<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AttachPropToProp(string& asPropName, string& asAttachName, string& asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Attaches a prop to another prop. Fixed version of AddAttachedPropToProp.<br />
<br />
''asPropName ''- the prop to attach another prop at <br />''asAttachName ''- internal name of the prop that gets attached <br />''asAttachFile ''- the prop that gets attached extension .ent <br />''afPosX ''- X position of the attach from the prop <br />''afPosY ''- Y position of the attach from the prop <br />''afPosZ ''- Z position of the attach from the prop <br />''afRotX ''- rotation around X axis of the attach <br />''afRotY ''- rotation around Y axis of the attach <br />''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of "AddEntityCollideCallback", attached props will not call the callback function if they collide with a "static_object" or a "StaticProp" entity type!<br />
<br />
<syntaxhighlight lang="cpp"><br />
void RemoveAttachedPropFromProp(string& asPropName, string& asAttachName);<br />
</syntaxhighlight><br />
<br />
Detaches a prop from a prop.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetPropHealth(string& asName, float afHealth);<br />
void AddPropHealth(string& asName, float afHealth);<br />
float GetPropHealth(string& asName);<br />
</syntaxhighlight><br />
<br />
Modifies/returns the health of a prop.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void ResetProp(string& asName);<br />
</syntaxhighlight><br />
<br />
Resets a prop's state to the original one when the map was loaded.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void PlayPropAnimation(string& asProp, string& asAnimation, float afFadeTime, bool abLoop, string& asCallback);<br />
</syntaxhighlight><br />
<br />
Makes the prop play an animation and calls a function. <br />Callback syntax: <code>void MyFunc(string &in asProp)</code><br />
<br />
''asProp ''- internal name of the prop <br />''asAnimation ''- animation to play <br />''afFadeTime ''- ? <br />''abLoop ''- determines whether the animation loops <br />''asCallback ''- function to call<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AddPropForce(string& asName, float afX, float afY, float afZ, string& asCoordSystem);<br />
void AddPropImpulse(string& asName, float afX, float afY, float afZ, string& asCoordSystem);<br />
void AddBodyForce(string& asName, float afX, float afY, float afZ, string& asCoordSystem);<br />
void AddBodyImpulse(string& asName, float afX, float afY, float afZ, string& asCoordSystem);<br />
</syntaxhighlight><br />
<br />
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 "Body" 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).<br />
<br />
''asName ''- the object to push; for bodies, use this format: "''entityName''_''bodyName''" <br />''afX ''- magnitude along the X-axis <br />''afY ''- magnitude along the Y-axis <br />''afZ ''- magnitude along the Z-axis <br />''asCoordSystem ''- determines which coordinate system is used, usually "world" 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.<br />
<br />
====Connections====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void InteractConnectPropWithRope(string& asName, string& asPropName, string& asRopeName, bool abInteractOnly, float afSpeedMul, float afToMinSpeed, float afToMaxSpeed, bool abInvert, int alStatesUsed);<br />
</syntaxhighlight><br />
<br />
Connects a prop with the movement of a rope (ie. turn wheel to move rope).<br />
<br />
''asName ''- connection name <br />''asPropName ''- name of prop <br />''asRopeName ''- name of rope <br />''abInteractOnly ''- ? <br />''afSpeedMul ''- speed multiplier of how quickly the rope moves <br />''afToMinSpeed ''- the slowest the rope will move when moving the prop <br />''afToMaxSpeed ''- the fastest the rope will move when moving the prop <br />''abInvert ''- whether to invert the direction the rope moves <br />''alStatesUsed ''- which states of the prop can interact with the rope?<br />
<br />
<syntaxhighlight lang="cpp"><br />
void InteractConnectPropWithMoveObject(string& asName, string& asPropName, string& asMoveObjectName, bool abInteractOnly, bool abInvert, int alStatesUsed);<br />
</syntaxhighlight><br />
<br />
This one should only be used if there must be an exact correspondance to prope "amount" and the moveobject open amount. It is best used for Wheel-door connections!<br />
<br />
<syntaxhighlight lang="cpp"><br />
void ConnectEntities(string& asName, string& asMainEntity, string& asConnectEntity, bool abInvertStateSent, int alStatesUsed, string& asCallbackFunc);<br />
</syntaxhighlight><br />
<br />
Callback syntax: <code>void MyFunc(string &in asConnectionName, string &in asMainEntity, string &in asConnectEntity, int alState)</code> <br />State is what is sent to connection entity and will be inverted if abInvertStateSent = true!<br />
<br />
====Lamps====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetLampLit(string& asName, bool abLit, bool abEffects);<br />
</syntaxhighlight><br />
<br />
(Un)lits a lamp.<br />
<br />
''asName ''- Name of the lamp <br />''abLit ''- Set true if you want the lamp to be lit, set to false if you want the lamp to be unlit <br />''abEffects ''- If you want to have the lamp fade in/out when it gets (un)lit<br />
<br />
====Doors====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetSwingDoorLocked(string& asName, bool abLocked, bool abEffects);<br />
void SetSwingDoorClosed(string& asName, bool abClosed, bool abEffects);<br />
</syntaxhighlight><br />
<br />
Locks/closes a swing door.<br />
<br />
<syntaxhighlight lang="cpp"><br />
bool GetSwingDoorLocked(string& asName);<br />
bool GetSwingDoorClosed(string& asName);<br />
</syntaxhighlight><br />
<br />
Checks whether a swing door is locked/closed.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetSwingDoorDisableAutoClose(string& asName, bool abDisableAutoClose);<br />
</syntaxhighlight><br />
<br />
Deactivates the "auto-close" when a door is nearly closed.<br />
<br />
<syntaxhighlight lang="cpp"><br />
int GetSwingDoorState(string& asName);<br />
</syntaxhighlight><br />
<br />
Returns an integer depending on how far the door is opened. <br />-1 = angle is close to 0°, 1 = angle is 70% or higher of max, 0 = inbetween -1 and 1.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetLevelDoorLocked(string& asName, bool abLocked);<br />
</syntaxhighlight><br />
<br />
Locks a level door. Note that level doors are NOT swing doors.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetLevelDoorLockedSound(string& asName, string& asSound);<br />
</syntaxhighlight><br />
<br />
Determines which sound is played when interacting with a locked level door.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetLevelDoorLockedText(string& asName, string& asTextCat, string& asTextEntry);<br />
</syntaxhighlight><br />
<br />
Displays a message when interacting with a locked level door.<br />
<br />
''asName ''- internal name <br />''asTextCat ''- the category in the .lang file <br />''asTextEntry ''- the entry in the .lang file<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetMoveObjectState(string& asName, float afState);<br />
</syntaxhighlight><br />
<br />
Moves an object to a certain state.<br />
<br />
''asName ''- internal name <br />''afState ''- state of the object, 0 = closed, 1 = open, values inbetween (and above, for example, the bridge_metal_vert) are valid too!<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetMoveObjectStateExt(string& asName, float afState, float afAcc, float afMaxSpeed, float afSlowdownDist, bool abResetSpeed);<br />
</syntaxhighlight><br />
<br />
Moves an object to a certain state, extended method.<br />
<br />
''asName ''- internal name <br />''afState ''- state of the object, 0 = closed, 1 = open, values inbetween are valid too! <br />''afAcc ''- acceleration <br />''afMaxSpeed ''- maximum speed <br />''afSlowdownDist ''- Distance to the target state before decceleration occurs. <br />''abResetSpeed ''- Set to True if the prop's speed should be reset before performing the movement, else the prop will accelerate from it's current speed to afMaxSpeed.<br />
<br />
====Levers, wheels and buttons====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetPropObjectStuckState(string& asName, int alState);<br />
void SetWheelStuckState(string& asName, int alState, bool abEffects);<br />
void SetLeverStuckState(string& asName, int alState, bool abEffects);<br />
</syntaxhighlight><br />
<br />
Makes a prop<nowiki>\</nowiki>wheel<nowiki>\</nowiki>lever stuck in a certain state.<br />
<br />
''asName ''- internal name <br />''alState ''- 0 = not stuck, 1 = at max, -1 = at min <br />''abEffects ''- use effects<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetWheelAngle(string& asName, float afAngle, bool abAutoMove);<br />
</syntaxhighlight><br />
<br />
Moves a wheel to a certain angle.<br />
<br />
''asName ''- internal name <br />''afAngle ''- angle <br />''abAutoMove ''- determines whether the wheel should move on its own<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetWheelInteractionDisablesStuck(string& asName, bool abX);<br />
void SetLeverInteractionDisablesStuck(string& asName, bool abX);<br />
</syntaxhighlight><br />
<br />
Allows the player to make a wheel/lever unstuck when interacted with.<br />
<br />
<syntaxhighlight lang="cpp"><br />
int GetLeverState(string& asName);<br />
</syntaxhighlight><br />
<br />
Returns the state of the lever. <br />0 = not stuck, 1 = at max, -1 = at min<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetMultiSliderStuckState(string& asName, int alStuckState, bool abEffects);<br />
</syntaxhighlight><br />
<br />
Makes a MultiSlider stuck in a certain state.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetMultiSliderCallback(string& asName, string& asCallback);<br />
</syntaxhighlight><br />
<br />
Calls a function when state changes. <br />Callback syntax: <code>void MyFunc(string &in asEntity, int alState)</code><br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetButtonSwitchedOn(string& asName, bool abSwitchedOn, bool abEffects);<br />
</syntaxhighlight><br />
<br />
====Sticky areas====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetAllowStickyAreaAttachment(bool abX);<br />
</syntaxhighlight><br />
<br />
Allows entites to stick to a StickyArea.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AttachPropToStickyArea(string& asAreaName, string& asProp);<br />
void AttachBodyToStickyArea(string& asAreaName, string& asBody);<br />
</syntaxhighlight><br />
<br />
Attaches a prop/body to a StickyArea.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void DetachFromStickyArea(string& asAreaName);<br />
</syntaxhighlight><br />
<br />
Detaches everything from a StickyArea.<br />
<br />
====Enemies====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetNPCAwake(string& asName, bool abAwake, bool abEffects);<br />
</syntaxhighlight><br />
<br />
Activates the npc<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetNPCFollowPlayer(string& asName, bool abX);<br />
</syntaxhighlight><br />
<br />
Sets an NPC's head to follow the player's movement's.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetEnemyDisabled(string& asName, bool abDisabled);<br />
</syntaxhighlight><br />
<br />
Disables an enemy.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetEnemyIsHallucination(string& asName, bool abX);<br />
</syntaxhighlight><br />
<br />
Makes an enemy a hallucination. Hallucinations fade to smoke when they get near the player.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void FadeEnemyToSmoke(string& asName, bool abPlaySound);<br />
</syntaxhighlight><br />
<br />
Instantly fades an enemy to smoke.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void ShowEnemyPlayerPosition(string& asName);<br />
</syntaxhighlight><br />
<br />
Makes the enemy run to the player, no matter where he is.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AlertEnemyOfPlayerPresence(string &in asName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Gives the specified enemy the player's current position and makes it search the area.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetEnemyDisableTriggers(string& asName, bool abX);<br />
</syntaxhighlight><br />
<br />
Enables or disables enemy triggers. If disabled, enemy will not react to player or attack.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AddEnemyPatrolNode(string& asName, string& asNodeName, float afWaitTime, string& asAnimation);<br />
</syntaxhighlight><br />
<br />
Adds a patrol node to the enemy's path.<br />
<br />
''asName ''- internal name of the enemy <br />''asNodeName ''- path node <br />''afWaitTime ''- time in seconds that the enemy waits at the path node before continuing <br />''asAnimation ''- the animation the enemy uses when reaching the path node<br />
<br />
<syntaxhighlight lang="cpp"><br />
void ClearEnemyPatrolNodes(string& asEnemyName);<br />
</syntaxhighlight><br />
<br />
Clears the current path of patrol nodes of the enemy.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetEnemySanityDecreaseActive(string &in asName, bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables whether an enemy activates the player's sanity drain when stared at.<br />
<br />
''asName ''- Internal name of the enemy <br />''abX ''- Enabled/disabled<br />
<br />
<syntaxhighlight lang="cpp"><br />
void TeleportEnemyToNode(string &in asEnemyName, string &in asNodeName, bool abChangeY);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Teleports an enemy to a specific PathNode.<br />
<br />
''asEnemyName ''- Internal name of the enemy <br />''asNodeName ''- Internal name of the node to teleport to <br />''abChangeY ''- Whether the Y position of the node will be used when teleporting the enemy<br />
<br />
<syntaxhighlight lang="cpp"><br />
void TeleportEnemyToEntity(string &in asEnemyName, string &in asTargetEntity, string &in asTargetBody, bool abChangeY);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Teleports an enemy to a specific entity.<br />
<br />
''asEnemyName ''- Internal name of the enemy <br />''asTargetEntity ''- Internal name of the entity to teleport to <br />''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) <br />''abChangeY ''- Whether the Y position of the node will be used when teleporting the enemy<br />
<br />
<syntaxhighlight lang="c"><br />
void ChangeManPigPose(string&in asName, string&in asPoseType);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Changes the pose a specified ManPig.<br />
<br />
''asName ''- Internal name of the enemy <br />''asPoseType''- Name of the ManPig pose to use. Can be "Biped" or "Quadruped"<br />
<br />
<syntaxhighlight lang="c"><br />
void SetTeslaPigFadeDisabled(string&in asName, bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables whether a specified TeslaPig should fade the player's view in and out.<br />
<br />
''asName ''- Internal name of the enemy <br />''abX''- Enabled/disabled<br />
<br />
<syntaxhighlight lang="c"><br />
void SetTeslaPigSoundDisabled(string&in asName, bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables whether a specified TeslaPig should play the proximity sounds.<br />
<br />
''asName ''- Internal name of the enemy <br />''abX''- Enabled/disabled<br />
<br />
<syntaxhighlight lang="c"><br />
void SetTeslaPigEasyEscapeDisabled(string&in asName, bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables whether a specified TeslaPig should be easier to escape from when hunted.<br />
<br />
''asName ''- Internal name of the enemy <br />''abX''- Enabled/disabled<br />
<br />
<syntaxhighlight lang="c"><br />
void ForceTeslaPigSighting(string&in asName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Forces a TeslaPig to be visible for a short time.<br />
<br />
''asName ''- Internal name of the enemy<br />
<br />
<syntaxhighlight lang="c"><br />
string& GetEnemyStateName(string &in asName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the name of the state a specified enemy is current in. States can be Hunt, Search, Patrol, Wait, Alert, Investigate, Track and BreakDoor.<br />
<br />
''asName ''- Internal name of the enemy</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&diff=6443HPL2/Engine Scripts2023-08-28T13:25:34Z<p>Mudbill: /* Screen Effects */ Added ShowScreenImage</p>
<hr />
<div>{{TocRight}}<br />
<br />
This page documents all scripts available in Amnesia: The Dark Descent.<br />
<br />
{{note|'''Note''': Some of the functions require the Amnesia 1.3 update. Steam and other online store copies should be automatically updated. Other copies can get it [http://www.frictionalgames.com/forum/thread-24334.html here].}}<br />
<br />
==Engine scripts==<br />
===Main===<br />
<br />
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.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void OnStart();<br />
</syntaxhighlight><br />
<br />
The function that runs when the map is loaded for the first time.<br />
<br />
<syntaxhighlight lang="c++"><br />
void OnEnter();<br />
</syntaxhighlight><br />
<br />
The function that runs whenever the player enters a map.<br />
<br />
<syntaxhighlight lang="c++"><br />
void OnLeave();<br />
</syntaxhighlight><br />
<br />
The function that runs when the player leaves a map.<br />
<br />
<syntaxhighlight lang="c++"><br />
void OnGameStart();<br />
</syntaxhighlight><br />
<br />
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").<br />
<br />
<syntaxhighlight lang="c++"><br />
void OnUpdate(float afStep);<br />
</syntaxhighlight><br />
{{ReqVer|1.5}}<br />
<br />
This function is executed for every game update or "tick". 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.<br />
<br />
===General===<br />
<br />
<syntaxhighlight lang="c++"><br />
float RandFloat(float afMin, float afMax);<br />
</syntaxhighlight><br />
<br />
Generates a random float.<br />
<br />
#''afMin ''- minimum value<br />
#''afMax ''- maximum value<br />
<syntaxhighlight lang="c++"><br />
int RandInt(int alMin, int alMax);<br />
</syntaxhighlight><br />
<br />
Generates a random int. Note: the maximum value is ''inclusive'' - the RandInt() function may return this value.<br />
<br />
#''alMin ''- minimum value<br />
#''alMax ''- maximum value<br />
<syntaxhighlight lang="c++"><br />
bool StringContains(string& asString, string& asSubString);<br />
</syntaxhighlight><br />
<br />
Checks whether a string contains the specified string. <br />Example: searching for "hello" in "hello world" would return '''true'''.<br />
<br />
#''asString ''- the string to check<br />
#''asSubString ''- the string to search for<br />
<syntaxhighlight lang="cpp"><br />
string& StringSub(string& asString, int alStart, int alCount);<br />
</syntaxhighlight><br />
<br />
Returns the substring in a string. <br />Example: in the string "frictional games rocks", using 4 as ''alStart'' and 6 as ''alCount'' would return '''"tional"'''.<br />
<br />
#''asString ''- the string<br />
#''alStart ''- start position in the string<br />
#''alCount ''- amount of characters<br />
<syntaxhighlight lang="c++"><br />
int StringToInt(string&in asString);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
If possible, returns an integer converted from a string, else returns 0.<br />
<br />
#''asString'' - String to convert.<br />
<syntaxhighlight lang="c++"><br />
float StringToFloat(string&in asString);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
If possible, returns a float converted from a string, else returns 0.<br />
<br />
#''asString'' - String to convert.<br />
<syntaxhighlight lang="c++"><br />
bool StringToBool(string&in asString);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
If possible, returns a boolean converted from a string, else returns false.<br />
<br />
#''asString'' - String to convert.<br />
<br />
===Mathematical Operations===<br />
<br />
<syntaxhighlight lang="c++"><br />
float MathSin(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the sine of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathCos(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the cosine of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathTan(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the tangent of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathAsin(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the arc sine of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathAcos(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the arc cosine of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathAtan(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the arc tangent of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathAtan2(float afX, float afY);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Calculates and returns the arc tangent of the specified values.<br />
<br />
#''afX'' - First value to operate.<br />
#''afY'' - Second value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathSqrt(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the square root of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathPow(float afBase, float afExp);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the value of afBase raised to the power of afExp.<br />
<br />
#''afBase'' - The base value.<br />
#''afExp'' - Value to calculate the base with.<br />
<syntaxhighlight lang="c++"><br />
float MathMin(float afA, float afB);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the lowest value.<br />
<br />
#''afA'' - First value.<br />
#''afB'' - Second value.<br />
<syntaxhighlight lang="c++"><br />
float MathMax(float afA, float afB);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the highest value.<br />
<br />
#''afA'' - First value.<br />
#''afB'' - Second value.<br />
<syntaxhighlight lang="c++"><br />
float MathClamp(float afX, float afMin, float afMax);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns afX clamped between afMin and afMax. If afX < afMin, returns afMin, and if afX > afMax, returns afMax.<br />
<br />
#''afX'' - The value to clamp.<br />
#''afMin'' - The minimum value to clamp afX with.<br />
#''afMax'' - The maximum value to clamp afX with.<br />
<syntaxhighlight lang="c++"><br />
float MathAbs(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the absolute value.<br />
<br />
#''afX'' - Value to operate.<br />
<br />
===Debugging===<br />
<br />
<syntaxhighlight lang="cpp"><br />
void Print(string& asString);<br />
</syntaxhighlight><br />
<br />
Prints a string to the log file (''hpl.log'').<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddDebugMessage(string& asString, bool abCheckForDuplicates);<br />
</syntaxhighlight><br />
<br />
Prints a string to the debug console.<br />
<br />
#''asString ''- the string to print<br />
#''abCheckForDuplicates ''- if true, the string won't be printed more than once on screen until it disappears<br />
<syntaxhighlight lang="c++"><br />
void ProgLog(string& asLevel, string& asMessage);<br />
</syntaxhighlight><br />
<br />
Prints an entry to the ProgLog (progression log). <br />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. <br /> <br />This function allows to log custom messages.The messages in the ProgLog file are sorted by time elapsed since a map was loaded.<br />
<br />
ProgLog has to be enabled for a player profile in ''user_settings.cfg'' before it starts working.<br />
<br />
#''asLevel ''- can be "Low", "Medium" or "High". It's a tag which appears in each log entry, for event prioritising.<br />
#''asMessage ''- The custom message to be printed to the log.<br />
<syntaxhighlight lang="c++"><br />
bool ScriptDebugOn();<br />
</syntaxhighlight><br />
<br />
Checks whether the debug mode is enabled. <br />See [[HPL2/Development_Environment|"Setting up Development Environment"]] to setup debug mode on your own computer.<br />
<br />
===Variables===<br />
{{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 "for" loop. For variables which need to be saved, use the wrappers as described below.}}<br />
<br />
====Local====<br />
<br />
Local variables can be used throughout the same script file.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetLocalVarInt(string& asName, int alVal);<br />
void AddLocalVarInt(string& asName, int alVal);<br />
int GetLocalVarInt(string& asName);<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLocalVarFloat(string& asName, float afVal);<br />
void AddLocalVarFloat(string& asName, float afVal);<br />
float GetLocalVarFloat(string& asName);<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLocalVarString(string& asName, const string& asVal);<br />
void AddLocalVarString(string& asName, string& asVal);<br />
string& GetLocalVarString(string& asName);<br />
</syntaxhighlight><br />
<br />
====Global====<br />
<br />
Global variables can be used throughout several maps and can be accessed by several script files.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetGlobalVarInt(string& asName, int alVal);<br />
void AddGlobalVarInt(string& asName, int alVal);<br />
int GetGlobalVarInt(string& asName);<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="c++"><br />
void SetGlobalVarFloat(string& asName, float afVal);<br />
void AddGlobalVarFloat(string& asName, float afVal);<br />
float GetGlobalVarFloat(string& asName);<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="c++"><br />
void SetGlobalVarString(string& asName, const string& asVal);<br />
void AddGlobalVarString(string& asName, string& asVal);<br />
string& GetGlobalVarString(string& asName);<br />
</syntaxhighlight><br />
<br />
===Particle Systems===<br />
<br />
<syntaxhighlight lang="c++"><br />
void PreloadParticleSystem(string& asPSFile);<br />
</syntaxhighlight><br />
<br />
Preloads a particle system.<br />
<br />
#''asPSFile'' - The particle system file to load. Extension: .ps<br />
<syntaxhighlight lang="c++"><br />
void CreateParticleSystemAtEntity(string& asPSName, string& asPSFile, string& asEntity, bool abSavePS);<br />
</syntaxhighlight><br />
<br />
Creates a particle system on an entity.<br />
<br />
#''asPSName ''- internal name<br />
#''asPSFile ''- the particle system to use + extension .ps<br />
#''asEntity ''- the entity to create the particle system at<br />
#''abSavePS ''- determines whether a particle system should "remember" its shown/hidden state, so that this state can be restored when the player revisits the level<br />
<syntaxhighlight lang="c++"><br />
void CreateParticleSystemAtEntityExt(string& asPSName, string& asPSFile, string& asEntity, bool abSavePS,<br />
float afR, float afG, float afB, float afA, bool abFadeAtDistance, float afFadeMinEnd, float afFadeMinStart,<br />
float afFadeMaxStart, float afFadeMaxEnd);<br />
</syntaxhighlight><br />
<br />
Creates a particle system on an entity, extended method with more options.<br />
<br />
#''asPSName ''- internal name<br />
#''asPSFile ''- the particle system to use + extension .ps<br />
#''asEntity ''- the entity to create the particle system at<br />
#''abSavePS ''- determines whether a particle system should "remember" its shown/hidden state, so that this state can be restored when the player revisits the level<br />
#''afR ''- red value<br />
#''afG ''- green value<br />
#''afB ''- blue value<br />
#''afA ''- alpha value<br />
#''abFadeAtDistance ''- determines whether a particle system fades from a certain distance on<br />
#''afFadeMinEnd ''- minimum distance at which the particle system stops fading<br />
#''afFadeMinStart ''- minimum distance at which the particle system starts fading<br />
#''afFadeMaxStart ''- maximum distance at which the particle system starts fading<br />
#''afFadeMaxEnd ''- maximum distance at which the particle system stops fading<br />
<syntaxhighlight lang="c++"><br />
void DestroyParticleSystem(string& asName);<br />
</syntaxhighlight><br />
<br />
Destroys a particle system.<br />
<br />
#''asName'' - The internal name of the particle system<br />
<br />
===Sounds & Music===<br />
<br />
<syntaxhighlight lang="c++"><br />
void PreloadSound(string& asSoundFile);<br />
</syntaxhighlight><br />
<br />
Preloads a sound.<br />
<br />
#''asSoundFile'' - The sound file to load. Extension: .snt<br />
<syntaxhighlight lang="c++"><br />
void PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);<br />
</syntaxhighlight><br />
<br />
Creates a sound on an entity.<br />
<br />
#''asSoundName ''- internal name<br />
#''asSoundFile ''- the sound to use + extension .snt<br />
#''asEntity ''- the entity to create the sound at, can be "Player"<br />
#''afFadeTime ''- time in seconds the sound needs to fade. Avoids enemies hearing the sound if afFadeTime is at least 0.1f<br />
#''abSaveSound ''- if ''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''!<br />
<syntaxhighlight lang="c++"><br />
void FadeInSound(string& asSoundName, float afFadeTime, bool abPlayStart);<br />
</syntaxhighlight><br />
<br />
Fades in a sound.<br />
<br />
#''asSoundName ''- internal name<br />
#''afFadeTime ''- time in seconds<br />
#''abPlayStart ''- ?<br />
<syntaxhighlight lang="c++"><br />
void StopSound(string& asSoundName, float afFadeTime);<br />
</syntaxhighlight><br />
<br />
Fades out a sound.<br />
<br />
#''asSoundName ''- internal name<br />
#''afFadeTime ''- time in seconds, use 0 to immediatly stop the sound<br />
<syntaxhighlight lang="c++"><br />
void PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);<br />
</syntaxhighlight><br />
<br />
Plays music.<br />
<br />
#''asMusicFile ''- the music to play + extension .ogg<br />
#''abLoop ''- determines whether a music track should loop<br />
#''afVolume ''- volume of the music<br />
#''afFadeTime ''- time in seconds until music reaches full volume<br />
#''alPrio ''- priority of the music. Note that only the music with the highest priority can be heard! 0 - lowest, 1 - higher, etc.<br />
#''abResume'' - if ''true'', playback will be continued from where the track stopped after the call to StopMusic(); if ''false'', the track will be restarted.<br />
<syntaxhighlight lang="c++"><br />
void StopMusic(float afFadeTime, int alPrio);<br />
</syntaxhighlight><br />
<br />
Stops music.<br />
<br />
#''afFadeTime ''- time in seconds until music stops<br />
#''alPrio ''- the priority of the music that should stop<br />
<syntaxhighlight lang="c++"><br />
void FadeGlobalSoundVolume(float afDestVolume, float afTime);<br />
</syntaxhighlight><br />
<br />
Influences the global sound volume, that means everything you can hear '''from the world'''. This does not affect music of GUI sounds.<br />
<br />
#''afDestVolume ''- desired volume<br />
#''afTime ''- time in seconds until volume reaches desired volume<br />
<syntaxhighlight lang="c++"><br />
void FadeGlobalSoundSpeed(float afDestSpeed, float afTime);<br />
</syntaxhighlight><br />
<br />
Influences the global sound speed.<br />
<br />
#''afDestSpeed ''- desired speed<br />
#''afTime ''- time in seconds until volume reaches desired speed<br />
<br />
===Lights===<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLightVisible(string& asLightName, bool abVisible);<br />
</syntaxhighlight><br />
<br />
Enables/disables lights.<br />
<br />
#''asLightName ''- internal name<br />
#''abVisible ''- determines the state of the light<br />
<syntaxhighlight lang="c++"><br />
void FadeLightTo(string& asLightName, float afR, float afG, float afB, float afA, float afRadius, float afTime);<br />
</syntaxhighlight><br />
<br />
Changes the properties of a light.<br />
<br />
#''asLightName ''- internal name<br />
#''afR ''- red value<br />
#''afG ''- green value<br />
#''afB ''- blue value<br />
#''afA ''- alpha value<br />
#''afRadius ''- radius of the light. -1 means keeping the radius<br />
#''afTime ''- time in seconds until change is done<br />
<syntaxhighlight lang="c++"><br />
void SetLightFlickerActive(string& asLightName, bool abActive);<br />
</syntaxhighlight><br />
<br />
Activates flickering on a light.<br />
<br />
#''asLightName'' - The internal light name<br />
#''abActive'' - true = active, false = inactive<br />
<br />
==Game scripts==<br />
<br />
===General===<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartCredits(string& asMusic, bool abLoopMusic, string& asTextCat, string& asTextEntry, int alEndNum);<br />
</syntaxhighlight><br />
<br />
Starts the end credits screen.<br />
<br />
#''asMusic ''- the music to play (including .ogg)<br />
#''abLoopMusic ''- determines whether the music should loop<br />
#''asTextCat ''- the category to be used in the .lang file<br />
#''asTextEntry ''- the entry in the .lang file<br />
#''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.<br />
<syntaxhighlight lang="c++"><br />
void StartDemoEnd();<br />
</syntaxhighlight><br />
<br />
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)<br />
<br />
<syntaxhighlight lang="c++"><br />
void AutoSave();<br />
</syntaxhighlight><br />
<br />
Save the game to the auto save.<br />
<br />
<syntaxhighlight lang="c++"><br />
void CheckPoint (string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry);<br />
</syntaxhighlight><br />
<br />
Sets a checkpoint at which the player will respawn in case he dies. <br />Callback syntax: <code>void MyFunc(string &in asName, int alCount)</code> <br />Count is 0 on the first checkpoint load!<br />
<br />
#''asName ''- the internal name<br />
#''asStartPos ''- the name of the StartPos in the editor<br />
#''asCallback ''- the function to call when the player dies/respawns<br />
#''asDeathHintCat ''- the category of the death hint message to be used in the .lang file<br />
#''asDeathHintEntry ''- the entry in the .lang file<br />
<syntaxhighlight lang="c++"><br />
void ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);<br />
</syntaxhighlight><br />
<br />
Immediatly loads another map.<br />
<br />
#''asMapName ''- the file to load<br />
#''asStartPos ''- the name of the StartPos on the next map<br />
#''asStartSound ''- the sound that is played when the change starts<br />
#''asEndSound ''- the sound that is played when the new map is loaded<br />
<syntaxhighlight lang="c++"><br />
void ClearSavedMaps();<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
<syntaxhighlight lang="c++"><br />
void CreateDataCache();<br />
void DestroyDataCache();<br />
</syntaxhighlight><br />
<br />
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.<br />
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.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetMapDisplayNameEntry(string& asNameEntry);<br />
</syntaxhighlight><br />
<br />
Sets the map name shown in save file names. If none is set NULL is assumed.<br />
<br />
#''asNameEntry ''- the entry to display, category must be "Levels"!<br />
<syntaxhighlight lang="c++"><br />
void SetSkyBoxActive(bool abActive);<br />
</syntaxhighlight><br />
<br />
Enables/Disables the skybox.<br />
<br />
#''abActive'' - true = active, false = inactive<br />
<syntaxhighlight lang="c++"><br />
void SetSkyBoxTexture(string& asTexture);<br />
</syntaxhighlight><br />
<br />
Sets the texture of the skybox.<br />
<br />
#''asTexture'' - The texture file to set. Extension: .dds<br />
<syntaxhighlight lang="c++"><br />
void SetSkyBoxColor(float afR, float afG, float afB, float afA);<br />
</syntaxhighlight><br />
<br />
Sets the solid color of the skybox rather than a texture.<br />
<br />
#''afR ''- red value<br />
#''afG ''- green value<br />
#''afB ''- blue value<br />
#''afA ''- alpha value<br />
<syntaxhighlight lang="c++"><br />
void SetFogActive(bool abActive);<br />
</syntaxhighlight><br />
<br />
Enables/Disables the global fog.<br />
<br />
#''abActive'' - true = active, false = inactive<br />
<syntaxhighlight lang="c++"><br />
void SetFogColor(float afR, float afG, float afB, float afA);<br />
</syntaxhighlight><br />
<br />
Sets the color to use for the global fog.<br />
<br />
#''afR ''- red value<br />
#''afG ''- green value<br />
#''afB ''- blue value<br />
#''afA ''- alpha value<br />
<syntaxhighlight lang="c++"><br />
void SetFogProperties(float afStart, float afEnd, float afFalloffExp, bool abCulling);<br />
</syntaxhighlight><br />
<br />
Sets the properties for the global fog.<br />
<br />
#''afStart ''- how many meters from the camera should the fog begin<br />
#''afEnd ''- how many meters from the camera should the fog reach full thickness<br />
#''afFalloffExp ''- the amount by which the thinkness increases<br />
#''abCulling ''- whether occlusion culling is active for the fog; this prevents objects behind the fog from being loaded<br />
<syntaxhighlight lang="c++"><br />
void SetupLoadScreen(string&asTextCat, string&asTextEntry, int alRandomNum, string&asImageFile);<br />
</syntaxhighlight><br />
<br />
Determines which loading screen will be shown when changing maps.<br />
<br />
#''asTextCat ''- the category of the loading text in the .lang file to be shown on the loading screen<br />
#''asTextEntry ''- the entry in the .lang file<br />
#''alRandomNum ''- if greater 1, then it will randomize between 1 and alRandom for each LoadScreen giving entry the suffix XX (eg 01). If < =1 then no suffix is added<br />
#''asImageFile ''- the image to be shown (optional)<br />
<br />
===Game Timer===<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddTimer(string& asName, float afTime, string& asFunction);<br />
</syntaxhighlight><br />
<br />
Creates a timer which calls a function when it expires. <br />Callback syntax: <code>void MyFunc(string &in asTimer)</code><br />
<br />
#''asName ''- the name of the timer<br />
#''afTime ''- time in seconds<br />
#''asFunction ''- the function to call<br />
<syntaxhighlight lang="c++"><br />
void RemoveTimer(string& asName);<br />
</syntaxhighlight><br />
<br />
Removes a timer, no matter how much time is left.<br />
<br />
#''asName'' - the internal name of the timer.<br />
<syntaxhighlight lang="c++"><br />
float GetTimerTimeLeft(string& asName);<br />
</syntaxhighlight><br />
<br />
Returns the time left on a timer.<br />
<br />
#''asName'' - the internal name of the timer.<br />
<br />
===Screen Effects===<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadeOut(float afTime);<br />
</syntaxhighlight><br />
<br />
Fades the screen to black.<br />
<br />
''afTime ''- time in seconds until the screen is completly black<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadeIn(float afTime);<br />
</syntaxhighlight><br />
<br />
Fades the screen back to normal.<br />
<br />
''afTime ''- time in seconds until the screen back to normal<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadeImageTrailTo(float afAmount, float afSpeed);<br />
</syntaxhighlight><br />
<br />
Applies the image trail effect to the screen.<br />
<br />
''afAmount ''- intensity (default: 0) <br />''afSpeed ''- time in seconds until full effect<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadeSepiaColorTo(float afAmount, float afSpeed);<br />
</syntaxhighlight><br />
<br />
Makes the screen go dark red.<br />
<br />
''afAmount ''- intensity (default: 0) <br />''afSpeed ''- time in seconds until full effect<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadeRadialBlurTo(float afSize, float afSpeed);<br />
</syntaxhighlight><br />
<br />
Applies radial blur effects to the screen.<br />
<br />
''afSize ''- intensity (default: 0) <br />''afSpeed ''- time in seconds until full effect<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetRadialBlurStartDist(float afStartDist);<br />
</syntaxhighlight><br />
<br />
Determines at which distance the radial blur effects appear.<br />
<br />
''afStartDist ''- the distance at which the effect starts<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartEffectFlash(float afFadeIn, float afWhite, float afFadeOut);<br />
</syntaxhighlight><br />
<br />
Fades the screen to white.<br />
<br />
''afFadeIn ''- time in seconds until screen is white <br />''afWhite ''- determines to which percentage the screen fades to white (1.0 = completly white) <br />''afFadeOut ''- time in seconds until screen is back to normal again<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartEffectEmotionFlash(string& asTextCat, string& asTextEntry, string& asSound);<br />
</syntaxhighlight><br />
<br />
Fades the screen to white and shows a text message.<br />
<br />
''asTextCat ''- the category in the .lang file <br />''asTextEntry ''- the text entry in the .lang file <br />''asSound ''- the sound to play while fading<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddEffectVoice(string& asVoiceFile, string& asEffectFile, string& asTextCat, string& asTextEntry,<br />
bool abUsePosition, string& asPosEntity, float afMinDistance, float afMaxDistance);<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
''asVoiceFile ''- the voice to play <br />''asEffectFile ''- the effect to play <br />''asTextCat ''- the category in the .lang file <br />''asTextEntry ''- the text entry in the .lang file <br />''abUsePosition ''- plays using 3D from the entity, or without 3D <br />''asPosEntity ''- the entity at which the effect appears <br />''afMinDistance ''- minimum distance to see the effect <br />''afMaxDistance ''- maximum distance to see the effect<br />
<br />
<syntaxhighlight lang="c++"><br />
void StopAllEffectVoices(float afFadeOutTime);<br />
</syntaxhighlight><br />
<br />
Stops all voices and calls the EffectVoiceOverCallback.<br />
<br />
<syntaxhighlight lang="c++"><br />
bool GetEffectVoiceActive();<br />
</syntaxhighlight><br />
<br />
Checks whether EffectVoices are still active.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetEffectVoiceOverCallback(string& asFunc);<br />
</syntaxhighlight><br />
<br />
Sets the function to be called when the EffectVoices are finished. <br />Callback syntax: <code>void MyFunc()</code><br />
<br />
<syntaxhighlight lang="c++"><br />
bool GetFlashbackIsActive();<br />
</syntaxhighlight><br />
<br />
Checks whether a flashback is still in effect.<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartPlayerSpawnPS(string& asSPSFile);<br />
void StopPlayerSpawnPS();<br />
</syntaxhighlight><br />
<br />
Continuously spawn regular particle systems (''.ps'') around the player. Particles created by this script carry over from map to map. <br /> <br />''asSPSFile'' - the ''.sps'' file to use. Exemplary ''.sps'' files are located in the ''/misc'' folder in the main game directory. <br /> <br />Custom ''.sps'' files can be created by hand in a text editor (see existing ones and mimic how those are written). <br />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.<br />
<br />
<syntaxhighlight lang="c++"><br />
void PlayGuiSound(string& asSoundFile, float afVolume);<br />
</syntaxhighlight><br />
<br />
Plays a sound, not using 3D.<br />
<br />
''asSoundFile ''- the sound to play (extension is .snt) <br />''afVolume ''- the volume of the sound<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);<br />
</syntaxhighlight><br />
<br />
Shakes the screen.<br />
<br />
''afAmount ''- intensity of the shake <br />''afTime ''- duration of the shake <br />''afFadeInTime ''- time in seconds until full intensity is reached <br />''afFadeOutTime ''- time until screen is back to normal<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetInDarknessEffectsActive(bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables the sanity drain and night vision effects while in the darkness.<br />
<br />
''bool abX'' - Enable/disable effects.<syntaxhighlight lang="c++"><br />
void ShowScreenImage(string &in asImageName, float afX, float afY, float afScale, bool abUseRelativeCoordinates, float afDuration, float afFadeIn, float afFadeOut);<br />
</syntaxhighlight>{{ReqVer|1.5}}<br />
<br />
Displays an image file directly onto the screen.<br />
<br />
<br />''afX ''- duration of the shake <br />''afY ''- time in seconds until full intensity is reached <br />''afFadeOutTime ''- time until screen is back to normal''afAmount ''- The image file to render ''afTime''pg, .png, .tga, .dds)<br />
<br />
''asImageFile'' - The image file to render (.jpg, .png, .tga, .dds)<br />
<br />
''afX'' - The X position of the image<br />
<br />
''afY'' - The Y position of the image<br />
<br />
''afScale'' - The scale of the image (default 1.0f)<br />
<br />
''abUseRelativeCoordinates'' - Whether or not to use relative coordinates for positioning. Use false for absolute.<br />
<br />
''afDuration'' - The duration that the image is displayed for.<br />
<br />
''afFadeIn'' - The time, in seconds, to fade in the image.<br />
<br />
''afFadeOut'' - The time, in seconds, to fade out the image.<br />
<br />
===Insanity===<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetInsanitySetEnabled(string& asSet, bool abX);<br />
</syntaxhighlight><br />
<br />
Determines which InsanitySets are enabled.<br />
<br />
''asSet ''- the set <br />''abX ''- enabled or not<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartInsanityEvent(string &in asEventName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Starts a specified insanity event.<br />
<br />
''asEventName ''- Insanity event to play.<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartRandomInsanityEvent();<br />
</syntaxhighlight><br />
<br />
Starts a random insanity event from the available sets.<br />
<br />
<syntaxhighlight lang="c++"><br />
void StopCurrentInsanityEvent();<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Stops the currently playing insanity event.<br />
<br />
<syntaxhighlight lang="c++"><br />
void InsanityEventIsActive();<br />
</syntaxhighlight><br />
<br />
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 [http://wiki.frictionalgames.com/lib/images/smileys/icon_smile.gif?nolink&15x15]<br />
<br />
===Player===<br />
<br />
Note that the player's maximum health and sanity is 100.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerActive(bool abActive);<br />
</syntaxhighlight><br />
<br />
Enabled/Disable player controlled movement.<br />
<br />
<syntaxhighlight lang="c++"><br />
void ChangePlayerStateToNormal();<br />
</syntaxhighlight><br />
<br />
Sets certain effects back to normal. It can for example make the player drop an item.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerCrouching(bool abCrouch);<br />
</syntaxhighlight><br />
<br />
Forces the player to crouch.<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddPlayerBodyForce(float afX, float afY, float afZ, bool abUseLocalCoords);<br />
</syntaxhighlight><br />
<br />
Pushes the player into a certain direction. Note that you need values above ~2000 to see any effects.<br />
<br />
''afX ''- amount along the X-axis <br />''afY ''- amount along the Y-axis <br />''afZ ''- amount along the Z-axis <br />''abUseLocalCoords ''- If true, axes are based on where the player is facing, not the world.<br />
<br />
<syntaxhighlight lang="c++"><br />
void ShowPlayerCrossHairIcons(bool abX);<br />
</syntaxhighlight><br />
<br />
Enables/Disables the icons when a player has something in focus.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerSanity(float afSanity);<br />
void AddPlayerSanity(float afSanity);<br />
float GetPlayerSanity();<br />
</syntaxhighlight><br />
<br />
Modifies/returns the sanity of the player.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerHealth(float afHealth);<br />
void AddPlayerHealth(float afHealth);<br />
float GetPlayerHealth();<br />
</syntaxhighlight><br />
<br />
Modifies/returns the health of the player.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerLampOil(float afOil);<br />
void AddPlayerLampOil(float afOil);<br />
float GetPlayerLampOil();<br />
</syntaxhighlight><br />
<br />
Modifies/returns the lamp oil of the player.<br />
<br />
<syntaxhighlight lang="c++"><br />
float GetPlayerSpeed();<br />
float GetPlayerYSpeed();<br />
</syntaxhighlight><br />
<br />
Returns the current speed of the player.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetSanityDrainDisabled(bool abX);<br />
</syntaxhighlight><br />
<br />
Enables/Disables sanity drain from darkness, monsters, etc.<br />
<br />
<syntaxhighlight lang="c++"><br />
void GiveSanityBoost();<br />
void GiveSanityBoostSmall();<br />
</syntaxhighlight><br />
<br />
Boosts the player's sanity by a fixed amount.<br />
<br />
<syntaxhighlight lang="c++"><br />
void GiveSanityDamage(float afAmount, bool abUseEffect);<br />
</syntaxhighlight><br />
<br />
Reduces the sanity of the player.<br />
<br />
''afAmount ''- amount of sanity damage done <br />''abUseEffect ''- determines whether an effect is played when the sanity damage is dealt<br />
<br />
<syntaxhighlight lang="c++"><br />
void GivePlayerDamage(float afAmount, string& asType, bool abSpinHead, bool abLethal);<br />
</syntaxhighlight><br />
<br />
Reduces the health of the player.<br />
<br />
''afAmount ''- amount of damage done to health <br />''asType ''- plays a certain effect on the screen when the damage is dealt (BloodSplat, Claws or Slash) <br />''abSpinHead ''- changes the camera view when damage is dealt <br />''abLethal ''- set to true if player can die from given damage<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadePlayerFOVMulTo(float afX, float afSpeed);<br />
</syntaxhighlight><br />
<br />
Changes the field of view of the player. A shorter FOV will create a zoom effect.<br />
<br />
''afX ''- multiplier of default FOV (1 is default) <br />''afSpeed ''- the speed of change between FOV's<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadePlayerAspectMulTo(float afX, float afSpeed);<br />
</syntaxhighlight><br />
<br />
Changes the aspect ratio of the player. Basically stretches or narrows the screen horizontally.<br />
<br />
''afX ''- multiplier of default aspect (default is 1) <br />''afSpeed ''- the speed of change between FOV's<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed);<br />
</syntaxhighlight><br />
<br />
Rotates the position of the camera on the player's body.<br />
<br />
''afX ''- angle of rotation of head, positive being counter-clockwise <br />''afSpeedMul ''- speed (possibly acceleration) multiplier of the rotation (default 1, which is really slow) <br />''afMaxSpeed ''- maximum speed of rotation<br />
<br />
<syntaxhighlight lang="c++"><br />
void MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist);<br />
</syntaxhighlight><br />
<br />
Changes the position of the camera on the player's body.<br />
<br />
''afX ''- amount along the X-axis <br />''afY ''- amount along the Y-axis <br />''afZ ''- amount along the Z-axis <br />''afSpeed ''- speed at which the change happens <br />''afSlowDownDist ''- distance at which to start slowing down (prevents the head from abruptly stopping)<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartPlayerLookAt(string& asEntityName, float afSpeedMul, float afMaxSpeed, string& asAtTargetCallback);<br />
void StopPlayerLookAt();<br />
</syntaxhighlight><br />
<br />
Forces the player to look at a certain entity until StopPlayerLookAt is used.<br />
<br />
''asEntityName ''- the entity to look at <br />''afSpeedMul ''- how fast should the player look at the entity <br />''afMaxSpeed ''- maximum speed allowed <br />''asAtTargetCallback ''- function to call when player looks at target<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerMoveSpeedMul(float afMul);<br />
void SetPlayerRunSpeedMul(float afMul);<br />
void SetPlayerLookSpeedMul(float afMul);<br />
</syntaxhighlight><br />
<br />
Changes the player's move/run/look speed. Default is 1.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerJumpForceMul(float afMul);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Changes the player's jump multiplier. Higher values = higher jumps. Default is 1.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerJumpDisabled(bool abX);<br />
void SetPlayerCrouchDisabled(bool abX);<br />
</syntaxhighlight><br />
<br />
Enables/Disables the player's ability to jump/crouch.<br />
<br />
<syntaxhighlight lang="c++"><br />
void TeleportPlayer(string& asStartPosName);<br />
</syntaxhighlight><br />
<br />
Instantly teleports the player to the target StartPos.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLanternActive(bool abX, bool abUseEffects);<br />
</syntaxhighlight><br />
<br />
Makes the player use his lantern.<br />
<br />
<syntaxhighlight lang="c++"><br />
bool GetLanternActive();<br />
</syntaxhighlight><br />
<br />
Checks whether the player currently uses his lantern.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLanternDisabled(bool abX);<br />
</syntaxhighlight><br />
<br />
Enables/Disables the player's ability to use his lantern.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLanternLitCallback(string& asCallback);<br />
</syntaxhighlight><br />
<br />
Sets the function to call when the player uses his lantern. <br />Callback syntax: <code>MyFunc(bool abLit)</code><br />
<br />
<syntaxhighlight lang="c++"><br />
void SetMessage(string& asTextCategory, string& asTextEntry, float afTime);<br />
</syntaxhighlight><br />
<br />
Displays a message on the screen.<br />
<br />
''asTextCategory ''- the category in the .lang file <br />''asTextEntry ''- the entry in the .lang file <br />''afTime ''- determines how long the message is displayed. If time is < =0 then the life time is calculated based on string length.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetDeathHint(string& asTextCategory, string& asTextEntry);<br />
</syntaxhighlight><br />
<br />
Sets the message that appears when the player dies.<br />
<br />
''asTextCategory ''- the category in the .lang file <br />''asTextEntry ''- the entry in the .lang file<br />
<br />
<syntaxhighlight lang="c++"><br />
void DisableDeathStartSound();<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
<syntaxhighlight lang=""><br />
void MovePlayerForward(float afAmount)<br />
</syntaxhighlight><br />
<br />
"REQUIRES THE 1.2 PATCH: JUSTINE" Moves the player forward. It needs to be called in a timer that updates 60 times / second.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerFallDamageDisabled(bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables the player's ability to take fall damage.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerPos(float afX, float afY, float afZ);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Sets the player's position within the level.<br />
<br />
''afX'' - X co-ordinate position. <br />''afY'' - Y co-ordinate position. <br />''afZ'' - Z co-ordinate position.<br />
<br />
<syntaxhighlight lang="c++"><br />
float GetPlayerPosX();<br />
float GetPlayerPosY();<br />
float GetPlayerPosZ();<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the player's position within the level on the specified axis.<br />
<br />
===Journal===<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddNote(string& asNameAndTextEntry, string& asImage);<br />
</syntaxhighlight><br />
<br />
Adds a note to the player's journal.<br />
<br />
''asNameAndTextEntry ''- entries in the .lang file. Must end with _Name and _Text and be in category "Journal"! <br />''asImage ''- the background image to be used<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddDiary(string& asNameAndTextEntry, string& asImage);<br />
</syntaxhighlight><br />
<br />
Adds a diary to the player's journal.<br />
<br />
''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"! <br />''asImage ''- the background image to be used<br />
<br />
<syntaxhighlight lang="c++"><br />
void ReturnOpenJournal(bool abOpenJournal);<br />
</syntaxhighlight><br />
<br />
Only called in the pickup diary callback! If true the journal displays the entry else not.<br />
<br />
===Quests===<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddQuest(string& asName, string& asNameAndTextEntry);<br />
</syntaxhighlight><br />
<br />
Adds a quest to the player's journal under mementos.<br />
<br />
''asName ''- the internal name to be used <br />''asNameAndTextEntry ''- entry in the .lang file. Must start with "Quest_<texthere>_Text”, and be in category “Journal”!<br />
<br />
<syntaxhighlight lang="c++"><br />
void CompleteQuest(string& asName, string& asNameAndTextEntry);<br />
</syntaxhighlight><br />
<br />
Completes a quest.<br />
<br />
''asName ''- the internal name of the quest <br />''asNameAndTextEntry ''- entry in the .lang file. Must start with " Quest_<texthere>_Text ”, and be in category “Journal”!<br />
<br />
<syntaxhighlight lang="c++"><br />
bool QuestIsCompleted(string& asName);<br />
bool QuestIsAdded(string& asName);<br />
</syntaxhighlight><br />
<br />
Checks whether a quest is completed/added.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetNumberOfQuestsInMap(int alNumberOfQuests);<br />
</syntaxhighlight><br />
<br />
Sets the number of quests in the map.<br />
<br />
''alNumberOfQuests ''- Amount of Quests<br />
<br />
<syntaxhighlight lang="c++"><br />
void GiveHint (string& asName, string& asMessageCat, string& asMessageEntry, float afTimeShown);<br />
</syntaxhighlight><br />
<br />
Displays a hint on the player's screen.<br />
<br />
''asName ''- the internal name <br />''asMessageCat ''- the category in the .lang file <br />''asMessageEntry ''- the entry in the .lang file <br />''afTimeShown ''- time in seconds until the message disappears. If time is <= 0 then the life time is calculated based on string length.<br />
<br />
<syntaxhighlight lang="c++"><br />
void RemoveHint (string& asName);<br />
void BlockHint (string& asName);<br />
void UnBlockHint (string& asName);<br />
</syntaxhighlight><br />
<br />
Removes<nowiki>\</nowiki>Blocks<nowiki>\</nowiki>Unblocks a hint.<br />
<br />
===Inventory===<br />
<br />
<syntaxhighlight lang="c++"><br />
void ExitInventory();<br />
</syntaxhighlight><br />
<br />
Exits the inventory by force.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetInventoryDisabled(bool abX);<br />
</syntaxhighlight><br />
<br />
Disables the player's ability to open his inventory.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetInventoryMessage(string& asTextCategory, string& asTextEntry, float afTime);<br />
</syntaxhighlight><br />
<br />
Adds a message at the bottom of the inventory screen.<br />
<br />
''asTextCategory ''- the category in the .lang file <br />''asTextEntry ''- the entry in the .lang file <br />''afTime ''- time in seconds until the message disappears. If life time is <= 0 then the life time is calculated based on string length.<br />
<br />
<syntaxhighlight lang="c++"><br />
void GiveItem(string& asName, string& asType, string& asSubTypeName, string& asImageName, float afAmount);<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
''asName ''- internal name <br />''asType ''- item type to give, Available types are: <br /><br />
<br />
*Puzzle<br />
*Lantern<br />
*Health<br />
*Sanity<br />
*LampOil<br />
*Tinderbox<br />
<br />
''asSubTypeName ''- item name for .lang file <br />''asImageName ''- the image which will appear in inventory. For example: <code>void GiveItem("chemical_container_full_1", "Puzzle", "chemical_container_full", "chemical_container_full.tga", 1);</code> will use the image from <code>graphics/item/chemical_container_full.tga</code> <br />
<br />
''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.<br />
<br />
<syntaxhighlight lang="c++"><br />
void RemoveItem(string& asName);<br />
</syntaxhighlight><br />
<br />
Removes an item from the player's inventory.<br />
<br />
<syntaxhighlight lang="c++"><br />
bool HasItem(string& asName);<br />
</syntaxhighlight><br />
<br />
Checks whether the player has an item in his inventory.<br />
<br />
<syntaxhighlight lang="c++"><br />
void GiveItemFromFile(string& asName, string& asFileName);<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
''asName ''- internal name <br />''asFileName ''- item to give + extension (.ent)<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddCombineCallback(string& asName, string& asItemA, string& asItemB, string& asFunction, bool abAutoRemove);<br />
</syntaxhighlight><br />
<br />
Allows the player to combine items in his inventory. <br />Callback syntax: <code>void MyFunc(string &in asItemA, string &in asItemB)</code><br />
<br />
''asName ''- internal name for the callback <br />''asItemA ''- internal name of first item <br />''asItemB ''- internal name of second item <br />''asFunction ''- the function to call <br />''abAutoRemove ''- determines whether the callback should be removed when the items are combined<br />
<br />
<syntaxhighlight lang="c++"><br />
void RemoveCombineCallback(string& asName);<br />
</syntaxhighlight><br />
<br />
Removes a combine callback. <br />''asName'' - the internal name of the callback to be removed (as specified in AddCombineCallback)<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddUseItemCallback(string& asName, string& asItem, string& asEntity, string& asFunction, bool abAutoDestroy);<br />
</syntaxhighlight><br />
<br />
Allows the player to use items on the world. <br />Callback syntax: <code>void MyFunc(string &in asItem, string &in asEntity)</code><br />
<br />
''asName ''- internal name <br />''asItem ''- internal name of the item <br />''asEntity ''- entity to be able to use the item on <br />''asFunction ''- function to call <br />''abAutoDestroy ''- determines whether the item is destroyed when used<br />
<br />
<syntaxhighlight lang="c++"><br />
void RemoveUseItemCallback(string& asName);<br />
</syntaxhighlight><br />
<br />
Removes an item callback.<br />
<br />
===Entities===<br />
<br />
====General====<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityActive(string& asName, bool abActive);<br />
</syntaxhighlight><br />
<br />
Activates/deactivates an entity.<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityVisible(string &in asName, bool abVisible);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Activates/deactivates an entity's visual mesh. The collision body remains.<br />
<br />
''asName'' - Name of the entity. <br />''abActive'' - Activate/deactivate mesh.<br />
<br />
<syntaxhighlight lang="c"><br />
bool GetEntityExists(string& asName);<br />
</syntaxhighlight><br />
<br />
Checks whether an entity exists.<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityCustomFocusCrossHair(string& asName, string& asCrossHair);<br />
</syntaxhighlight><br />
<br />
Changes the crosshair that is used when focusing an entity.<br />
<br />
''asName ''- internal name <br />''asCrossHair ''- desired crosshair, can be: Default (uses default), Grab, Push, Ignite, Pick, LevelDoor, Ladder<br />
<br />
<syntaxhighlight lang="c"><br />
void CreateEntityAtArea(string& asEntityName, string& asEntityFile, string& asAreaName, bool abFullGameSave);<br />
</syntaxhighlight><br />
<br />
Creates an entity at an area. When creating an enemy though, it cannot chase properly along PathNodes(using for example ShowEnemyPlayerPosition).<br />
<br />
''asEntityName ''- internal name <br />''asEntityFile ''- entity to be used extension .ent <br />''asAreaName ''- the area to create the entity at <br />''abFullGameSave ''- determines whether an entity "remembers" its state<br />
<br />
<syntaxhighlight lang="c"><br />
void ReplaceEntity(string &in asName, string &in asBodyName, string &in asNewEntityName, string &in asNewEntityFile, bool abFullGameSave);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Removes an entity and places a new one in its place.<br />
<br />
''asName'' - Name of the entity to replace. <br />''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). <br />''asNewEntityName'' - Name of the new entity. <br />''asNewEntityFile'' - Name of the new entity file. Extension .ent. <br />''abFullGameSave'' - Whether ALL properties of this entity should be saved throughout levels.<br />
<br />
<syntaxhighlight lang="c++"><br />
void PlaceEntityAtEntity(string &in asName, string &in asTargetEntity, string &in asTargetBodyName, bool abUseRotation);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Places an entity at the position of another entity. Does not work for enemies, use TeleportEnemyToEntity instead.<br />
<br />
''asName'' - Name of the entity to place. <br />''asTargetEntity'' - Name of the other entity to place the first entity at. <br />''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). <br />''abUseRotation'' - Whether the entity should be rotated like the target entity.<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityPos(string &in asName, float afX, float afY, float afZ);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Moves an entity to a position in the level.<br />
<br />
''asName'' - Name of the entity to move. <br />''afX'' - X co-ordinate position. <br />''afY'' - Y co-ordinate position. <br />''afZ'' - Z co-ordinate position.<br />
<br />
<syntaxhighlight lang="c"><br />
float GetEntityPosX(string &in asName);<br />
float GetEntityPosY(string &in asName);<br />
float GetEntityPosZ(string &in asName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns an entity's position in the level on the specified axis.<br />
<br />
''asName'' - Name of the entity.<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityPlayerLookAtCallback(string& asName, string& asCallback, bool abRemoveWhenLookedAt);<br />
</syntaxhighlight><br />
<br />
Calls a function when the player looks at a certain entity. <br />Callback syntax: <code>void MyFunc(string &in asEntity, int alState)</code> <br />alState: 1 = looking, -1 = not looking<br />
<br />
''asName ''- internal name <br />''asCallback ''- function to call <br />''abRemoveWhenLookedAt ''- determines whether the callback should be removed when the player looked at the entity<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction);<br />
</syntaxhighlight><br />
<br />
Calls a function when the player interacts with a certain entity. <br />Callback syntax: <code>void MyFunc(string &in asEntity)</code><br />
<br />
''asName ''- internal name <br />''asCallback ''- function to call <br />''abRemoveOnInteraction ''- determines whether the callback should be removed when the player interacts with the entity<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityCallbackFunc(string& asName, string& asCallback);<br />
</syntaxhighlight><br />
<br />
Calls a function when the player interacts with a certain entity. <br />Callback syntax: <code>void MyFunc(string &in asEntity, string &in type)</code> <br />Type depends on entity type and includes: "OnPickup", "Break", "OnIgnite", etc<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityConnectionStateChangeCallback(string& asName, string& asCallback);<br />
</syntaxhighlight><br />
<br />
A callback called when ever the connection state changes (button being switched on, lever switched, etc). <br />Callback syntax: <code>void Func(string &in asEntity, int alState)</code> <br />alState: -1 = off, 0 = between, 1 = on<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityInteractionDisabled(string& asName, bool abDisabled);<br />
</syntaxhighlight><br />
<br />
Disallows interaction with an entity.<br />
<br />
<syntaxhighlight lang="c"><br />
void BreakJoint (string& asName);<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
<syntaxhighlight lang="c"><br />
void AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);<br />
</syntaxhighlight><br />
<br />
Calls a function when two entites collide. <br />Callback syntax: <code>void MyFunc(string &in asParent, string &in asChild, int alState)</code> <br />alState: 1 = enter, -1 = leave<br />
<br />
''asParentName ''- internal name of main object <br />''asChildName ''- internal name of object that collides with main object (asterix (<nowiki>*</nowiki>) NOT supported!) <br />''asFunction ''- function to call <br />''abDeleteOnCollide ''- determines whether the callback after it was called <br />''alStates ''- 1 = only enter, -1 = only leave, 0 = both<br />
<br />
<syntaxhighlight lang="c"><br />
void RemoveEntityCollideCallback(string& asParentName, string& asChildName);<br />
</syntaxhighlight><br />
<br />
Removes an EntityCollideCallback. Asterix (<nowiki>*</nowiki>) not supported in ''asChildName''.<br />
<br />
<syntaxhighlight lang="c"><br />
bool GetEntitiesCollide(string& asEntityA, string& asEntityB);<br />
</syntaxhighlight><br />
<br />
Checks whether two entites collide. This function does NOT support asterix (<nowiki>*</nowiki>) or "Player"!<br />
<br />
<syntaxhighlight lang="c"><br />
void SetBodyMass(string &in asName, float afMass);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Sets the mass of an entity's body.<br />
<br />
''asName'' - Name of the body of an entity. The body name of an entity is EntityName_BodyName. <br />''afMass'' - The mass to set.<br />
<br />
<syntaxhighlight lang="c"><br />
float GetBodyMass(string &in asName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Gets the mass of an entity's body.<br />
<br />
''asName'' - Name of the body of an entity. The body name of an entity is EntityName_BodyName. <br />''afMass'' - The mass to get.<br />
<br />
====Props====<br />
<br />
<syntaxhighlight lang="c"><br />
void SetPropEffectActive(string& asName, bool abActive, bool abFadeAndPlaySounds);<br />
</syntaxhighlight><br />
<br />
Can be used on coal to give it the black color it should have.<br />
<br />
<syntaxhighlight lang="c"><br />
void SetPropActiveAndFade(string& asName, bool abActive, float afFadeTime);<br />
</syntaxhighlight><br />
<br />
Activates/deactivates a prop.<br />
<br />
''asName ''- internal name <br />''abActive ''- nothing to add <br />''afFadeTime ''- time in seconds until prop fully fades<br />
<br />
<syntaxhighlight lang="c"><br />
void SetPropStaticPhysics(string& asName, bool abX);<br />
</syntaxhighlight><br />
<br />
Activates/deactivates the physics of a prop. Setting as true will make entities static in midair.<br />
<br />
<syntaxhighlight lang="c"><br />
bool GetPropIsInteractedWith(string& asName);<br />
</syntaxhighlight><br />
<br />
Checks whether a prop is interacted with.<br />
<br />
<syntaxhighlight lang="c"><br />
void RotatePropToSpeed(string& asName, float afAcc, float afGoalSpeed, float afAxisX, float afAxisY, float afAxisZ, bool abResetSpeed, string& asOffsetArea);<br />
</syntaxhighlight><br />
<br />
Rotates the prop up to a set speed.<br />
<br />
''asName ''- internal name <br />''afAcc ''- acceleration <br />''afGoalSpeed ''- desired speed <br />''afAxisX ''- rotation around X axis <br />''afAxisY ''- rotation around Y axis <br />''afAxisZ ''- rotation around Z axis <br />''abResetSpeed ''- determines whether the speed is resetted after goal speed is reached <br />''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 "StaticObject" entity!<br />
<br />
<syntaxhighlight lang="cpp"><br />
void StopPropMovement(string& asName);<br />
</syntaxhighlight><br />
<br />
Stops all movement of a prop.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AddAttachedPropToProp(string& asPropName, string& asAttachName, string& asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);<br />
</syntaxhighlight><br />
<br />
Attaches a prop to another prop.<br />
<br />
a''sPropName''- the prop to attach another prop at <br />''asAttachName ''- internal name of the prop that gets attached <br />''asAttachFile ''- the prop that gets attached extension .ent <br />''afPosX ''- X position of the attach from the prop <br />''afPosY ''- Y position of the attach from the prop <br />''afPosZ ''- Z position of the attach from the prop <br />''afRotX ''- rotation around X axis of the attach <br />''afRotY ''- rotation around Y axis of the attach <br />''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of "AddEntityCollideCallback", attached props will not call the callback function if they collide with a "static_object" or a "StaticProp" entity type!<br />
<br />
{{bug|''afRotZ '' is used for both the ZX rotation and the Z position of the attached prop. Unwanted rotation can be avoided by using: <br />''AddAttachedPropToProp(asPropName, asAttachName, asAttachFile, afPosX, afPosY, '''0''', afPosZ, '''90.0f''', afPosZ)''}}<br />
<br />
{{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.}}<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AttachPropToProp(string& asPropName, string& asAttachName, string& asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Attaches a prop to another prop. Fixed version of AddAttachedPropToProp.<br />
<br />
''asPropName ''- the prop to attach another prop at <br />''asAttachName ''- internal name of the prop that gets attached <br />''asAttachFile ''- the prop that gets attached extension .ent <br />''afPosX ''- X position of the attach from the prop <br />''afPosY ''- Y position of the attach from the prop <br />''afPosZ ''- Z position of the attach from the prop <br />''afRotX ''- rotation around X axis of the attach <br />''afRotY ''- rotation around Y axis of the attach <br />''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of "AddEntityCollideCallback", attached props will not call the callback function if they collide with a "static_object" or a "StaticProp" entity type!<br />
<br />
<syntaxhighlight lang="cpp"><br />
void RemoveAttachedPropFromProp(string& asPropName, string& asAttachName);<br />
</syntaxhighlight><br />
<br />
Detaches a prop from a prop.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetPropHealth(string& asName, float afHealth);<br />
void AddPropHealth(string& asName, float afHealth);<br />
float GetPropHealth(string& asName);<br />
</syntaxhighlight><br />
<br />
Modifies/returns the health of a prop.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void ResetProp(string& asName);<br />
</syntaxhighlight><br />
<br />
Resets a prop's state to the original one when the map was loaded.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void PlayPropAnimation(string& asProp, string& asAnimation, float afFadeTime, bool abLoop, string& asCallback);<br />
</syntaxhighlight><br />
<br />
Makes the prop play an animation and calls a function. <br />Callback syntax: <code>void MyFunc(string &in asProp)</code><br />
<br />
''asProp ''- internal name of the prop <br />''asAnimation ''- animation to play <br />''afFadeTime ''- ? <br />''abLoop ''- determines whether the animation loops <br />''asCallback ''- function to call<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AddPropForce(string& asName, float afX, float afY, float afZ, string& asCoordSystem);<br />
void AddPropImpulse(string& asName, float afX, float afY, float afZ, string& asCoordSystem);<br />
void AddBodyForce(string& asName, float afX, float afY, float afZ, string& asCoordSystem);<br />
void AddBodyImpulse(string& asName, float afX, float afY, float afZ, string& asCoordSystem);<br />
</syntaxhighlight><br />
<br />
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 "Body" 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).<br />
<br />
''asName ''- the object to push; for bodies, use this format: "''entityName''_''bodyName''" <br />''afX ''- magnitude along the X-axis <br />''afY ''- magnitude along the Y-axis <br />''afZ ''- magnitude along the Z-axis <br />''asCoordSystem ''- determines which coordinate system is used, usually "world" 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.<br />
<br />
====Connections====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void InteractConnectPropWithRope(string& asName, string& asPropName, string& asRopeName, bool abInteractOnly, float afSpeedMul, float afToMinSpeed, float afToMaxSpeed, bool abInvert, int alStatesUsed);<br />
</syntaxhighlight><br />
<br />
Connects a prop with the movement of a rope (ie. turn wheel to move rope).<br />
<br />
''asName ''- connection name <br />''asPropName ''- name of prop <br />''asRopeName ''- name of rope <br />''abInteractOnly ''- ? <br />''afSpeedMul ''- speed multiplier of how quickly the rope moves <br />''afToMinSpeed ''- the slowest the rope will move when moving the prop <br />''afToMaxSpeed ''- the fastest the rope will move when moving the prop <br />''abInvert ''- whether to invert the direction the rope moves <br />''alStatesUsed ''- which states of the prop can interact with the rope?<br />
<br />
<syntaxhighlight lang="cpp"><br />
void InteractConnectPropWithMoveObject(string& asName, string& asPropName, string& asMoveObjectName, bool abInteractOnly, bool abInvert, int alStatesUsed);<br />
</syntaxhighlight><br />
<br />
This one should only be used if there must be an exact correspondance to prope "amount" and the moveobject open amount. It is best used for Wheel-door connections!<br />
<br />
<syntaxhighlight lang="cpp"><br />
void ConnectEntities(string& asName, string& asMainEntity, string& asConnectEntity, bool abInvertStateSent, int alStatesUsed, string& asCallbackFunc);<br />
</syntaxhighlight><br />
<br />
Callback syntax: <code>void MyFunc(string &in asConnectionName, string &in asMainEntity, string &in asConnectEntity, int alState)</code> <br />State is what is sent to connection entity and will be inverted if abInvertStateSent = true!<br />
<br />
====Lamps====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetLampLit(string& asName, bool abLit, bool abEffects);<br />
</syntaxhighlight><br />
<br />
(Un)lits a lamp.<br />
<br />
''asName ''- Name of the lamp <br />''abLit ''- Set true if you want the lamp to be lit, set to false if you want the lamp to be unlit <br />''abEffects ''- If you want to have the lamp fade in/out when it gets (un)lit<br />
<br />
====Doors====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetSwingDoorLocked(string& asName, bool abLocked, bool abEffects);<br />
void SetSwingDoorClosed(string& asName, bool abClosed, bool abEffects);<br />
</syntaxhighlight><br />
<br />
Locks/closes a swing door.<br />
<br />
<syntaxhighlight lang="cpp"><br />
bool GetSwingDoorLocked(string& asName);<br />
bool GetSwingDoorClosed(string& asName);<br />
</syntaxhighlight><br />
<br />
Checks whether a swing door is locked/closed.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetSwingDoorDisableAutoClose(string& asName, bool abDisableAutoClose);<br />
</syntaxhighlight><br />
<br />
Deactivates the "auto-close" when a door is nearly closed.<br />
<br />
<syntaxhighlight lang="cpp"><br />
int GetSwingDoorState(string& asName);<br />
</syntaxhighlight><br />
<br />
Returns an integer depending on how far the door is opened. <br />-1 = angle is close to 0°, 1 = angle is 70% or higher of max, 0 = inbetween -1 and 1.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetLevelDoorLocked(string& asName, bool abLocked);<br />
</syntaxhighlight><br />
<br />
Locks a level door. Note that level doors are NOT swing doors.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetLevelDoorLockedSound(string& asName, string& asSound);<br />
</syntaxhighlight><br />
<br />
Determines which sound is played when interacting with a locked level door.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetLevelDoorLockedText(string& asName, string& asTextCat, string& asTextEntry);<br />
</syntaxhighlight><br />
<br />
Displays a message when interacting with a locked level door.<br />
<br />
''asName ''- internal name <br />''asTextCat ''- the category in the .lang file <br />''asTextEntry ''- the entry in the .lang file<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetMoveObjectState(string& asName, float afState);<br />
</syntaxhighlight><br />
<br />
Moves an object to a certain state.<br />
<br />
''asName ''- internal name <br />''afState ''- state of the object, 0 = closed, 1 = open, values inbetween (and above, for example, the bridge_metal_vert) are valid too!<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetMoveObjectStateExt(string& asName, float afState, float afAcc, float afMaxSpeed, float afSlowdownDist, bool abResetSpeed);<br />
</syntaxhighlight><br />
<br />
Moves an object to a certain state, extended method.<br />
<br />
''asName ''- internal name <br />''afState ''- state of the object, 0 = closed, 1 = open, values inbetween are valid too! <br />''afAcc ''- acceleration <br />''afMaxSpeed ''- maximum speed <br />''afSlowdownDist ''- Distance to the target state before decceleration occurs. <br />''abResetSpeed ''- Set to True if the prop's speed should be reset before performing the movement, else the prop will accelerate from it's current speed to afMaxSpeed.<br />
<br />
====Levers, wheels and buttons====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetPropObjectStuckState(string& asName, int alState);<br />
void SetWheelStuckState(string& asName, int alState, bool abEffects);<br />
void SetLeverStuckState(string& asName, int alState, bool abEffects);<br />
</syntaxhighlight><br />
<br />
Makes a prop<nowiki>\</nowiki>wheel<nowiki>\</nowiki>lever stuck in a certain state.<br />
<br />
''asName ''- internal name <br />''alState ''- 0 = not stuck, 1 = at max, -1 = at min <br />''abEffects ''- use effects<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetWheelAngle(string& asName, float afAngle, bool abAutoMove);<br />
</syntaxhighlight><br />
<br />
Moves a wheel to a certain angle.<br />
<br />
''asName ''- internal name <br />''afAngle ''- angle <br />''abAutoMove ''- determines whether the wheel should move on its own<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetWheelInteractionDisablesStuck(string& asName, bool abX);<br />
void SetLeverInteractionDisablesStuck(string& asName, bool abX);<br />
</syntaxhighlight><br />
<br />
Allows the player to make a wheel/lever unstuck when interacted with.<br />
<br />
<syntaxhighlight lang="cpp"><br />
int GetLeverState(string& asName);<br />
</syntaxhighlight><br />
<br />
Returns the state of the lever. <br />0 = not stuck, 1 = at max, -1 = at min<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetMultiSliderStuckState(string& asName, int alStuckState, bool abEffects);<br />
</syntaxhighlight><br />
<br />
Makes a MultiSlider stuck in a certain state.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetMultiSliderCallback(string& asName, string& asCallback);<br />
</syntaxhighlight><br />
<br />
Calls a function when state changes. <br />Callback syntax: <code>void MyFunc(string &in asEntity, int alState)</code><br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetButtonSwitchedOn(string& asName, bool abSwitchedOn, bool abEffects);<br />
</syntaxhighlight><br />
<br />
====Sticky areas====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetAllowStickyAreaAttachment(bool abX);<br />
</syntaxhighlight><br />
<br />
Allows entites to stick to a StickyArea.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AttachPropToStickyArea(string& asAreaName, string& asProp);<br />
void AttachBodyToStickyArea(string& asAreaName, string& asBody);<br />
</syntaxhighlight><br />
<br />
Attaches a prop/body to a StickyArea.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void DetachFromStickyArea(string& asAreaName);<br />
</syntaxhighlight><br />
<br />
Detaches everything from a StickyArea.<br />
<br />
====Enemies====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetNPCAwake(string& asName, bool abAwake, bool abEffects);<br />
</syntaxhighlight><br />
<br />
Activates the npc<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetNPCFollowPlayer(string& asName, bool abX);<br />
</syntaxhighlight><br />
<br />
Sets an NPC's head to follow the player's movement's.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetEnemyDisabled(string& asName, bool abDisabled);<br />
</syntaxhighlight><br />
<br />
Disables an enemy.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetEnemyIsHallucination(string& asName, bool abX);<br />
</syntaxhighlight><br />
<br />
Makes an enemy a hallucination. Hallucinations fade to smoke when they get near the player.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void FadeEnemyToSmoke(string& asName, bool abPlaySound);<br />
</syntaxhighlight><br />
<br />
Instantly fades an enemy to smoke.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void ShowEnemyPlayerPosition(string& asName);<br />
</syntaxhighlight><br />
<br />
Makes the enemy run to the player, no matter where he is.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AlertEnemyOfPlayerPresence(string &in asName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Gives the specified enemy the player's current position and makes it search the area.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetEnemyDisableTriggers(string& asName, bool abX);<br />
</syntaxhighlight><br />
<br />
Enables or disables enemy triggers. If disabled, enemy will not react to player or attack.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AddEnemyPatrolNode(string& asName, string& asNodeName, float afWaitTime, string& asAnimation);<br />
</syntaxhighlight><br />
<br />
Adds a patrol node to the enemy's path.<br />
<br />
''asName ''- internal name of the enemy <br />''asNodeName ''- path node <br />''afWaitTime ''- time in seconds that the enemy waits at the path node before continuing <br />''asAnimation ''- the animation the enemy uses when reaching the path node<br />
<br />
<syntaxhighlight lang="cpp"><br />
void ClearEnemyPatrolNodes(string& asEnemyName);<br />
</syntaxhighlight><br />
<br />
Clears the current path of patrol nodes of the enemy.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetEnemySanityDecreaseActive(string &in asName, bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables whether an enemy activates the player's sanity drain when stared at.<br />
<br />
''asName ''- Internal name of the enemy <br />''abX ''- Enabled/disabled<br />
<br />
<syntaxhighlight lang="cpp"><br />
void TeleportEnemyToNode(string &in asEnemyName, string &in asNodeName, bool abChangeY);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Teleports an enemy to a specific PathNode.<br />
<br />
''asEnemyName ''- Internal name of the enemy <br />''asNodeName ''- Internal name of the node to teleport to <br />''abChangeY ''- Whether the Y position of the node will be used when teleporting the enemy<br />
<br />
<syntaxhighlight lang="cpp"><br />
void TeleportEnemyToEntity(string &in asEnemyName, string &in asTargetEntity, string &in asTargetBody, bool abChangeY);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Teleports an enemy to a specific entity.<br />
<br />
''asEnemyName ''- Internal name of the enemy <br />''asTargetEntity ''- Internal name of the entity to teleport to <br />''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) <br />''abChangeY ''- Whether the Y position of the node will be used when teleporting the enemy<br />
<br />
<syntaxhighlight lang="c"><br />
void ChangeManPigPose(string&in asName, string&in asPoseType);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Changes the pose a specified ManPig.<br />
<br />
''asName ''- Internal name of the enemy <br />''asPoseType''- Name of the ManPig pose to use. Can be "Biped" or "Quadruped"<br />
<br />
<syntaxhighlight lang="c"><br />
void SetTeslaPigFadeDisabled(string&in asName, bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables whether a specified TeslaPig should fade the player's view in and out.<br />
<br />
''asName ''- Internal name of the enemy <br />''abX''- Enabled/disabled<br />
<br />
<syntaxhighlight lang="c"><br />
void SetTeslaPigSoundDisabled(string&in asName, bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables whether a specified TeslaPig should play the proximity sounds.<br />
<br />
''asName ''- Internal name of the enemy <br />''abX''- Enabled/disabled<br />
<br />
<syntaxhighlight lang="c"><br />
void SetTeslaPigEasyEscapeDisabled(string&in asName, bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables whether a specified TeslaPig should be easier to escape from when hunted.<br />
<br />
''asName ''- Internal name of the enemy <br />''abX''- Enabled/disabled<br />
<br />
<syntaxhighlight lang="c"><br />
void ForceTeslaPigSighting(string&in asName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Forces a TeslaPig to be visible for a short time.<br />
<br />
''asName ''- Internal name of the enemy<br />
<br />
<syntaxhighlight lang="c"><br />
string& GetEnemyStateName(string &in asName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the name of the state a specified enemy is current in. States can be Hunt, Search, Patrol, Wait, Alert, Investigate, Track and BreakDoor.<br />
<br />
''asName ''- Internal name of the enemy</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&diff=6442HPL2/Engine Scripts2023-08-28T13:16:12Z<p>Mudbill: Added OnUpdate hook</p>
<hr />
<div>{{TocRight}}<br />
<br />
This page documents all scripts available in Amnesia: The Dark Descent.<br />
<br />
{{note|'''Note''': Some of the functions require the Amnesia 1.3 update. Steam and other online store copies should be automatically updated. Other copies can get it [http://www.frictionalgames.com/forum/thread-24334.html here].}}<br />
<br />
==Engine scripts==<br />
===Main===<br />
<br />
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.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void OnStart();<br />
</syntaxhighlight><br />
<br />
The function that runs when the map is loaded for the first time.<br />
<br />
<syntaxhighlight lang="c++"><br />
void OnEnter();<br />
</syntaxhighlight><br />
<br />
The function that runs whenever the player enters a map.<br />
<br />
<syntaxhighlight lang="c++"><br />
void OnLeave();<br />
</syntaxhighlight><br />
<br />
The function that runs when the player leaves a map.<br />
<br />
<syntaxhighlight lang="c++"><br />
void OnGameStart();<br />
</syntaxhighlight><br />
<br />
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").<br />
<br />
<syntaxhighlight lang="c++"><br />
void OnUpdate(float afStep);<br />
</syntaxhighlight><br />
{{ReqVer|1.5}}<br />
<br />
This function is executed for every game update or "tick". 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.<br />
<br />
===General===<br />
<br />
<syntaxhighlight lang="c++"><br />
float RandFloat(float afMin, float afMax);<br />
</syntaxhighlight><br />
<br />
Generates a random float.<br />
<br />
#''afMin ''- minimum value<br />
#''afMax ''- maximum value<br />
<syntaxhighlight lang="c++"><br />
int RandInt(int alMin, int alMax);<br />
</syntaxhighlight><br />
<br />
Generates a random int. Note: the maximum value is ''inclusive'' - the RandInt() function may return this value.<br />
<br />
#''alMin ''- minimum value<br />
#''alMax ''- maximum value<br />
<syntaxhighlight lang="c++"><br />
bool StringContains(string& asString, string& asSubString);<br />
</syntaxhighlight><br />
<br />
Checks whether a string contains the specified string. <br />Example: searching for "hello" in "hello world" would return '''true'''.<br />
<br />
#''asString ''- the string to check<br />
#''asSubString ''- the string to search for<br />
<syntaxhighlight lang="cpp"><br />
string& StringSub(string& asString, int alStart, int alCount);<br />
</syntaxhighlight><br />
<br />
Returns the substring in a string. <br />Example: in the string "frictional games rocks", using 4 as ''alStart'' and 6 as ''alCount'' would return '''"tional"'''.<br />
<br />
#''asString ''- the string<br />
#''alStart ''- start position in the string<br />
#''alCount ''- amount of characters<br />
<syntaxhighlight lang="c++"><br />
int StringToInt(string&in asString);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
If possible, returns an integer converted from a string, else returns 0.<br />
<br />
#''asString'' - String to convert.<br />
<syntaxhighlight lang="c++"><br />
float StringToFloat(string&in asString);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
If possible, returns a float converted from a string, else returns 0.<br />
<br />
#''asString'' - String to convert.<br />
<syntaxhighlight lang="c++"><br />
bool StringToBool(string&in asString);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
If possible, returns a boolean converted from a string, else returns false.<br />
<br />
#''asString'' - String to convert.<br />
<br />
===Mathematical Operations===<br />
<br />
<syntaxhighlight lang="c++"><br />
float MathSin(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the sine of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathCos(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the cosine of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathTan(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the tangent of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathAsin(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the arc sine of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathAcos(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the arc cosine of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathAtan(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the arc tangent of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathAtan2(float afX, float afY);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Calculates and returns the arc tangent of the specified values.<br />
<br />
#''afX'' - First value to operate.<br />
#''afY'' - Second value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathSqrt(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the square root of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathPow(float afBase, float afExp);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the value of afBase raised to the power of afExp.<br />
<br />
#''afBase'' - The base value.<br />
#''afExp'' - Value to calculate the base with.<br />
<syntaxhighlight lang="c++"><br />
float MathMin(float afA, float afB);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the lowest value.<br />
<br />
#''afA'' - First value.<br />
#''afB'' - Second value.<br />
<syntaxhighlight lang="c++"><br />
float MathMax(float afA, float afB);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the highest value.<br />
<br />
#''afA'' - First value.<br />
#''afB'' - Second value.<br />
<syntaxhighlight lang="c++"><br />
float MathClamp(float afX, float afMin, float afMax);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns afX clamped between afMin and afMax. If afX < afMin, returns afMin, and if afX > afMax, returns afMax.<br />
<br />
#''afX'' - The value to clamp.<br />
#''afMin'' - The minimum value to clamp afX with.<br />
#''afMax'' - The maximum value to clamp afX with.<br />
<syntaxhighlight lang="c++"><br />
float MathAbs(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the absolute value.<br />
<br />
#''afX'' - Value to operate.<br />
<br />
===Debugging===<br />
<br />
<syntaxhighlight lang="cpp"><br />
void Print(string& asString);<br />
</syntaxhighlight><br />
<br />
Prints a string to the log file (''hpl.log'').<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddDebugMessage(string& asString, bool abCheckForDuplicates);<br />
</syntaxhighlight><br />
<br />
Prints a string to the debug console.<br />
<br />
#''asString ''- the string to print<br />
#''abCheckForDuplicates ''- if true, the string won't be printed more than once on screen until it disappears<br />
<syntaxhighlight lang="c++"><br />
void ProgLog(string& asLevel, string& asMessage);<br />
</syntaxhighlight><br />
<br />
Prints an entry to the ProgLog (progression log). <br />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. <br /> <br />This function allows to log custom messages.The messages in the ProgLog file are sorted by time elapsed since a map was loaded.<br />
<br />
ProgLog has to be enabled for a player profile in ''user_settings.cfg'' before it starts working.<br />
<br />
#''asLevel ''- can be "Low", "Medium" or "High". It's a tag which appears in each log entry, for event prioritising.<br />
#''asMessage ''- The custom message to be printed to the log.<br />
<syntaxhighlight lang="c++"><br />
bool ScriptDebugOn();<br />
</syntaxhighlight><br />
<br />
Checks whether the debug mode is enabled. <br />See [[HPL2/Development_Environment|"Setting up Development Environment"]] to setup debug mode on your own computer.<br />
<br />
===Variables===<br />
{{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 "for" loop. For variables which need to be saved, use the wrappers as described below.}}<br />
<br />
====Local====<br />
<br />
Local variables can be used throughout the same script file.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetLocalVarInt(string& asName, int alVal);<br />
void AddLocalVarInt(string& asName, int alVal);<br />
int GetLocalVarInt(string& asName);<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLocalVarFloat(string& asName, float afVal);<br />
void AddLocalVarFloat(string& asName, float afVal);<br />
float GetLocalVarFloat(string& asName);<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLocalVarString(string& asName, const string& asVal);<br />
void AddLocalVarString(string& asName, string& asVal);<br />
string& GetLocalVarString(string& asName);<br />
</syntaxhighlight><br />
<br />
====Global====<br />
<br />
Global variables can be used throughout several maps and can be accessed by several script files.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetGlobalVarInt(string& asName, int alVal);<br />
void AddGlobalVarInt(string& asName, int alVal);<br />
int GetGlobalVarInt(string& asName);<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="c++"><br />
void SetGlobalVarFloat(string& asName, float afVal);<br />
void AddGlobalVarFloat(string& asName, float afVal);<br />
float GetGlobalVarFloat(string& asName);<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="c++"><br />
void SetGlobalVarString(string& asName, const string& asVal);<br />
void AddGlobalVarString(string& asName, string& asVal);<br />
string& GetGlobalVarString(string& asName);<br />
</syntaxhighlight><br />
<br />
===Particle Systems===<br />
<br />
<syntaxhighlight lang="c++"><br />
void PreloadParticleSystem(string& asPSFile);<br />
</syntaxhighlight><br />
<br />
Preloads a particle system.<br />
<br />
#''asPSFile'' - The particle system file to load. Extension: .ps<br />
<syntaxhighlight lang="c++"><br />
void CreateParticleSystemAtEntity(string& asPSName, string& asPSFile, string& asEntity, bool abSavePS);<br />
</syntaxhighlight><br />
<br />
Creates a particle system on an entity.<br />
<br />
#''asPSName ''- internal name<br />
#''asPSFile ''- the particle system to use + extension .ps<br />
#''asEntity ''- the entity to create the particle system at<br />
#''abSavePS ''- determines whether a particle system should "remember" its shown/hidden state, so that this state can be restored when the player revisits the level<br />
<syntaxhighlight lang="c++"><br />
void CreateParticleSystemAtEntityExt(string& asPSName, string& asPSFile, string& asEntity, bool abSavePS,<br />
float afR, float afG, float afB, float afA, bool abFadeAtDistance, float afFadeMinEnd, float afFadeMinStart,<br />
float afFadeMaxStart, float afFadeMaxEnd);<br />
</syntaxhighlight><br />
<br />
Creates a particle system on an entity, extended method with more options.<br />
<br />
#''asPSName ''- internal name<br />
#''asPSFile ''- the particle system to use + extension .ps<br />
#''asEntity ''- the entity to create the particle system at<br />
#''abSavePS ''- determines whether a particle system should "remember" its shown/hidden state, so that this state can be restored when the player revisits the level<br />
#''afR ''- red value<br />
#''afG ''- green value<br />
#''afB ''- blue value<br />
#''afA ''- alpha value<br />
#''abFadeAtDistance ''- determines whether a particle system fades from a certain distance on<br />
#''afFadeMinEnd ''- minimum distance at which the particle system stops fading<br />
#''afFadeMinStart ''- minimum distance at which the particle system starts fading<br />
#''afFadeMaxStart ''- maximum distance at which the particle system starts fading<br />
#''afFadeMaxEnd ''- maximum distance at which the particle system stops fading<br />
<syntaxhighlight lang="c++"><br />
void DestroyParticleSystem(string& asName);<br />
</syntaxhighlight><br />
<br />
Destroys a particle system.<br />
<br />
#''asName'' - The internal name of the particle system<br />
<br />
===Sounds & Music===<br />
<br />
<syntaxhighlight lang="c++"><br />
void PreloadSound(string& asSoundFile);<br />
</syntaxhighlight><br />
<br />
Preloads a sound.<br />
<br />
#''asSoundFile'' - The sound file to load. Extension: .snt<br />
<syntaxhighlight lang="c++"><br />
void PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);<br />
</syntaxhighlight><br />
<br />
Creates a sound on an entity.<br />
<br />
#''asSoundName ''- internal name<br />
#''asSoundFile ''- the sound to use + extension .snt<br />
#''asEntity ''- the entity to create the sound at, can be "Player"<br />
#''afFadeTime ''- time in seconds the sound needs to fade. Avoids enemies hearing the sound if afFadeTime is at least 0.1f<br />
#''abSaveSound ''- if ''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''!<br />
<syntaxhighlight lang="c++"><br />
void FadeInSound(string& asSoundName, float afFadeTime, bool abPlayStart);<br />
</syntaxhighlight><br />
<br />
Fades in a sound.<br />
<br />
#''asSoundName ''- internal name<br />
#''afFadeTime ''- time in seconds<br />
#''abPlayStart ''- ?<br />
<syntaxhighlight lang="c++"><br />
void StopSound(string& asSoundName, float afFadeTime);<br />
</syntaxhighlight><br />
<br />
Fades out a sound.<br />
<br />
#''asSoundName ''- internal name<br />
#''afFadeTime ''- time in seconds, use 0 to immediatly stop the sound<br />
<syntaxhighlight lang="c++"><br />
void PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);<br />
</syntaxhighlight><br />
<br />
Plays music.<br />
<br />
#''asMusicFile ''- the music to play + extension .ogg<br />
#''abLoop ''- determines whether a music track should loop<br />
#''afVolume ''- volume of the music<br />
#''afFadeTime ''- time in seconds until music reaches full volume<br />
#''alPrio ''- priority of the music. Note that only the music with the highest priority can be heard! 0 - lowest, 1 - higher, etc.<br />
#''abResume'' - if ''true'', playback will be continued from where the track stopped after the call to StopMusic(); if ''false'', the track will be restarted.<br />
<syntaxhighlight lang="c++"><br />
void StopMusic(float afFadeTime, int alPrio);<br />
</syntaxhighlight><br />
<br />
Stops music.<br />
<br />
#''afFadeTime ''- time in seconds until music stops<br />
#''alPrio ''- the priority of the music that should stop<br />
<syntaxhighlight lang="c++"><br />
void FadeGlobalSoundVolume(float afDestVolume, float afTime);<br />
</syntaxhighlight><br />
<br />
Influences the global sound volume, that means everything you can hear '''from the world'''. This does not affect music of GUI sounds.<br />
<br />
#''afDestVolume ''- desired volume<br />
#''afTime ''- time in seconds until volume reaches desired volume<br />
<syntaxhighlight lang="c++"><br />
void FadeGlobalSoundSpeed(float afDestSpeed, float afTime);<br />
</syntaxhighlight><br />
<br />
Influences the global sound speed.<br />
<br />
#''afDestSpeed ''- desired speed<br />
#''afTime ''- time in seconds until volume reaches desired speed<br />
<br />
===Lights===<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLightVisible(string& asLightName, bool abVisible);<br />
</syntaxhighlight><br />
<br />
Enables/disables lights.<br />
<br />
#''asLightName ''- internal name<br />
#''abVisible ''- determines the state of the light<br />
<syntaxhighlight lang="c++"><br />
void FadeLightTo(string& asLightName, float afR, float afG, float afB, float afA, float afRadius, float afTime);<br />
</syntaxhighlight><br />
<br />
Changes the properties of a light.<br />
<br />
#''asLightName ''- internal name<br />
#''afR ''- red value<br />
#''afG ''- green value<br />
#''afB ''- blue value<br />
#''afA ''- alpha value<br />
#''afRadius ''- radius of the light. -1 means keeping the radius<br />
#''afTime ''- time in seconds until change is done<br />
<syntaxhighlight lang="c++"><br />
void SetLightFlickerActive(string& asLightName, bool abActive);<br />
</syntaxhighlight><br />
<br />
Activates flickering on a light.<br />
<br />
#''asLightName'' - The internal light name<br />
#''abActive'' - true = active, false = inactive<br />
<br />
==Game scripts==<br />
<br />
===General===<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartCredits(string& asMusic, bool abLoopMusic, string& asTextCat, string& asTextEntry, int alEndNum);<br />
</syntaxhighlight><br />
<br />
Starts the end credits screen.<br />
<br />
#''asMusic ''- the music to play (including .ogg)<br />
#''abLoopMusic ''- determines whether the music should loop<br />
#''asTextCat ''- the category to be used in the .lang file<br />
#''asTextEntry ''- the entry in the .lang file<br />
#''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.<br />
<syntaxhighlight lang="c++"><br />
void StartDemoEnd();<br />
</syntaxhighlight><br />
<br />
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)<br />
<br />
<syntaxhighlight lang="c++"><br />
void AutoSave();<br />
</syntaxhighlight><br />
<br />
Save the game to the auto save.<br />
<br />
<syntaxhighlight lang="c++"><br />
void CheckPoint (string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry);<br />
</syntaxhighlight><br />
<br />
Sets a checkpoint at which the player will respawn in case he dies. <br />Callback syntax: <code>void MyFunc(string &in asName, int alCount)</code> <br />Count is 0 on the first checkpoint load!<br />
<br />
#''asName ''- the internal name<br />
#''asStartPos ''- the name of the StartPos in the editor<br />
#''asCallback ''- the function to call when the player dies/respawns<br />
#''asDeathHintCat ''- the category of the death hint message to be used in the .lang file<br />
#''asDeathHintEntry ''- the entry in the .lang file<br />
<syntaxhighlight lang="c++"><br />
void ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);<br />
</syntaxhighlight><br />
<br />
Immediatly loads another map.<br />
<br />
#''asMapName ''- the file to load<br />
#''asStartPos ''- the name of the StartPos on the next map<br />
#''asStartSound ''- the sound that is played when the change starts<br />
#''asEndSound ''- the sound that is played when the new map is loaded<br />
<syntaxhighlight lang="c++"><br />
void ClearSavedMaps();<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
<syntaxhighlight lang="c++"><br />
void CreateDataCache();<br />
void DestroyDataCache();<br />
</syntaxhighlight><br />
<br />
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.<br />
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.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetMapDisplayNameEntry(string& asNameEntry);<br />
</syntaxhighlight><br />
<br />
Sets the map name shown in save file names. If none is set NULL is assumed.<br />
<br />
#''asNameEntry ''- the entry to display, category must be "Levels"!<br />
<syntaxhighlight lang="c++"><br />
void SetSkyBoxActive(bool abActive);<br />
</syntaxhighlight><br />
<br />
Enables/Disables the skybox.<br />
<br />
#''abActive'' - true = active, false = inactive<br />
<syntaxhighlight lang="c++"><br />
void SetSkyBoxTexture(string& asTexture);<br />
</syntaxhighlight><br />
<br />
Sets the texture of the skybox.<br />
<br />
#''asTexture'' - The texture file to set. Extension: .dds<br />
<syntaxhighlight lang="c++"><br />
void SetSkyBoxColor(float afR, float afG, float afB, float afA);<br />
</syntaxhighlight><br />
<br />
Sets the solid color of the skybox rather than a texture.<br />
<br />
#''afR ''- red value<br />
#''afG ''- green value<br />
#''afB ''- blue value<br />
#''afA ''- alpha value<br />
<syntaxhighlight lang="c++"><br />
void SetFogActive(bool abActive);<br />
</syntaxhighlight><br />
<br />
Enables/Disables the global fog.<br />
<br />
#''abActive'' - true = active, false = inactive<br />
<syntaxhighlight lang="c++"><br />
void SetFogColor(float afR, float afG, float afB, float afA);<br />
</syntaxhighlight><br />
<br />
Sets the color to use for the global fog.<br />
<br />
#''afR ''- red value<br />
#''afG ''- green value<br />
#''afB ''- blue value<br />
#''afA ''- alpha value<br />
<syntaxhighlight lang="c++"><br />
void SetFogProperties(float afStart, float afEnd, float afFalloffExp, bool abCulling);<br />
</syntaxhighlight><br />
<br />
Sets the properties for the global fog.<br />
<br />
#''afStart ''- how many meters from the camera should the fog begin<br />
#''afEnd ''- how many meters from the camera should the fog reach full thickness<br />
#''afFalloffExp ''- the amount by which the thinkness increases<br />
#''abCulling ''- whether occlusion culling is active for the fog; this prevents objects behind the fog from being loaded<br />
<syntaxhighlight lang="c++"><br />
void SetupLoadScreen(string&asTextCat, string&asTextEntry, int alRandomNum, string&asImageFile);<br />
</syntaxhighlight><br />
<br />
Determines which loading screen will be shown when changing maps.<br />
<br />
#''asTextCat ''- the category of the loading text in the .lang file to be shown on the loading screen<br />
#''asTextEntry ''- the entry in the .lang file<br />
#''alRandomNum ''- if greater 1, then it will randomize between 1 and alRandom for each LoadScreen giving entry the suffix XX (eg 01). If < =1 then no suffix is added<br />
#''asImageFile ''- the image to be shown (optional)<br />
<br />
===Game Timer===<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddTimer(string& asName, float afTime, string& asFunction);<br />
</syntaxhighlight><br />
<br />
Creates a timer which calls a function when it expires. <br />Callback syntax: <code>void MyFunc(string &in asTimer)</code><br />
<br />
#''asName ''- the name of the timer<br />
#''afTime ''- time in seconds<br />
#''asFunction ''- the function to call<br />
<syntaxhighlight lang="c++"><br />
void RemoveTimer(string& asName);<br />
</syntaxhighlight><br />
<br />
Removes a timer, no matter how much time is left.<br />
<br />
#''asName'' - the internal name of the timer.<br />
<syntaxhighlight lang="c++"><br />
float GetTimerTimeLeft(string& asName);<br />
</syntaxhighlight><br />
<br />
Returns the time left on a timer.<br />
<br />
#''asName'' - the internal name of the timer.<br />
<br />
===Screen Effects===<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadeOut(float afTime);<br />
</syntaxhighlight><br />
<br />
Fades the screen to black.<br />
<br />
''afTime ''- time in seconds until the screen is completly black<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadeIn(float afTime);<br />
</syntaxhighlight><br />
<br />
Fades the screen back to normal.<br />
<br />
''afTime ''- time in seconds until the screen back to normal<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadeImageTrailTo(float afAmount, float afSpeed);<br />
</syntaxhighlight><br />
<br />
Applies the image trail effect to the screen.<br />
<br />
''afAmount ''- intensity (default: 0) <br />''afSpeed ''- time in seconds until full effect<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadeSepiaColorTo(float afAmount, float afSpeed);<br />
</syntaxhighlight><br />
<br />
Makes the screen go dark red.<br />
<br />
''afAmount ''- intensity (default: 0) <br />''afSpeed ''- time in seconds until full effect<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadeRadialBlurTo(float afSize, float afSpeed);<br />
</syntaxhighlight><br />
<br />
Applies radial blur effects to the screen.<br />
<br />
''afSize ''- intensity (default: 0) <br />''afSpeed ''- time in seconds until full effect<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetRadialBlurStartDist(float afStartDist);<br />
</syntaxhighlight><br />
<br />
Determines at which distance the radial blur effects appear.<br />
<br />
''afStartDist ''- the distance at which the effect starts<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartEffectFlash(float afFadeIn, float afWhite, float afFadeOut);<br />
</syntaxhighlight><br />
<br />
Fades the screen to white.<br />
<br />
''afFadeIn ''- time in seconds until screen is white <br />''afWhite ''- determines to which percentage the screen fades to white (1.0 = completly white) <br />''afFadeOut ''- time in seconds until screen is back to normal again<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartEffectEmotionFlash(string& asTextCat, string& asTextEntry, string& asSound);<br />
</syntaxhighlight><br />
<br />
Fades the screen to white and shows a text message.<br />
<br />
''asTextCat ''- the category in the .lang file <br />''asTextEntry ''- the text entry in the .lang file <br />''asSound ''- the sound to play while fading<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddEffectVoice(string& asVoiceFile, string& asEffectFile, string& asTextCat, string& asTextEntry,<br />
bool abUsePosition, string& asPosEntity, float afMinDistance, float afMaxDistance);<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
''asVoiceFile ''- the voice to play <br />''asEffectFile ''- the effect to play <br />''asTextCat ''- the category in the .lang file <br />''asTextEntry ''- the text entry in the .lang file <br />''abUsePosition ''- plays using 3D from the entity, or without 3D <br />''asPosEntity ''- the entity at which the effect appears <br />''afMinDistance ''- minimum distance to see the effect <br />''afMaxDistance ''- maximum distance to see the effect<br />
<br />
<syntaxhighlight lang="c++"><br />
void StopAllEffectVoices(float afFadeOutTime);<br />
</syntaxhighlight><br />
<br />
Stops all voices and calls the EffectVoiceOverCallback.<br />
<br />
<syntaxhighlight lang="c++"><br />
bool GetEffectVoiceActive();<br />
</syntaxhighlight><br />
<br />
Checks whether EffectVoices are still active.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetEffectVoiceOverCallback(string& asFunc);<br />
</syntaxhighlight><br />
<br />
Sets the function to be called when the EffectVoices are finished. <br />Callback syntax: <code>void MyFunc()</code><br />
<br />
<syntaxhighlight lang="c++"><br />
bool GetFlashbackIsActive();<br />
</syntaxhighlight><br />
<br />
Checks whether a flashback is still in effect.<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartPlayerSpawnPS(string& asSPSFile);<br />
void StopPlayerSpawnPS();<br />
</syntaxhighlight><br />
<br />
Continuously spawn regular particle systems (''.ps'') around the player. Particles created by this script carry over from map to map. <br /> <br />''asSPSFile'' - the ''.sps'' file to use. Exemplary ''.sps'' files are located in the ''/misc'' folder in the main game directory. <br /> <br />Custom ''.sps'' files can be created by hand in a text editor (see existing ones and mimic how those are written). <br />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.<br />
<br />
<syntaxhighlight lang="c++"><br />
void PlayGuiSound(string& asSoundFile, float afVolume);<br />
</syntaxhighlight><br />
<br />
Plays a sound, not using 3D.<br />
<br />
''asSoundFile ''- the sound to play (extension is .snt) <br />''afVolume ''- the volume of the sound<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);<br />
</syntaxhighlight><br />
<br />
Shakes the screen.<br />
<br />
''afAmount ''- intensity of the shake <br />''afTime ''- duration of the shake <br />''afFadeInTime ''- time in seconds until full intensity is reached <br />''afFadeOutTime ''- time until screen is back to normal<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetInDarknessEffectsActive(bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables the sanity drain and night vision effects while in the darkness.<br />
<br />
''bool abX'' - Enable/disable effects.<br />
<br />
===Insanity===<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetInsanitySetEnabled(string& asSet, bool abX);<br />
</syntaxhighlight><br />
<br />
Determines which InsanitySets are enabled.<br />
<br />
''asSet ''- the set <br />''abX ''- enabled or not<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartInsanityEvent(string &in asEventName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Starts a specified insanity event.<br />
<br />
''asEventName ''- Insanity event to play.<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartRandomInsanityEvent();<br />
</syntaxhighlight><br />
<br />
Starts a random insanity event from the available sets.<br />
<br />
<syntaxhighlight lang="c++"><br />
void StopCurrentInsanityEvent();<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Stops the currently playing insanity event.<br />
<br />
<syntaxhighlight lang="c++"><br />
void InsanityEventIsActive();<br />
</syntaxhighlight><br />
<br />
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 [http://wiki.frictionalgames.com/lib/images/smileys/icon_smile.gif?nolink&15x15]<br />
<br />
===Player===<br />
<br />
Note that the player's maximum health and sanity is 100.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerActive(bool abActive);<br />
</syntaxhighlight><br />
<br />
Enabled/Disable player controlled movement.<br />
<br />
<syntaxhighlight lang="c++"><br />
void ChangePlayerStateToNormal();<br />
</syntaxhighlight><br />
<br />
Sets certain effects back to normal. It can for example make the player drop an item.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerCrouching(bool abCrouch);<br />
</syntaxhighlight><br />
<br />
Forces the player to crouch.<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddPlayerBodyForce(float afX, float afY, float afZ, bool abUseLocalCoords);<br />
</syntaxhighlight><br />
<br />
Pushes the player into a certain direction. Note that you need values above ~2000 to see any effects.<br />
<br />
''afX ''- amount along the X-axis <br />''afY ''- amount along the Y-axis <br />''afZ ''- amount along the Z-axis <br />''abUseLocalCoords ''- If true, axes are based on where the player is facing, not the world.<br />
<br />
<syntaxhighlight lang="c++"><br />
void ShowPlayerCrossHairIcons(bool abX);<br />
</syntaxhighlight><br />
<br />
Enables/Disables the icons when a player has something in focus.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerSanity(float afSanity);<br />
void AddPlayerSanity(float afSanity);<br />
float GetPlayerSanity();<br />
</syntaxhighlight><br />
<br />
Modifies/returns the sanity of the player.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerHealth(float afHealth);<br />
void AddPlayerHealth(float afHealth);<br />
float GetPlayerHealth();<br />
</syntaxhighlight><br />
<br />
Modifies/returns the health of the player.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerLampOil(float afOil);<br />
void AddPlayerLampOil(float afOil);<br />
float GetPlayerLampOil();<br />
</syntaxhighlight><br />
<br />
Modifies/returns the lamp oil of the player.<br />
<br />
<syntaxhighlight lang="c++"><br />
float GetPlayerSpeed();<br />
float GetPlayerYSpeed();<br />
</syntaxhighlight><br />
<br />
Returns the current speed of the player.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetSanityDrainDisabled(bool abX);<br />
</syntaxhighlight><br />
<br />
Enables/Disables sanity drain from darkness, monsters, etc.<br />
<br />
<syntaxhighlight lang="c++"><br />
void GiveSanityBoost();<br />
void GiveSanityBoostSmall();<br />
</syntaxhighlight><br />
<br />
Boosts the player's sanity by a fixed amount.<br />
<br />
<syntaxhighlight lang="c++"><br />
void GiveSanityDamage(float afAmount, bool abUseEffect);<br />
</syntaxhighlight><br />
<br />
Reduces the sanity of the player.<br />
<br />
''afAmount ''- amount of sanity damage done <br />''abUseEffect ''- determines whether an effect is played when the sanity damage is dealt<br />
<br />
<syntaxhighlight lang="c++"><br />
void GivePlayerDamage(float afAmount, string& asType, bool abSpinHead, bool abLethal);<br />
</syntaxhighlight><br />
<br />
Reduces the health of the player.<br />
<br />
''afAmount ''- amount of damage done to health <br />''asType ''- plays a certain effect on the screen when the damage is dealt (BloodSplat, Claws or Slash) <br />''abSpinHead ''- changes the camera view when damage is dealt <br />''abLethal ''- set to true if player can die from given damage<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadePlayerFOVMulTo(float afX, float afSpeed);<br />
</syntaxhighlight><br />
<br />
Changes the field of view of the player. A shorter FOV will create a zoom effect.<br />
<br />
''afX ''- multiplier of default FOV (1 is default) <br />''afSpeed ''- the speed of change between FOV's<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadePlayerAspectMulTo(float afX, float afSpeed);<br />
</syntaxhighlight><br />
<br />
Changes the aspect ratio of the player. Basically stretches or narrows the screen horizontally.<br />
<br />
''afX ''- multiplier of default aspect (default is 1) <br />''afSpeed ''- the speed of change between FOV's<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed);<br />
</syntaxhighlight><br />
<br />
Rotates the position of the camera on the player's body.<br />
<br />
''afX ''- angle of rotation of head, positive being counter-clockwise <br />''afSpeedMul ''- speed (possibly acceleration) multiplier of the rotation (default 1, which is really slow) <br />''afMaxSpeed ''- maximum speed of rotation<br />
<br />
<syntaxhighlight lang="c++"><br />
void MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist);<br />
</syntaxhighlight><br />
<br />
Changes the position of the camera on the player's body.<br />
<br />
''afX ''- amount along the X-axis <br />''afY ''- amount along the Y-axis <br />''afZ ''- amount along the Z-axis <br />''afSpeed ''- speed at which the change happens <br />''afSlowDownDist ''- distance at which to start slowing down (prevents the head from abruptly stopping)<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartPlayerLookAt(string& asEntityName, float afSpeedMul, float afMaxSpeed, string& asAtTargetCallback);<br />
void StopPlayerLookAt();<br />
</syntaxhighlight><br />
<br />
Forces the player to look at a certain entity until StopPlayerLookAt is used.<br />
<br />
''asEntityName ''- the entity to look at <br />''afSpeedMul ''- how fast should the player look at the entity <br />''afMaxSpeed ''- maximum speed allowed <br />''asAtTargetCallback ''- function to call when player looks at target<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerMoveSpeedMul(float afMul);<br />
void SetPlayerRunSpeedMul(float afMul);<br />
void SetPlayerLookSpeedMul(float afMul);<br />
</syntaxhighlight><br />
<br />
Changes the player's move/run/look speed. Default is 1.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerJumpForceMul(float afMul);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Changes the player's jump multiplier. Higher values = higher jumps. Default is 1.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerJumpDisabled(bool abX);<br />
void SetPlayerCrouchDisabled(bool abX);<br />
</syntaxhighlight><br />
<br />
Enables/Disables the player's ability to jump/crouch.<br />
<br />
<syntaxhighlight lang="c++"><br />
void TeleportPlayer(string& asStartPosName);<br />
</syntaxhighlight><br />
<br />
Instantly teleports the player to the target StartPos.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLanternActive(bool abX, bool abUseEffects);<br />
</syntaxhighlight><br />
<br />
Makes the player use his lantern.<br />
<br />
<syntaxhighlight lang="c++"><br />
bool GetLanternActive();<br />
</syntaxhighlight><br />
<br />
Checks whether the player currently uses his lantern.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLanternDisabled(bool abX);<br />
</syntaxhighlight><br />
<br />
Enables/Disables the player's ability to use his lantern.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLanternLitCallback(string& asCallback);<br />
</syntaxhighlight><br />
<br />
Sets the function to call when the player uses his lantern. <br />Callback syntax: <code>MyFunc(bool abLit)</code><br />
<br />
<syntaxhighlight lang="c++"><br />
void SetMessage(string& asTextCategory, string& asTextEntry, float afTime);<br />
</syntaxhighlight><br />
<br />
Displays a message on the screen.<br />
<br />
''asTextCategory ''- the category in the .lang file <br />''asTextEntry ''- the entry in the .lang file <br />''afTime ''- determines how long the message is displayed. If time is < =0 then the life time is calculated based on string length.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetDeathHint(string& asTextCategory, string& asTextEntry);<br />
</syntaxhighlight><br />
<br />
Sets the message that appears when the player dies.<br />
<br />
''asTextCategory ''- the category in the .lang file <br />''asTextEntry ''- the entry in the .lang file<br />
<br />
<syntaxhighlight lang="c++"><br />
void DisableDeathStartSound();<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
<syntaxhighlight lang=""><br />
void MovePlayerForward(float afAmount)<br />
</syntaxhighlight><br />
<br />
"REQUIRES THE 1.2 PATCH: JUSTINE" Moves the player forward. It needs to be called in a timer that updates 60 times / second.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerFallDamageDisabled(bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables the player's ability to take fall damage.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerPos(float afX, float afY, float afZ);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Sets the player's position within the level.<br />
<br />
''afX'' - X co-ordinate position. <br />''afY'' - Y co-ordinate position. <br />''afZ'' - Z co-ordinate position.<br />
<br />
<syntaxhighlight lang="c++"><br />
float GetPlayerPosX();<br />
float GetPlayerPosY();<br />
float GetPlayerPosZ();<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the player's position within the level on the specified axis.<br />
<br />
===Journal===<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddNote(string& asNameAndTextEntry, string& asImage);<br />
</syntaxhighlight><br />
<br />
Adds a note to the player's journal.<br />
<br />
''asNameAndTextEntry ''- entries in the .lang file. Must end with _Name and _Text and be in category "Journal"! <br />''asImage ''- the background image to be used<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddDiary(string& asNameAndTextEntry, string& asImage);<br />
</syntaxhighlight><br />
<br />
Adds a diary to the player's journal.<br />
<br />
''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"! <br />''asImage ''- the background image to be used<br />
<br />
<syntaxhighlight lang="c++"><br />
void ReturnOpenJournal(bool abOpenJournal);<br />
</syntaxhighlight><br />
<br />
Only called in the pickup diary callback! If true the journal displays the entry else not.<br />
<br />
===Quests===<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddQuest(string& asName, string& asNameAndTextEntry);<br />
</syntaxhighlight><br />
<br />
Adds a quest to the player's journal under mementos.<br />
<br />
''asName ''- the internal name to be used <br />''asNameAndTextEntry ''- entry in the .lang file. Must start with "Quest_<texthere>_Text”, and be in category “Journal”!<br />
<br />
<syntaxhighlight lang="c++"><br />
void CompleteQuest(string& asName, string& asNameAndTextEntry);<br />
</syntaxhighlight><br />
<br />
Completes a quest.<br />
<br />
''asName ''- the internal name of the quest <br />''asNameAndTextEntry ''- entry in the .lang file. Must start with " Quest_<texthere>_Text ”, and be in category “Journal”!<br />
<br />
<syntaxhighlight lang="c++"><br />
bool QuestIsCompleted(string& asName);<br />
bool QuestIsAdded(string& asName);<br />
</syntaxhighlight><br />
<br />
Checks whether a quest is completed/added.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetNumberOfQuestsInMap(int alNumberOfQuests);<br />
</syntaxhighlight><br />
<br />
Sets the number of quests in the map.<br />
<br />
''alNumberOfQuests ''- Amount of Quests<br />
<br />
<syntaxhighlight lang="c++"><br />
void GiveHint (string& asName, string& asMessageCat, string& asMessageEntry, float afTimeShown);<br />
</syntaxhighlight><br />
<br />
Displays a hint on the player's screen.<br />
<br />
''asName ''- the internal name <br />''asMessageCat ''- the category in the .lang file <br />''asMessageEntry ''- the entry in the .lang file <br />''afTimeShown ''- time in seconds until the message disappears. If time is <= 0 then the life time is calculated based on string length.<br />
<br />
<syntaxhighlight lang="c++"><br />
void RemoveHint (string& asName);<br />
void BlockHint (string& asName);<br />
void UnBlockHint (string& asName);<br />
</syntaxhighlight><br />
<br />
Removes<nowiki>\</nowiki>Blocks<nowiki>\</nowiki>Unblocks a hint.<br />
<br />
===Inventory===<br />
<br />
<syntaxhighlight lang="c++"><br />
void ExitInventory();<br />
</syntaxhighlight><br />
<br />
Exits the inventory by force.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetInventoryDisabled(bool abX);<br />
</syntaxhighlight><br />
<br />
Disables the player's ability to open his inventory.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetInventoryMessage(string& asTextCategory, string& asTextEntry, float afTime);<br />
</syntaxhighlight><br />
<br />
Adds a message at the bottom of the inventory screen.<br />
<br />
''asTextCategory ''- the category in the .lang file <br />''asTextEntry ''- the entry in the .lang file <br />''afTime ''- time in seconds until the message disappears. If life time is <= 0 then the life time is calculated based on string length.<br />
<br />
<syntaxhighlight lang="c++"><br />
void GiveItem(string& asName, string& asType, string& asSubTypeName, string& asImageName, float afAmount);<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
''asName ''- internal name <br />''asType ''- item type to give, Available types are: <br /><br />
<br />
*Puzzle<br />
*Lantern<br />
*Health<br />
*Sanity<br />
*LampOil<br />
*Tinderbox<br />
<br />
''asSubTypeName ''- item name for .lang file <br />''asImageName ''- the image which will appear in inventory. For example: <code>void GiveItem("chemical_container_full_1", "Puzzle", "chemical_container_full", "chemical_container_full.tga", 1);</code> will use the image from <code>graphics/item/chemical_container_full.tga</code> <br />
<br />
''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.<br />
<br />
<syntaxhighlight lang="c++"><br />
void RemoveItem(string& asName);<br />
</syntaxhighlight><br />
<br />
Removes an item from the player's inventory.<br />
<br />
<syntaxhighlight lang="c++"><br />
bool HasItem(string& asName);<br />
</syntaxhighlight><br />
<br />
Checks whether the player has an item in his inventory.<br />
<br />
<syntaxhighlight lang="c++"><br />
void GiveItemFromFile(string& asName, string& asFileName);<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
''asName ''- internal name <br />''asFileName ''- item to give + extension (.ent)<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddCombineCallback(string& asName, string& asItemA, string& asItemB, string& asFunction, bool abAutoRemove);<br />
</syntaxhighlight><br />
<br />
Allows the player to combine items in his inventory. <br />Callback syntax: <code>void MyFunc(string &in asItemA, string &in asItemB)</code><br />
<br />
''asName ''- internal name for the callback <br />''asItemA ''- internal name of first item <br />''asItemB ''- internal name of second item <br />''asFunction ''- the function to call <br />''abAutoRemove ''- determines whether the callback should be removed when the items are combined<br />
<br />
<syntaxhighlight lang="c++"><br />
void RemoveCombineCallback(string& asName);<br />
</syntaxhighlight><br />
<br />
Removes a combine callback. <br />''asName'' - the internal name of the callback to be removed (as specified in AddCombineCallback)<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddUseItemCallback(string& asName, string& asItem, string& asEntity, string& asFunction, bool abAutoDestroy);<br />
</syntaxhighlight><br />
<br />
Allows the player to use items on the world. <br />Callback syntax: <code>void MyFunc(string &in asItem, string &in asEntity)</code><br />
<br />
''asName ''- internal name <br />''asItem ''- internal name of the item <br />''asEntity ''- entity to be able to use the item on <br />''asFunction ''- function to call <br />''abAutoDestroy ''- determines whether the item is destroyed when used<br />
<br />
<syntaxhighlight lang="c++"><br />
void RemoveUseItemCallback(string& asName);<br />
</syntaxhighlight><br />
<br />
Removes an item callback.<br />
<br />
===Entities===<br />
<br />
====General====<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityActive(string& asName, bool abActive);<br />
</syntaxhighlight><br />
<br />
Activates/deactivates an entity.<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityVisible(string &in asName, bool abVisible);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Activates/deactivates an entity's visual mesh. The collision body remains.<br />
<br />
''asName'' - Name of the entity. <br />''abActive'' - Activate/deactivate mesh.<br />
<br />
<syntaxhighlight lang="c"><br />
bool GetEntityExists(string& asName);<br />
</syntaxhighlight><br />
<br />
Checks whether an entity exists.<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityCustomFocusCrossHair(string& asName, string& asCrossHair);<br />
</syntaxhighlight><br />
<br />
Changes the crosshair that is used when focusing an entity.<br />
<br />
''asName ''- internal name <br />''asCrossHair ''- desired crosshair, can be: Default (uses default), Grab, Push, Ignite, Pick, LevelDoor, Ladder<br />
<br />
<syntaxhighlight lang="c"><br />
void CreateEntityAtArea(string& asEntityName, string& asEntityFile, string& asAreaName, bool abFullGameSave);<br />
</syntaxhighlight><br />
<br />
Creates an entity at an area. When creating an enemy though, it cannot chase properly along PathNodes(using for example ShowEnemyPlayerPosition).<br />
<br />
''asEntityName ''- internal name <br />''asEntityFile ''- entity to be used extension .ent <br />''asAreaName ''- the area to create the entity at <br />''abFullGameSave ''- determines whether an entity "remembers" its state<br />
<br />
<syntaxhighlight lang="c"><br />
void ReplaceEntity(string &in asName, string &in asBodyName, string &in asNewEntityName, string &in asNewEntityFile, bool abFullGameSave);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Removes an entity and places a new one in its place.<br />
<br />
''asName'' - Name of the entity to replace. <br />''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). <br />''asNewEntityName'' - Name of the new entity. <br />''asNewEntityFile'' - Name of the new entity file. Extension .ent. <br />''abFullGameSave'' - Whether ALL properties of this entity should be saved throughout levels.<br />
<br />
<syntaxhighlight lang="c++"><br />
void PlaceEntityAtEntity(string &in asName, string &in asTargetEntity, string &in asTargetBodyName, bool abUseRotation);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Places an entity at the position of another entity. Does not work for enemies, use TeleportEnemyToEntity instead.<br />
<br />
''asName'' - Name of the entity to place. <br />''asTargetEntity'' - Name of the other entity to place the first entity at. <br />''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). <br />''abUseRotation'' - Whether the entity should be rotated like the target entity.<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityPos(string &in asName, float afX, float afY, float afZ);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Moves an entity to a position in the level.<br />
<br />
''asName'' - Name of the entity to move. <br />''afX'' - X co-ordinate position. <br />''afY'' - Y co-ordinate position. <br />''afZ'' - Z co-ordinate position.<br />
<br />
<syntaxhighlight lang="c"><br />
float GetEntityPosX(string &in asName);<br />
float GetEntityPosY(string &in asName);<br />
float GetEntityPosZ(string &in asName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns an entity's position in the level on the specified axis.<br />
<br />
''asName'' - Name of the entity.<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityPlayerLookAtCallback(string& asName, string& asCallback, bool abRemoveWhenLookedAt);<br />
</syntaxhighlight><br />
<br />
Calls a function when the player looks at a certain entity. <br />Callback syntax: <code>void MyFunc(string &in asEntity, int alState)</code> <br />alState: 1 = looking, -1 = not looking<br />
<br />
''asName ''- internal name <br />''asCallback ''- function to call <br />''abRemoveWhenLookedAt ''- determines whether the callback should be removed when the player looked at the entity<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction);<br />
</syntaxhighlight><br />
<br />
Calls a function when the player interacts with a certain entity. <br />Callback syntax: <code>void MyFunc(string &in asEntity)</code><br />
<br />
''asName ''- internal name <br />''asCallback ''- function to call <br />''abRemoveOnInteraction ''- determines whether the callback should be removed when the player interacts with the entity<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityCallbackFunc(string& asName, string& asCallback);<br />
</syntaxhighlight><br />
<br />
Calls a function when the player interacts with a certain entity. <br />Callback syntax: <code>void MyFunc(string &in asEntity, string &in type)</code> <br />Type depends on entity type and includes: "OnPickup", "Break", "OnIgnite", etc<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityConnectionStateChangeCallback(string& asName, string& asCallback);<br />
</syntaxhighlight><br />
<br />
A callback called when ever the connection state changes (button being switched on, lever switched, etc). <br />Callback syntax: <code>void Func(string &in asEntity, int alState)</code> <br />alState: -1 = off, 0 = between, 1 = on<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityInteractionDisabled(string& asName, bool abDisabled);<br />
</syntaxhighlight><br />
<br />
Disallows interaction with an entity.<br />
<br />
<syntaxhighlight lang="c"><br />
void BreakJoint (string& asName);<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
<syntaxhighlight lang="c"><br />
void AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);<br />
</syntaxhighlight><br />
<br />
Calls a function when two entites collide. <br />Callback syntax: <code>void MyFunc(string &in asParent, string &in asChild, int alState)</code> <br />alState: 1 = enter, -1 = leave<br />
<br />
''asParentName ''- internal name of main object <br />''asChildName ''- internal name of object that collides with main object (asterix (<nowiki>*</nowiki>) NOT supported!) <br />''asFunction ''- function to call <br />''abDeleteOnCollide ''- determines whether the callback after it was called <br />''alStates ''- 1 = only enter, -1 = only leave, 0 = both<br />
<br />
<syntaxhighlight lang="c"><br />
void RemoveEntityCollideCallback(string& asParentName, string& asChildName);<br />
</syntaxhighlight><br />
<br />
Removes an EntityCollideCallback. Asterix (<nowiki>*</nowiki>) not supported in ''asChildName''.<br />
<br />
<syntaxhighlight lang="c"><br />
bool GetEntitiesCollide(string& asEntityA, string& asEntityB);<br />
</syntaxhighlight><br />
<br />
Checks whether two entites collide. This function does NOT support asterix (<nowiki>*</nowiki>) or "Player"!<br />
<br />
<syntaxhighlight lang="c"><br />
void SetBodyMass(string &in asName, float afMass);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Sets the mass of an entity's body.<br />
<br />
''asName'' - Name of the body of an entity. The body name of an entity is EntityName_BodyName. <br />''afMass'' - The mass to set.<br />
<br />
<syntaxhighlight lang="c"><br />
float GetBodyMass(string &in asName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Gets the mass of an entity's body.<br />
<br />
''asName'' - Name of the body of an entity. The body name of an entity is EntityName_BodyName. <br />''afMass'' - The mass to get.<br />
<br />
====Props====<br />
<br />
<syntaxhighlight lang="c"><br />
void SetPropEffectActive(string& asName, bool abActive, bool abFadeAndPlaySounds);<br />
</syntaxhighlight><br />
<br />
Can be used on coal to give it the black color it should have.<br />
<br />
<syntaxhighlight lang="c"><br />
void SetPropActiveAndFade(string& asName, bool abActive, float afFadeTime);<br />
</syntaxhighlight><br />
<br />
Activates/deactivates a prop.<br />
<br />
''asName ''- internal name <br />''abActive ''- nothing to add <br />''afFadeTime ''- time in seconds until prop fully fades<br />
<br />
<syntaxhighlight lang="c"><br />
void SetPropStaticPhysics(string& asName, bool abX);<br />
</syntaxhighlight><br />
<br />
Activates/deactivates the physics of a prop. Setting as true will make entities static in midair.<br />
<br />
<syntaxhighlight lang="c"><br />
bool GetPropIsInteractedWith(string& asName);<br />
</syntaxhighlight><br />
<br />
Checks whether a prop is interacted with.<br />
<br />
<syntaxhighlight lang="c"><br />
void RotatePropToSpeed(string& asName, float afAcc, float afGoalSpeed, float afAxisX, float afAxisY, float afAxisZ, bool abResetSpeed, string& asOffsetArea);<br />
</syntaxhighlight><br />
<br />
Rotates the prop up to a set speed.<br />
<br />
''asName ''- internal name <br />''afAcc ''- acceleration <br />''afGoalSpeed ''- desired speed <br />''afAxisX ''- rotation around X axis <br />''afAxisY ''- rotation around Y axis <br />''afAxisZ ''- rotation around Z axis <br />''abResetSpeed ''- determines whether the speed is resetted after goal speed is reached <br />''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 "StaticObject" entity!<br />
<br />
<syntaxhighlight lang="cpp"><br />
void StopPropMovement(string& asName);<br />
</syntaxhighlight><br />
<br />
Stops all movement of a prop.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AddAttachedPropToProp(string& asPropName, string& asAttachName, string& asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);<br />
</syntaxhighlight><br />
<br />
Attaches a prop to another prop.<br />
<br />
a''sPropName''- the prop to attach another prop at <br />''asAttachName ''- internal name of the prop that gets attached <br />''asAttachFile ''- the prop that gets attached extension .ent <br />''afPosX ''- X position of the attach from the prop <br />''afPosY ''- Y position of the attach from the prop <br />''afPosZ ''- Z position of the attach from the prop <br />''afRotX ''- rotation around X axis of the attach <br />''afRotY ''- rotation around Y axis of the attach <br />''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of "AddEntityCollideCallback", attached props will not call the callback function if they collide with a "static_object" or a "StaticProp" entity type!<br />
<br />
{{bug|''afRotZ '' is used for both the ZX rotation and the Z position of the attached prop. Unwanted rotation can be avoided by using: <br />''AddAttachedPropToProp(asPropName, asAttachName, asAttachFile, afPosX, afPosY, '''0''', afPosZ, '''90.0f''', afPosZ)''}}<br />
<br />
{{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.}}<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AttachPropToProp(string& asPropName, string& asAttachName, string& asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Attaches a prop to another prop. Fixed version of AddAttachedPropToProp.<br />
<br />
''asPropName ''- the prop to attach another prop at <br />''asAttachName ''- internal name of the prop that gets attached <br />''asAttachFile ''- the prop that gets attached extension .ent <br />''afPosX ''- X position of the attach from the prop <br />''afPosY ''- Y position of the attach from the prop <br />''afPosZ ''- Z position of the attach from the prop <br />''afRotX ''- rotation around X axis of the attach <br />''afRotY ''- rotation around Y axis of the attach <br />''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of "AddEntityCollideCallback", attached props will not call the callback function if they collide with a "static_object" or a "StaticProp" entity type!<br />
<br />
<syntaxhighlight lang="cpp"><br />
void RemoveAttachedPropFromProp(string& asPropName, string& asAttachName);<br />
</syntaxhighlight><br />
<br />
Detaches a prop from a prop.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetPropHealth(string& asName, float afHealth);<br />
void AddPropHealth(string& asName, float afHealth);<br />
float GetPropHealth(string& asName);<br />
</syntaxhighlight><br />
<br />
Modifies/returns the health of a prop.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void ResetProp(string& asName);<br />
</syntaxhighlight><br />
<br />
Resets a prop's state to the original one when the map was loaded.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void PlayPropAnimation(string& asProp, string& asAnimation, float afFadeTime, bool abLoop, string& asCallback);<br />
</syntaxhighlight><br />
<br />
Makes the prop play an animation and calls a function. <br />Callback syntax: <code>void MyFunc(string &in asProp)</code><br />
<br />
''asProp ''- internal name of the prop <br />''asAnimation ''- animation to play <br />''afFadeTime ''- ? <br />''abLoop ''- determines whether the animation loops <br />''asCallback ''- function to call<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AddPropForce(string& asName, float afX, float afY, float afZ, string& asCoordSystem);<br />
void AddPropImpulse(string& asName, float afX, float afY, float afZ, string& asCoordSystem);<br />
void AddBodyForce(string& asName, float afX, float afY, float afZ, string& asCoordSystem);<br />
void AddBodyImpulse(string& asName, float afX, float afY, float afZ, string& asCoordSystem);<br />
</syntaxhighlight><br />
<br />
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 "Body" 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).<br />
<br />
''asName ''- the object to push; for bodies, use this format: "''entityName''_''bodyName''" <br />''afX ''- magnitude along the X-axis <br />''afY ''- magnitude along the Y-axis <br />''afZ ''- magnitude along the Z-axis <br />''asCoordSystem ''- determines which coordinate system is used, usually "world" 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.<br />
<br />
====Connections====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void InteractConnectPropWithRope(string& asName, string& asPropName, string& asRopeName, bool abInteractOnly, float afSpeedMul, float afToMinSpeed, float afToMaxSpeed, bool abInvert, int alStatesUsed);<br />
</syntaxhighlight><br />
<br />
Connects a prop with the movement of a rope (ie. turn wheel to move rope).<br />
<br />
''asName ''- connection name <br />''asPropName ''- name of prop <br />''asRopeName ''- name of rope <br />''abInteractOnly ''- ? <br />''afSpeedMul ''- speed multiplier of how quickly the rope moves <br />''afToMinSpeed ''- the slowest the rope will move when moving the prop <br />''afToMaxSpeed ''- the fastest the rope will move when moving the prop <br />''abInvert ''- whether to invert the direction the rope moves <br />''alStatesUsed ''- which states of the prop can interact with the rope?<br />
<br />
<syntaxhighlight lang="cpp"><br />
void InteractConnectPropWithMoveObject(string& asName, string& asPropName, string& asMoveObjectName, bool abInteractOnly, bool abInvert, int alStatesUsed);<br />
</syntaxhighlight><br />
<br />
This one should only be used if there must be an exact correspondance to prope "amount" and the moveobject open amount. It is best used for Wheel-door connections!<br />
<br />
<syntaxhighlight lang="cpp"><br />
void ConnectEntities(string& asName, string& asMainEntity, string& asConnectEntity, bool abInvertStateSent, int alStatesUsed, string& asCallbackFunc);<br />
</syntaxhighlight><br />
<br />
Callback syntax: <code>void MyFunc(string &in asConnectionName, string &in asMainEntity, string &in asConnectEntity, int alState)</code> <br />State is what is sent to connection entity and will be inverted if abInvertStateSent = true!<br />
<br />
====Lamps====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetLampLit(string& asName, bool abLit, bool abEffects);<br />
</syntaxhighlight><br />
<br />
(Un)lits a lamp.<br />
<br />
''asName ''- Name of the lamp <br />''abLit ''- Set true if you want the lamp to be lit, set to false if you want the lamp to be unlit <br />''abEffects ''- If you want to have the lamp fade in/out when it gets (un)lit<br />
<br />
====Doors====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetSwingDoorLocked(string& asName, bool abLocked, bool abEffects);<br />
void SetSwingDoorClosed(string& asName, bool abClosed, bool abEffects);<br />
</syntaxhighlight><br />
<br />
Locks/closes a swing door.<br />
<br />
<syntaxhighlight lang="cpp"><br />
bool GetSwingDoorLocked(string& asName);<br />
bool GetSwingDoorClosed(string& asName);<br />
</syntaxhighlight><br />
<br />
Checks whether a swing door is locked/closed.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetSwingDoorDisableAutoClose(string& asName, bool abDisableAutoClose);<br />
</syntaxhighlight><br />
<br />
Deactivates the "auto-close" when a door is nearly closed.<br />
<br />
<syntaxhighlight lang="cpp"><br />
int GetSwingDoorState(string& asName);<br />
</syntaxhighlight><br />
<br />
Returns an integer depending on how far the door is opened. <br />-1 = angle is close to 0°, 1 = angle is 70% or higher of max, 0 = inbetween -1 and 1.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetLevelDoorLocked(string& asName, bool abLocked);<br />
</syntaxhighlight><br />
<br />
Locks a level door. Note that level doors are NOT swing doors.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetLevelDoorLockedSound(string& asName, string& asSound);<br />
</syntaxhighlight><br />
<br />
Determines which sound is played when interacting with a locked level door.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetLevelDoorLockedText(string& asName, string& asTextCat, string& asTextEntry);<br />
</syntaxhighlight><br />
<br />
Displays a message when interacting with a locked level door.<br />
<br />
''asName ''- internal name <br />''asTextCat ''- the category in the .lang file <br />''asTextEntry ''- the entry in the .lang file<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetMoveObjectState(string& asName, float afState);<br />
</syntaxhighlight><br />
<br />
Moves an object to a certain state.<br />
<br />
''asName ''- internal name <br />''afState ''- state of the object, 0 = closed, 1 = open, values inbetween (and above, for example, the bridge_metal_vert) are valid too!<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetMoveObjectStateExt(string& asName, float afState, float afAcc, float afMaxSpeed, float afSlowdownDist, bool abResetSpeed);<br />
</syntaxhighlight><br />
<br />
Moves an object to a certain state, extended method.<br />
<br />
''asName ''- internal name <br />''afState ''- state of the object, 0 = closed, 1 = open, values inbetween are valid too! <br />''afAcc ''- acceleration <br />''afMaxSpeed ''- maximum speed <br />''afSlowdownDist ''- Distance to the target state before decceleration occurs. <br />''abResetSpeed ''- Set to True if the prop's speed should be reset before performing the movement, else the prop will accelerate from it's current speed to afMaxSpeed.<br />
<br />
====Levers, wheels and buttons====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetPropObjectStuckState(string& asName, int alState);<br />
void SetWheelStuckState(string& asName, int alState, bool abEffects);<br />
void SetLeverStuckState(string& asName, int alState, bool abEffects);<br />
</syntaxhighlight><br />
<br />
Makes a prop<nowiki>\</nowiki>wheel<nowiki>\</nowiki>lever stuck in a certain state.<br />
<br />
''asName ''- internal name <br />''alState ''- 0 = not stuck, 1 = at max, -1 = at min <br />''abEffects ''- use effects<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetWheelAngle(string& asName, float afAngle, bool abAutoMove);<br />
</syntaxhighlight><br />
<br />
Moves a wheel to a certain angle.<br />
<br />
''asName ''- internal name <br />''afAngle ''- angle <br />''abAutoMove ''- determines whether the wheel should move on its own<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetWheelInteractionDisablesStuck(string& asName, bool abX);<br />
void SetLeverInteractionDisablesStuck(string& asName, bool abX);<br />
</syntaxhighlight><br />
<br />
Allows the player to make a wheel/lever unstuck when interacted with.<br />
<br />
<syntaxhighlight lang="cpp"><br />
int GetLeverState(string& asName);<br />
</syntaxhighlight><br />
<br />
Returns the state of the lever. <br />0 = not stuck, 1 = at max, -1 = at min<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetMultiSliderStuckState(string& asName, int alStuckState, bool abEffects);<br />
</syntaxhighlight><br />
<br />
Makes a MultiSlider stuck in a certain state.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetMultiSliderCallback(string& asName, string& asCallback);<br />
</syntaxhighlight><br />
<br />
Calls a function when state changes. <br />Callback syntax: <code>void MyFunc(string &in asEntity, int alState)</code><br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetButtonSwitchedOn(string& asName, bool abSwitchedOn, bool abEffects);<br />
</syntaxhighlight><br />
<br />
====Sticky areas====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetAllowStickyAreaAttachment(bool abX);<br />
</syntaxhighlight><br />
<br />
Allows entites to stick to a StickyArea.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AttachPropToStickyArea(string& asAreaName, string& asProp);<br />
void AttachBodyToStickyArea(string& asAreaName, string& asBody);<br />
</syntaxhighlight><br />
<br />
Attaches a prop/body to a StickyArea.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void DetachFromStickyArea(string& asAreaName);<br />
</syntaxhighlight><br />
<br />
Detaches everything from a StickyArea.<br />
<br />
====Enemies====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetNPCAwake(string& asName, bool abAwake, bool abEffects);<br />
</syntaxhighlight><br />
<br />
Activates the npc<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetNPCFollowPlayer(string& asName, bool abX);<br />
</syntaxhighlight><br />
<br />
Sets an NPC's head to follow the player's movement's.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetEnemyDisabled(string& asName, bool abDisabled);<br />
</syntaxhighlight><br />
<br />
Disables an enemy.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetEnemyIsHallucination(string& asName, bool abX);<br />
</syntaxhighlight><br />
<br />
Makes an enemy a hallucination. Hallucinations fade to smoke when they get near the player.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void FadeEnemyToSmoke(string& asName, bool abPlaySound);<br />
</syntaxhighlight><br />
<br />
Instantly fades an enemy to smoke.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void ShowEnemyPlayerPosition(string& asName);<br />
</syntaxhighlight><br />
<br />
Makes the enemy run to the player, no matter where he is.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AlertEnemyOfPlayerPresence(string &in asName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Gives the specified enemy the player's current position and makes it search the area.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetEnemyDisableTriggers(string& asName, bool abX);<br />
</syntaxhighlight><br />
<br />
Enables or disables enemy triggers. If disabled, enemy will not react to player or attack.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AddEnemyPatrolNode(string& asName, string& asNodeName, float afWaitTime, string& asAnimation);<br />
</syntaxhighlight><br />
<br />
Adds a patrol node to the enemy's path.<br />
<br />
''asName ''- internal name of the enemy <br />''asNodeName ''- path node <br />''afWaitTime ''- time in seconds that the enemy waits at the path node before continuing <br />''asAnimation ''- the animation the enemy uses when reaching the path node<br />
<br />
<syntaxhighlight lang="cpp"><br />
void ClearEnemyPatrolNodes(string& asEnemyName);<br />
</syntaxhighlight><br />
<br />
Clears the current path of patrol nodes of the enemy.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetEnemySanityDecreaseActive(string &in asName, bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables whether an enemy activates the player's sanity drain when stared at.<br />
<br />
''asName ''- Internal name of the enemy <br />''abX ''- Enabled/disabled<br />
<br />
<syntaxhighlight lang="cpp"><br />
void TeleportEnemyToNode(string &in asEnemyName, string &in asNodeName, bool abChangeY);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Teleports an enemy to a specific PathNode.<br />
<br />
''asEnemyName ''- Internal name of the enemy <br />''asNodeName ''- Internal name of the node to teleport to <br />''abChangeY ''- Whether the Y position of the node will be used when teleporting the enemy<br />
<br />
<syntaxhighlight lang="cpp"><br />
void TeleportEnemyToEntity(string &in asEnemyName, string &in asTargetEntity, string &in asTargetBody, bool abChangeY);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Teleports an enemy to a specific entity.<br />
<br />
''asEnemyName ''- Internal name of the enemy <br />''asTargetEntity ''- Internal name of the entity to teleport to <br />''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) <br />''abChangeY ''- Whether the Y position of the node will be used when teleporting the enemy<br />
<br />
<syntaxhighlight lang="c"><br />
void ChangeManPigPose(string&in asName, string&in asPoseType);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Changes the pose a specified ManPig.<br />
<br />
''asName ''- Internal name of the enemy <br />''asPoseType''- Name of the ManPig pose to use. Can be "Biped" or "Quadruped"<br />
<br />
<syntaxhighlight lang="c"><br />
void SetTeslaPigFadeDisabled(string&in asName, bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables whether a specified TeslaPig should fade the player's view in and out.<br />
<br />
''asName ''- Internal name of the enemy <br />''abX''- Enabled/disabled<br />
<br />
<syntaxhighlight lang="c"><br />
void SetTeslaPigSoundDisabled(string&in asName, bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables whether a specified TeslaPig should play the proximity sounds.<br />
<br />
''asName ''- Internal name of the enemy <br />''abX''- Enabled/disabled<br />
<br />
<syntaxhighlight lang="c"><br />
void SetTeslaPigEasyEscapeDisabled(string&in asName, bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables whether a specified TeslaPig should be easier to escape from when hunted.<br />
<br />
''asName ''- Internal name of the enemy <br />''abX''- Enabled/disabled<br />
<br />
<syntaxhighlight lang="c"><br />
void ForceTeslaPigSighting(string&in asName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Forces a TeslaPig to be visible for a short time.<br />
<br />
''asName ''- Internal name of the enemy<br />
<br />
<syntaxhighlight lang="c"><br />
string& GetEnemyStateName(string &in asName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the name of the state a specified enemy is current in. States can be Hunt, Search, Patrol, Wait, Alert, Investigate, Track and BreakDoor.<br />
<br />
''asName ''- Internal name of the enemy</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/menu.cfg&diff=6441HPL2/menu.cfg2023-08-28T13:14:02Z<p>Mudbill: Added TopMenuFontColor and TopMenuFontHighlightColor</p>
<hr />
<div>{{DISPLAYTITLE:menu.cfg}}<br />
{{TocRight}}<br />
<br />
== General ==<br />
<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|TextDuration_StartTime||Text duration start time<br />
|-<br />
|TextDuration_MinTime||Text duration minimal time<br />
|-<br />
|TextDuration_CharTime||Text duration character time<br />
|}<br />
<br />
== Main ==<br />
<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|MainFadeInTime||Fade-in time<br />
|-<br />
|MainFadeOutTimeFast||Fade-out time when fast<br />
|-<br />
|MainFadeOutTimeSlow||Fade-out time when slow<br />
|-<br />
|TopMenuFadeInTime||Main menu fade-in time<br />
|-<br />
|TopMenuFadeOutTime||Main menu fade-out time<br />
|-<br />
|TopMenuFontRelativeSize||Main menu font size<br />
|-<br />
|TopMenuStartRelativePos||Main menu relative position<br />
|-<br />
|TopMenuStartRelativePosInGame||Main menu relative position in game<br />
|-<br />
|TopMenuFont||Main menu font<br />
|-<br />
|TopMenuFontColor||Text color for menu items<br />
|-<br />
|TopMenuFontHighlightColor||Hover text color for menu items<br />
|-<br />
|MainMenuLogoStartRelativePos||Main menu logo start relative position<br />
|-<br />
|MainMenuLogoRelativeSize||Main menu logo relative size<br />
|-<br />
|BGScene||Menu background map file<br />
|-<br />
|BGCamera_FOV||Background camera start face-of-view<br />
|-<br />
|BGCamera_ZoomedFOV||Background camera zoomed face-of-view<br />
|-<br />
|ZoomSound||Sound played when the game is loaded<br />
|-<br />
|Music||Music that will be played in main menu<br />
|-<br />
|}<br />
<br />
<br />
== Options ==<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|ShowCommentary||Commentary-mod setting<br />
|-<br />
|}<br />
<br />
== Credits ==<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|NormalFont||Main text font name<br />
|-<br />
|HeaderFont||Header font name<br />
|-<br />
|NormalFontSize||Main text font size<br />
|-<br />
|HeaderFontSize||Header font size<br />
|-<br />
|TheEndFontSize||"The End" text font size<br />
|-<br />
|ScrollSpeed||Speed of scroll<br />
|-<br />
|FadeSpeed||Speed of fade<br />
|-<br />
|}<br />
<br />
== Profiles ==<br />
<br />
<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|WindowSize||Profiles window size<br />
|-<br />
|InformationWidth||Information width<br />
|-<br />
|ListFontSize||List font size<br />
|-<br />
|EnterNameWindowSize||Enter name window size<br />
|-<br />
|EnterNameButtonLength||Enter name button length<br />
|-<br />
|}<br />
<br />
== Inventory ==<br />
<br />
<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|FadeInTime||Inv fade-in time<br />
|-<br />
|FadeOutTime||Inv fade-out time<br />
|-<br />
|DefaultFont||Inv default font<br />
|-<br />
|HeaderFont||Inv Header font<br />
|-<br />
|PopUpMessageCenter||Inv pop-up messages center<br />
|-<br />
|SlotImage||Inv slot image<br />
|-<br />
|SlotColor||Inv slot color<br />
|-<br />
|SlotSize||Inv slot size<br />
|-<br />
|SlotMouseOverImage||Inv slot mouse over image<br />
|-<br />
|SlotMouseOverColor||Inv slot mouse over color<br />
|-<br />
|SlotMouseOverOffset||Inv slot mouse over offset<br />
|-<br />
|SlotPulsatingMin||Inv slot pulsating minimal<br />
|-<br />
|SlotPulsatingAmp||Inv slot pulsating amplitude<br />
|-<br />
|SlotPulsatingFreq||Inv pulsating frequency<br />
|-<br />
|SlotsRows||Inv slots rows<br />
|-<br />
|SlotsColumns||Inv slots columns<br />
|-<br />
|SlotsStart||Inv slots start<br />
|-<br />
|SlotsSeparation||Inv slots separation<br />
|-<br />
|SlotsGridColor||Inv slots grid color<br />
|-<br />
|SlotsDrawGrid||Inv slots draw grid<br />
|-<br />
|SlotsDrawFrame||Inv slots draw frame<br />
|-<br />
|SlotsFrameSize||Inv slots frame size<br />
|-<br />
|SlotsFrameHPadding||Inv slots frame horizontal-padding<br />
|-<br />
|SlotsFrameVPadding||Inv slots frame vertical-padding<br />
|-<br />
|SlotsFrameOffset||Inv slots frame offset<br />
|-<br />
|SlotsGridHExtension||Inv slots grid horizontal-extension<br />
|-<br />
|SlotsGridVExtension||Inv slots grid vertical-extension<br />
|-<br />
|SlotsGridOffset||Inv slots grid offset<br />
|-<br />
|HealthCenter||Inv health center<br />
|-<br />
|HealthLabelCenter||Inv health label center<br />
|-<br />
|HealthFrameSize||Inv health grame size<br />
|-<br />
|HealthFrameHPadding||Inv health frame horizontal-padding<br />
|-<br />
|HealthFrameVPadding||Inv health frame vertical-padding<br />
|-<br />
|HealthFrameOffset||Inv health frame offset<br />
|-<br />
|SanityCenter||Inv sanity center<br />
|-<br />
|SanityLabelCenter||Inv sanity label center<br />
|-<br />
|SanityFrameSize||Inv sanity frame size<br />
|-<br />
|SanityFrameHPadding||Inv sanity frame horizontal-padding<br />
|-<br />
|SanityFrameVPadding||Inv frame vertical-padding<br />
|-<br />
|SanityFrameOffset||Inv sanity frame offset<br />
|-<br />
|TinderboxesCenter||Inv tinderboxes center<br />
|-<br />
|TinderboxesLabelCenter||Inv tinderboxes label center<br />
|-<br />
|TinderboxesFrameSize||Inv tinderboxes frame size<br />
|-<br />
|TinderboxesFrameHPadding||Inv tinderboxes frame horizontal-padding<br />
|-<br />
|TinderboxesFrameVPadding||Inv tinderboxes frame vertical-padding<br />
|-<br />
|TinderboxesFrameOffset||Inv tinderboxes frame offset<br />
|-<br />
|OilCenter||Inv oil center<br />
|-<br />
|OilLabelCenter||Inv oil label center<br />
|-<br />
|OilFrameSize||Inv oil frame size<br />
|-<br />
|OilFrameHPadding||Inv oil frame horizontal-padding<br />
|-<br />
|OilFrameVPadding||Inv oil frame vertical-padding<br />
|-<br />
|OilFrameOffset||Inv oil frame offset<br />
|-<br />
|JournalCenter||Inv journal center<br />
|-<br />
|JournalLabelCenter||Inv journal label center<br />
|-<br />
|JournalFrameSize||Inv journal frame size<br />
|-<br />
|JournalFrameHPadding||Inv journal frame horizontal-padding<br />
|-<br />
|JournalFrameVPadding||Inv journal frame vertical-padding<br />
|-<br />
|JournalFrameOffset||Inv journal frame offset<br />
|-<br />
|ItemHeaderCenter||Inv item-header center<br />
|-<br />
|ItemDescCenter||Inv item-description center<br />
|-<br />
|ItemTextFrameSize||Inv item-text frame size<br />
|-<br />
|ItemTextFrameHPadding||Inv item-text frame horizontal-padding<br />
|-<br />
|ItemTextFrameVPadding||Inv item-text frame vertical-padding<br />
|-<br />
|ItemTextFrameOffset||Inv item-text frame offset<br />
|-<br />
|ItemDescTextWidth||Inv item-desc text width<br />
|-<br />
|ItemCountOffset||Inv item-count offset<br />
|-<br />
|FontSize_ItemCount||Inv font-size of item-count<br />
|-<br />
|FontSize_Label||Inv font-size of label<br />
|-<br />
|FontSize_Header||Inv font-size of header<br />
|-<br />
|FontSize_Description||Inv font-size of description<br />
|-<br />
|FontSize_Message||Inv font-size of message<br />
|-<br />
|}<br />
<br />
== CompletionCounter ==<br />
<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|DefaultFont||Default font of completion counter<br />
|-<br />
|}<br />
<br />
== Messages ==<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|QuestAddedIcon||Icon that will be shown when new quest will be added<br />
|-<br />
|QuestAddedSound||Sound of quest-addition<br />
|-<br />
|GameMessageFontSize||Message font size<br />
|-<br />
|}<br />
<br />
== Hints ==<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|DefaultFont||Default hints font<br />
|-<br />
|YPos||The Y-position of hints<br />
|-<br />
|FontSize||Hints font size<br />
|-<br />
|TextDurationMul||Hints text duration<br />
|-<br />
|}<br />
<br />
== Journal ==<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|DefaultFont||Default journal font<br />
|-<br />
|MenuFont||Journal menu font<br />
|-<br />
|NoteTextWidth||Note text width<br />
|-<br />
|NoteMaxPageRows||Note max page rows<br />
|-<br />
|NoteFontSize||Note font size<br />
|-<br />
|NoteRowDist||Note row distantion<br />
|-<br />
|NoteHeaderFontSize||Note header font size<br />
|-<br />
|NoteTextStartY||Note text start y-position<br />
|-<br />
|}<br />
<br />
== LoadScreen ==<br />
<br />
<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|DefaultFont||Default font in loading screen<br />
|-<br />
|LoadingFontSize||Loading text size<br />
|-<br />
|TextFontSize||Loading text size<br />
|-<br />
|LoadingY||Loading text y-position<br />
|-<br />
|TextWithImageY||Text with image y-position<br />
|-<br />
|TextAloneY||Loading text y-position(without image)<br />
|-<br />
|ImageY||Image y-position<br />
|-<br />
|TextMaxWidth||Max text width<br />
|-<br />
|FadeOutTime||Screen fade-out time<br />
|-<br />
|TextDurationMul||Text duration<br />
|-<br />
|}</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/TDD/Change_Custom_Story_into_Full_Conversion_Mod&diff=6439HPL2/TDD/Change Custom Story into Full Conversion Mod2023-07-27T08:25:22Z<p>Mudbill: Add note about relative paths</p>
<hr />
<div>{{constructionNotice|This page is still being written and is currently incomplete}}<br />
<br />
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.<br />
<br />
<br />
<br />
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:<syntaxhighlight lang="xml"><br />
<Main<br />
Name = "My story"<br />
Author = "Me"<br />
<br />
...<br />
<br />
InitCfgFile = "config/main_init.cfg"<br />
/><br />
</syntaxhighlight>Specifying this field will disable <code>MapsFolder</code>, <code>StartMap</code> and <code>StartPos</code>, as these fields will instead be read from the main_init.cfg file. It will also disable <code>ExtraLangFilePrefix</code> and <code>DefaultExtraLangFile</code>, as the game will instead use the primary lang files specified in main_init.cfg.<br />
<br />
<br />
<br />
From this point on, you can follow tutorials for full conversion mods. Your mod folder will remain <code>custom_stories/<your story></code>. For example, if your story folder is named "Ascent", your main init file should exist at <code>custom_stories/Ascent/config/main_init.cfg</code> (reflecting what you put in the <code>InitCfgFile</code> above). Create the "config" folder and the "main_init.cfg" file. The contents of your main_init.cfg file can start as such (Remember to change the references to "Ascent" to reflect your own mod, such as MainSaveFolder and GameName):<syntaxhighlight lang="xml"><br />
<ConfigFiles<br />
Resources = "resources.cfg"<br />
Materials = "materials.cfg"<br />
<br />
Game = "config/game.cfg"<br />
Menu = "config/menu.cfg"<br />
PreMenu = "config/pre_menu.cfg"<br />
Demo = "config/demo.cfg"<br />
<br />
DefaultMainSettings = "config/default_main_settings.cfg"<br />
DefaultMainSettingsSDL2 = "config/default_main_settings_sdl2.cfg"<br />
<br />
DefaultMainSettingsLow = "launcher/default_main_settings_low.cfg"<br />
DefaultMainSettingsMedium = "launcher/default_main_settings_medium.cfg"<br />
DefaultMainSettingsHigh = "launcher/default_main_settings_high.cfg"<br />
<br />
DefaultUserSettings = "config/default_user_settings.cfg"<br />
DefaultUserKeys = "config/default_user_keys.cfg"<br />
DefaultUserKeysSDL2 = "config/default_user_keys_sdl2.cfg"<br />
<br />
DefaultBaseLanguage = "base_english.lang"<br />
DefaultGameLanguage = "english.lang"<br />
/><br />
<br />
<Directories<br />
MainSaveFolder = "Ascent"<br />
<br />
BaseLanguageFolder = "config/"<br />
GameLanguageFolder = "config/lang_main/"<br />
<br />
CustomStoryPath = "custom_stories"<br />
/><br />
<br />
<Variables<br />
GameName = "Ascent, an Amnesia mod"<br />
/><br />
<br />
<StartMap<br />
File = "level_01.map"<br />
Folder = "maps/"<br />
Pos = "PlayerStartArea_1"<br />
/><br />
</syntaxhighlight>Note: Paths specified in this file are relative paths starting from the custom story's main folder, eg: "custom_stories/Ascent". Leaving Resources as "resources.cfg" means it should exist at "custom_stories/Ascent/resources.cfg". If a file is not found here, it will fall back to using the game root folder as the starting point (needs confirmation).</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/TDD/Change_Custom_Story_into_Full_Conversion_Mod&diff=6438HPL2/TDD/Change Custom Story into Full Conversion Mod2023-07-27T08:20:57Z<p>Mudbill: Added main_init.cfg contents</p>
<hr />
<div>{{constructionNotice|This page is still being written and is currently incomplete}}<br />
<br />
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.<br />
<br />
<br />
<br />
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:<syntaxhighlight lang="xml"><br />
<Main<br />
Name = "My story"<br />
Author = "Me"<br />
<br />
...<br />
<br />
InitCfgFile = "config/main_init.cfg"<br />
/><br />
</syntaxhighlight>Specifying this field will disable <code>MapsFolder</code>, <code>StartMap</code> and <code>StartPos</code>, as these fields will instead be read from the main_init.cfg file. It will also disable <code>ExtraLangFilePrefix</code> and <code>DefaultExtraLangFile</code>, as the game will instead use the primary lang files specified in main_init.cfg.<br />
<br />
<br />
<br />
From this point on, you can follow tutorials for full conversion mods. Your mod folder will remain <code>custom_stories/<your story></code>. For example, if your story folder is named "Ascent", your main init file should exist at <code>custom_stories/Ascent/config/main_init.cfg</code> (reflecting what you put in the <code>InitCfgFile</code> above). Create the "config" folder and the "main_init.cfg" file. The contents of your main_init.cfg file can start as such (Remember to change the references to "Ascent" to reflect your own mod, such as MainSaveFolder and GameName):<syntaxhighlight lang="xml"><br />
<ConfigFiles<br />
Resources = "resources.cfg"<br />
Materials = "materials.cfg"<br />
<br />
Game = "config/game.cfg"<br />
Menu = "config/menu.cfg"<br />
PreMenu = "config/pre_menu.cfg"<br />
Demo = "config/demo.cfg"<br />
<br />
DefaultMainSettings = "config/default_main_settings.cfg"<br />
DefaultMainSettingsSDL2 = "config/default_main_settings_sdl2.cfg"<br />
<br />
DefaultMainSettingsLow = "launcher/default_main_settings_low.cfg"<br />
DefaultMainSettingsMedium = "launcher/default_main_settings_medium.cfg"<br />
DefaultMainSettingsHigh = "launcher/default_main_settings_high.cfg"<br />
<br />
DefaultUserSettings = "config/default_user_settings.cfg"<br />
DefaultUserKeys = "config/default_user_keys.cfg"<br />
DefaultUserKeysSDL2 = "config/default_user_keys_sdl2.cfg"<br />
<br />
DefaultBaseLanguage = "base_english.lang"<br />
DefaultGameLanguage = "english.lang"<br />
/><br />
<br />
<Directories<br />
MainSaveFolder = "Ascent"<br />
<br />
BaseLanguageFolder = "config/"<br />
GameLanguageFolder = "config/lang_main/"<br />
<br />
CustomStoryPath = "custom_stories"<br />
/><br />
<br />
<Variables<br />
GameName = "Ascent, an Amnesia mod"<br />
/><br />
<br />
<StartMap<br />
File = "level_01.map"<br />
Folder = "maps/"<br />
Pos = "PlayerStartArea_1"<br />
/><br />
</syntaxhighlight></div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/TDD/Change_Custom_Story_into_Full_Conversion_Mod&diff=6434HPL2/TDD/Change Custom Story into Full Conversion Mod2023-07-24T16:41:15Z<p>Mudbill: </p>
<hr />
<div>{{constructionNotice|This page is still being written and is currently incomplete}}<br />
<br />
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.<br />
<br />
<br />
<br />
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:<syntaxhighlight lang="xml"><br />
<Main<br />
Name = "My story"<br />
Author = "Me"<br />
<br />
...<br />
<br />
InitCfgFile = "config/main_init.cfg"<br />
/><br />
</syntaxhighlight>Specifying this field will disable <code>MapsFolder</code>, <code>StartMap</code> and <code>StartPos</code>, as these fields will instead be read from the main_init.cfg file. It will also disable <code>ExtraLangFilePrefix</code> and <code>DefaultExtraLangFile</code>, as the game will instead use the primary lang files specified in main_init.cfg.<br />
<br />
<br />
<br />
From this point on, you can follow tutorials for full conversion mods. Your mod folder will remain <code>custom_stories/<your story></code>. For example, if your story folder is named "Ascent", your main init file should exist at <code>custom_stories/Ascent/config/main_init.cfg</code> (reflecting what you put in the <code>InitCfgFile</code> above). Create the "config" folder and the "main_init.cfg" file. The contents of your main_init.cfg file can start as such:<syntaxhighlight lang="xml"><br />
<Directories<br />
<br />
/><br />
<br />
<Variables<br />
<br />
/><br />
<br />
<StartMap<br />
<br />
/><br />
</syntaxhighlight></div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/TDD/Change_Custom_Story_into_Full_Conversion_Mod&diff=6433HPL2/TDD/Change Custom Story into Full Conversion Mod2023-07-24T16:39:36Z<p>Mudbill: Added notice</p>
<hr />
<div>{{constructionNotice|This page is still being written and is currently incomplete}}<br />
<br />
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.<br />
<br />
<br />
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:<syntaxhighlight lang="xml"><br />
<Main<br />
Name = "My story"<br />
Author = "Me"<br />
<br />
...<br />
<br />
InitCfgFile = "config/main_init.cfg"<br />
/><br />
</syntaxhighlight>Specifying this field will disable <code>MapsFolder</code>, <code>StartMap</code> and <code>StartPos</code>, as these fields will instead be read from the main_init.cfg file. It will also disable <code>ExtraLangFilePrefix</code> and <code>DefaultExtraLangFile</code>, as the game will instead use the primary lang files specified in main_init.cfg.<br />
<br />
<br />
From this point on, you can follow tutorials for full conversion mods. Your mod folder will remain <code>custom_stories/<your story></code>. For example, if your story folder is named "Ascent", your main init file should exist at <code>custom_stories/Ascent/config/main_init.cfg</code> (reflecting what you put in the <code>InitCfgFile</code> above. Create the "config" folder and the "main_init.cfg" file. The contents of your main_init.cfg file can start as such:<syntaxhighlight lang="xml"><br />
<Directories<br />
<br />
/><br />
<br />
<Variables<br />
<br />
/><br />
<br />
<StartMap<br />
<br />
/><br />
</syntaxhighlight></div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/TDD/Change_Custom_Story_into_Full_Conversion_Mod&diff=6432HPL2/TDD/Change Custom Story into Full Conversion Mod2023-07-24T16:37:39Z<p>Mudbill: Began page describing the process of transforming an existing custom story into a mod.</p>
<hr />
<div>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.<br />
<br />
<br />
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:<syntaxhighlight lang="xml"><br />
<Main<br />
Name = "My story"<br />
Author = "Me"<br />
<br />
...<br />
<br />
InitCfgFile = "config/main_init.cfg"<br />
/><br />
</syntaxhighlight>Specifying this field will disable <code>MapsFolder</code>, <code>StartMap</code> and <code>StartPos</code>, as these fields will instead be read from the main_init.cfg file. It will also disable <code>ExtraLangFilePrefix</code> and <code>DefaultExtraLangFile</code>, as the game will instead use the primary lang files specified in main_init.cfg.<br />
<br />
<br />
From this point on, you can follow tutorials for full conversion mods. Your mod folder will remain <code>custom_stories/<your story></code>. For example, if your story folder is named "Ascent", your main init file should exist at <code>custom_stories/Ascent/config/main_init.cfg</code> (reflecting what you put in the <code>InitCfgFile</code> above. Create the "config" folder and the "main_init.cfg" file. The contents of your main_init.cfg file can start as such:<syntaxhighlight lang="xml"><br />
<Directories<br />
<br />
/><br />
<br />
<Variables<br />
<br />
/><br />
<br />
<StartMap<br />
<br />
/><br />
</syntaxhighlight></div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/custom_story_settings.cfg&diff=6431HPL2/custom story settings.cfg2023-07-24T15:10:00Z<p>Mudbill: Added the new InitCfgFile field</p>
<hr />
<div>{{DISPLAYTITLE:custom_story_settings.cfg}}<br />
<br />
This file is used to configure a custom story, and is found in the root of the custom story, residing inside a subfolder of <code>/custom_stories</code> in the Amnesia folder. This file only applies to TDD, not AMFP. Below are all configurable fields for this file and what each does. All of the fields are XML attributes applied to an element named <code>Main</code>.<br />
<br />
{| class="wikitable"<br />
!Field name<br />
!Description<br />
|-<br />
|Name<br />
|The name of your custom story as it will appear in the game menu.<br />
|-<br />
|Author<br />
|Your name which appears under the title.<br />
|-<br />
|ImgFile<br />
|The name of an image file to use as the background image in the game menu.<br />
|-<br />
|MapsFolder<br />
|The folder where your levels are loaded from. Recommended to keep as "maps/".<br />
|-<br />
|StartMap<br />
|The name of the first level that is loaded upon clicking "Start new game" in the main menu.<br />
|-<br />
|StartPos<br />
|The internal name of a PlayerStart type area within the above level. If empty or not matching, the game will use the first alphabetical start area.<br />
|-<br />
|ExtraLangFilePrefix<br />
|A prefix applied to all language files that this story uses. If unspecified, it falls back to the default "extra_". This field can include forward slashes to represent folders.<br />
|-<br />
|DefaultExtraLangFile<br />
|The default language file to load. This is appended to the above prefix, making the default language file "extra_english.lang".<br />
|-<br />
|InitCfgFile<br />
|A relative path to a main_init.cfg file. Specifying this field transforms the custom story into a full conversion mod. (Coming soon)<br />
|}</div>Mudbillhttps://wiki.frictionalgames.com/page?title=Notepad%2B%2B&diff=6320Notepad++2023-02-09T08:15:31Z<p>Mudbill: Same as previous but for 1 more link</p>
<hr />
<div>=Notepad++=<br />
<br />
[http://notepad-plus.sourceforge.net Notepad++] is a text editor with a ton of features useful when writing scripts for the HPL2 engine. Syntax colouring, auto-complete, call tips and so on and on. While it supports many different languages it does not, for obvious reasons, know much about our script functions. Here is a quick how-to for setting up Notepad++ so that it can auto-complete, give tips and give code snippets for .hps files.<br />
<br />
==Notepad++ Setup==<br />
<br />
##Download [http://notepad-plus-plus.org/ Notepad++]<br />
##Settings menu - Preferences - File Association -> customize add a .hps to registered exts<br />
##Settings menu - Preferences - Backup/AutoCompletion -> Enable Function Completion and Function Parameters Hint on input.<br />
##Download [https://oldwiki.frictionalgames.com/_media/hpl2/third_party_tools/text/userdefinelang.zip userdefinelang.zip], unzip and go to Language - Define your dialogue -> Import unzipped file "userDefineLang.XML"<br />
##Download [https://oldwiki.frictionalgames.com/_media/hpl2/third_party_tools/text/hps.zip hps.zip], unzip and go to Program Files<nowiki>\</nowiki>Notepad++<nowiki>\</nowiki>plugins<nowiki>\</nowiki>APIs and put hps.xml here.<br />
<br />
<br />
{{bug|Notepad++ still isnt showing you colors for syntaxes and similar things. <br/>Fix: Hit __LANGUAGE__ and select at the bottom: HPS}}<br />
===Notepad++ will now be able to===<br />
<br />
''' .hps script files should have the text colourized properly when you open them.'''<br />
''' Suggest functions, callbacks and other specific words when you begin to type, '''pressing enter''' completes the word. The suggestion window can be shown manually using '''ctrl-space'''.'''<br />
''' When re-typing a custom word, say "bMyBool", pressing '''ctrl-return''' will suggest auto-completions for words found in the current .hps file you are editing.'''<br />
''' Give a description of variables needed for functions and what type of variable it returns, if any. For example, type "AddTimer(" and it will show the variables needed. This can also be brought up if pressing '''ctrl-shift-space''' when in a function.'''<br />
<br />
==QuickText==<br />
<br />
With this plugin you can extend functionality further. If you write a function then press '''ctrl-shift-return''' and it will auto-write a whole code snippet.<br />
<br />
##Using the Plugins menu in Notepad++, start Plugin Manager, in the available tab, select QuickText and install. Might have to [http://sourceforge.net/tracker/download.php?group_id=183263&atid=904542&file_id=375790&aid=3009773 download manually] instead.<br />
##By default QuickText uses '''ctrl-return''', this collides with a Notepad++ shortcut and does not work. Use Settings → Shortcut Mapper … → Plugin Commands and change this to '''ctrl-shift-return''', on line 202.<br />
##Download [https://oldwiki.frictionalgames.com/_media/hpl2/third_party_tools/text/quicktext.zip quicktext.zip], unzip and open in Notepad++, copy its content.<br />
##Open the file Notepad++/plugins/Config/QuickText.ini in Notepad++ and locate the row with [15], select it and paste the content from the previous step to replace and insert our HPL defined quicktext settings.<br />
##Close and start Notepad++ to activate it's functionality.<br />
<br />
===With QuickText Notepad++ will now be able to===<br />
<br />
''' Write a function name and press '''ctrl-shift-return''' and the rest of the function should auto-complete, for each following '''ctrl-shift-return''' you should move through the different places. For example type “for” then press '''ctrl-shift-return''', it should do:'''<br />
<br />
<pre><br />
for(X;X;X){<br />
X<br />
}<br />
X<br />
</pre><br />
<br />
Then for each '''ctrl-shift-return''' the cursor should jump to the X positions (they are not visible, only to show locations in example). There are also extra function auto-completes, for example add an s after for or if to make it a single line without the {}.<br />
<br />
That's it, code snippets and function lists can be extended further of course by the user if wanted! '''Take note that QuickText can be a little buggy, for example the ctrl-shift-return to jump inside a function does not work reliable with all functions.'''</div>Mudbillhttps://wiki.frictionalgames.com/page?title=Notepad%2B%2B&diff=6319Notepad++2023-02-09T08:14:48Z<p>Mudbill: Update download links to point to the files on oldwiki</p>
<hr />
<div>=Notepad++=<br />
<br />
[http://notepad-plus.sourceforge.net Notepad++] is a text editor with a ton of features useful when writing scripts for the HPL2 engine. Syntax colouring, auto-complete, call tips and so on and on. While it supports many different languages it does not, for obvious reasons, know much about our script functions. Here is a quick how-to for setting up Notepad++ so that it can auto-complete, give tips and give code snippets for .hps files.<br />
<br />
==Notepad++ Setup==<br />
<br />
##Download [http://notepad-plus-plus.org/ Notepad++]<br />
##Settings menu - Preferences - File Association -> customize add a .hps to registered exts<br />
##Settings menu - Preferences - Backup/AutoCompletion -> Enable Function Completion and Function Parameters Hint on input.<br />
##Download [https://oldwiki.frictionalgames.com/_media/hpl2/third_party_tools/text/userdefinelang.zip userdefinelang.zip], unzip and go to Language - Define your dialogue -> Import unzipped file "userDefineLang.XML"<br />
##Download [https://oldwiki.frictionalgames.com/_media/hpl2/third_party_tools/text/hps.zip hps.zip], unzip and go to Program Files<nowiki>\</nowiki>Notepad++<nowiki>\</nowiki>plugins<nowiki>\</nowiki>APIs and put hps.xml here.<br />
<br />
<br />
{{bug|Notepad++ still isnt showing you colors for syntaxes and similar things. <br/>Fix: Hit __LANGUAGE__ and select at the bottom: HPS}}<br />
===Notepad++ will now be able to===<br />
<br />
''' .hps script files should have the text colourized properly when you open them.'''<br />
''' Suggest functions, callbacks and other specific words when you begin to type, '''pressing enter''' completes the word. The suggestion window can be shown manually using '''ctrl-space'''.'''<br />
''' When re-typing a custom word, say "bMyBool", pressing '''ctrl-return''' will suggest auto-completions for words found in the current .hps file you are editing.'''<br />
''' Give a description of variables needed for functions and what type of variable it returns, if any. For example, type "AddTimer(" and it will show the variables needed. This can also be brought up if pressing '''ctrl-shift-space''' when in a function.'''<br />
<br />
==QuickText==<br />
<br />
With this plugin you can extend functionality further. If you write a function then press '''ctrl-shift-return''' and it will auto-write a whole code snippet.<br />
<br />
##Using the Plugins menu in Notepad++, start Plugin Manager, in the available tab, select QuickText and install. Might have to [http://sourceforge.net/tracker/download.php?group_id=183263&atid=904542&file_id=375790&aid=3009773 download manually] instead.<br />
##By default QuickText uses '''ctrl-return''', this collides with a Notepad++ shortcut and does not work. Use Settings → Shortcut Mapper … → Plugin Commands and change this to '''ctrl-shift-return''', on line 202.<br />
##Download [[:hpl2:third_party_tools:text:quicktext.zip|quicktext.zip]], unzip and open in Notepad++, copy its content.<br />
##Open the file Notepad++/plugins/Config/QuickText.ini in Notepad++ and locate the row with [15], select it and paste the content from the previous step to replace and insert our HPL defined quicktext settings.<br />
##Close and start Notepad++ to activate it's functionality.<br />
<br />
===With QuickText Notepad++ will now be able to===<br />
<br />
''' Write a function name and press '''ctrl-shift-return''' and the rest of the function should auto-complete, for each following '''ctrl-shift-return''' you should move through the different places. For example type “for” then press '''ctrl-shift-return''', it should do:'''<br />
<br />
<pre><br />
for(X;X;X){<br />
X<br />
}<br />
X<br />
</pre><br />
<br />
Then for each '''ctrl-shift-return''' the cursor should jump to the X positions (they are not visible, only to show locations in example). There are also extra function auto-completes, for example add an s after for or if to make it a single line without the {}.<br />
<br />
That's it, code snippets and function lists can be extended further of course by the user if wanted! '''Take note that QuickText can be a little buggy, for example the ctrl-shift-return to jump inside a function does not work reliable with all functions.'''</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/Engine_Scripts&diff=6300HPL2/Engine Scripts2021-11-24T21:17:02Z<p>Mudbill: Fixed a broken description for GiveItem</p>
<hr />
<div>{{TocRight}}<br />
<br />
This page documents all scripts available in Amnesia: The Dark Descent.<br />
<br />
{{note|'''Note''': Some of the functions require the Amnesia 1.3 update. Steam and other online store copies should be automatically updated. Other copies can get it [http://www.frictionalgames.com/forum/thread-24334.html here].}}<br />
<br />
==Engine scripts==<br />
===Main===<br />
<br />
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.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void OnStart();<br />
</syntaxhighlight><br />
<br />
The function that runs when the map is loaded for the first time.<br />
<br />
<syntaxhighlight lang="c++"><br />
void OnEnter();<br />
</syntaxhighlight><br />
<br />
The function that runs whenever the player enters a map.<br />
<br />
<syntaxhighlight lang="c++"><br />
void OnLeave();<br />
</syntaxhighlight><br />
<br />
The function that runs when the player leaves a map.<br />
<br />
<syntaxhighlight lang="c++"><br />
void OnGameStart();<br />
</syntaxhighlight><br />
<br />
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").<br />
<br />
===General===<br />
<br />
<syntaxhighlight lang="c++"><br />
float RandFloat(float afMin, float afMax);<br />
</syntaxhighlight><br />
<br />
Generates a random float.<br />
<br />
#''afMin ''- minimum value<br />
#''afMax ''- maximum value<br />
<syntaxhighlight lang="c++"><br />
int RandInt(int alMin, int alMax);<br />
</syntaxhighlight><br />
<br />
Generates a random int. Note: the maximum value is ''inclusive'' - the RandInt() function may return this value.<br />
<br />
#''alMin ''- minimum value<br />
#''alMax ''- maximum value<br />
<syntaxhighlight lang="c++"><br />
bool StringContains(string& asString, string& asSubString);<br />
</syntaxhighlight><br />
<br />
Checks whether a string contains the specified string. <br />Example: searching for "hello" in "hello world" would return '''true'''.<br />
<br />
#''asString ''- the string to check<br />
#''asSubString ''- the string to search for<br />
<syntaxhighlight lang="cpp"><br />
string& StringSub(string& asString, int alStart, int alCount);<br />
</syntaxhighlight><br />
<br />
Returns the substring in a string. <br />Example: in the string "frictional games rocks", using 4 as ''alStart'' and 6 as ''alCount'' would return '''"tional"'''.<br />
<br />
#''asString ''- the string<br />
#''alStart ''- start position in the string<br />
#''alCount ''- amount of characters<br />
<syntaxhighlight lang="c++"><br />
int StringToInt(string&in asString);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
If possible, returns an integer converted from a string, else returns 0.<br />
<br />
#''asString'' - String to convert.<br />
<syntaxhighlight lang="c++"><br />
float StringToFloat(string&in asString);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
If possible, returns a float converted from a string, else returns 0.<br />
<br />
#''asString'' - String to convert.<br />
<syntaxhighlight lang="c++"><br />
bool StringToBool(string&in asString);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
If possible, returns a boolean converted from a string, else returns false.<br />
<br />
#''asString'' - String to convert.<br />
<br />
===Mathematical Operations===<br />
<br />
<syntaxhighlight lang="c++"><br />
float MathSin(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the sine of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathCos(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the cosine of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathTan(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the tangent of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathAsin(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the arc sine of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathAcos(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the arc cosine of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathAtan(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the arc tangent of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathAtan2(float afX, float afY);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Calculates and returns the arc tangent of the specified values.<br />
<br />
#''afX'' - First value to operate.<br />
#''afY'' - Second value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathSqrt(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the square root of the specified value.<br />
<br />
#''afX'' - Value to operate.<br />
<syntaxhighlight lang="c++"><br />
float MathPow(float afBase, float afExp);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the value of afBase raised to the power of afExp.<br />
<br />
#''afBase'' - The base value.<br />
#''afExp'' - Value to calculate the base with.<br />
<syntaxhighlight lang="c++"><br />
float MathMin(float afA, float afB);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the lowest value.<br />
<br />
#''afA'' - First value.<br />
#''afB'' - Second value.<br />
<syntaxhighlight lang="c++"><br />
float MathMax(float afA, float afB);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the highest value.<br />
<br />
#''afA'' - First value.<br />
#''afB'' - Second value.<br />
<syntaxhighlight lang="c++"><br />
float MathClamp(float afX, float afMin, float afMax);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns afX clamped between afMin and afMax. If afX < afMin, returns afMin, and if afX > afMax, returns afMax.<br />
<br />
#''afX'' - The value to clamp.<br />
#''afMin'' - The minimum value to clamp afX with.<br />
#''afMax'' - The maximum value to clamp afX with.<br />
<syntaxhighlight lang="c++"><br />
float MathAbs(float afX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the absolute value.<br />
<br />
#''afX'' - Value to operate.<br />
<br />
===Debugging===<br />
<br />
<syntaxhighlight lang="cpp"><br />
void Print(string& asString);<br />
</syntaxhighlight><br />
<br />
Prints a string to the log file (''hpl.log'').<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddDebugMessage(string& asString, bool abCheckForDuplicates);<br />
</syntaxhighlight><br />
<br />
Prints a string to the debug console.<br />
<br />
#''asString ''- the string to print<br />
#''abCheckForDuplicates ''- if true, the string won't be printed more than once on screen until it disappears<br />
<syntaxhighlight lang="c++"><br />
void ProgLog(string& asLevel, string& asMessage);<br />
</syntaxhighlight><br />
<br />
Prints an entry to the ProgLog (progression log). <br />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. <br /> <br />This function allows to log custom messages.The messages in the ProgLog file are sorted by time elapsed since a map was loaded.<br />
<br />
ProgLog has to be enabled for a player profile in ''user_settings.cfg'' before it starts working.<br />
<br />
#''asLevel ''- can be "Low", "Medium" or "High". It's a tag which appears in each log entry, for event prioritising.<br />
#''asMessage ''- The custom message to be printed to the log.<br />
<syntaxhighlight lang="c++"><br />
bool ScriptDebugOn();<br />
</syntaxhighlight><br />
<br />
Checks whether the debug mode is enabled. <br />See [[HPL2/Development_Environment|"Setting up Development Environment"]] to setup debug mode on your own computer.<br />
<br />
===Variables===<br />
{{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 "for" loop. For variables which need to be saved, use the wrappers as described below.}}<br />
<br />
====Local====<br />
<br />
Local variables can be used throughout the same script file.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetLocalVarInt(string& asName, int alVal);<br />
void AddLocalVarInt(string& asName, int alVal);<br />
int GetLocalVarInt(string& asName);<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLocalVarFloat(string& asName, float afVal);<br />
void AddLocalVarFloat(string& asName, float afVal);<br />
float GetLocalVarFloat(string& asName);<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLocalVarString(string& asName, const string& asVal);<br />
void AddLocalVarString(string& asName, string& asVal);<br />
string& GetLocalVarString(string& asName);<br />
</syntaxhighlight><br />
<br />
====Global====<br />
<br />
Global variables can be used throughout several maps and can be accessed by several script files.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetGlobalVarInt(string& asName, int alVal);<br />
void AddGlobalVarInt(string& asName, int alVal);<br />
int GetGlobalVarInt(string& asName);<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="c++"><br />
void SetGlobalVarFloat(string& asName, float afVal);<br />
void AddGlobalVarFloat(string& asName, float afVal);<br />
float GetGlobalVarFloat(string& asName);<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="c++"><br />
void SetGlobalVarString(string& asName, const string& asVal);<br />
void AddGlobalVarString(string& asName, string& asVal);<br />
string& GetGlobalVarString(string& asName);<br />
</syntaxhighlight><br />
<br />
===Particle Systems===<br />
<br />
<syntaxhighlight lang="c++"><br />
void PreloadParticleSystem(string& asPSFile);<br />
</syntaxhighlight><br />
<br />
Preloads a particle system.<br />
<br />
#''asPSFile'' - The particle system file to load. Extension: .ps<br />
<syntaxhighlight lang="c++"><br />
void CreateParticleSystemAtEntity(string& asPSName, string& asPSFile, string& asEntity, bool abSavePS);<br />
</syntaxhighlight><br />
<br />
Creates a particle system on an entity.<br />
<br />
#''asPSName ''- internal name<br />
#''asPSFile ''- the particle system to use + extension .ps<br />
#''asEntity ''- the entity to create the particle system at<br />
#''abSavePS ''- determines whether a particle system should "remember" its shown/hidden state, so that this state can be restored when the player revisits the level<br />
<syntaxhighlight lang="c++"><br />
void CreateParticleSystemAtEntityExt(string& asPSName, string& asPSFile, string& asEntity, bool abSavePS,<br />
float afR, float afG, float afB, float afA, bool abFadeAtDistance, float afFadeMinEnd, float afFadeMinStart,<br />
float afFadeMaxStart, float afFadeMaxEnd);<br />
</syntaxhighlight><br />
<br />
Creates a particle system on an entity, extended method with more options.<br />
<br />
#''asPSName ''- internal name<br />
#''asPSFile ''- the particle system to use + extension .ps<br />
#''asEntity ''- the entity to create the particle system at<br />
#''abSavePS ''- determines whether a particle system should "remember" its shown/hidden state, so that this state can be restored when the player revisits the level<br />
#''afR ''- red value<br />
#''afG ''- green value<br />
#''afB ''- blue value<br />
#''afA ''- alpha value<br />
#''abFadeAtDistance ''- determines whether a particle system fades from a certain distance on<br />
#''afFadeMinEnd ''- minimum distance at which the particle system stops fading<br />
#''afFadeMinStart ''- minimum distance at which the particle system starts fading<br />
#''afFadeMaxStart ''- maximum distance at which the particle system starts fading<br />
#''afFadeMaxEnd ''- maximum distance at which the particle system stops fading<br />
<syntaxhighlight lang="c++"><br />
void DestroyParticleSystem(string& asName);<br />
</syntaxhighlight><br />
<br />
Destroys a particle system.<br />
<br />
#''asName'' - The internal name of the particle system<br />
<br />
===Sounds & Music===<br />
<br />
<syntaxhighlight lang="c++"><br />
void PreloadSound(string& asSoundFile);<br />
</syntaxhighlight><br />
<br />
Preloads a sound.<br />
<br />
#''asSoundFile'' - The sound file to load. Extension: .snt<br />
<syntaxhighlight lang="c++"><br />
void PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);<br />
</syntaxhighlight><br />
<br />
Creates a sound on an entity.<br />
<br />
#''asSoundName ''- internal name<br />
#''asSoundFile ''- the sound to use + extension .snt<br />
#''asEntity ''- the entity to create the sound at, can be "Player"<br />
#''afFadeTime ''- time in seconds the sound needs to fade. Avoids enemies hearing the sound if afFadeTime is at least 0.1f<br />
#''abSaveSound ''- if ''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''!<br />
<syntaxhighlight lang="c++"><br />
void FadeInSound(string& asSoundName, float afFadeTime, bool abPlayStart);<br />
</syntaxhighlight><br />
<br />
Fades in a sound.<br />
<br />
#''asSoundName ''- internal name<br />
#''afFadeTime ''- time in seconds<br />
#''abPlayStart ''- ?<br />
<syntaxhighlight lang="c++"><br />
void StopSound(string& asSoundName, float afFadeTime);<br />
</syntaxhighlight><br />
<br />
Fades out a sound.<br />
<br />
#''asSoundName ''- internal name<br />
#''afFadeTime ''- time in seconds, use 0 to immediatly stop the sound<br />
<syntaxhighlight lang="c++"><br />
void PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);<br />
</syntaxhighlight><br />
<br />
Plays music.<br />
<br />
#''asMusicFile ''- the music to play + extension .ogg<br />
#''abLoop ''- determines whether a music track should loop<br />
#''afVolume ''- volume of the music<br />
#''afFadeTime ''- time in seconds until music reaches full volume<br />
#''alPrio ''- priority of the music. Note that only the music with the highest priority can be heard! 0 - lowest, 1 - higher, etc.<br />
#''abResume'' - if ''true'', playback will be continued from where the track stopped after the call to StopMusic(); if ''false'', the track will be restarted.<br />
<syntaxhighlight lang="c++"><br />
void StopMusic(float afFadeTime, int alPrio);<br />
</syntaxhighlight><br />
<br />
Stops music.<br />
<br />
#''afFadeTime ''- time in seconds until music stops<br />
#''alPrio ''- the priority of the music that should stop<br />
<syntaxhighlight lang="c++"><br />
void FadeGlobalSoundVolume(float afDestVolume, float afTime);<br />
</syntaxhighlight><br />
<br />
Influences the global sound volume, that means everything you can hear '''from the world'''. This does not affect music of GUI sounds.<br />
<br />
#''afDestVolume ''- desired volume<br />
#''afTime ''- time in seconds until volume reaches desired volume<br />
<syntaxhighlight lang="c++"><br />
void FadeGlobalSoundSpeed(float afDestSpeed, float afTime);<br />
</syntaxhighlight><br />
<br />
Influences the global sound speed.<br />
<br />
#''afDestSpeed ''- desired speed<br />
#''afTime ''- time in seconds until volume reaches desired speed<br />
<br />
===Lights===<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLightVisible(string& asLightName, bool abVisible);<br />
</syntaxhighlight><br />
<br />
Enables/disables lights.<br />
<br />
#''asLightName ''- internal name<br />
#''abVisible ''- determines the state of the light<br />
<syntaxhighlight lang="c++"><br />
void FadeLightTo(string& asLightName, float afR, float afG, float afB, float afA, float afRadius, float afTime);<br />
</syntaxhighlight><br />
<br />
Changes the properties of a light.<br />
<br />
#''asLightName ''- internal name<br />
#''afR ''- red value<br />
#''afG ''- green value<br />
#''afB ''- blue value<br />
#''afA ''- alpha value<br />
#''afRadius ''- radius of the light. -1 means keeping the radius<br />
#''afTime ''- time in seconds until change is done<br />
<syntaxhighlight lang="c++"><br />
void SetLightFlickerActive(string& asLightName, bool abActive);<br />
</syntaxhighlight><br />
<br />
Activates flickering on a light.<br />
<br />
#''asLightName'' - The internal light name<br />
#''abActive'' - true = active, false = inactive<br />
<br />
==Game scripts==<br />
<br />
===General===<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartCredits(string& asMusic, bool abLoopMusic, string& asTextCat, string& asTextEntry, int alEndNum);<br />
</syntaxhighlight><br />
<br />
Starts the end credits screen.<br />
<br />
#''asMusic ''- the music to play (including .ogg)<br />
#''abLoopMusic ''- determines whether the music should loop<br />
#''asTextCat ''- the category to be used in the .lang file<br />
#''asTextEntry ''- the entry in the .lang file<br />
#''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.<br />
<syntaxhighlight lang="c++"><br />
void StartDemoEnd();<br />
</syntaxhighlight><br />
<br />
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)<br />
<br />
<syntaxhighlight lang="c++"><br />
void AutoSave();<br />
</syntaxhighlight><br />
<br />
Save the game to the auto save.<br />
<br />
<syntaxhighlight lang="c++"><br />
void CheckPoint (string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry);<br />
</syntaxhighlight><br />
<br />
Sets a checkpoint at which the player will respawn in case he dies. <br />Callback syntax: <code>void MyFunc(string &in asName, int alCount)</code> <br />Count is 0 on the first checkpoint load!<br />
<br />
#''asName ''- the internal name<br />
#''asStartPos ''- the name of the StartPos in the editor<br />
#''asCallback ''- the function to call when the player dies/respawns<br />
#''asDeathHintCat ''- the category of the death hint message to be used in the .lang file<br />
#''asDeathHintEntry ''- the entry in the .lang file<br />
<syntaxhighlight lang="c++"><br />
void ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);<br />
</syntaxhighlight><br />
<br />
Immediatly loads another map.<br />
<br />
#''asMapName ''- the file to load<br />
#''asStartPos ''- the name of the StartPos on the next map<br />
#''asStartSound ''- the sound that is played when the change starts<br />
#''asEndSound ''- the sound that is played when the new map is loaded<br />
<syntaxhighlight lang="c++"><br />
void ClearSavedMaps();<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
<syntaxhighlight lang="c++"><br />
void CreateDataCache();<br />
void DestroyDataCache();<br />
</syntaxhighlight><br />
<br />
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.<br />
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.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetMapDisplayNameEntry(string& asNameEntry);<br />
</syntaxhighlight><br />
<br />
Sets the map name shown in save file names. If none is set NULL is assumed.<br />
<br />
#''asNameEntry ''- the entry to display, category must be "Levels"!<br />
<syntaxhighlight lang="c++"><br />
void SetSkyBoxActive(bool abActive);<br />
</syntaxhighlight><br />
<br />
Enables/Disables the skybox.<br />
<br />
#''abActive'' - true = active, false = inactive<br />
<syntaxhighlight lang="c++"><br />
void SetSkyBoxTexture(string& asTexture);<br />
</syntaxhighlight><br />
<br />
Sets the texture of the skybox.<br />
<br />
#''asTexture'' - The texture file to set. Extension: .dds<br />
<syntaxhighlight lang="c++"><br />
void SetSkyBoxColor(float afR, float afG, float afB, float afA);<br />
</syntaxhighlight><br />
<br />
Sets the solid color of the skybox rather than a texture.<br />
<br />
#''afR ''- red value<br />
#''afG ''- green value<br />
#''afB ''- blue value<br />
#''afA ''- alpha value<br />
<syntaxhighlight lang="c++"><br />
void SetFogActive(bool abActive);<br />
</syntaxhighlight><br />
<br />
Enables/Disables the global fog.<br />
<br />
#''abActive'' - true = active, false = inactive<br />
<syntaxhighlight lang="c++"><br />
void SetFogColor(float afR, float afG, float afB, float afA);<br />
</syntaxhighlight><br />
<br />
Sets the color to use for the global fog.<br />
<br />
#''afR ''- red value<br />
#''afG ''- green value<br />
#''afB ''- blue value<br />
#''afA ''- alpha value<br />
<syntaxhighlight lang="c++"><br />
void SetFogProperties(float afStart, float afEnd, float afFalloffExp, bool abCulling);<br />
</syntaxhighlight><br />
<br />
Sets the properties for the global fog.<br />
<br />
#''afStart ''- how many meters from the camera should the fog begin<br />
#''afEnd ''- how many meters from the camera should the fog reach full thickness<br />
#''afFalloffExp ''- the amount by which the thinkness increases<br />
#''abCulling ''- whether occlusion culling is active for the fog; this prevents objects behind the fog from being loaded<br />
<syntaxhighlight lang="c++"><br />
void SetupLoadScreen(string&asTextCat, string&asTextEntry, int alRandomNum, string&asImageFile);<br />
</syntaxhighlight><br />
<br />
Determines which loading screen will be shown when changing maps.<br />
<br />
#''asTextCat ''- the category of the loading text in the .lang file to be shown on the loading screen<br />
#''asTextEntry ''- the entry in the .lang file<br />
#''alRandomNum ''- if greater 1, then it will randomize between 1 and alRandom for each LoadScreen giving entry the suffix XX (eg 01). If < =1 then no suffix is added<br />
#''asImageFile ''- the image to be shown (optional)<br />
<br />
===Game Timer===<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddTimer(string& asName, float afTime, string& asFunction);<br />
</syntaxhighlight><br />
<br />
Creates a timer which calls a function when it expires. <br />Callback syntax: <code>void MyFunc(string &in asTimer)</code><br />
<br />
#''asName ''- the name of the timer<br />
#''afTime ''- time in seconds<br />
#''asFunction ''- the function to call<br />
<syntaxhighlight lang="c++"><br />
void RemoveTimer(string& asName);<br />
</syntaxhighlight><br />
<br />
Removes a timer, no matter how much time is left.<br />
<br />
#''asName'' - the internal name of the timer.<br />
<syntaxhighlight lang="c++"><br />
float GetTimerTimeLeft(string& asName);<br />
</syntaxhighlight><br />
<br />
Returns the time left on a timer.<br />
<br />
#''asName'' - the internal name of the timer.<br />
<br />
===Screen Effects===<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadeOut(float afTime);<br />
</syntaxhighlight><br />
<br />
Fades the screen to black.<br />
<br />
''afTime ''- time in seconds until the screen is completly black<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadeIn(float afTime);<br />
</syntaxhighlight><br />
<br />
Fades the screen back to normal.<br />
<br />
''afTime ''- time in seconds until the screen back to normal<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadeImageTrailTo(float afAmount, float afSpeed);<br />
</syntaxhighlight><br />
<br />
Applies the image trail effect to the screen.<br />
<br />
''afAmount ''- intensity (default: 0) <br />''afSpeed ''- time in seconds until full effect<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadeSepiaColorTo(float afAmount, float afSpeed);<br />
</syntaxhighlight><br />
<br />
Makes the screen go dark red.<br />
<br />
''afAmount ''- intensity (default: 0) <br />''afSpeed ''- time in seconds until full effect<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadeRadialBlurTo(float afSize, float afSpeed);<br />
</syntaxhighlight><br />
<br />
Applies radial blur effects to the screen.<br />
<br />
''afSize ''- intensity (default: 0) <br />''afSpeed ''- time in seconds until full effect<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetRadialBlurStartDist(float afStartDist);<br />
</syntaxhighlight><br />
<br />
Determines at which distance the radial blur effects appear.<br />
<br />
''afStartDist ''- the distance at which the effect starts<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartEffectFlash(float afFadeIn, float afWhite, float afFadeOut);<br />
</syntaxhighlight><br />
<br />
Fades the screen to white.<br />
<br />
''afFadeIn ''- time in seconds until screen is white <br />''afWhite ''- determines to which percentage the screen fades to white (1.0 = completly white) <br />''afFadeOut ''- time in seconds until screen is back to normal again<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartEffectEmotionFlash(string& asTextCat, string& asTextEntry, string& asSound);<br />
</syntaxhighlight><br />
<br />
Fades the screen to white and shows a text message.<br />
<br />
''asTextCat ''- the category in the .lang file <br />''asTextEntry ''- the text entry in the .lang file <br />''asSound ''- the sound to play while fading<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddEffectVoice(string& asVoiceFile, string& asEffectFile, string& asTextCat, string& asTextEntry,<br />
bool abUsePosition, string& asPosEntity, float afMinDistance, float afMaxDistance);<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
''asVoiceFile ''- the voice to play <br />''asEffectFile ''- the effect to play <br />''asTextCat ''- the category in the .lang file <br />''asTextEntry ''- the text entry in the .lang file <br />''abUsePosition ''- plays using 3D from the entity, or without 3D <br />''asPosEntity ''- the entity at which the effect appears <br />''afMinDistance ''- minimum distance to see the effect <br />''afMaxDistance ''- maximum distance to see the effect<br />
<br />
<syntaxhighlight lang="c++"><br />
void StopAllEffectVoices(float afFadeOutTime);<br />
</syntaxhighlight><br />
<br />
Stops all voices and calls the EffectVoiceOverCallback.<br />
<br />
<syntaxhighlight lang="c++"><br />
bool GetEffectVoiceActive();<br />
</syntaxhighlight><br />
<br />
Checks whether EffectVoices are still active.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetEffectVoiceOverCallback(string& asFunc);<br />
</syntaxhighlight><br />
<br />
Sets the function to be called when the EffectVoices are finished. <br />Callback syntax: <code>void MyFunc()</code><br />
<br />
<syntaxhighlight lang="c++"><br />
bool GetFlashbackIsActive();<br />
</syntaxhighlight><br />
<br />
Checks whether a flashback is still in effect.<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartPlayerSpawnPS(string& asSPSFile);<br />
void StopPlayerSpawnPS();<br />
</syntaxhighlight><br />
<br />
Continuously spawn regular particle systems (''.ps'') around the player. Particles created by this script carry over from map to map. <br /> <br />''asSPSFile'' - the ''.sps'' file to use. Exemplary ''.sps'' files are located in the ''/misc'' folder in the main game directory. <br /> <br />Custom ''.sps'' files can be created by hand in a text editor (see existing ones and mimic how those are written). <br />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.<br />
<br />
<syntaxhighlight lang="c++"><br />
void PlayGuiSound(string& asSoundFile, float afVolume);<br />
</syntaxhighlight><br />
<br />
Plays a sound, not using 3D.<br />
<br />
''asSoundFile ''- the sound to play (extension is .snt) <br />''afVolume ''- the volume of the sound<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime);<br />
</syntaxhighlight><br />
<br />
Shakes the screen.<br />
<br />
''afAmount ''- intensity of the shake <br />''afTime ''- duration of the shake <br />''afFadeInTime ''- time in seconds until full intensity is reached <br />''afFadeOutTime ''- time until screen is back to normal<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetInDarknessEffectsActive(bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables the sanity drain and night vision effects while in the darkness.<br />
<br />
''bool abX'' - Enable/disable effects.<br />
<br />
===Insanity===<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetInsanitySetEnabled(string& asSet, bool abX);<br />
</syntaxhighlight><br />
<br />
Determines which InsanitySets are enabled.<br />
<br />
''asSet ''- the set <br />''abX ''- enabled or not<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartInsanityEvent(string &in asEventName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Starts a specified insanity event.<br />
<br />
''asEventName ''- Insanity event to play.<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartRandomInsanityEvent();<br />
</syntaxhighlight><br />
<br />
Starts a random insanity event from the available sets.<br />
<br />
<syntaxhighlight lang="c++"><br />
void StopCurrentInsanityEvent();<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Stops the currently playing insanity event.<br />
<br />
<syntaxhighlight lang="c++"><br />
void InsanityEventIsActive();<br />
</syntaxhighlight><br />
<br />
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 [http://wiki.frictionalgames.com/lib/images/smileys/icon_smile.gif?nolink&15x15]<br />
<br />
===Player===<br />
<br />
Note that the player's maximum health and sanity is 100.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerActive(bool abActive);<br />
</syntaxhighlight><br />
<br />
Enabled/Disable player controlled movement.<br />
<br />
<syntaxhighlight lang="c++"><br />
void ChangePlayerStateToNormal();<br />
</syntaxhighlight><br />
<br />
Sets certain effects back to normal. It can for example make the player drop an item.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerCrouching(bool abCrouch);<br />
</syntaxhighlight><br />
<br />
Forces the player to crouch.<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddPlayerBodyForce(float afX, float afY, float afZ, bool abUseLocalCoords);<br />
</syntaxhighlight><br />
<br />
Pushes the player into a certain direction. Note that you need values above ~2000 to see any effects.<br />
<br />
''afX ''- amount along the X-axis <br />''afY ''- amount along the Y-axis <br />''afZ ''- amount along the Z-axis <br />''abUseLocalCoords ''- If true, axes are based on where the player is facing, not the world.<br />
<br />
<syntaxhighlight lang="c++"><br />
void ShowPlayerCrossHairIcons(bool abX);<br />
</syntaxhighlight><br />
<br />
Enables/Disables the icons when a player has something in focus.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerSanity(float afSanity);<br />
void AddPlayerSanity(float afSanity);<br />
float GetPlayerSanity();<br />
</syntaxhighlight><br />
<br />
Modifies/returns the sanity of the player.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerHealth(float afHealth);<br />
void AddPlayerHealth(float afHealth);<br />
float GetPlayerHealth();<br />
</syntaxhighlight><br />
<br />
Modifies/returns the health of the player.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerLampOil(float afOil);<br />
void AddPlayerLampOil(float afOil);<br />
float GetPlayerLampOil();<br />
</syntaxhighlight><br />
<br />
Modifies/returns the lamp oil of the player.<br />
<br />
<syntaxhighlight lang="c++"><br />
float GetPlayerSpeed();<br />
float GetPlayerYSpeed();<br />
</syntaxhighlight><br />
<br />
Returns the current speed of the player.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetSanityDrainDisabled(bool abX);<br />
</syntaxhighlight><br />
<br />
Enables/Disables sanity drain from darkness, monsters, etc.<br />
<br />
<syntaxhighlight lang="c++"><br />
void GiveSanityBoost();<br />
void GiveSanityBoostSmall();<br />
</syntaxhighlight><br />
<br />
Boosts the player's sanity by a fixed amount.<br />
<br />
<syntaxhighlight lang="c++"><br />
void GiveSanityDamage(float afAmount, bool abUseEffect);<br />
</syntaxhighlight><br />
<br />
Reduces the sanity of the player.<br />
<br />
''afAmount ''- amount of sanity damage done <br />''abUseEffect ''- determines whether an effect is played when the sanity damage is dealt<br />
<br />
<syntaxhighlight lang="c++"><br />
void GivePlayerDamage(float afAmount, string& asType, bool abSpinHead, bool abLethal);<br />
</syntaxhighlight><br />
<br />
Reduces the health of the player.<br />
<br />
''afAmount ''- amount of damage done to health <br />''asType ''- plays a certain effect on the screen when the damage is dealt (BloodSplat, Claws or Slash) <br />''abSpinHead ''- changes the camera view when damage is dealt <br />''abLethal ''- set to true if player can die from given damage<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadePlayerFOVMulTo(float afX, float afSpeed);<br />
</syntaxhighlight><br />
<br />
Changes the field of view of the player. A shorter FOV will create a zoom effect.<br />
<br />
''afX ''- multiplier of default FOV (1 is default) <br />''afSpeed ''- the speed of change between FOV's<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadePlayerAspectMulTo(float afX, float afSpeed);<br />
</syntaxhighlight><br />
<br />
Changes the aspect ratio of the player. Basically stretches or narrows the screen horizontally.<br />
<br />
''afX ''- multiplier of default aspect (default is 1) <br />''afSpeed ''- the speed of change between FOV's<br />
<br />
<syntaxhighlight lang="c++"><br />
void FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed);<br />
</syntaxhighlight><br />
<br />
Rotates the position of the camera on the player's body.<br />
<br />
''afX ''- angle of rotation of head, positive being counter-clockwise <br />''afSpeedMul ''- speed (possibly acceleration) multiplier of the rotation (default 1, which is really slow) <br />''afMaxSpeed ''- maximum speed of rotation<br />
<br />
<syntaxhighlight lang="c++"><br />
void MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist);<br />
</syntaxhighlight><br />
<br />
Changes the position of the camera on the player's body.<br />
<br />
''afX ''- amount along the X-axis <br />''afY ''- amount along the Y-axis <br />''afZ ''- amount along the Z-axis <br />''afSpeed ''- speed at which the change happens <br />''afSlowDownDist ''- distance at which to start slowing down (prevents the head from abruptly stopping)<br />
<br />
<syntaxhighlight lang="c++"><br />
void StartPlayerLookAt(string& asEntityName, float afSpeedMul, float afMaxSpeed, string& asAtTargetCallback);<br />
void StopPlayerLookAt();<br />
</syntaxhighlight><br />
<br />
Forces the player to look at a certain entity until StopPlayerLookAt is used.<br />
<br />
''asEntityName ''- the entity to look at <br />''afSpeedMul ''- how fast should the player look at the entity <br />''afMaxSpeed ''- maximum speed allowed <br />''asAtTargetCallback ''- function to call when player looks at target<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerMoveSpeedMul(float afMul);<br />
void SetPlayerRunSpeedMul(float afMul);<br />
void SetPlayerLookSpeedMul(float afMul);<br />
</syntaxhighlight><br />
<br />
Changes the player's move/run/look speed. Default is 1.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerJumpForceMul(float afMul);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Changes the player's jump multiplier. Higher values = higher jumps. Default is 1.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerJumpDisabled(bool abX);<br />
void SetPlayerCrouchDisabled(bool abX);<br />
</syntaxhighlight><br />
<br />
Enables/Disables the player's ability to jump/crouch.<br />
<br />
<syntaxhighlight lang="c++"><br />
void TeleportPlayer(string& asStartPosName);<br />
</syntaxhighlight><br />
<br />
Instantly teleports the player to the target StartPos.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLanternActive(bool abX, bool abUseEffects);<br />
</syntaxhighlight><br />
<br />
Makes the player use his lantern.<br />
<br />
<syntaxhighlight lang="c++"><br />
bool GetLanternActive();<br />
</syntaxhighlight><br />
<br />
Checks whether the player currently uses his lantern.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLanternDisabled(bool abX);<br />
</syntaxhighlight><br />
<br />
Enables/Disables the player's ability to use his lantern.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetLanternLitCallback(string& asCallback);<br />
</syntaxhighlight><br />
<br />
Sets the function to call when the player uses his lantern. <br />Callback syntax: <code>MyFunc(bool abLit)</code><br />
<br />
<syntaxhighlight lang="c++"><br />
void SetMessage(string& asTextCategory, string& asTextEntry, float afTime);<br />
</syntaxhighlight><br />
<br />
Displays a message on the screen.<br />
<br />
''asTextCategory ''- the category in the .lang file <br />''asTextEntry ''- the entry in the .lang file <br />''afTime ''- determines how long the message is displayed. If time is < =0 then the life time is calculated based on string length.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetDeathHint(string& asTextCategory, string& asTextEntry);<br />
</syntaxhighlight><br />
<br />
Sets the message that appears when the player dies.<br />
<br />
''asTextCategory ''- the category in the .lang file <br />''asTextEntry ''- the entry in the .lang file<br />
<br />
<syntaxhighlight lang="c++"><br />
void DisableDeathStartSound();<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
<syntaxhighlight lang=""><br />
void MovePlayerForward(float afAmount)<br />
</syntaxhighlight><br />
<br />
"REQUIRES THE 1.2 PATCH: JUSTINE" Moves the player forward. It needs to be called in a timer that updates 60 times / second.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerFallDamageDisabled(bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables the player's ability to take fall damage.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetPlayerPos(float afX, float afY, float afZ);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Sets the player's position within the level.<br />
<br />
''afX'' - X co-ordinate position. <br />''afY'' - Y co-ordinate position. <br />''afZ'' - Z co-ordinate position.<br />
<br />
<syntaxhighlight lang="c++"><br />
float GetPlayerPosX();<br />
float GetPlayerPosY();<br />
float GetPlayerPosZ();<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the player's position within the level on the specified axis.<br />
<br />
===Journal===<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddNote(string& asNameAndTextEntry, string& asImage);<br />
</syntaxhighlight><br />
<br />
Adds a note to the player's journal.<br />
<br />
''asNameAndTextEntry ''- entries in the .lang file. Must end with _Name and _Text and be in category "Journal"! <br />''asImage ''- the background image to be used<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddDiary(string& asNameAndTextEntry, string& asImage);<br />
</syntaxhighlight><br />
<br />
Adds a diary to the player's journal.<br />
<br />
''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"! <br />''asImage ''- the background image to be used<br />
<br />
<syntaxhighlight lang="c++"><br />
void ReturnOpenJournal(bool abOpenJournal);<br />
</syntaxhighlight><br />
<br />
Only called in the pickup diary callback! If true the journal displays the entry else not.<br />
<br />
===Quests===<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddQuest(string& asName, string& asNameAndTextEntry);<br />
</syntaxhighlight><br />
<br />
Adds a quest to the player's journal.<br />
<br />
''asName ''- the internal name to be used <br />''asNameAndTextEntry ''- entry in the .lang file. Must start with "Quest_<texthere>_Text”, and be in category “Journal”!<br />
<br />
<syntaxhighlight lang="c++"><br />
void CompleteQuest(string& asName, string& asNameAndTextEntry);<br />
</syntaxhighlight><br />
<br />
Completes a quest.<br />
<br />
''asName ''- the internal name of the quest <br />''asNameAndTextEntry ''- entry in the .lang file. Must start with " Quest_<texthere>_Text ”, and be in category “Journal”!<br />
<br />
<syntaxhighlight lang="c++"><br />
bool QuestIsCompleted(string& asName);<br />
bool QuestIsAdded(string& asName);<br />
</syntaxhighlight><br />
<br />
Checks whether a quest is completed/added.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetNumberOfQuestsInMap(int alNumberOfQuests);<br />
</syntaxhighlight><br />
<br />
Sets the number of quests in the map.<br />
<br />
''alNumberOfQuests ''- Amount of Quests<br />
<br />
<syntaxhighlight lang="c++"><br />
void GiveHint (string& asName, string& asMessageCat, string& asMessageEntry, float afTimeShown);<br />
</syntaxhighlight><br />
<br />
Displays a hint on the player's screen.<br />
<br />
''asName ''- the internal name <br />''asMessageCat ''- the category in the .lang file <br />''asMessageEntry ''- the entry in the .lang file <br />''afTimeShown ''- time in seconds until the message disappears. If time is <= 0 then the life time is calculated based on string length.<br />
<br />
<syntaxhighlight lang="c++"><br />
void RemoveHint (string& asName);<br />
void BlockHint (string& asName);<br />
void UnBlockHint (string& asName);<br />
</syntaxhighlight><br />
<br />
Removes<nowiki>\</nowiki>Blocks<nowiki>\</nowiki>Unblocks a hint.<br />
<br />
===Inventory===<br />
<br />
<syntaxhighlight lang="c++"><br />
void ExitInventory();<br />
</syntaxhighlight><br />
<br />
Exits the inventory by force.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetInventoryDisabled(bool abX);<br />
</syntaxhighlight><br />
<br />
Disables the player's ability to open his inventory.<br />
<br />
<syntaxhighlight lang="c++"><br />
void SetInventoryMessage(string& asTextCategory, string& asTextEntry, float afTime);<br />
</syntaxhighlight><br />
<br />
Adds a message at the bottom of the inventory screen.<br />
<br />
''asTextCategory ''- the category in the .lang file <br />''asTextEntry ''- the entry in the .lang file <br />''afTime ''- time in seconds until the message disappears. If life time is <= 0 then the life time is calculated based on string length.<br />
<br />
<syntaxhighlight lang="c++"><br />
void GiveItem(string& asName, string& asType, string& asSubTypeName, string& asImageName, float afAmount);<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
''asName ''- internal name <br />''asType ''- item type to give, Available types are: <br /><br />
<br />
*Puzzle<br />
*Lantern<br />
*Health<br />
*Sanity<br />
*LampOil<br />
*Tinderbox<br />
<br />
''asSubTypeName ''- item name for .lang file <br />''asImageName ''- the image which will appear in inventory. For example: <code>void GiveItem("chemical_container_full_1", "Puzzle", "chemical_container_full", "chemical_container_full.tga", 1);</code> will use the image from <code>graphics/item/chemical_container_full.tga</code> <br />
<br />
''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.<br />
<br />
<syntaxhighlight lang="c++"><br />
void RemoveItem(string& asName);<br />
</syntaxhighlight><br />
<br />
Removes an item from the player's inventory.<br />
<br />
<syntaxhighlight lang="c++"><br />
bool HasItem(string& asName);<br />
</syntaxhighlight><br />
<br />
Checks whether the player has an item in his inventory.<br />
<br />
<syntaxhighlight lang="c++"><br />
void GiveItemFromFile(string& asName, string& asFileName);<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
''asName ''- internal name <br />''asFileName ''- item to give + extension (.ent)<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddCombineCallback(string& asName, string& asItemA, string& asItemB, string& asFunction, bool abAutoRemove);<br />
</syntaxhighlight><br />
<br />
Allows the player to combine items in his inventory. <br />Callback syntax: <code>void MyFunc(string &in asItemA, string &in asItemB)</code><br />
<br />
''asName ''- internal name for the callback <br />''asItemA ''- internal name of first item <br />''asItemB ''- internal name of second item <br />''asFunction ''- the function to call <br />''abAutoRemove ''- determines whether the callback should be removed when the items are combined<br />
<br />
<syntaxhighlight lang="c++"><br />
void RemoveCombineCallback(string& asName);<br />
</syntaxhighlight><br />
<br />
Removes a combine callback. <br />''asName'' - the internal name of the callback to be removed (as specified in AddCombineCallback)<br />
<br />
<syntaxhighlight lang="c++"><br />
void AddUseItemCallback(string& asName, string& asItem, string& asEntity, string& asFunction, bool abAutoDestroy);<br />
</syntaxhighlight><br />
<br />
Allows the player to use items on the world. <br />Callback syntax: <code>void MyFunc(string &in asItem, string &in asEntity)</code><br />
<br />
''asName ''- internal name <br />''asItem ''- internal name of the item <br />''asEntity ''- entity to be able to use the item on <br />''asFunction ''- function to call <br />''abAutoDestroy ''- determines whether the item is destroyed when used<br />
<br />
<syntaxhighlight lang="c++"><br />
void RemoveUseItemCallback(string& asName);<br />
</syntaxhighlight><br />
<br />
Removes an item callback.<br />
<br />
===Entities===<br />
<br />
====General====<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityActive(string& asName, bool abActive);<br />
</syntaxhighlight><br />
<br />
Activates/deactivates an entity.<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityVisible(string &in asName, bool abVisible);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Activates/deactivates an entity's visual mesh. The collision body remains.<br />
<br />
''asName'' - Name of the entity. <br />''abActive'' - Activate/deactivate mesh.<br />
<br />
<syntaxhighlight lang="c"><br />
bool GetEntityExists(string& asName);<br />
</syntaxhighlight><br />
<br />
Checks whether an entity exists.<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityCustomFocusCrossHair(string& asName, string& asCrossHair);<br />
</syntaxhighlight><br />
<br />
Changes the crosshair that is used when focusing an entity.<br />
<br />
''asName ''- internal name <br />''asCrossHair ''- desired crosshair, can be: Default (uses default), Grab, Push, Ignite, Pick, LevelDoor, Ladder<br />
<br />
<syntaxhighlight lang="c"><br />
void CreateEntityAtArea(string& asEntityName, string& asEntityFile, string& asAreaName, bool abFullGameSave);<br />
</syntaxhighlight><br />
<br />
Creates an entity at an area. When creating an enemy though, it cannot chase properly along PathNodes(using for example ShowEnemyPlayerPosition).<br />
<br />
''asEntityName ''- internal name <br />''asEntityFile ''- entity to be used extension .ent <br />''asAreaName ''- the area to create the entity at <br />''abFullGameSave ''- determines whether an entity "remembers" its state<br />
<br />
<syntaxhighlight lang="c"><br />
void ReplaceEntity(string &in asName, string &in asBodyName, string &in asNewEntityName, string &in asNewEntityFile, bool abFullGameSave);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Removes an entity and places a new one in its place.<br />
<br />
''asName'' - Name of the entity to replace. <br />''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). <br />''asNewEntityName'' - Name of the new entity. <br />''asNewEntityFile'' - Name of the new entity file. Extension .ent. <br />''abFullGameSave'' - Whether ALL properties of this entity should be saved throughout levels.<br />
<br />
<syntaxhighlight lang="c++"><br />
void PlaceEntityAtEntity(string &in asName, string &in asTargetEntity, string &in asTargetBodyName, bool abUseRotation);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Places an entity at the position of another entity. Does not work for enemies, use TeleportEnemyToEntity instead.<br />
<br />
''asName'' - Name of the entity to place. <br />''asTargetEntity'' - Name of the other entity to place the first entity at. <br />''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). <br />''abUseRotation'' - Whether the entity should be rotated like the target entity.<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityPos(string &in asName, float afX, float afY, float afZ);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Moves an entity to a position in the level.<br />
<br />
''asName'' - Name of the entity to move. <br />''afX'' - X co-ordinate position. <br />''afY'' - Y co-ordinate position. <br />''afZ'' - Z co-ordinate position.<br />
<br />
<syntaxhighlight lang="c"><br />
float GetEntityPosX(string &in asName);<br />
float GetEntityPosY(string &in asName);<br />
float GetEntityPosZ(string &in asName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns an entity's position in the level on the specified axis.<br />
<br />
''asName'' - Name of the entity.<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityPlayerLookAtCallback(string& asName, string& asCallback, bool abRemoveWhenLookedAt);<br />
</syntaxhighlight><br />
<br />
Calls a function when the player looks at a certain entity. <br />Callback syntax: <code>void MyFunc(string &in asEntity, int alState)</code> <br />alState: 1 = looking, -1 = not looking<br />
<br />
''asName ''- internal name <br />''asCallback ''- function to call <br />''abRemoveWhenLookedAt ''- determines whether the callback should be removed when the player looked at the entity<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction);<br />
</syntaxhighlight><br />
<br />
Calls a function when the player interacts with a certain entity. <br />Callback syntax: <code>void MyFunc(string &in asEntity)</code><br />
<br />
''asName ''- internal name <br />''asCallback ''- function to call <br />''abRemoveOnInteraction ''- determines whether the callback should be removed when the player interacts with the entity<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityCallbackFunc(string& asName, string& asCallback);<br />
</syntaxhighlight><br />
<br />
Calls a function when the player interacts with a certain entity. <br />Callback syntax: <code>void MyFunc(string &in asEntity, string &in type)</code> <br />Type depends on entity type and includes: "OnPickup", "Break", "OnIgnite", etc<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityConnectionStateChangeCallback(string& asName, string& asCallback);<br />
</syntaxhighlight><br />
<br />
A callback called when ever the connection state changes (button being switched on, lever switched, etc). <br />Callback syntax: <code>void Func(string &in asEntity, int alState)</code> <br />alState: -1 = off, 0 = between, 1 = on<br />
<br />
<syntaxhighlight lang="c"><br />
void SetEntityInteractionDisabled(string& asName, bool abDisabled);<br />
</syntaxhighlight><br />
<br />
Disallows interaction with an entity.<br />
<br />
<syntaxhighlight lang="c"><br />
void BreakJoint (string& asName);<br />
</syntaxhighlight><br />
<br />
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.<br />
<br />
<syntaxhighlight lang="c"><br />
void AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);<br />
</syntaxhighlight><br />
<br />
Calls a function when two entites collide. <br />Callback syntax: <code>void MyFunc(string &in asParent, string &in asChild, int alState)</code> <br />alState: 1 = enter, -1 = leave<br />
<br />
''asParentName ''- internal name of main object <br />''asChildName ''- internal name of object that collides with main object (asterix (<nowiki>*</nowiki>) NOT supported!) <br />''asFunction ''- function to call <br />''abDeleteOnCollide ''- determines whether the callback after it was called <br />''alStates ''- 1 = only enter, -1 = only leave, 0 = both<br />
<br />
<syntaxhighlight lang="c"><br />
void RemoveEntityCollideCallback(string& asParentName, string& asChildName);<br />
</syntaxhighlight><br />
<br />
Removes an EntityCollideCallback. Asterix (<nowiki>*</nowiki>) not supported in ''asChildName''.<br />
<br />
<syntaxhighlight lang="c"><br />
bool GetEntitiesCollide(string& asEntityA, string& asEntityB);<br />
</syntaxhighlight><br />
<br />
Checks whether two entites collide. This function does NOT support asterix (<nowiki>*</nowiki>) or "Player"!<br />
<br />
<syntaxhighlight lang="c"><br />
void SetBodyMass(string &in asName, float afMass);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Sets the mass of an entity's body.<br />
<br />
''asName'' - Name of the body of an entity. The body name of an entity is EntityName_BodyName. <br />''afMass'' - The mass to set.<br />
<br />
<syntaxhighlight lang="c"><br />
float GetBodyMass(string &in asName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Gets the mass of an entity's body.<br />
<br />
''asName'' - Name of the body of an entity. The body name of an entity is EntityName_BodyName. <br />''afMass'' - The mass to get.<br />
<br />
====Props====<br />
<br />
<syntaxhighlight lang="c"><br />
void SetPropEffectActive(string& asName, bool abActive, bool abFadeAndPlaySounds);<br />
</syntaxhighlight><br />
<br />
Can be used on coal to give it the black color it should have.<br />
<br />
<syntaxhighlight lang="c"><br />
void SetPropActiveAndFade(string& asName, bool abActive, float afFadeTime);<br />
</syntaxhighlight><br />
<br />
Activates/deactivates a prop.<br />
<br />
''asName ''- internal name <br />''abActive ''- nothing to add <br />''afFadeTime ''- time in seconds until prop fully fades<br />
<br />
<syntaxhighlight lang="c"><br />
void SetPropStaticPhysics(string& asName, bool abX);<br />
</syntaxhighlight><br />
<br />
Activates/deactivates the physics of a prop. Setting as true will make entities static in midair.<br />
<br />
<syntaxhighlight lang="c"><br />
bool GetPropIsInteractedWith(string& asName);<br />
</syntaxhighlight><br />
<br />
Checks whether a prop is interacted with.<br />
<br />
<syntaxhighlight lang="c"><br />
void RotatePropToSpeed(string& asName, float afAcc, float afGoalSpeed, float afAxisX, float afAxisY, float afAxisZ, bool abResetSpeed, string& asOffsetArea);<br />
</syntaxhighlight><br />
<br />
Rotates the prop up to a set speed.<br />
<br />
''asName ''- internal name <br />''afAcc ''- acceleration <br />''afGoalSpeed ''- desired speed <br />''afAxisX ''- rotation around X axis <br />''afAxisY ''- rotation around Y axis <br />''afAxisZ ''- rotation around Z axis <br />''abResetSpeed ''- determines whether the speed is resetted after goal speed is reached <br />''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 "StaticObject" entity!<br />
<br />
<syntaxhighlight lang="cpp"><br />
void StopPropMovement(string& asName);<br />
</syntaxhighlight><br />
<br />
Stops all movement of a prop.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AddAttachedPropToProp(string& asPropName, string& asAttachName, string& asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);<br />
</syntaxhighlight><br />
<br />
Attaches a prop to another prop.<br />
<br />
a''sPropName''- the prop to attach another prop at <br />''asAttachName ''- internal name of the prop that gets attached <br />''asAttachFile ''- the prop that gets attached extension .ent <br />''afPosX ''- X position of the attach from the prop <br />''afPosY ''- Y position of the attach from the prop <br />''afPosZ ''- Z position of the attach from the prop <br />''afRotX ''- rotation around X axis of the attach <br />''afRotY ''- rotation around Y axis of the attach <br />''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of "AddEntityCollideCallback", attached props will not call the callback function if they collide with a "static_object" or a "StaticProp" entity type!<br />
<br />
{{bug|''afRotZ '' is used for both the ZX rotation and the Z position of the attached prop. Unwanted rotation can be avoided by using: <br />''AddAttachedPropToProp(asPropName, asAttachName, asAttachFile, afPosX, afPosY, '''0''', afPosZ, '''90.0f''', afPosZ)''}}<br />
<br />
{{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.}}<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AttachPropToProp(string& asPropName, string& asAttachName, string& asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Attaches a prop to another prop. Fixed version of AddAttachedPropToProp.<br />
<br />
''asPropName ''- the prop to attach another prop at <br />''asAttachName ''- internal name of the prop that gets attached <br />''asAttachFile ''- the prop that gets attached extension .ent <br />''afPosX ''- X position of the attach from the prop <br />''afPosY ''- Y position of the attach from the prop <br />''afPosZ ''- Z position of the attach from the prop <br />''afRotX ''- rotation around X axis of the attach <br />''afRotY ''- rotation around Y axis of the attach <br />''afRotZ ''- rotation around ZX axis of the attach Note: for the purposes of "AddEntityCollideCallback", attached props will not call the callback function if they collide with a "static_object" or a "StaticProp" entity type!<br />
<br />
<syntaxhighlight lang="cpp"><br />
void RemoveAttachedPropFromProp(string& asPropName, string& asAttachName);<br />
</syntaxhighlight><br />
<br />
Detaches a prop from a prop.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetPropHealth(string& asName, float afHealth);<br />
void AddPropHealth(string& asName, float afHealth);<br />
float GetPropHealth(string& asName);<br />
</syntaxhighlight><br />
<br />
Modifies/returns the health of a prop.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void ResetProp(string& asName);<br />
</syntaxhighlight><br />
<br />
Resets a prop's state to the original one when the map was loaded.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void PlayPropAnimation(string& asProp, string& asAnimation, float afFadeTime, bool abLoop, string& asCallback);<br />
</syntaxhighlight><br />
<br />
Makes the prop play an animation and calls a function. <br />Callback syntax: <code>void MyFunc(string &in asProp)</code><br />
<br />
''asProp ''- internal name of the prop <br />''asAnimation ''- animation to play <br />''afFadeTime ''- ? <br />''abLoop ''- determines whether the animation loops <br />''asCallback ''- function to call<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AddPropForce(string& asName, float afX, float afY, float afZ, string& asCoordSystem);<br />
void AddPropImpulse(string& asName, float afX, float afY, float afZ, string& asCoordSystem);<br />
void AddBodyForce(string& asName, float afX, float afY, float afZ, string& asCoordSystem);<br />
void AddBodyImpulse(string& asName, float afX, float afY, float afZ, string& asCoordSystem);<br />
</syntaxhighlight><br />
<br />
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 "Body" 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).<br />
<br />
''asName ''- the object to push; for bodies, use this format: "''entityName''_''bodyName''" <br />''afX ''- magnitude along the X-axis <br />''afY ''- magnitude along the Y-axis <br />''afZ ''- magnitude along the Z-axis <br />''asCoordSystem ''- determines which coordinate system is used, usually "world" 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.<br />
<br />
====Connections====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void InteractConnectPropWithRope(string& asName, string& asPropName, string& asRopeName, bool abInteractOnly, float afSpeedMul, float afToMinSpeed, float afToMaxSpeed, bool abInvert, int alStatesUsed);<br />
</syntaxhighlight><br />
<br />
Connects a prop with the movement of a rope (ie. turn wheel to move rope).<br />
<br />
''asName ''- connection name <br />''asPropName ''- name of prop <br />''asRopeName ''- name of rope <br />''abInteractOnly ''- ? <br />''afSpeedMul ''- speed multiplier of how quickly the rope moves <br />''afToMinSpeed ''- the slowest the rope will move when moving the prop <br />''afToMaxSpeed ''- the fastest the rope will move when moving the prop <br />''abInvert ''- whether to invert the direction the rope moves <br />''alStatesUsed ''- which states of the prop can interact with the rope?<br />
<br />
<syntaxhighlight lang="cpp"><br />
void InteractConnectPropWithMoveObject(string& asName, string& asPropName, string& asMoveObjectName, bool abInteractOnly, bool abInvert, int alStatesUsed);<br />
</syntaxhighlight><br />
<br />
This one should only be used if there must be an exact correspondance to prope "amount" and the moveobject open amount. It is best used for Wheel-door connections!<br />
<br />
<syntaxhighlight lang="cpp"><br />
void ConnectEntities(string& asName, string& asMainEntity, string& asConnectEntity, bool abInvertStateSent, int alStatesUsed, string& asCallbackFunc);<br />
</syntaxhighlight><br />
<br />
Callback syntax: <code>void MyFunc(string &in asConnectionName, string &in asMainEntity, string &in asConnectEntity, int alState)</code> <br />State is what is sent to connection entity and will be inverted if abInvertStateSent = true!<br />
<br />
====Lamps====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetLampLit(string& asName, bool abLit, bool abEffects);<br />
</syntaxhighlight><br />
<br />
(Un)lits a lamp.<br />
<br />
''asName ''- Name of the lamp <br />''abLit ''- Set true if you want the lamp to be lit, set to false if you want the lamp to be unlit <br />''abEffects ''- If you want to have the lamp fade in/out when it gets (un)lit<br />
<br />
====Doors====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetSwingDoorLocked(string& asName, bool abLocked, bool abEffects);<br />
void SetSwingDoorClosed(string& asName, bool abClosed, bool abEffects);<br />
</syntaxhighlight><br />
<br />
Locks/closes a swing door.<br />
<br />
<syntaxhighlight lang="cpp"><br />
bool GetSwingDoorLocked(string& asName);<br />
bool GetSwingDoorClosed(string& asName);<br />
</syntaxhighlight><br />
<br />
Checks whether a swing door is locked/closed.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetSwingDoorDisableAutoClose(string& asName, bool abDisableAutoClose);<br />
</syntaxhighlight><br />
<br />
Deactivates the "auto-close" when a door is nearly closed.<br />
<br />
<syntaxhighlight lang="cpp"><br />
int GetSwingDoorState(string& asName);<br />
</syntaxhighlight><br />
<br />
Returns an integer depending on how far the door is opened. <br />-1 = angle is close to 0°, 1 = angle is 70% or higher of max, 0 = inbetween -1 and 1.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetLevelDoorLocked(string& asName, bool abLocked);<br />
</syntaxhighlight><br />
<br />
Locks a level door. Note that level doors are NOT swing doors.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetLevelDoorLockedSound(string& asName, string& asSound);<br />
</syntaxhighlight><br />
<br />
Determines which sound is played when interacting with a locked level door.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetLevelDoorLockedText(string& asName, string& asTextCat, string& asTextEntry);<br />
</syntaxhighlight><br />
<br />
Displays a message when interacting with a locked level door.<br />
<br />
''asName ''- internal name <br />''asTextCat ''- the category in the .lang file <br />''asTextEntry ''- the entry in the .lang file<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetMoveObjectState(string& asName, float afState);<br />
</syntaxhighlight><br />
<br />
Moves an object to a certain state.<br />
<br />
''asName ''- internal name <br />''afState ''- state of the object, 0 = closed, 1 = open, values inbetween (and above, for example, the bridge_metal_vert) are valid too!<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetMoveObjectStateExt(string& asName, float afState, float afAcc, float afMaxSpeed, float afSlowdownDist, bool abResetSpeed);<br />
</syntaxhighlight><br />
<br />
Moves an object to a certain state, extended method.<br />
<br />
''asName ''- internal name <br />''afState ''- state of the object, 0 = closed, 1 = open, values inbetween are valid too! <br />''afAcc ''- acceleration <br />''afMaxSpeed ''- maximum speed <br />''afSlowdownDist ''- Distance to the target state before decceleration occurs. <br />''abResetSpeed ''- Set to True if the prop's speed should be reset before performing the movement, else the prop will accelerate from it's current speed to afMaxSpeed.<br />
<br />
====Levers, wheels and buttons====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetPropObjectStuckState(string& asName, int alState);<br />
void SetWheelStuckState(string& asName, int alState, bool abEffects);<br />
void SetLeverStuckState(string& asName, int alState, bool abEffects);<br />
</syntaxhighlight><br />
<br />
Makes a prop<nowiki>\</nowiki>wheel<nowiki>\</nowiki>lever stuck in a certain state.<br />
<br />
''asName ''- internal name <br />''alState ''- 0 = not stuck, 1 = at max, -1 = at min <br />''abEffects ''- use effects<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetWheelAngle(string& asName, float afAngle, bool abAutoMove);<br />
</syntaxhighlight><br />
<br />
Moves a wheel to a certain angle.<br />
<br />
''asName ''- internal name <br />''afAngle ''- angle <br />''abAutoMove ''- determines whether the wheel should move on its own<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetWheelInteractionDisablesStuck(string& asName, bool abX);<br />
void SetLeverInteractionDisablesStuck(string& asName, bool abX);<br />
</syntaxhighlight><br />
<br />
Allows the player to make a wheel/lever unstuck when interacted with.<br />
<br />
<syntaxhighlight lang="cpp"><br />
int GetLeverState(string& asName);<br />
</syntaxhighlight><br />
<br />
Returns the state of the lever. <br />0 = not stuck, 1 = at max, -1 = at min<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetMultiSliderStuckState(string& asName, int alStuckState, bool abEffects);<br />
</syntaxhighlight><br />
<br />
Makes a MultiSlider stuck in a certain state.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetMultiSliderCallback(string& asName, string& asCallback);<br />
</syntaxhighlight><br />
<br />
Calls a function when state changes. <br />Callback syntax: <code>void MyFunc(string &in asEntity, int alState)</code><br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetButtonSwitchedOn(string& asName, bool abSwitchedOn, bool abEffects);<br />
</syntaxhighlight><br />
<br />
====Sticky areas====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetAllowStickyAreaAttachment(bool abX);<br />
</syntaxhighlight><br />
<br />
Allows entites to stick to a StickyArea.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AttachPropToStickyArea(string& asAreaName, string& asProp);<br />
void AttachBodyToStickyArea(string& asAreaName, string& asBody);<br />
</syntaxhighlight><br />
<br />
Attaches a prop/body to a StickyArea.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void DetachFromStickyArea(string& asAreaName);<br />
</syntaxhighlight><br />
<br />
Detaches everything from a StickyArea.<br />
<br />
====Enemies====<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetNPCAwake(string& asName, bool abAwake, bool abEffects);<br />
</syntaxhighlight><br />
<br />
Activates the npc<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetNPCFollowPlayer(string& asName, bool abX);<br />
</syntaxhighlight><br />
<br />
Sets an NPC's head to follow the player's movement's.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetEnemyDisabled(string& asName, bool abDisabled);<br />
</syntaxhighlight><br />
<br />
Disables an enemy.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetEnemyIsHallucination(string& asName, bool abX);<br />
</syntaxhighlight><br />
<br />
Makes an enemy a hallucination. Hallucinations fade to smoke when they get near the player.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void FadeEnemyToSmoke(string& asName, bool abPlaySound);<br />
</syntaxhighlight><br />
<br />
Instantly fades an enemy to smoke.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void ShowEnemyPlayerPosition(string& asName);<br />
</syntaxhighlight><br />
<br />
Makes the enemy run to the player, no matter where he is.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AlertEnemyOfPlayerPresence(string &in asName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Gives the specified enemy the player's current position and makes it search the area.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetEnemyDisableTriggers(string& asName, bool abX);<br />
</syntaxhighlight><br />
<br />
Enables or disables enemy triggers. If disabled, enemy will not react to player or attack.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void AddEnemyPatrolNode(string& asName, string& asNodeName, float afWaitTime, string& asAnimation);<br />
</syntaxhighlight><br />
<br />
Adds a patrol node to the enemy's path.<br />
<br />
''asName ''- internal name of the enemy <br />''asNodeName ''- path node <br />''afWaitTime ''- time in seconds that the enemy waits at the path node before continuing <br />''asAnimation ''- the animation the enemy uses when reaching the path node<br />
<br />
<syntaxhighlight lang="cpp"><br />
void ClearEnemyPatrolNodes(string& asEnemyName);<br />
</syntaxhighlight><br />
<br />
Clears the current path of patrol nodes of the enemy.<br />
<br />
<syntaxhighlight lang="cpp"><br />
void SetEnemySanityDecreaseActive(string &in asName, bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables whether an enemy activates the player's sanity drain when stared at.<br />
<br />
''asName ''- Internal name of the enemy <br />''abX ''- Enabled/disabled<br />
<br />
<syntaxhighlight lang="cpp"><br />
void TeleportEnemyToNode(string &in asEnemyName, string &in asNodeName, bool abChangeY);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Teleports an enemy to a specific PathNode.<br />
<br />
''asEnemyName ''- Internal name of the enemy <br />''asNodeName ''- Internal name of the node to teleport to <br />''abChangeY ''- Whether the Y position of the node will be used when teleporting the enemy<br />
<br />
<syntaxhighlight lang="cpp"><br />
void TeleportEnemyToEntity(string &in asEnemyName, string &in asTargetEntity, string &in asTargetBody, bool abChangeY);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Teleports an enemy to a specific entity.<br />
<br />
''asEnemyName ''- Internal name of the enemy <br />''asTargetEntity ''- Internal name of the entity to teleport to <br />''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) <br />''abChangeY ''- Whether the Y position of the node will be used when teleporting the enemy<br />
<br />
<syntaxhighlight lang="c"><br />
void ChangeManPigPose(string&in asName, string&in asPoseType);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Changes the pose a specified ManPig.<br />
<br />
''asName ''- Internal name of the enemy <br />''asPoseType''- Name of the ManPig pose to use. Can be "Biped" or "Quadruped"<br />
<br />
<syntaxhighlight lang="c"><br />
void SetTeslaPigFadeDisabled(string&in asName, bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables whether a specified TeslaPig should fade the player's view in and out.<br />
<br />
''asName ''- Internal name of the enemy <br />''abX''- Enabled/disabled<br />
<br />
<syntaxhighlight lang="c"><br />
void SetTeslaPigSoundDisabled(string&in asName, bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables whether a specified TeslaPig should play the proximity sounds.<br />
<br />
''asName ''- Internal name of the enemy <br />''abX''- Enabled/disabled<br />
<br />
<syntaxhighlight lang="c"><br />
void SetTeslaPigEasyEscapeDisabled(string&in asName, bool abX);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Enables/disables whether a specified TeslaPig should be easier to escape from when hunted.<br />
<br />
''asName ''- Internal name of the enemy <br />''abX''- Enabled/disabled<br />
<br />
<syntaxhighlight lang="c"><br />
void ForceTeslaPigSighting(string&in asName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Forces a TeslaPig to be visible for a short time.<br />
<br />
''asName ''- Internal name of the enemy<br />
<br />
<syntaxhighlight lang="c"><br />
string& GetEnemyStateName(string &in asName);<br />
</syntaxhighlight><br />
<br />
{{ReqVer|1.3}}<br />
<br />
Returns the name of the state a specified enemy is current in. States can be Hunt, Search, Patrol, Wait, Alert, Investigate, Track and BreakDoor.<br />
<br />
''asName ''- Internal name of the enemy</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/Development_Environment&diff=6291HPL2/Development Environment2021-10-09T18:38:58Z<p>Mudbill: Rewrote the tip to be a bit clearer</p>
<hr />
<div>In order to mod Amnesia comfortably, you will need to set up the game so you can easily test maps and reload scripts. To do that, it is recommended to have two in-game users; a regular one (for testing how the mod works for the player) and a developer one. This article is about the basic set up of a developer user.<br />
<br />
==Setting up a dev user==<br />
<br />
Follow these steps to create a developer user:<br />
<br />
#Enter the game (or Full Conversion mod) normally, create a profile name (e.g. MyName) and then exit.<br />
#Enter the save directory (<code>My Documents/Amnesia/Main</code> in Windows by default; <code>~/.frictionalgames/Amnesia/Main</code> in Linux) and rename the user name (e.g. MyName) to "dev_user". If your mod is an FC, do this in its save folder.<br />
#Open main_settings.cfg and set <code>LoadDebugMenu="true"</code> and <code>ShowPreMenu="false"</code> (this will skip you some waiting on each game launch). Setting <code>SaveConfig="false"</code> will make sure that the in-game changes don't overwrite changes to this file, and it is recommended to do.<br />
#You can also set <code>ExitMenuDirectly="true"</code> if you wish to exit the game directly, without visiting the main menu.<br />
#You must set <code>ForceCacheLoadingAndSkipSaving="false"</code> in '''main_settings.cfg''', or certain map changes will not show! Either way, you will sometimes need to delete the map's cache file.<br />
#Open user_settings.cfg (in "dev_user" folder), inside the '''Debug''' element add <code>AllowQuickSave="true"</code> ('''F4'''=save, '''F5'''=load) and change <code>ScriptDebugOn="true"</code> (more on that later).<br />
#In order to avoid running into "File index out of bounds" errors when designing your custom story in the level editor, edit the file '''resources.cfg''' located in the root the directory of Amnesia (i.e. where Amnesia is installed) and add the ''custom_stories'' directory to the end of the list. This will also let you see custom assets placed in maps in the editors.<br />
<br />
You can now press '''F1''' to open a '''debug menu''' to turn on/off various things and more importantly quick reload the map. This is probably the most important thing to do when editing. When changed a script or added entities to a map, do NOT restart the game, instead simply press "Quick reload" or F2. If a mesh or texture has been updated (e.g. in an Entity file), you need to press "Reload".<br />
<br />
{{tip|If you start the game with a syntax error in your script file, it will crash. But if you reload the script with F2 with a syntax error, it will instead give you an error description. Therefore it's a good idea to load the game before making uncertain changes to the script.}}<br />
By setting <code>ScriptDebugOn="true"</code> you have set the script function <code>ScriptDebugOn()</code> to return true. This is extremly important as you can add something like this in your startup code:<br />
<br />
<syntaxhighlight lang="cpp">if(ScriptDebugOn()) {<br />
//Do your setup stuff<br />
}</syntaxhighlight><br />
<br />
This will enable you to easily add all kinds of debug stuff (giving lantern, extra items, etc) wihout having to worry about removing it for the final release. <br />
<br />
If you wish to test a map without these features, you can use your normal user profile. Alternatively, you can make another dev user, but without the script debug option - this way you can both use the debug menu and have the script debug off.<br />
<br />
Now you should be ready to start some editing!<br />
<br />
==Loading directly into a map==<br />
The following will let you load directly into a level when starting the game:<br />
<br />
#Open '''main_settings.cfg''' again and set <code>ShowMenu="false"</code> (keep in mind this feature won't work without the next steps).<br />
#In '''user_settings.cfg''', inside the '''Map''' element set <code>Folder=""</code> to the root folder for your maps (eg <code>Folder="MyMaps/"</code>), this folder MUST be located inside the maps folder in the game directory (where you put the tools).<br />
#In '''user_settings.cfg''', inside the '''Map''' element set <code>File=""</code> to point to the map you want to load (eg <code>File="my_map.map"</code>).<br />
<br />
Now you can simply run Amnesia and the map will be loaded directly without any menu. This is optional, because it's only useful for things like testing player config files, and will only work if you place your maps in the mentioned folder, which is not recommended.</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/Development_Environment&diff=6290HPL2/Development Environment2021-10-09T18:32:21Z<p>Mudbill: Added F2 hotkey note</p>
<hr />
<div>In order to mod Amnesia comfortably, you will need to set up the game so you can easily test maps and reload scripts. To do that, it is recommended to have two in-game users; a regular one (for testing how the mod works for the player) and a developer one. This article is about the basic set up of a developer user.<br />
<br />
==Setting up a dev user==<br />
<br />
Follow these steps to create a developer user:<br />
<br />
#Enter the game (or Full Conversion mod) normally, create a profile name (e.g. MyName) and then exit.<br />
#Enter the save directory (<code>My Documents/Amnesia/Main</code> in Windows by default; <code>~/.frictionalgames/Amnesia/Main</code> in Linux) and rename the user name (e.g. MyName) to "dev_user". If your mod is an FC, do this in its save folder.<br />
#Open main_settings.cfg and set <code>LoadDebugMenu="true"</code> and <code>ShowPreMenu="false"</code> (this will skip you some waiting on each game launch). Setting <code>SaveConfig="false"</code> will make sure that the in-game changes don't overwrite changes to this file, and it is recommended to do.<br />
#You can also set <code>ExitMenuDirectly="true"</code> if you wish to exit the game directly, without visiting the main menu.<br />
#You must set <code>ForceCacheLoadingAndSkipSaving="false"</code> in '''main_settings.cfg''', or certain map changes will not show! Either way, you will sometimes need to delete the map's cache file.<br />
#Open user_settings.cfg (in "dev_user" folder), inside the '''Debug''' element add <code>AllowQuickSave="true"</code> ('''F4'''=save, '''F5'''=load) and change <code>ScriptDebugOn="true"</code> (more on that later).<br />
#In order to avoid running into "File index out of bounds" errors when designing your custom story in the level editor, edit the file '''resources.cfg''' located in the root the directory of Amnesia (i.e. where Amnesia is installed) and add the ''custom_stories'' directory to the end of the list. This will also let you see custom assets placed in maps in the editors.<br />
<br />
You can now press '''F1''' to open a '''debug menu''' to turn on/off various things and more importantly quick reload the map. This is probably the most important thing to do when editing. When changed a script or added entities to a map, do NOT restart the game, instead simply press "Quick reload" or F2. If a mesh or texture has been updated (e.g. in an Entity file), you need to press "Reload".<br />
<br />
{{tip|Don't change a map script before you load the map. Doing that with any mistakes in the script will make the game crash when loading that map. Instead, load the map before editing the script.}}<br />
By setting <code>ScriptDebugOn="true"</code> you have set the script function <code>ScriptDebugOn()</code> to return true. This is extremly important as you can add something like this in your startup code:<br />
<br />
<syntaxhighlight lang="cpp">if(ScriptDebugOn()) {<br />
//Do your setup stuff<br />
}</syntaxhighlight><br />
<br />
This will enable you to easily add all kinds of debug stuff (giving lantern, extra items, etc) wihout having to worry about removing it for the final release. <br />
<br />
If you wish to test a map without these features, you can use your normal user profile. Alternatively, you can make another dev user, but without the script debug option - this way you can both use the debug menu and have the script debug off.<br />
<br />
Now you should be ready to start some editing!<br />
<br />
==Loading directly into a map==<br />
The following will let you load directly into a level when starting the game:<br />
<br />
#Open '''main_settings.cfg''' again and set <code>ShowMenu="false"</code> (keep in mind this feature won't work without the next steps).<br />
#In '''user_settings.cfg''', inside the '''Map''' element set <code>Folder=""</code> to the root folder for your maps (eg <code>Folder="MyMaps/"</code>), this folder MUST be located inside the maps folder in the game directory (where you put the tools).<br />
#In '''user_settings.cfg''', inside the '''Map''' element set <code>File=""</code> to point to the map you want to load (eg <code>File="my_map.map"</code>).<br />
<br />
Now you can simply run Amnesia and the map will be loaded directly without any menu. This is optional, because it's only useful for things like testing player config files, and will only work if you place your maps in the mentioned folder, which is not recommended.</div>Mudbillhttps://wiki.frictionalgames.com/page?title=Hpl2:Tools:start&diff=6289Hpl2:Tools:start2021-09-28T21:26:12Z<p>Mudbill: Wait, that was the wrong destination</p>
<hr />
<div>#REDIRECT [[HPL2/Tools]]</div>Mudbillhttps://wiki.frictionalgames.com/page?title=Hpl2:Tools:start&diff=6288Hpl2:Tools:start2021-09-28T21:25:01Z<p>Mudbill: Removed nowiki tags</p>
<hr />
<div>#REDIRECT [[HPL2/Engine_Scripts]]</div>Mudbillhttps://wiki.frictionalgames.com/page?title=Hpl2:Tools:start&diff=6287Hpl2:Tools:start2021-09-28T21:24:43Z<p>Mudbill: Added redirect page</p>
<hr />
<div><nowiki>#REDIRECT [[HPL2/Engine_Scripts]]</nowiki></div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL3/SOMA/Level_Design&diff=6243HPL3/SOMA/Level Design2021-09-15T06:20:25Z<p>Mudbill: Removed protection from "HPL3/SOMA/Level Design"</p>
<hr />
<div>{{constructionNotice|This category and its sub-pages are undergoing major editing, as some information in this category and all the sub pages is currently in the process of being formatted or re-written from scratch to achieve a higher standard of formatting, or not everything is yet available. More pages and information will gradually be added.}}<br />
<br />
'''This category deals with the SOMA Level Editor, Level Design and related topics.'''<br />
{{CategoryHeader}}<br />
{{CategoryNewcolumn}}<br />
<br />
== Getting Started ==<br />
* [[HPL3/SOMA/Level Design/Your First Map|Your First Map]]<br />
* [[Advice for Level Designers|Advice for Level Designers]]<br />
<br />
== General ==<br />
* [[HPL3/SOMA/Level Design/Level Editor Controls|Level Editor Controls]]<br />
* [[HPL3/SOMA/Level Design/Level Editor View|Level Editor View]]<br />
* [[HPL3/SOMA/Level Design/Level Editor Toolbar|Level Editor Toolbar]]<br />
* [[HPL3/SOMA/Level Design/Level Editor Preferences|Level Editor Preferences]]<br />
* [[HPL3/SOMA/Level Design/Level Settings|Level Settings]]<br />
* [[HPL3/SOMA/Level Design/Level Information|Level Information]]<br />
* [[HPL3/SOMA/Level Design/Pose Editor|Pose Editor]]<br />
* [[HPL3/SOMA/Level Design/Finding Objects|Finding Objects]]<br />
* [[HPL3/SOMA/Level Design/Importing and Exporting Objects|Importing and Exporting Objects]]<br />
* [[HPL3/SOMA/Level Design/Compounds|Compounds]]<br />
<br />
== Primitives ==<br />
* [[HPL3/SOMA/Level Design/Working with Primitives|Working with Primitives]]<br />
<br />
== Static Objects ==<br />
* [[HPL3/SOMA/Level Design/Working with Static Objects|Working with Static Objects]]<br />
<br />
== Entities ==<br />
* [[HPL3/SOMA/Level Design/Working with Static Objects|Working with Entities]]<br />
<br />
== Lighting ==<br />
* [[HPL3/SOMA/Level Design/Point Lights|Point Lights]]<br />
* [[HPL3/SOMA/Level Design/Spot Lights|Spot Lights]]<br />
* [[HPL3/SOMA/Level Design/Light Masks|Light Masks]]<br />
* [[HPL3/SOMA/Level Design/Global Spot Light|Global Spot Light]]<br />
* [[HPL3/SOMA/Level Design/SH Probes|SH Probes]]<br />
<br />
{{CategoryNewcolumn}}<br />
<br />
== Terrain Editor ==<br />
* [[HPL3/SOMA/Level Design/Terrain Editor Overview|Terrain Editor Overview]]<br />
* [[HPL3/SOMA/Level Design/Creating Terrain|Creating Terrain]]<br />
* [[HPL3/SOMA/Level Design/Terrain Height Map|Terrain Height Map]]<br />
* [[HPL3/SOMA/Level Design/Terrain Painting|Terrain Painting]]<br />
* [[HPL3/SOMA/Level Design/Terrain Texturing|Terrain Texturing]]<br />
* [[HPL3/SOMA/Level Design/Undergrowth|Undergrowth]]<br />
<br />
== Effects ==<br />
* [[HPL3/SOMA/Level Design/HDR|HDR]]<br />
* [[HPL3/SOMA/Level Design/Color Grading|Color Grading]]<br />
* [[HPL3/SOMA/Level Design/Environment Particles|Environment Particles]]<br />
* [[HPL3/SOMA/Level Design/Billboards|Billboards]]<br />
* [[HPL3/SOMA/Level Design/Lens Flares|Lens Flares]]<br />
* [[HPL3/SOMA/Level Design/Particles|Particles]]<br />
* [[HPL3/SOMA/Level Design/Sounds|Sounds]]<br />
* [[HPL3/SOMA/Level Design/Decals|Decals]]<br />
* [[HPL3/SOMA/Level Design/Fog Areas|Fog Areas]]<br />
* [[HPL3/SOMA/Level Design/Exposure Areas|Exposure Areas]]<br />
<br />
== Detailing ==<br />
* [[HPL3/SOMA/Level Design/Combos|Combos]]<br />
* [[HPL3/SOMA/Level Design/Detail Meshes|Detail Meshes]]<br />
<br />
== Design Theory ==<br />
* [[HPL3/SOMA/Level Design/Indoor Level Performance|Indoor Level Performance]]<br />
* [[HPL3/SOMA/Level Design/Outdoor Level Performance|Outdoor Level Performance]]<br />
<br />
== Resources ==<br />
*[https://docs.google.com/document/d/1fAlf2MwEFTwePwzbP3try1H0aYa9kpVBHPBkyIq-caY/edit In Pursuit of Better Levels] - Free educational book on Level Design <br />
*[[HPL3/Resources/TDD Asset Pack|"Amnesia: The Dark Descent" Asset Pack]]<br />
{{CategoryEnd}}<br />
<br />
__NOTOC__<br />
<br />
[[Category:Entry pages]]<br />
[[Category:English]]</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/Tools&diff=6200HPL2/Tools2021-01-15T21:19:05Z<p>Mudbill: /* Windows */ Added warning about copying link</p>
<hr />
<div>[[Category:Entry pages]]<br />
{| class="wikitable" style="margin:auto"<br />
! colspan="2" scope="row" |Editors<br />
|-<br />
|'''[[HPL2/Tools/Level Editor|Level Editor]]'''||Everything that you do in the other editors comes to use here.<br />
|-<br />
|'''[[HPL2/Tools/Model Editor|Model Editor]]'''||Makes your 3D models come to life with ingame functions.<br />
|-<br />
|'''[[HPL2/Tools/Particle Editor|Particle Editor]]'''||Create fire, smoke and other particles to spice up levels and models.<br />
|-<br />
|'''[[HPL2/Tools/Material Editor|Material Editor]]'''||Should a texture come with normal, specular or illumination maps? Should the material be transparent or sound like metal?<br />
|-<br />
|[[HPL2/Tools/HplLangTool|'''HPL Language Tool''']]||Helper tool to build,edit, and translate language files<br />
|-<br />
! colspan="2" scope="row" |Viewers<br />
|-<br />
|'''[[HPL2/Tools/Map Viewer|Map Viewer]]'''||Gives extra information about the level and allows viewing without running the game. A useful tool for optimization.<br />
|-<br />
|'''[[HPL2/Tools/Model Viewer|Model Viewer]]'''||See how your model will look ingame without having to start the game or make game specific files. Useful for porting assets.<br />
|}<br />
==Installation Instructions==<br />
Keep in mind that these tools, while having been used to produce actual content and a lot of effort has been put on making them as stable as possible, are a constant work in progress, so bugs and the like may arise anytime. Make sure to back up your work often, and it is highly recommended to use a versioning system (e.g. [https://git-scm.com/ Git]). <br />
<br />
===Windows===<br />
<br />
Download the Windows HPL Editor Suite for Amnesia (click the link, it won't work if you copy it into a tab):<br />
<br />
*[https://fricpub.s3.amazonaws.com/tools/hpl2/amnesia_tdd_1.3_editor_suite.zip Version 1.3 and later]<br />
*[https://fricpub.s3.amazonaws.com/tools/hpl2/hpl_editor_suite.zip Version 1.2 and earlier].<br />
<br />
This file must be unpacked into the folder where you find Amnesia.exe, all .dll files and folders with game data. This may be one of two locations depending on which version of the game you have.<br />
<br />
* '''For Steam users''': This will be your game installation directory, usually <code>C:\Program Files\Steam\steamapps\common\Amnesia - The Dark Descent\</code><br />
* '''For retail/other users''': This will be inside the "redist" folder inside your installation directory, for example <code>C:\Program Files\Amnesia - The Dark Descent\redist\</code><br />
<br />
When reporting crashes and bugs, always include a description of the problem and any log output from the editors themselves. Logs are located in your <code><Documents>\HPL2\</code> folder.<br />
<br />
===Linux===<br />
<br />
Download the Linux HPL Editor Suite for Amnesia:<br />
<br />
*[https://fricpub.s3.amazonaws.com/tools/hpl2/hpl2_editor_suite-linux-2015-03-04.zip Version 1.3 and later]<br />
*[https://fricpub.s3.amazonaws.com/tools/hpl2/hpl_editor_suite_linux.zip Version 1.2.1 and earlier]<br />
<br />
'''Updated 2011-02-19''' Updated to fix crashes when selecting enemies.<br />
<br />
Extract the zip and run the installer (<code>hpl_editor_suite.sh</code>).<br />
<br />
The installer should automatically find your currently installed copy of Amnesia if you installed it in one of the common installation locations. If not, simply select the Amnesia folder where you installed the game.<br />
<br />
'''Note:''' No menu items are created by the installer, it simply installs the editor data files and executables for your platform.<br />
<br />
'''Note:''' The HplLangTool.exe is included in the Linux HPL editor suite, it is a .NET application that does run under wine/mono.<br />
<br />
When reporting crashes and bugs, always include a description of the problem and any log output from the editors themselves. Logs are located in your <code>~/.frictionalgames/HPL2</code> folder.<br />
<br />
===Mac OS X===<br />
<br />
Download the Mac OS X HPL Editor Suite:<br />
<br />
*[https://fricpub.s3.amazonaws.com/tools/hpl2/HPL2-EditorSuite-OSX-2015-03-04.dmg Version 1.3 and later]<br />
*[https://fricpub.s3.amazonaws.com/tools/hpl2/hpl2editorsuite.dmg Version 1.2.1 and earlier]<br />
*[https://fricpub.s3.amazonaws.com/tools/hpl2/hpl2editorsuite-manual.dmg Manual Install for version 1.2.1 and earlier]. (Use the Manual Install only if you have issues with the automated installer, and be ''SURE'' to read the directions)<br />
<br />
Extract the zip and run the installer (''HPL2 Editor Suite Installer''). The installer should automatically find your currently installed copy of Amnesia no matter where you purchased it (including Steam). After installing the tools, simply run Amnesia and select the "Editor Suite" tab in the launcher to run the tools.<br />
<br />
Notes:<br />
<br />
*This{{clarify}} currently is not for the Mac [http://www.proleadsoft.com/mobile-app-development/| App Store] release, as updates to Amnesia will completely remove the Editor suite. Please read [http://support.frictionalgames.com/entry/103/ this] for more information.<br />
*'''Update 2011-02-19''' Includes fixes for crashes and "hangs"<br />
*'''Update 2011-03-19''' Includes fixes for a crash that occurs when selecting entities to add to a level<br />
*You must install the [http://support.frictionalgames.com/entry/100/ Amnesia 1.0.1.2 Mac OS X Patch] (this is a Mac-only patch). Steam users will get the update directly from the Steam client.<br />
<br />
When reporting crashes and bugs, always include a description of the problem and any log output from the editors themselves. Logs are located in your <code>~/Library/Application Support/Frictional Games/HPL2</code> folder.<br />
<br />
== Community tools ==<br />
<br />
After the HPL2 games went open-source, the community managed to compile newer editors with a few quality-of-life improvements. They are '''available for Windows and Linux.'''<br />
The new features include:<br />
* A much more comfortable color picker<br />
* Dark theme (installed by default, but the original one can be reinstated)<br />
* Keyboard shortcuts for common utilities (e.g. grid snapping)<br />
* Ability to load MFP maps and assets without errors<br />
* Other small improvements<br />
<br />
Check [https://github.com/TiManGames/AmnesiaTheDarkDescent/releases this Github page to download the latest version]. Not all files and editors are included in this download, so please install the original editors first.<br />
<br />
'''Installation:'''<br />
#Download the archive of your choice.<br />
#Extract the contents into the main directory of Amnesia.<br />
#Merge and overwrite all when asked.<br />
No information will be lost by replacing these files, so no need to create a backup.</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/Tools/Level_Editor&diff=6197HPL2/Tools/Level Editor2020-12-29T19:21:02Z<p>Mudbill: </p>
<hr />
<div>{{DISPLAYTITLE:Level Editor}}<br />
[[File:LevelEditorGr.jpg|thumb|right|The level editor.]]<br />
The Level Editor is our own application to build maps for HPL2-based games. It is comprised of a set of basic object creation and edition modes which make the building task a lot easier.<br />
<br />
==Overview==<br />
<br />
When run, the first screen we get to see is like this:<br />
<br />
[[File:leveleditoroverview-small.jpg]]<br />
<br />
Each part of the screen has a specific function, as follows:<br />
<br />
#[[#main_menu|Main menu bar]]: this is where every non-editor command lies, as well as some edition ones.<br />
#[[#editmode_selection_bar|EditMode sidebar]]: here you will find a set of buttons used to switch the current behaviour of the editor. More on this later.<br />
#EditMode window area: any helper input the current EditMode needs will appear here.<br />
#[[HPL2/Tools/Viewport|Viewport area]]: this area of the screen is reserved for the viewports, which are used to actually see what you are doing to the map. Every viewport has its own menu bar, to control some parameters of the visualization.<br />
#[[#lower_toolbar|Lower toolbar]]: some tools that are either viewport-dependent or global are located here.<br />
<br />
Not listed above are some special windows, used pretty often here:<br />
<br />
*''' [[HPL2/Tools/Save Dialog|Save file dialog]] '''<br />
*''' [[HPL2/Tools/Load Dialog|Load file dialog]] '''<br />
*''' [[HPL2/Tools/Color Picker|Color Picker]] '''<br />
*''' [[HPL2/Tools/Texture Browser|Texture Browser]] '''<br />
*''' [[HPL2/Tools/Sound Browser|Sound Browser]]'''<br />
<br />
==Main Menu==<br />
<br />
This is a menu bar, just like in any other windowed application. Available options for this particular editor are as follows:<br />
<br />
*'''File:''' <br />
**'''New''': This command will reset the map to an empty one, and the editor to a default state as well.<br />
**'''Open''': This will load a map file picked in a dialog in the editor.<br />
**'''Save''': Use this to save your work to a file in disk. Will ask for a file name when no file has been created.<br />
**'''Save As''': This will also save your work, but will ask for a file name everytime it is called.<br />
**'''Open Recent''': This will show a list of up to 10 files that have been recently loaded or saved.<br />
**'''Import Objects''': This will show a file dialog with exported object (.expobj) files. When picked, the objects in the file will be added to the map.<br />
**'''Export Selection''': This will save the current selection to a .expobj file.<br />
**'''Quit''': This will exit the program.<br />
<br />
*'''Edit:''' <br />
**'''Undo''': Use this to undo the last action. Note that not everything you can do in the editor is undo-able.<br />
**'''Redo''': Use this to redo the last undone action.<br />
**'''Duplicate''': This will clone the current selected objects. More details on selection later.<br />
**'''Delete''': This will delete the current selected objects.<br />
**'''Create''' /'''Destroy compound object''': Use this to create a compound object with the current selected objects, or to destroy the currently selected compound object. More on compound objects [[HPL2/Tools/Level Editor/Compounds|here]].<br />
**'''Search for object''': This will open the [[HPL2/Tools/Level Editor/Find Objects|Find Objects window]] window. It is useful when you want to find a particular object and don't want to actually look for it.<br />
**'''Browse groups''': This will open the [[HPL2/Tools/Level Editor/Group Window|Group window]]. This one is used to manage groups of objects.<br />
**'''Level Settings''': This will open the [[HPL2/Tools/Level Editor/Level Settings|Level Settings window]] window. This is used to add global fog and skybox to a level, also has other tools.<br />
**'''Options''': This will open the [[HPL2/Tools/Level Editor/Options Window|Options Window]]. You will find general settings for the editor here.<br />
<br />
==EditMode selection bar==<br />
Here you will be able to switch between the different EditModes available in this editor. An EditMode describes the state the editor is going to work in when selected. These five EditModes can be found in this editor and the Model Editor.<br />
<br />
*[[HPL2/Tools/Select Editmode|Select EditMode]]: this mode is used to select and edit objects.<br />
*[[HPL2/Tools/Light Editmode|Light EditMode]]: with this mode you will be able to place lights.<br />
*[[HPL2/Tools/Billboard Editmode|Billboard EditMode]]: use this to create billboards; light halos, light shafts, etc.<br />
*[[HPL2/Tools/Particle System Editmode|Particle System EditMode]]: one can add Particle systems to the entity with this mode.<br />
*[[HPL2/Tools/Sound Editmode|Sound EditMode]]: used to place sound entities in the map.<br />
<br />
The following EditModes are exclusive to the Level Editor:<br />
<br />
*[[HPL2/Tools/Level Editor/Static Object Editmode|Static object EditMode]]: this, and the Primitive EditMode, are the actual building tools. StaticObjects (aka level pieces) are placed using this.<br />
*[[HPL2/Tools/Level Editor/Primitive Editmode|Primitive EditMode]]: creates static geometry to be part of the map. Only Planes are currently supported.<br />
*[[HPL2/Tools/Level Editor/Entity Editmode|Entity EditMode]]: objects that are interactive, such as doors, boxes and NPCs are created here.<br />
*[[HPL2/Tools/Level Editor/Area Editmode|Area EditMode]]: Areas are places that can be used for several purposes, like linking to scripts, setting up where the player starts the map, and so on.<br />
*[[HPL2/Tools/Level Editor/Decal Editmode|Decal EditMode]]: give detail to objects by placing decals on them.<br />
*[[HPL2/Tools/Level Editor/Fog Editmode|Fog EditMode]]: similar to the Area EditMode, but will place volumes containing a fog effect.<br />
*[[HPL2/Tools/Level Editor/Combine Editmode|Combine EditMode]]: useful for optimizing, creates groups of static geometry that will be loaded by the engine as a whole.<br />
<br />
==Viewport area==<br />
This area is meant to actually show what the map contains. Main article: [[HPL2/Tools/Viewport|editor viewport]].<br />
<br />
==Lower Toolbar==<br />
You can find some useful controls in this bar located at all times at the lower part of the screen.<br />
<br />
[[File:Level-editor-lower-toolbar.PNG]]<br />
<br />
#Grid Controls: <br />
#*'''Grid Plane''': cycles through the available grid planes (XZ, XY, YZ).<br />
#*'''Toggle Snap''' (magnet button): enables/disables snapping for translation (over grid), rotation and scale.<br />
#*'''Grid Height''': height of the plane, measured on the plane normal.<br />
#*'''Snap Separation''': separation of snapping points.<br />
#'''Enlarge Viewport button''': will toggle enlargement of the focused viewport.<br />
#Misc controls(Note: these are not shortcuts):<br />
#*'''A''': toggles global ambient lighting<br />
#*'''P''': togles global point light<br />
#*'''LT''': toggles Lock to grid for tracking in focused viewport<br />
#*'''F''': focus on current selection<br />
#Clip Plane controls<br />
#*'''Selected clip plane''': used to select a clip plane among the available ones.<br />
#*'''Add/Remove clip plane''' (+/- buttons): adds a new clip plane / removes the selected one.<br />
#*'''Actual Plane''': cycles through the available planes (XZ, XY, YZ).<br />
#*'''Plane height''': height of the plane, measured on the plane normal.<br />
#*'''Pos'''/'''Neg Button''': sets the culling side of the plane.<br />
#*'''Active''': sets whether the plane should cull objects.<br />
<br />
==Types of Objects==<br />
These are the kinds of objects that you can create and place in this editor. Details on each one and parameter listing in the following links:<br />
<br />
*[[HPL2/Lights|Lights]]<br />
*[[HPL2/Billboards|Billboards]]<br />
*[[HPL2/Particle Systems|Particle Systems]]<br />
*[[HPL2/Sounds|Sounds]]<br />
<br />
The following types are exclusive to the Level Editor:<br />
<br />
*[[HPL2/Static Objects|Static Objects]]<br />
*[[HPL2/Entities| Entities]]<br />
*[[HPL2/Areas|Areas]]<br />
*[[HPL2/Primitives|Primitives]]<br />
*[[HPL2/Decals|Decals]]<br />
*[[HPL2/Fog Areas|FogAreas]]<br />
*[[HPL2/Tools/Level Editor/Compounds|Compound Objects]]</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL3/Amnesia:_Rebirth/Modding/Creating_a_Mod&diff=6194HPL3/Amnesia: Rebirth/Modding/Creating a Mod2020-12-12T21:29:49Z<p>Mudbill: Fixed developer command link from SOMA to Rebirth</p>
<hr />
<div>{{shortPageTitle}}<br />
<br />
This article describes in detail how to create, setup and structure your mod.<br><br />
'''Important: Make sure you have a folder named <code>mods</code> in your game directory. If you do not have it, then just create an empty folder and name it <code>mods</code>.'''<br />
<br />
{{tip|The game offers a basic example mod: <code>[[HPL3/Amnesia:_Rebirth/Modding/MinimalCustomMapMod|MinimalCustomMapMod]]</code>. You can copy it or use it as reference for creating your own mod.}}<br />
<br />
<br />
==Mod Types==<br />
Amnesia: Rebirth has one mod type called a Stand-Alone mod. <br />
<br />
===Stand-Alone Mod===<br />
A Stand-Alone mod describes a mod of any scale: From a simple mod with a few maps to an extensive game modification of custom assets and custom scripts.<br />
<br />
==Mod Structure==<br />
A typical mod structure (folders and files) may look like this:<syntaxhighlight lang="css"><br />
modFolder/<br />
├── config/<br />
│ ├── lang/<br />
│ │ ├── english.lang<br />
│ ├── main_init.cfg<br />
├── maps/<br />
├── entry.hpc<br />
├── resources.cfg<br />
</syntaxhighlight> <br />
The mod structure may change and have more or less files, depends on your mod type, but '''it's important to have entry.hpc and resources.cfg for every mod.'''<br />
<br />
==Mod Entry File==<br />
When creating a mod, be it a simple add-on or a fully fledged total conversion, an entry file is needed so that the mod can be listed by the custom stories menu or simply be started by the game.<br />
This means that an XML file with name <code>entry.hpc</code> needs to be created in the root directory of the mod, and its contents will depend on what kind of mod you are creating.<br />
<br />
===Setting up the Entry File===<br />
{{tip|It is recommended to copy one the sample mod (MinimalCustomMap) provided in this page and edit the files, instead of doing this manually. This way, you won't miss anything by mistake.}}<br />
<br />
#Create a file named <code>entry.hpc</code> in your mod's root folder.<br />
#Paste the following content into the file and save:<syntaxhighlight lang="xml"><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<Content Version="1.0"<br />
Type="StandAlone"<br />
Title="Your mod name here"<br />
Author="Your name here"<br />
Description_english="Mod description here"<br />
<br />
LauncherPic="LauncherPic.png"<br />
InitCfg="config/main_init.cfg"<br />
/><br />
</syntaxhighlight><br />
<br />
===Common Attributes===<br />
Any valid <code>entry.hpc</code> file (like the one shown above), will have at least the following attributes:<br />
{| class="wikitable"<br />
|+<br />
|-<br />
|Version<br />
|The version for the mod, since the mod might get updated in the future.<br />
|-<br />
|Type<br />
|The type for the content the mod is offering. Possible is<code>"StandAlone"</code>.<br />
|-<br />
|Title<br />
|This sets the title for the mod. It should not be longer than 128 characters, especially if the mod is to be uploaded to the Steam Workshop.<br />
|-<br />
|Author<br />
|The creator(s) of the mod. This will be shown below the title on the info column in the custom stories menu.<br />
|-<br />
|Description_English<br />
|The description of the mod. Should not exceed 8000 characters for the same reason as the title.<br />
For localizing descriptions, add a translated entry for the target language under the Description_(name of target language) parameter.<br />
|-<br />
|LauncherPic<br />
|The file to be used as a thumbnail picture for the Custom Story menu page.<br />
|-<br />
|InitCfg<br />
|The relative path to the file which information when initializing the mod. The default value is <code>"config/main_init.cfg"</code> and usually shouldn't be changed.<br />
|}<br />
{{Tip|Unsure about how to label your mod versions? Read about semantic versioning [https://semver.org/ here]}}<br />
<br />
===Special Attributes===<br />
There are special attributes which can be added to a mod entry file in order to enable optional functionalities:<br />
<br />
{| class="wikitable"<br />
|+<br />
|UID<br />
|A string in the form <code>"provider_name.mod_name"</code>. This is used so other mods can reference your mod as a [[HPL3/Modding/Mod_Dependencies|Mod Dependency]]<br />
|-<br />
|Dependencies<br />
|A list of UIDs separated by commas. The resources in these mods will be available to the game when the current mod is running.<br />
|}<br />
<br />
==Mod Configuration Files==<br />
In addition to the mod entry file, the mod needs to be correctly configured in order to load resources such as maps, script, sounds, sounds, etc (As seen in the Mod Structure diagram).<br />
<br />
Read the following articles in order to understand how to set up and configure them:<br />
<br />
*[[HPL3/Resources Configuration|Resources Configuration]]<br />
*[[HPL3/Launch Configuration|Launch Configuration]]<br />
*[[HPL3/Language Configuration|Language Configuration]]<br />
<br />
It is recommended to copy the files from the mods provided with the game and modify them, instead of creating them on your own.<br />
<br />
==Running the Mod==<br />
There are two different ways to run a mod:<br />
<br />
1.<u>Through the Custom Story menu page in Main menu:</u> This method should generally be used when testing the final version of your mod. After selecting the mod, the game will restart and will load the mod.<br />
[[File:Rebirth-custom-stories-emnu.jpg|thumb|left|Custom Stories menu.]] {{clr}}<br />
<br />
2.<u>Command Line:</u> To run a mod directly with dev features enabled, you only need to run the game executable passing the "-mod" argument followed by word <code>local:</code> and then immediately the name of the mod folder. This method should be used throughout the development of your mod.<br />
<br />
Example:<syntaxhighlight lang="bash"><br />
AmnesiaRebirth.exe -mod local:my_mod<br />
</syntaxhighlight><br />
There are more arguments which can be added to the command line. It is recommended to create a <code>.bat</code> file which will launch the mod.<br />
<br />
{{warning|If you do not run the game with <code>-mod</code> command and your mod uses custom assets, you won't be able to see the assets in-game!}}<br />
<br />
''Main article: [[HPL3/Amnesia: Rebirth/Developer Commands|Developer Commands]]''<br />
<br />
==What's Next==<br />
Now that the mod is set up, you may proceed to set up a [[HPL3/Amnesia: Rebirth/Modding/Setup Modding Environment|Modding Environment]] for your game, and learn how to use the [[HPL3/Amnesia: Rebirth/Modding/Developer Debug Menu|Developer Debug Menu]].<br />
it is also recommended to [[Setting up an Online Repository|set up an online repository]].<br />
More articles are available in the main Amnesia: Rebirth modding category.<br />
<br />
==See Also==<br />
<br />
*[[Mod Content Usage]]<br />
<br />
[[Category:Modding]]<br />
[[Category:English]]</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL3/SOMA/Developer_Commands&diff=5563HPL3/SOMA/Developer Commands2020-11-10T03:36:25Z<p>Mudbill: Moved default value before description</p>
<hr />
<div>{{ShortPageTitle}}<br />
When launching a game or a mod via a Command Prompt (CMD .bat file), you can pass optional arguments which will affect the way the mod is loaded by the game. It can be useful for mods which require custom assets and scripts, or if you want to customize it further than that.<br />
<br />
==Command Line Arguments==<br />
{{Note|You can add multiple arguments and combine them when launching the game. It doesn't have to be only one argument.}}<br />
{| class="wikitable"<br />
!Argument<br />
!Default Value<br />
!Description<br />
!Example<br />
|-<br />
|user<br />
|<code>Default</code><br />
|Starts the game with a different user name. <br />
<br />
This is useful for starting a game / mod with a different set of save files, as they are saved per-user.<br />
|<code>Soma.exe -user Default_dev</code><br />
|-<br />
|cfg<br />
|<code>config/main_init.cfg</code><br />
|Changes the main config file that is used when starting the mod.<br />
<br />
This is useful if the relative path of the config file inside your mod folder is different and you want to point to your file.<br />
|<code>Soma.exe -cfg config/main_init_dev.cfg</code><br />
|-<br />
|mod<br />
|''No default value.''<br />
|Points to a mod entry file and launches the mod instead of the main game. Use this if you want to run your mod in dev mode.<br />
This argument requires a full path of the game / mod directory.<br />
|<code>Soma.exe -mod "C:\SOMA\mods\myMod\entry.hpc"</code><br />
|-<br />
|map<br />
|Stated at <code>StartMap->File</code> in <code>main_init.cfg</code>.<br />
|The game loads a specific map after startup.<br />
<br />
This is useful if you want to load a specific map quickly or if you want to skip the "load map" option in the debug menu.<br />
|<code>Soma.exe -map "mods/myMod/maps/myMap.hpm"</code><br />
|-<br />
|mapfolder<br />
|Stated at StartMap->Folder in <code>main_init.cfg</code>.<br />
|Starts the game with a specific map folder.<br />
|<code>Soma.exe -mapfolder "mods/myMod/maps"</code><br />
|-<br />
|mappos<br />
|Stated at <code>StartMap->Pos</code> in <code>main_init.cfg.</code><br />
|Sets a specific start position to be used in a map.<br />
<br />
This is useful if you want to test your map from a specific position or if you want to skip the "jump to start pos" option in the debug menu.<br />
|<code>Soma.exe -map "PathToMap/myMap.hpm" -mappos "MyPos"</code><br />
|-<br />
|workdir<br />
|''No default value.''<br />
|Which directory the game exe is located. Can be used to change between engine and main redist. <br />
'''This command line argument is useful for the engine developers only!'''<br />
|''No default value.''<br />
|}</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL3/Amnesia:_Rebirth/Developer_Commands&diff=5562HPL3/Amnesia: Rebirth/Developer Commands2020-11-10T03:24:01Z<p>Mudbill: Made platform agnostic and some clearer formatting.</p>
<hr />
<div>{{ShortPageTitle}}<br />
When launching a game or a mod via the command line, you can pass optional arguments which will affect the way the game is loaded. It can be useful for mods which require custom assets and scripts, or if you want to customize it further than that.<br />
<br />
An example of useful arguments to use in a Windows .bat file, to start a mod in developer mode:<br />
AmnesiaRebirth.exe -user Dev -cfg config/main_init_dev.cfg -mod local:MyMod<br />
<br />
==Command Line Arguments==<br />
{{Note|You can add multiple arguments and combine them when launching the game.}}<br />
{| class="wikitable"<br />
!Argument<br />
!Default Value<br />
!Description<br />
!Example<br />
|-<br />
|<code>-user</code><br />
|<code>Default</code><br />
|Starts the game with a different user name. <br />
<br />
This is useful for starting a game / mod with a different set of save files, as they are saved per-user.<br />
|<code>-user Default_dev</code><br />
|-<br />
|<code>-cfg</code><br />
|<code>config/main_init.cfg</code><br />
|Changes the main config file that is used when starting the mod.<br />
<br />
This is useful if the relative path of the config file inside your mod folder is different and you want to point to your file.<br />
|<code>-cfg config/main_init_dev.cfg</code><br />
|-<br />
|<code>-mod</code><br />
|''No default value.''<br />
|Launches a mod instead of the main game. Use this if you want to run your mod in dev mode.<br />
This argument begins with either <code>local:</code> or <code>steamworkshop:</code> depending on where the mod is sourced from. In most cases you want to use <code>local:</code>, since this is mostly for mod developers. After this first keyword immediately follows the name of the mod folder or the Steam Workshop ID of the mod.<br />
|<code>-mod local:MyMod</code><br><code>-mod steamworkshop:42069</code><br />
|-<br />
|<code>-map</code><br />
|Stated at <code>StartMap->File</code> in <code>main_init.cfg</code>.<br />
|The game loads a specific map after startup.<br />
<br />
This is useful if you want to load a specific map quickly or if you want to skip the "load map" option in the debug menu.<br />
|<code>-map "mods/myMod/maps/myMap.hpm"</code><br />
|-<br />
|<code>-mapfolder</code><br />
|Stated at <code>StartMap->Folder</code> in <code>main_init.cfg</code>.<br />
|Starts the game with a specific map folder.<br />
|<code>-mapfolder "mods/myMod/maps"</code><br />
|-<br />
|<code>-mappos</code><br />
|Stated at <code>StartMap->Pos</code> in <code>main_init.cfg.</code><br />
|Sets a specific start position to be used in a map.<br />
<br />
This is useful if you want to test your map from a specific position or if you want to skip the "jump to start pos" option in the debug menu.<br />
|<code>-map "PathToMap/myMap.hpm" -mappos "MyPos"</code><br />
|-<br />
|<code>-workdir</code><br />
|''No default value.''<br />
|Which directory the game exe is located. Can be used to change between engine and main redist. <br />
'''This command line argument is useful for the engine developers only!'''<br />
|''No default value.''<br />
|}</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL3/Amnesia:_Rebirth/Developer_Commands&diff=5561HPL3/Amnesia: Rebirth/Developer Commands2020-11-10T03:16:13Z<p>Mudbill: </p>
<hr />
<div>{{ShortPageTitle}}<br />
When launching a game or a mod via a Command Prompt (CMD .bat file), you can pass optional arguments which will affect the way the mod is loaded by the game. It can be useful for mods which require custom assets and scripts, or if you want to customize it further than that.<br />
<br />
==Command Line Arguments==<br />
{{Note|You can add multiple arguments and combine them when launching the game. It doesn't have to be only one argument.}}<br />
{| class="wikitable"<br />
|+<br />
!Argument<br />
!Description<br />
!Default Value<br />
!Example<br />
|-<br />
|user<br />
|Starts the game with a different user name. <br />
<br />
This is useful for starting a game / mod with a different set of save files, as they are saved per-user.<br />
|<code>Default</code><br />
|<code>AmnesiaRebirth.exe -user Default_dev</code><br />
|-<br />
|cfg<br />
|Changes the main config file that is used when starting the mod.<br />
<br />
This is useful if the relative path of the config file inside your mod folder is different and you want to point to your file.<br />
|<code>config/main_init.cfg</code><br />
|<code>AmnesiaRebirth.exe -cfg config/main_init_dev.cfg</code><br />
|-<br />
|mod<br />
|Launches a mod instead of the main game. Use this if you want to run your mod in dev mode.<br />
This argument begins with either <code>local:</code> or <code>steamworkshop:</code> depending on where the mod is sourced from. In most cases you want to use <code>local:</code>, since this is mostly for mod developers. After this first keyword immediately follows the name of the mod folder or the Steam Workshop ID of the mod.<br />
|''No default value.''<br />
|<code>AmnesiaRebirth.exe -mod local:myMod</code><br><code>AmnesiaRebirth.exe -mod steamworkshop:42069</code><br />
|-<br />
|map<br />
|The game loads a specific map after startup.<br />
<br />
This is useful if you want to load a specific map quickly or if you want to skip the "load map" option in the debug menu.<br />
|Stated at <code>StartMap->File</code> in <code>main_init.cfg</code>.<br />
|<code>AmnesiaRebirth.exe -map "mods/myMod/maps/myMap.hpm"</code><br />
|-<br />
|mapfolder<br />
|Starts the game with a specific map folder.<br />
|Stated at StartMap->Folder in <code>main_init.cfg</code>.<br />
|<code>AmnesiaRebirth.exe -mapfolder "mods/myMod/maps"</code><br />
|-<br />
|mappos<br />
|Sets a specific start position to be used in a map.<br />
<br />
This is useful if you want to test your map from a specific position or if you want to skip the "jump to start pos" option in the debug menu.<br />
|Stated at <code>StartMap->Pos</code> in <code>main_init.cfg.</code><br />
|<code>AmnesiaRebirth.exe -map "PathToMap/myMap.hpm" -mappos "MyPos"</code><br />
|-<br />
|workdir<br />
|Which directory the game exe is located. Can be used to change between engine and main redist. <br />
'''This command line argument is useful for the engine developers only!'''<br />
|''No default value.''<br />
|''No default value.''<br />
|}</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL3/Amnesia:_Rebirth/Developer_Commands&diff=5560HPL3/Amnesia: Rebirth/Developer Commands2020-11-10T03:15:20Z<p>Mudbill: Updated description for -mod argument and added Steam Workshop example.</p>
<hr />
<div>{{ShortPageTitle}}<br />
When launching a game or a mod via a Command Prompt (CMD .bat file), you can pass optional arguments which will affect the way the mod is loaded by the game. It can be useful for mods which require custom assets and scripts, or if you want to customize it further than that.<br />
<br />
==Command Line Arguments==<br />
{{Note|You can add multiple arguments and combine them when launching the game. It doesn't have to be only one argument.}}<br />
{| class="wikitable"<br />
|+<br />
!Argument<br />
!Description<br />
!Default Value<br />
!Example<br />
|-<br />
|user<br />
|Starts the game with a different user name. <br />
<br />
This is useful for starting a game / mod with a different set of save files, as they are saved per-user.<br />
|<code>Default</code><br />
|<code>AmnesiaRebirth.exe -user Default_dev</code><br />
|-<br />
|cfg<br />
|Changes the main config file that is used when starting the mod.<br />
<br />
This is useful if the relative path of the config file inside your mod folder is different and you want to point to your file.<br />
|<code>config/main_init.cfg</code><br />
|<code>AmnesiaRebirth.exe -cfg config/main_init_dev.cfg</code><br />
|-<br />
|mod<br />
|Launches a mod instead of the main game. Use this if you want to run your mod in dev mode.<br />
This argument begins with either <code>local:</code> or <code>steamworkshop:</code> depending on where the mod is sourced from. In most cases you want to use <code>local:</code>, since this is mostly for mod developers. After this first keyword immediately follows the name of the mod folder or the Steam Workshop ID of the mod.<br />
|''No default value.''<br />
|<code>AmnesiaRebirth.exe -mod local:myMod</code><code>AmnesiaRebirth.exe -mod steamworkshop:42069</code><br />
|-<br />
|map<br />
|The game loads a specific map after startup.<br />
<br />
This is useful if you want to load a specific map quickly or if you want to skip the "load map" option in the debug menu.<br />
|Stated at <code>StartMap->File</code> in <code>main_init.cfg</code>.<br />
|<code>AmnesiaRebirth.exe -map "mods/myMod/maps/myMap.hpm"</code><br />
|-<br />
|mapfolder<br />
|Starts the game with a specific map folder.<br />
|Stated at StartMap->Folder in <code>main_init.cfg</code>.<br />
|<code>AmnesiaRebirth.exe -mapfolder "mods/myMod/maps"</code><br />
|-<br />
|mappos<br />
|Sets a specific start position to be used in a map.<br />
<br />
This is useful if you want to test your map from a specific position or if you want to skip the "jump to start pos" option in the debug menu.<br />
|Stated at <code>StartMap->Pos</code> in <code>main_init.cfg.</code><br />
|<code>AmnesiaRebirth.exe -map "PathToMap/myMap.hpm" -mappos "MyPos"</code><br />
|-<br />
|workdir<br />
|Which directory the game exe is located. Can be used to change between engine and main redist. <br />
'''This command line argument is useful for the engine developers only!'''<br />
|''No default value.''<br />
|''No default value.''<br />
|}</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL3/Amnesia:_Rebirth/Modding/Setup_Modding_Environment&diff=5559HPL3/Amnesia: Rebirth/Modding/Setup Modding Environment2020-11-10T02:58:09Z<p>Mudbill: Rewrote some bits to be multi-platform rather than Windows focused.</p>
<hr />
<div>{{shortPageTitle}}<br />
In order to have a smooth modding development experience, Amnesia: Rebirth should be configured to run in a proper development environment.<br />
<br />
==Setting up Custom Story Dev Mode==<br />
During development, it is extremely helpful to have access to the development options and [[HPL3/Amnesia:_Rebirth/Modding/Developer_Debug_Menu|debug mode]] of the game. To achieve that, you need to start the game with a few extra arguments. It is suggested that you set up a script file for your mod so you can more quickly launch it in development mode.<br />
<br />
#In the main folder of the game, create a script file with a recognizable name for your mod development. For example: <code>myMod_dev.bat</code> (.sh for Mac/Linux)<br />
#Paste the following text into the file and save, changing <code>MyModName</code> so it fits your mod <u>folder name</u>.<br />
<pre>AmnesiaRebirth.exe -user Dev -cfg config/main_init_dev.cfg -mod local:MyModName</pre><br />
'''Non-Windows users''': Substitute <code>AmnesiaRebirth.exe</code> with your platform's executable, for example: <code>./Amnesia2.bin.x86_64</code><br />
<br />
You can now launch the script file throughout the development of your mod.<br />
<br />
==Setting up the Editors==<br />
Your mod might have custom assets. In order to make the editors (Level Editor, Model Editor, etc) to load your mod's assets, it needs to be configured into a special mode called "WIP Mod". <br />
{{tip|Even if your mod doesn't have any custom assets, it's a good practice to configure the Level Editor anyway, just so you won't have to deal with it in the future should you decide to add custom assets.}} <br />
<br />
===WIP Mod - Manual Configuration===<br />
<br />
#Navigate to <code>My Documents/HPL3</code>. You need to open one of the editors at least once in order to see the HPL3 folder inside your document folder.<br />
#Inside that folder, create a file called <code>WIPMod.cfg</code>.<br />
#Paste the following into the file, and save:<br />
<syntaxhighlight lang="xml"><br />
<WIPmod Path="Full_Path_To_Mod/entry.hpc" /><br />
</syntaxhighlight><br />
(Of course, you will have to change the path in order to suit your own location of the mod).<br />
<br />
===Final Step===<br />
<br />
If your mod indeed has custom assets, you need to make sure the editors can add them to their look up list. <br />
<br />
#In your mod's folder, create a new folder and name it <code>editor</code>.<br />
#Inside that folder, create a file called <code>lookupdirs.cfg</code>.<br />
#Create a new <code><Directories></code> xml tag inside the file.<br />
#Add a list of directories which include your custom assets. The directory has to be associated with a category. The allowed categories are:<br />
#*<code>StaticObjects</code><br />
#*<code>Entities</code><br />
#*<code>Billboards</code><br />
#*<code>Particles</code><br />
#*<code>Sounds</code><br />
<br />
Example file:<br />
<syntaxhighlight lang="xml"><br />
<Directories><br />
<Dir Category="StaticObjects" Path="assets/static_objects" /><br />
<Dir Category="Entities" Path="assets/entities" /><br />
<Dir Category="Billboards" Path="assets/billboards" /><br />
<Dir Category="Particles" Path="assets/particles" /><br />
<Dir Category="Sounds" Path="assets/sounds" /><br />
</Directories><br />
</syntaxhighlight><br />
<br />
If all the above is done correctly, a <code>(Working on mod)</code> text should appear on the title bar of HPL3 editors when run.<br />
<br />
[[Category:Modding]]<br />
[[Category:English]]</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL3/Amnesia:_Rebirth/Modding/Creating_a_Mod&diff=5497HPL3/Amnesia: Rebirth/Modding/Creating a Mod2020-11-07T03:11:04Z<p>Mudbill: Added tip about semantic versioning</p>
<hr />
<div>{{shortPageTitle}}<br />
<br />
This article describes in detail how to create, setup and structure your mod.<br><br />
'''Important: Make sure you have a folder named <code>mods</code> in your game directory. If you do not have it, then just create an empty folder and name it <code>mods</code>.'''<br />
<br />
{{tip|The game offers a basic example mod: <code>[[HPL3/Amnesia:_Rebirth/Modding/MinimalCustomMapMod|MinimalCustomMapMod]]</code>. You can copy it or use it as reference for creating your own mod.}}<br />
<br />
<br />
==Mod Types==<br />
Amnesia: Rebirth has one mod type called a Stand-Alone mod. <br />
<br />
===Stand-Alone Mod===<br />
A Stand-Alone mod describes a mod of any scale: From a simple mod with a few maps to an extensive game modification of custom assets and custom scripts.<br />
<br />
==Mod Structure==<br />
A typical mod structure (folders and files) may look like this:<syntaxhighlight lang="css"><br />
modFolder/<br />
├── config/<br />
│ ├── lang/<br />
│ │ ├── english.lang<br />
│ ├── main_init.cfg<br />
├── maps/<br />
├── entry.hpc<br />
├── resources.cfg<br />
</syntaxhighlight> <br />
The mod structure may change and have more or less files, depends on your mod type, but '''it's important to have entry.hpc and resources.cfg for every mod.'''<br />
<br />
==Mod Entry File==<br />
When creating a mod, be it a simple add-on or a fully fledged total conversion, an entry file is needed so that the mod can be listed by the custom stories menu or simply be started by the game.<br />
This means that an XML file with name <code>entry.hpc</code> needs to be created in the root directory of the mod, and its contents will depend on what kind of mod you are creating.<br />
<br />
===Setting up the Entry File===<br />
{{tip|It is recommended to copy one the sample mod (MinimalCustomMap) provided in this page and edit the files, instead of doing this manually. This way, you won't miss anything by mistake.}}<br />
<br />
#Create a file named <code>entry.hpc</code> in your mod's root folder.<br />
#Paste the following content into the file and save:<syntaxhighlight lang="xml"><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<Content Version="1.0"<br />
Type="StandAlone"<br />
Title="Your mod name here"<br />
Author="Your name here"<br />
Description_english="Mod description here"<br />
<br />
LauncherPic="LauncherPic.png"<br />
InitCfg="config/main_init.cfg"<br />
/><br />
</syntaxhighlight><br />
<br />
===Common Attributes===<br />
Any valid <code>entry.hpc</code> file (like the one shown above), will have at least the following attributes:<br />
{| class="wikitable"<br />
|+<br />
|-<br />
|Version<br />
|The version for the mod, since the mod might get updated in the future.<br />
|-<br />
|Type<br />
|The type for the content the mod is offering. Possible is<code>"StandAlone"</code>.<br />
|-<br />
|Title<br />
|This sets the title for the mod. It should not be longer than 128 characters, especially if the mod is to be uploaded to the Steam Workshop.<br />
|-<br />
|Author<br />
|The creator(s) of the mod. This will be shown below the title on the info column in the custom stories menu.<br />
|-<br />
|Description_English<br />
|The description of the mod. Should not exceed 8000 characters for the same reason as the title.<br />
For localizing descriptions, add a translated entry for the target language under the Description_(name of target language) parameter.<br />
|-<br />
|LauncherPic<br />
|The file to be used as a thumbnail picture for the Custom Story menu page.<br />
|-<br />
|InitCfg<br />
|The relative path to the file which information when initializing the mod. The default value is <code>"config/main_init.cfg"</code> and usually shouldn't be changed.<br />
|}<br />
{{Tip|Unsure about how to label your mod versions? Read about semantic versioning [https://semver.org/ here]}}<br />
<br />
===Special Attributes===<br />
There are special attributes which can be added to a mod entry file in order to enable optional functionalities:<br />
<br />
{| class="wikitable"<br />
|+<br />
|UID<br />
|A string in the form <code>"provider_name.mod_name"</code>. This is used so other mods can reference your mod as a [[HPL3/Modding/Mod_Dependencies|Mod Dependency]]<br />
|-<br />
|Dependencies<br />
|A list of UIDs separated by commas. The resources in these mods will be available to the game when the current mod is running.<br />
|}<br />
<br />
==Mod Configuration Files==<br />
In addition to the mod entry file, the mod needs to be correctly configured in order to load resources such as maps, script, sounds, sounds, etc (As seen in the Mod Structure diagram).<br />
<br />
Read the following articles in order to understand how to set up and configure them:<br />
<br />
*[[HPL3/Resources Configuration|Resources Configuration]]<br />
*[[HPL3/Launch Configuration|Launch Configuration]]<br />
*[[HPL3/Language Configuration|Language Configuration]]<br />
<br />
It is recommended to copy the files from the mods provided with the game and modify them, instead of creating them on your own.<br />
<br />
==Running the Mod==<br />
There are two different ways to run a mod:<br />
<br />
1.<u>Through the Custom Story menu page in Main menu:</u> This method should generally be used when testing the final version of your mod. After selecting the mod, the game will restart and will load the mod.<br />
[[File:Rebirth-custom-stories-emnu.jpg|thumb|left|Custom Stories menu.]] {{clr}}<br />
<br />
2.<u>Command Line:</u> To run a mod directly with dev features enabled, you only need to run the game executable passing the "-mod" argument followed by word <code>local:</code> and then immediately the name of the mod folder. This method should be used throughout the development of your mod.<br />
<br />
Example:<syntaxhighlight lang="bash"><br />
AmnesiaRebirth.exe -mod local:my_mod<br />
</syntaxhighlight><br />
There are more arguments which can be added to the command line. It is recommended to create a <code>.bat</code> file which will launch the mod.<br />
<br />
''Main article: [[HPL3/Developer_Commands|Developer Commands]]''<br />
<br />
==What's Next==<br />
Now that the mod is set up, you may proceed to set up a [[HPL3/Amnesia: Rebirth/Modding/Setup Modding Environment|Modding Environment]] for your game, and learn how to use the [[HPL3/Amnesia: Rebirth/Modding/Developer Debug Menu|Developer Debug Menu]].<br />
it is also recommended to [[Setting up an Online Repository|set up an online repository]].<br />
More articles are available in the main Amnesia: Rebirth modding category.<br />
<br />
==See Also==<br />
<br />
*[[Mod Content Usage]]<br />
<br />
[[Category:Modding]]<br />
[[Category:English]]</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL3/Third_Party_Tools/HPL3_Mod_Manager&diff=5496HPL3/Third Party Tools/HPL3 Mod Manager2020-11-07T03:03:41Z<p>Mudbill: Rephrased some things to appear more neutral.</p>
<hr />
<div>{{shortPageTitle}}<br />
[[File:rebirth-mod-manager.png|The Amnesia: Rebirth mod manager.|thumb|500x500px]]<br />
{{Note|This page details third-party software which is not affiliated with Frictional Games.}}<br />
<br><br />
{{Note|This application is open source. View the repository on [https://gitlab.com/TiManGames/amnesia-rebirth-mod-manager GitLab].}}<br />
<br />
<br />
The HPL3 Mod Manager is an application intended to make it easier to manage and configure ''Amnesia: Rebirth'' mods. It removes the need to manually tamper with configuration files and keeps everything in one place so that it can be easily modified.<br />
<br />
'''Features:'''<br />
<br />
*Add or create new [[HPL3/Amnesia: Rebirth/Modding/Creating a Mod#Mod Entry File|mod entries]].<br />
*Edit mod information: Name, Author, Description and Thumbnail Photo.<br />
*Manage [[HPL3/Modding/Mod Dependencies|mod dependencies]].<br />
*[[HPL3/Amnesia: Rebirth/Modding/Setup Modding Environment|Sync your mod]] to the Level Editor: If your mod has any custom assets, the level editor will automatically load it after it's synced.<br />
*Create a [[HPL3/Amnesia: Rebirth/Modding/Creating a Mod|custom .dev launch file]] that will load your mod with your custom scripts and assets<br />
{{clr}}<br />
<br />
==Download==<br />
{{Note|This application requires a modern Java Runtime. Ensure you have the latest version installed.}}<br />
<br />
{| class="wikitable"<br />
!Application<br />
!Upload Date<br />
!SHA<br />
!VirusTotal<br />
|-<br />
|[https://drive.google.com/file/d/12w-f-Ltg3bZetRP9sAXFi3Q5sQP3fiP4/view?usp=sharing ModManager.exe]<br />
|6 November, 2020<br />
|19de727b65be18c4fefd8824b36111afbd0f83d143624acb1549e0d524595b86<br />
|[https://www.virustotal.com/gui/file/19de727b65be18c4fefd8824b36111afbd0f83d143624acb1549e0d524595b86/detection Results]<br />
|}<br />
<br />
The application can be run from anywhere on your computer, but it is recommended to place it in the main Amnesia: Rebirth game folder.<br />
<br />
[[Category:Modding]]<br />
[[Category:English]]</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL3/Amnesia:_Rebirth/Modding&diff=5495HPL3/Amnesia: Rebirth/Modding2020-11-07T02:45:05Z<p>Mudbill: Moved "Advice" section below "Getting Started" and renamed "General Advice"</p>
<hr />
<div>'''This category deals with creating, managing and releasing Amnesia: Rebirth mods, including managing and organizing a team.'''<br />
{{CategoryHeader}}<br />
{{CategoryNewcolumn}}<br />
<br />
== Getting Started ==<br />
* [[HPL3/Amnesia: Rebirth/Modding/Creating a Mod|Creating a Mod]]<br />
* [[HPL3/Amnesia: Rebirth/Modding/Setup Modding Environment|Setup Modding Environment]]<br />
* [[HPL3/Amnesia: Rebirth/Developer Commands|Developer Commands]]<br />
* [[HPL3/Amnesia: Rebirth/Modding/Developer Debug Menu|Developer Debug Menu]]<br />
* [[Setting up an Online Repository|Setting up an Online Repository]]<br />
* [[Mod Content Usage|Mod Content Usage]]<br />
<br />
== General Advice ==<br />
* [[Making a Mod - Best Practices]]<br />
* [[Online Presence]]<br />
* [[Efficient Teamwork]]<br />
<br />
== Releasing ==<br />
* [[Pre-Publication Evaluation]]<br />
* [[Mod Distribution]]<br />
<br />
== Community ==<br />
* [https://discord.com/invite/frictionalgames Discord Server]<br />
* [https://www.moddb.com/games/soma/mods ModDB Homepage]<br />
<br />
{{CategoryNewcolumn}}<br />
<br />
== Mod Configuration ==<br />
* [[HPL3/Resources Configuration|Resources Configuration]]<br />
* [[HPL3/Launch Configuration|Launch Configuration]]<br />
* [[HPL3/Language Configuration|Language Configuration]]<br />
* [[HPL3/Modding/Mod Dependencies|Mod Dependencies]]<br />
<br />
== Resources ==<br />
*[[HPL3/Amnesia: Rebirth/Modding/MinimalCustomMapMod|Minimal Custom Map Mod]]<br />
*[[HPL3/Amnesia: Rebirth/Modding/Amnesia: Rebirth Language Editor|Language Editor]]<br />
<br />
== Tools ==<br />
*[[HPL3/Amnesia: Rebirth/Third_Party_Tools/Amnesia: Rebirth Mod Manager|Amnesia: Rebirth Mod Manager]]<br />
<br />
{{CategoryEnd}}<br />
<br />
__NOTOC__<br />
<br />
[[Category:Entry pages]]<br />
[[Category:English]]</div>Mudbillhttps://wiki.frictionalgames.com/page?title=Hpl3:Community:hpl3_legacy_editors&diff=5397Hpl3:Community:hpl3 legacy editors2020-11-04T10:39:02Z<p>Mudbill: Fixed formatting</p>
<hr />
<div>= HPL3 - Legacy Editors =<br />
<br />
== Introduction ==<br />
<br />
This section of the wiki will be dedicated to hosting older versions of editors compatible with the HPL3 engine. These editors are here for archiving and compatibility purposes. It is unlikely you will require any of these, however, they will be made available here should an issue occur.<br />
<br />
If there is an issue with any of your editors, it is highly recommended to repair your installation. Steam users may do so by verifying their game cache. See [https://www.frictionalgames.com/forum/thread-30585.html Problem K in the Troubleshooting Guide] on the forums for further instructions to do this. GOG users may do so by performing a repair on their installation. These procedures will verify your current editors are up-to-date and working, as well as repair any corrupted files within the SOMA subdirectory.<br />
<br />
For any contributions, while you are permitted to upload your copy of the editor, please include both a SHA and a VirusTotal results link in your post. Both of these are generated by uploading a file to VirusTotal.<br />
<br />
{{todo|Fix this link}}<br />
{| class="wikitable sortable" border=1<br />
| '''Editor''' || '''Upload Date''' || '''SHA''' || '''VirusTotal''' <br />
|-<br />
| [https://puu.sh/yO8KN/c4308fd901.zip Level Editor.zip] || 27 December 2017 || ''10f761ff5bd69e43b57130f919e3b82bc1881a28b702b39404c9d332d551e905'' || [https://www.virustotal.com/#/file/10f761ff5bd69e43b57130f919e3b82bc1881a28b702b39404c9d332d551e905/detection Link]<br />
|-<br />
|}<br />
<br />
<br /></div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/Getting_started&diff=5364HPL2/Getting started2020-09-18T18:04:57Z<p>Mudbill: Missing bold text</p>
<hr />
<div>This page will guide you through the basic steps you want to make to get started modding HPL2. This guide will have you use '''Amnesia – The Dark Descent''' (TDD), not '''Amnesia – A Machine For Pigs''' (AMFP), as TDD is the one that is officially supported for modding.<br />
<br />
==Prerequisites==<br />
Before you get started, you should already have the following:<br />
<br />
#A legal copy of '''Amnesia – The Dark Descent''' installed. All platforms should work, including Steam, GOG and retail DVDs, on Windows, Mac OS X (versions EARLIER than 10.15 Catalina), and most Linux distros.<br />
#Your code editor of choice installed. For example [https://code.visualstudio.com/ VS Code] or [https://atom.io/ Atom]. If you're old school, [https://notepad-plus-plus.org/ Notepad++] also works great.<br />
<br />
==Setting up your game==<br />
[[File:Level Editor.png|alt=The initial view of the HPL2 level editor.|thumb|The view of the level editor]]<br />
Before you dive in, you should set up a few things:<br />
<br />
#[[HPL2/Tools#Installation Instructions|Install the development tools]] for your platform.<br />
#Configure your game to use the [[HPL2/Development Environment|development environment]] (optional, but highly recommended).<br />
#Bookmark the [[HPL2/Engine Scripts|Script Functions]] page. This page is a great reference for when you create your scripts.<br />
<br />
==Additional reading==<br />
Here are a few additional things you can do that are very useful to check out:<br />
<br />
#Check out the [[HPL2/Glossary|HPL2 glossary]] for explanations on common terms and phrases and what they mean.<br />
#Join the official [https://discord.com/invite/frictionalgames Discord server] and ask questions if you need help.<br />
<br />
You are now ready to start [[HPL2/TDD/Creating a Custom Story|'''setting up your first custom story''']]!</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/Tools/Level_Editor&diff=5363HPL2/Tools/Level Editor2020-09-16T19:47:05Z<p>Mudbill: </p>
<hr />
<div>{{DISPLAYTITLE:Level Editor}}<br />
[[File:LevelEditorGr.jpg|thumb|right|The level editor.]]<br />
HPL2/Tools/Level Editor/Fog EditmodeHPL2/Tools/Level Editor/Find ObjectsHPL2/Tools/Level Editor/Entity EditmodeHPL2/DecalsHPL2/Tools/Level Editor/Combine EditmodeBillboard The Level Editor is our own application to build maps for HPL2-based games. It is comprised of a set of basic object creation and edition modes which make the building task a lot easier.<br />
<br />
==Overview==<br />
<br />
When run, the first screen we get to see is like this:<br />
<br />
[[File:leveleditoroverview-small.jpg]]<br />
<br />
Each part of the screen has a specific function, as follows:<br />
<br />
#[[#main_menu|Main menu bar]]: this is where every non-editor command lies, as well as some edition ones.<br />
#[[#editmode_selection_bar|EditMode sidebar]]: here you will find a set of buttons used to switch the current behaviour of the editor. More on this later.<br />
#EditMode window area: any helper input the current EditMode needs will appear here.<br />
#[[HPL2/Tools/Viewport|Viewport area]]: this area of the screen is reserved for the viewports, which are used to actually see what you are doing to the map. Every viewport has its own menu bar, to control some parameters of the visualization.<br />
#[[#lower_toolbar|Lower toolbar]]: some tools that are either viewport-dependent or global are located here.<br />
<br />
Not listed above are some special windows, used pretty often here:<br />
<br />
*''' [[HPL2/Tools/Save Dialog|Save file dialog]] '''<br />
*''' [[HPL2/Tools/Load Dialog|Load file dialog]] '''<br />
*''' [[HPL2/Tools/Color Picker|Color Picker]] '''<br />
*''' [[HPL2/Tools/Texture Browser|Texture Browser]] '''<br />
*''' [[HPL2/Tools/Sound Browser|Sound Browser]]'''<br />
<br />
==Main Menu==<br />
<br />
This is a menu bar, just like in any other windowed application. Available options for this particular editor are as follows:<br />
<br />
*'''File:''' <br />
**'''New''': This command will reset the map to an empty one, and the editor to a default state as well.<br />
**'''Open''': This will load a map file picked in a dialog in the editor.<br />
**'''Save''': Use this to save your work to a file in disk. Will ask for a file name when no file has been created.<br />
**'''Save As''': This will also save your work, but will ask for a file name everytime it is called.<br />
**'''Open Recent''': This will show a list of up to 10 files that have been recently loaded or saved.<br />
**'''Import Objects''': This will show a file dialog with exported object (.expobj) files. When picked, the objects in the file will be added to the map.<br />
**'''Export Selection''': This will save the current selection to a .expobj file.<br />
**'''Quit''': This will exit the program.<br />
<br />
*'''Edit:''' <br />
**'''Undo''': Use this to undo the last action. Note that not everything you can do in the editor is undo-able.<br />
**'''Redo''': Use this to redo the last undone action.<br />
**'''Duplicate''': This will clone the current selected objects. More details on selection later.<br />
**'''Delete''': This will delete the current selected objects.<br />
**'''Create''' /'''Destroy compound object''': Use this to create a compound object with the current selected objects, or to destroy the currently selected compound object. More on compound objects [[HPL2/Tools/Level Editor/Compounds|here]].<br />
**'''Search for object''': This will open the [[HPL2/Tools/Level Editor/Find Objects|Find Objects window]] window. It is useful when you want to find a particular object and don't want to actually look for it.<br />
**'''Browse groups''': This will open the [[HPL2/Tools/Level Editor/Group Window|Group window]]. This one is used to manage groups of objects.<br />
**'''Level Settings''': This will open the [[HPL2/Tools/Level Editor/Level Settings|Level Settings window]] window. This is used to add global fog and skybox to a level, also has other tools.<br />
**'''Options''': This will open the [[HPL2/Tools/Level Editor/Options Window|Options Window]]. You will find general settings for the editor here.<br />
<br />
==EditMode selection bar==<br />
Here you will be able to switch between the different EditModes available in this editor. An EditMode describes the state the editor is going to work in when selected. These five EditModes can be found in this editor and the Model Editor.<br />
<br />
*[[HPL2/Tools/Select Editmode|Select EditMode]]: this mode is used to select and edit objects.<br />
*[[HPL2/Tools/Light Editmode|Light EditMode]]: with this mode you will be able to place lights.<br />
*[[HPL2/Tools/Billboard Editmode|Billboard EditMode]]: use this to create billboards; light halos, light shafts, etc.<br />
*[[HPL2/Tools/Particle System Editmode|Particle System EditMode]]: one can add Particle systems to the entity with this mode.<br />
*[[HPL2/Tools/Sound Editmode|Sound EditMode]]: used to place sound entities in the map.<br />
<br />
The following EditModes are exclusive to the Level Editor:<br />
<br />
*[[HPL2/Tools/Level Editor/Static Object Editmode|Static object EditMode]]: this, and the Primitive EditMode, are the actual building tools. StaticObjects (aka level pieces) are placed using this.<br />
*[[HPL2/Tools/Level Editor/Primitive Editmode|Primitive EditMode]]: creates static geometry to be part of the map. Only Planes are currently supported.<br />
*[[HPL2/Tools/Level Editor/Entity Editmode|Entity EditMode]]: objects that are interactive, such as doors, boxes and NPCs are created here.<br />
*[[HPL2/Tools/Level Editor/Area Editmode|Area EditMode]]: Areas are places that can be used for several purposes, like linking to scripts, setting up where the player starts the map, and so on.<br />
*[[HPL2/Tools/Level Editor/Decal Editmode|Decal EditMode]]: give detail to objects by placing decals on them.<br />
*[[HPL2/Tools/Level Editor/Fog Editmode|Fog EditMode]]: similar to the Area EditMode, but will place volumes containing a fog effect.<br />
*[[HPL2/Tools/Level Editor/Combine Editmode|Combine EditMode]]: useful for optimizing, creates groups of static geometry that will be loaded by the engine as a whole.<br />
<br />
==Viewport area==<br />
This area is meant to actually show what the map contains. Main article: [[HPL2/Tools/Viewport|editor viewport]].<br />
<br />
==Lower Toolbar==<br />
You can find some useful controls in this bar located at all times at the lower part of the screen.<br />
<br />
[[File:Level-editor-lower-toolbar.PNG]]<br />
<br />
#Grid Controls: <br />
#*'''Grid Plane''': cycles through the available grid planes (XZ, XY, YZ).<br />
#*'''Toggle Snap''' (magnet button): enables/disables snapping for translation (over grid), rotation and scale.<br />
#*'''Grid Height''': height of the plane, measured on the plane normal.<br />
#*'''Snap Separation''': separation of snapping points.<br />
#'''Enlarge Viewport button''': will toggle enlargement of the focused viewport.<br />
#Misc controls(Note: these are not shortcuts):<br />
#*'''A''': toggles global ambient lighting<br />
#*'''P''': togles global point light<br />
#*'''LT''': toggles Lock to grid for tracking in focused viewport<br />
#*'''F''': focus on current selection<br />
#Clip Plane controls<br />
#*'''Selected clip plane''': used to select a clip plane among the available ones.<br />
#*'''Add/Remove clip plane''' (+/- buttons): adds a new clip plane / removes the selected one.<br />
#*'''Actual Plane''': cycles through the available planes (XZ, XY, YZ).<br />
#*'''Plane height''': height of the plane, measured on the plane normal.<br />
#*'''Pos'''/'''Neg Button''': sets the culling side of the plane.<br />
#*'''Active''': sets whether the plane should cull objects.<br />
<br />
==Types of Objects==<br />
These are the kinds of objects that you can create and place in this editor. Details on each one and parameter listing in the following links:<br />
<br />
*[[HPL2/Lights|Lights]]<br />
*[[HPL2/Billboards|Billboards]]<br />
*[[HPL2/Particle Systems|Particle Systems]]<br />
*[[HPL2/Sounds|Sounds]]<br />
<br />
The following types are exclusive to the Level Editor:<br />
<br />
*[[HPL2/Static Objects|Static Objects]]<br />
*[[HPL2/Entities| Entities]]<br />
*[[HPL2/Areas|Areas]]<br />
*[[HPL2/Primitives|Primitives]]<br />
*[[HPL2/Decals|Decals]]<br />
*[[HPL2/Fog Areas|FogAreas]]<br />
*[[HPL2/Tools/Level Editor/Compounds|Compound Objects]]</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/TDD/Creating_a_Custom_Story&diff=5362HPL2/TDD/Creating a Custom Story2020-09-16T19:46:00Z<p>Mudbill: </p>
<hr />
<div>{{TocRight}}<br />
Creating a working custom story is a relatively simple process. This page will explain what you need to set up to do so, but it will not go into how you create engaging content as that is a much more invested topic.<br />
<br />
To get started, browse to your Amnesia TDD installation directory. This is often called the ''Amnesia root directory'', and where it is located depends on the system and platform you are using. Here are some common locations:<br />
{| class="wikitable"<br />
|Steam @ Windows<br />
|<code>C:\Program Files (x86)\Steam\steamapps\common\Amnesia The Dark Descent</code><br />
|-<br />
|Retail @ Windows<br />
|<code>C:\Program Files (x86)\Amnesia</code><br />
|-<br />
|Steam @ Mac<br />
|<code>~/Library/Application Support/Steam/steamapps/common/Amnesia The Dark Descent</code><br />
|}<br />
<br />
==Setting up a custom story==<br />
{{note|The simplest way of starting a Custom Story is downloading a [https://www.mediafire.com/file/m0yw9ro94yruzk6/Custom_Story.zip/file template]. The following tutorial will help with understanding what those files do.}}{{todo|Reupload the template to the wiki}}<br />
<br />
Depending on your version, you may have a folder called "redist" inside your root directory. If you do, you will be working from inside this folder. If you do not have the "redist" folder, you will be working from the root directory itself.<br />
<br />
#Navigate to <code>custom_stories/</code><br />
#Create a new folder for your custom story. This folder can be named pretty much anything, for example "My First Story".<br />
#Enter your new folder and create a new plain text file named <code>custom_story_settings.cfg</code>. Open this file in your favorite code editor and paste in the following XML configuration:<syntaxhighlight lang="xml"><br />
<Main<br />
Name="My First Story"<br />
Author="Lovecraft Himself"<br />
ImgFile="cool_bg.png"<br />
<br />
MapsFolder="maps/"<br />
StartMap="level_01.map"<br />
StartPos="PlayerStartArea_1"<br />
<br />
ExtraLangFilePrefix="extra_"<br />
DefaultExtraLangFile="english.lang"<br />
/><br />
</syntaxhighlight>You can change any fields you like, for instance the name and author, but you may want to come back to this later. See the link at the bottom for a full explanation of this file. [[File:Custom story empty example.png|alt=A bare minimum custom story configuration|thumb|A bare minimum custom story configuration]]<br />
#The next requirement before the story will appear in the game's menu is a valid map file. Open the level editor and create a simple room – or at the very least create a floor using the Plane tool, place down a Box Light to cover the area, and place a PlayerStart area. Save the map file into <code>custom_stories/My First Story/maps/level_01.map</code>, or whatever matches the setup you've used. Don't forget to create the "maps" folder as it is written in your config file.<br />
#At this point, if you launch Amnesia, your story should appear in the list of custom stories as seen in the image to the right. Feel free to test this to ensure everything works so far. If you click "Start" you should load into your level.<br />
#Optional: Add the image file as specified by the <code>ImgFile</code>attribute above. Match the name and extension and place the file next to your config, and it should render as the background image in the game menu.<br />
<br />
==Displaying text==<br />
Now that you have a functional custom story, it's time to add some other essential files. In the image to the right you may notice it says "No description." This is the fallback text that appears if you do not have a functional language file, so let's create that now.<br />
<br />
#Start by creating a new plain text file in your custom story folder named <code>extra_english.lang</code>.<br />
#Open the language file. This is another XML file that stores ALL text that will be displayed in your story. This includes things like descriptions, pop-up text, notes, item names, level names etc. You can start by pasting in the following:<syntaxhighlight lang="xml"><br />
<LANGUAGE><br />
<CATEGORY Name="CustomStoryMain"><br />
<Entry Name="Description">Hello, this is the description of my story.</Entry><br />
</CATEGORY><br />
</LANGUAGE><br />
</syntaxhighlight>There are a few rules to keep in mind when it comes to this file:<br />
##All text within this file is CASE SENSITIVE, meaning if you write "language" instead of "LANGUAGE" it will not work.<br />
##The file MUST start with the opening <code><LANGUAGE></code> tag and it MUST end with the closing <code></LANGUAGE></code> tag. This element should only occur once in the entire file.<br />
##Inside the LANGUAGE element, you can place as many CATEGORY elements as you wish, but ensure that every opening tag is always accompanied by a closing tag.<br />
##Certain CATEGORY tags require a specific value in the "Name" attribute. For instance, the main menu description is required to be within a category named <code>CustomStoryMain</code>.<br />
##You can place as many Entry elements as you wish inside each CATEGORY element. The actual text that appears in the game will be written between the opening and closing tag for the Entry. Similarly to CATEGORY tags, certain Entry tags require specific values in their name attribute for the game to pick it up. In the above example, the description must have the name <code>Description</code>.<br />
##If any errors are encountered while the game parses this file, the entire file will fail to load and no custom text will appear in your story. You will know that it failed to load if you see "No description" in the game menu.<br />
<br />
==Moving on==<br />
You have now set up the basic configuration for a custom story. What's left to do now is to create your levels using the level editor, create scripts for your levels using any code editor, and optionally add extra assets you wish to use to additional folders inside your custom story directory. These topics are very expansive and are not covered here, but you can follow the links below for more information on them.<br />
<br />
Your final results from following this guide should leave you with a custom story folder that has this structure:<pre><br />
My First Story/<br />
|- maps/<br />
| |- level_01.map<br />
|<br />
|- cool_bg.png<br />
|- custom_story_settings.cfg<br />
|- extra_english.lang</pre><br />
<br />
==See also==<br />
<br />
*[[HPL2/custom story settings.cfg|Explanation of the custom_story_settings.cfg file]]<br />
*[[HPL2/Tools/Level Editor|How to navigate the Level Editor]]<br />
*[[HPL2/Tutorials/Level Design|Using the level editor to design maps]]<br />
*[[HPL2/ScriptReference|Introduction to AngelScript and level scripting]]</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/TDD/Creating_a_Custom_Story&diff=5361HPL2/TDD/Creating a Custom Story2020-09-16T19:37:40Z<p>Mudbill: </p>
<hr />
<div>{{TocRight}}<br />
Creating a working custom story is a relatively simple process. This page will explain what you need to set up to do so, but it will not go into how you create engaging content as that is a much more invested topic.<br />
<br />
To get started, browse to your Amnesia TDD installation directory. This is often called the ''Amnesia root directory'', and where it is located depends on the system and platform you are using. Here are some common locations:<br />
{| class="wikitable"<br />
|Steam @ Windows<br />
|<code>C:\Program Files (x86)\Steam\steamapps\common\Amnesia The Dark Descent</code><br />
|-<br />
|Retail @ Windows<br />
|<code>C:\Program Files (x86)\Amnesia</code><br />
|-<br />
|Steam @ Mac<br />
|<code>~/Library/Application Support/Steam/steamapps/common/Amnesia The Dark Descent</code><br />
|}<br />
<br />
==Setting up a custom story==<br />
{{note|The simplest way of starting a Custom Story is downloading a [https://www.mediafire.com/file/m0yw9ro94yruzk6/Custom_Story.zip/file template]. The following tutorial will help with understanding what those files do.}}{{todo|Reupload the template to the wiki}}<br />
<br />
Depending on your version, you may have a folder called "redist" inside your root directory. If you do, you will be working from inside this folder. If you do not have the "redist" folder, you will be working from the root directory itself.<br />
<br />
#Navigate to <code>custom_stories/</code><br />
#Create a new folder for your custom story. This folder can be named pretty much anything, for example "My First Story".<br />
#Enter your new folder and create a new plain text file named <code>custom_story_settings.cfg</code>. Open this file in your favorite code editor and paste in the following XML configuration:<syntaxhighlight lang="xml"><br />
<Main<br />
Name="My First Story"<br />
Author="Lovecraft Himself"<br />
ImgFile="cool_bg.png"<br />
<br />
MapsFolder="maps/"<br />
StartMap="level_01.map"<br />
StartPos="PlayerStartArea_1"<br />
<br />
ExtraLangFilePrefix="extra_"<br />
DefaultExtraLangFile="english.lang"<br />
/><br />
</syntaxhighlight>You can change any fields you like, for instance the name and author, but you may want to come back to this later. [[HPL2/custom story settings.cfg|Click here to see the full explanation for this file]]. [[File:Custom story empty example.png|alt=A bare minimum custom story configuration|thumb|A bare minimum custom story configuration]]<br />
#The next requirement before the story will appear in the game's menu is a valid map file. Open the level editor and create a simple room – or at the very least create a floor using the Plane tool, place down a Box Light to cover the area, and place a PlayerStart area. Save the map file into <code>custom_stories/My First Story/maps/level_01.map</code>, or whatever matches the setup you've used. Don't forget to create the "maps" folder as it is written in your config file.<br />
#At this point, if you launch Amnesia, your story should appear in the list of custom stories as seen in the image to the right. Feel free to test this to ensure everything works so far. If you click "Start" you should load into your level.<br />
#Optional: Add the image file as specified by the <code>ImgFile</code>attribute above. Match the name and extension and place the file next to your config, and it should render as the background image in the game menu.<br />
<br />
==Displaying text==<br />
Now that you have a functional custom story, it's time to add some other essential files. In the image to the right you may notice it says "No description." This is the fallback text that appears if you do not have a functional language file, so let's create that now.<br />
<br />
#Start by creating a new plain text file in your custom story folder named <code>extra_english.lang</code>.<br />
#Open the language file. This is another XML file that stores ALL text that will be displayed in your story. This includes things like descriptions, pop-up text, notes, item names, level names etc. You can start by pasting in the following:<syntaxhighlight lang="xml"><br />
<LANGUAGE><br />
<CATEGORY Name="CustomStoryMain"><br />
<Entry Name="Description">Hello, this is the description of my story.</Entry><br />
</CATEGORY><br />
</LANGUAGE><br />
</syntaxhighlight>There are a few rules to keep in mind when it comes to this file:<br />
##All text within this file is CASE SENSITIVE, meaning if you write "language" instead of "LANGUAGE" it will not work.<br />
##The file MUST start with the opening <code><LANGUAGE></code> tag and it MUST end with the closing <code></LANGUAGE></code> tag. This element should only occur once in the entire file.<br />
##Inside the LANGUAGE element, you can place as many CATEGORY elements as you wish, but ensure that every opening tag is always accompanied by a closing tag.<br />
##Certain CATEGORY tags require a specific value in the "Name" attribute. For instance, the main menu description is required to be within a category named <code>CustomStoryMain</code>.<br />
##You can place as many Entry elements as you wish inside each CATEGORY element. The actual text that appears in the game will be written between the opening and closing tag for the Entry. Similarly to CATEGORY tags, certain Entry tags require specific values in their name attribute for the game to pick it up. In the above example, the description must have the name <code>Description</code>.<br />
##If any errors are encountered while the game parses this file, the entire file will fail to load and no custom text will appear in your story. You will know that it failed to load if you see "No description" in the game menu.<br />
<br />
==Moving on==<br />
You have now set up the basic configuration for a custom story. What's left to do now is to create your levels using the level editor, create scripts for your levels using any code editor, and optionally add extra assets you wish to use to additional folders inside your custom story directory. These topics are very expansive and are not covered here, but you can follow the links below for more information on them.<br />
<br />
Your final results from following this guide should leave you with a custom story folder that has this structure:<pre><br />
My First Story/<br />
|- maps/<br />
| |- level_01.map<br />
|<br />
|- cool_bg.png<br />
|- custom_story_settings.cfg<br />
|- extra_english.lang</pre><br />
<br />
==See also==<br />
<br />
*[[HPL2/Tools/Level Editor|How to navigate the Level Editor]]<br />
*[[HPL2/Tutorials/Level Design|Using the level editor to design maps]]<br />
*[[HPL2/ScriptReference|Introduction to AngelScript and level scripting]]</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/custom_story_settings.cfg&diff=5360HPL2/custom story settings.cfg2020-09-16T19:32:48Z<p>Mudbill: Created page with "{{DISPLAYTITLE:custom_story_settings.cfg}} This file is used to configure a custom story, and is found in the root of the custom story, residing inside a subfolder of <code>/c..."</p>
<hr />
<div>{{DISPLAYTITLE:custom_story_settings.cfg}}<br />
This file is used to configure a custom story, and is found in the root of the custom story, residing inside a subfolder of <code>/custom_stories</code> in the Amnesia folder. This file only applies to TDD, not AMFP. Below are all configurable fields for this file and what each does. All of the fields are XML attributes applied to an element named <code>Main</code>.<br />
<br />
{| class="wikitable"<br />
!Field name<br />
!Description<br />
|-<br />
|Name<br />
|The name of your custom story as it will appear in the game menu.<br />
|-<br />
|Author<br />
|Your name which appears under the title.<br />
|-<br />
|ImgFile<br />
|The name of an image file to use as the background image in the game menu.<br />
|-<br />
|MapsFolder<br />
|The folder where your levels are loaded from. Recommended to keep as "maps/".<br />
|-<br />
|StartMap<br />
|The name of the first level that is loaded upon clicking "Start new game" in the main menu.<br />
|-<br />
|StartPos<br />
|The internal name of a PlayerStart type area within the above level. If empty or not matching, the game will use the first alphabetical start area.<br />
|-<br />
|ExtraLangFilePrefix<br />
|A prefix applied to all language files that this story uses. If unspecified, it falls back to the default "extra_". This field can include forward slashes to represent folders.<br />
|-<br />
|DefaultExtraLangFile<br />
|The default language file to load. This is appended to the above prefix, making the default language file "extra_english.lang".<br />
|}</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/game.cfg&diff=5359HPL2/game.cfg2020-09-16T19:28:55Z<p>Mudbill: /* Player_General */</p>
<hr />
<div>{{DISPLAYTITLE:game.cfg}}<br />
{{TocRight}}<br />
This page lists entries within the '''game.cfg''' file found in '''/config''' and in full conversion mods. Warning: Some of the descriptions are missing and some are currently untested assumptions. WIP page.<br />
== Input ==<br />
<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|MaxSmoothMousePos||Add info<br />
|-<br />
|PrevSmoothMousePosMul||Add info<br />
|}<br />
<br />
== Sound ==<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|InGameMusicvolume||Global volume for music<br />
|}<br />
<br />
== Effects ==<br />
<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|VoiceTextFontSize||Subtitle font size<br />
|-<br />
|VoiceTextRowWidth||Subtitle width limit before it breaks a new line<br />
|}<br />
<br />
== Quest ==<br />
<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|QuestCompletionValue||Add info<br />
|-<br />
|ItemCompletionValue||Add info<br />
|-<br />
|NoteCompletionValue||Add info<br />
|-<br />
|DiaryCompletionValue||Add info<br />
|-<br />
|FlashbackCompletionValue||Add info<br />
|-<br />
|ChestCompletionValue||Add info<br />
|}<br />
<br />
== Saving ==<br />
<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|MaxAutoSaves||Amount of maximum auto saves to store in user files<br />
|}<br />
<br />
== Enemy ==<br />
<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|EnemyDarknessGlowMaxDistance||Maximum distance from player that enemies glow in darkness<br />
|}<br />
<br />
== Insanity ==<br />
<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|EventsFile||Name of file to use for insanity events. Default: '''misc/main_sanity_events.cfg''' <br />
|-<br />
|MinTimeBetweenEvents||Minimum time until another insanity event can happen again<br />
|-<br />
|MaxEventSanity||Maximum sanity the player can have to experience insanity events<br />
|-<br />
|MaxSanity_LongWait||Add info<br />
|-<br />
|MaxSanity_MedWait||Add info<br />
|-<br />
|MaxSanity_ShortWait||Add info<br />
|-<br />
|TimeBetween_LongWait||Add info<br />
|-<br />
|TimeBetween_MedWait||Add info<br />
|-<br />
|TimeBetween_ShortWait||Add info<br />
|-<br />
|MaxExamineSanity||Maximum sanity the player can have to use ExamineAreas<br />
|-<br />
|InsanityArea_CheckTimeMin||Add info<br />
|-<br />
|InsanityArea_CheckTimeMax||Add info<br />
|}<br />
<br />
== Slime ==<br />
<br />
{| class="wikitable sortable" border=1<br />
|SlimeType0_AttackSound||Sound played when attacked by a slime area<br />
|-<br />
|SlimeType0_AttackPS||Particles played when attacked by a slime area<br />
|-<br />
|SlimeType0_MinAttackDamage||Minimum damage a slime area can inflict<br />
|-<br />
|SlimeType0_MaxAttackDamage||Maximum damage a slime area can inflict<br />
|-<br />
|SlimeType0_ScreenShakeAmount||Amount of screen shake applied when hit by a slime area<br />
|}<br />
<br />
== Player_General ==<br />
<br />
{| class="wikitable sortable" border=1<br />
|FOV||The "Field of View" visible from the player's perspective<br />
|-<br />
|FarClipPlane||For optimization, the distance in which objects aren't rendered<br />
|-<br />
|NearClipPlane||Add info<br />
|-<br />
|FocusTextFont||The font used when displaying text in focus by the player (extension .fnt)<br />
|-<br />
|HeadSpinDamageSpeed||The speed at which the player's head spins when damaged<br />
|-<br />
|HeadSpinDeacc||The deacceleration to slow down head spin<br />
|-<br />
|MaxCameraSmoothAngles||Add info<br />
|-<br />
|TerrorSound||The sound played when chased by an enemy<br />
|-<br />
|TerrorIncSpeed||Add info<br />
|-<br />
|TerrorDecSpeed||Add info<br />
|-<br />
|MaxPrevSpeedsSaved||Add info<br />
|-<br />
|AutoKillYPos||The Y co-ordinate position in the level to automatically kill the player at if they pass<br />
|-<br />
|FlashbackRadialBlurSize||The size of the radial blur effect applied during flashbacks<br />
|-<br />
|FlashbackRadialBlurStartDist||The start distance at which the radial blur starts<br />
|-<br />
|FlashbackWorldSoundVolume||The global sound level used during a flashback<br />
|-<br />
|FlashbackMoveSpeedMul||The walk speed multiplier used for the player during flashbacks<br />
|-<br />
|FlashbackRunSpeedMul||The run speed multiplier used for the player during flashbacks<br />
|-<br />
|Death_HeightAdd||The height change of the camera during death<br />
|-<br />
|Death_HeightAddCrouch||The height change of the camera during death (while crouching)<br />
|-<br />
|Death_FadeTime||The fade out time during death<br />
|-<br />
|Death_MaxSanityGain||The maximum amount of sanity the player respawns with<br />
|-<br />
|Death_MaxHealthGain||The maximum amount of health the player respawns with<br />
|-<br />
|Death_MaxOilGain||The maximum amount of oil the player respawns with<br />
|-<br />
|Death_MinSanityGain||The minimum amount of sanity the player respawns with<br />
|-<br />
|Death_MinHealthGain||The minimum amount of health the player respawns with<br />
|-<br />
|Death_MinOilGain||The minimum amount of oil the player respawns with<br />
|-<br />
|Death_HeightAddSpeed||The speed of which the height change of the camera changes<br />
|-<br />
|Death_RollSpeed||The speed of camera roll<br />
|-<br />
|Death_StartSound||The sound played when dying<br />
|-<br />
|Death_AwakenSound||The sound played when respawning<br />
|-<br />
|InsanityCollapse_HeightAddGoal||The height change of the camera during a sanity collapse<br />
|-<br />
|InsanityCollapse_HeightAddCollapseSpeed||The speed of which the camera change happens<br />
|-<br />
|InsanityCollapse_HeightAddAwakeSpeed||The speed of which the camera changes back to normal<br />
|-<br />
|InsanityCollapse_RollCollapseSpeed||The speed of which the camera rolls when collapsing<br />
|-<br />
|InsanityCollapse_RollAwakeSpeed||The speed of which the camera rolls back to normal<br />
|-<br />
|InsanityCollapse_AwakenSanity||The sanity the player is left with after awaking a sanity collapse<br />
|-<br />
|InsanityCollapse_SleepTime||The time the player is collapsed<br />
|-<br />
|InsanityCollapse_SleepSpeedMul||The speed multiplier while collapsed<br />
|-<br />
|InsanityCollapse_WakeUpSpeedMul||The speed multiplier while waking up<br />
|-<br />
|InsanityCollapse_StartSound||The sound played when collapsing<br />
|-<br />
|InsanityCollapse_AwakenSound||The sound played when awaking a collapse<br />
|-<br />
|InsanityCollapse_SleepLoopSound||The sound played while being collapsed<br />
|-<br />
|InsanityCollapse_SleepLoopSoundVolume||The sound volume while collapsed<br />
|-<br />
|InsanityCollapse_SleepRandomSound||Random sounds being played while collapsed<br />
|-<br />
|InsanityCollapse_SleepRandomMinTime||The minimum amount of time between a random sound<br />
|-<br />
|InsanityCollapse_SleepRandomMaxTime||The maximum amount of time between a random sound<br />
|-<br />
|Hurt_EffectStartHealth||At what health amount should damage effects start playing<br />
|-<br />
|Hurt_MinSpeedMul||Minimum speed multiplier while hurt<br />
|-<br />
|Hurt_MaxPantCount||Add info<br />
|-<br />
|Hurt_PantSpeed||Add info<br />
|-<br />
|Hurt_PantSize||Add info<br />
|-<br />
|HealthRegainSpeed||Add info<br />
|-<br />
|HealthRegainLimit||Add info<br />
|-<br />
|Hurt_NoiseAlpha||The amount of opacity for the noise effect when on low health<br />
|-<br />
|Hurt_NoiseFreq||The frequency of the noise effect<br />
|-<br />
|Hurt_NoiseColor||The color of the noise effect (red, green, blue, alpha)<br />
|-<br />
|SanityGain_Color||The color of the sanity boost effect (red, green, blue, alpha)<br />
|-<br />
|SanityGain_Sound||The sound played when given a sanity boost<br />
|-<br />
|SanityGain_FadeInTime||The time it takes to fade in a sanity boost<br />
|-<br />
|SanityGain_FadeOutTime||The time it takes to fade out a sanity boost<br />
|-<br />
|HandsRotationSmoothNum||Add info<br />
|-<br />
|HandsPosAddMul||Add info<br />
|-<br />
|FallDamageBounceSizeMul||Add info<br />
|-<br />
|FallDamageBounceSpeedMul||Add info<br />
|-<br />
|FallDamageSpeed_Min||The minimum amount of speed needed to receive minimum fall damage<br />
|-<br />
|FallDamage_Min||The minimum amount of damage received from minor falls<br />
|-<br />
|FallDamageSound_Min||The sound played when taking minimum fall damage<br />
|-<br />
|FallDamageSpeed_Med||The minimum amount of speed needed to receive medium fall damage<br />
|-<br />
|FallDamage_Med||The minimum amount of damage received from medium falls<br />
|-<br />
|FallDamageSound_Med||The sound played when taking medium fall damage<br />
|-<br />
|FallDamageSpeed_Max||The minimum amount of speed needed to receive maximum fall damage<br />
|-<br />
|FallDamage_Max||The minimum amount of damage received from major falls<br />
|-<br />
|FallDamageSound_Max||The sound played when taking maximum fall damage<br />
|}<br />
<br />
== Player_Interaction ==<br />
<br />
{| class="wikitable sortable" border=1<br />
|GrabMaxForce||Maximum force applied to a thrown object<br />
|-<br />
|GrabMaxTorque||Add info<br />
|-<br />
|GrabMaxAngularSpeed||Maximum angular speed for thrown object<br />
|-<br />
|GrabMinSlowPlayerMass||Add info<br />
|-<br />
|GrabMaxSlowPlayerMass||Add info<br />
|-<br />
|GrabMinSlowPlayerMul||Add info<br />
|-<br />
|GrabMaxLeaveAngularSpeed||Add info<br />
|-<br />
|GrabMaxLeaveLinearSpeed||Add info<br />
|-<br />
|PushMaxSpeedWalk||The maximum amount of force applied to a push object while walking<br />
|-<br />
|PushMaxSpeedRun||The maximum amount of force applied to a push object while running<br />
|-<br />
|PushMaxSpeedCrouch||The maximum amount of force applied to a push object while crouching<br />
|-<br />
|PushForceWalk||The amount of force applied to a push object while walking<br />
|-<br />
|PushForceRun||The amount of force applied to a push object while running<br />
|-<br />
|PushForceCrouch||The amount of force applied to a push object while crouching<br />
|-<br />
|PushYawRange||Add info<br />
|-<br />
|PushPitchMinRange||Add info<br />
|-<br />
|PushPitchMaxRange||Add info<br />
|-<br />
|PushMaxForce||Maximum amount of force applied when pushing<br />
|-<br />
|MoveToMouseAddFactor||Add info<br />
|-<br />
|MoveMaxForce||Maximum amount of force applied when moving<br />
|-<br />
|SlideMaxForce||Maximum amount of force applied to a slide object<br />
|-<br />
|Default_DefaultMaxFocusDist||The default maximum distance at which the player can focus objects from<br />
|-<br />
|Grab_DefaultMaxFocusDist||The default maximum distance at which the player can grab objects from<br />
|-<br />
|Push_DefaultMaxFocusDist||The default maximum distance at which the player can push objects from<br />
|-<br />
|Slide_DefaultMaxFocusDist||The default maximum distance at which the player can slide objects from<br />
|-<br />
|SwingDoor_DefaultMaxFocusDist||The default maximum distance at which the player can use a swing door from<br />
|-<br />
|Lever_DefaultMaxFocusDist||The default maximum distance at which the player can use a lever from<br />
|-<br />
|Wheel_DefaultMaxFocusDist||The default maximum distance at which the player can use a wheel from<br />
|-<br />
|Item_DefaultMaxFocusDist||The default maximum distance at which the player can use an item from<br />
|-<br />
|LevelDoor_DefaultMaxFocusDist||The default maximum distance at which the player can use a level door from<br />
|-<br />
|MultiSlider_DefaultMaxFocusDist||The default maximum distance at which the player can use a multi slider from<br />
|-<br />
|Commentary_MaxFocusDist||The maximum distance at which the player can activate a commentary icon from<br />
|-<br />
|Ladder_MaxFocusDist||The maximum distance at which the player can use a ladder from<br />
|-<br />
|Examine_MaxFocusDist||The maximum distance at which the player can focus an examine area from<br />
|-<br />
|Sign_MaxFocusDist||The maximum distance at which the player can focus a sign area from<br />
|-<br />
|ScriptArea_MaxFocusDist||The maximum distance at which the player can focus a script area from<br />
|-<br />
|MinUseItemDistance||The minimum distance an item can be used from<br />
|}<br />
<br />
== Player_Body ==<br />
<br />
{| class="wikitable sortable" border=1<br />
|Mass||The mass of the player's body<br />
|-<br />
|Size||The size of the player's cylinder shape body<br />
|-<br />
|CrouchSize||the size of the player while crouching<br />
|-<br />
|GravityForce||The amount and direction of the gravitational pull (X, Y, Z)<br />
|-<br />
|CameraPosAdd||The position of the camera on the player (X, Y, Z)<br />
|-<br />
|CameraSmoothPosNum||Add info<br />
|-<br />
|AccurateClimbing||Whether climbing on ladders should be accurate<br />
|-<br />
|MaxNoSlideSlopeAngle||Maximum angle of environment before the player starts sliding down<br />
|-<br />
|MaxPushMass||The maximum mass the player can push by the use of objects<br />
|-<br />
|PushForce||The force used when pushing by object collision<br />
|-<br />
|CharacterMaxPushMass||The maximum mass the player's body can push<br />
|-<br />
|CharacterPushForce||The force used when pushing by player collision.<br />
|-<br />
|MaxStepSize||The maximum size of the player's steps<br />
|-<br />
|MaxStepSizeInAir||The maximum step size while in the air<br />
|-<br />
|StepClimbSpeed||The speed at which the player's steps happen when climbing a ladder<br />
|}<br />
<br />
== Player_Darkness ==<br />
<br />
{| class="wikitable sortable" border=1<br />
|MinLightLevel||The minimum level of light before the night vision is activated<br />
|-<br />
|RadiusAdd||The radius of the active night vision effect<br />
|-<br />
|AmbientLightMinLightLevel||The minimum light level for the night vision effect<br />
|-<br />
|AmbientLightRadius||Add info<br />
|-<br />
|AmbientLightIntensity||The intensity of the night vision effect's light level<br />
|-<br />
|AmbientLightFadeInTime||The time it takes to fade in the full night vision effect<br />
|-<br />
|AmbientLightFadeOutTime||The time it takes to fade out from the full night vision effect<br />
|-<br />
|AmbientLightColor||The color for the night vision effect<br />
|-<br />
|LoopSoundFile||The sound file played and looped while in the darkness<br />
|-<br />
|LoopSoundVolume||The volume for the darkness sound<br />
|-<br />
|LoopSoundStartupTime||The time it takes for the darkness sound to start playing<br />
|-<br />
|LoopSoundFadeInSpeed||The time it takes for the darkness sound to fade in<br />
|-<br />
|LoopSoundFadeOutSpeed||The time it takes for the darkness sound to fade out<br />
|-<br />
|SanityLossPerSecond||The amount of sanity drained per second while in the darkness<br />
|}<br />
<br />
== Player_Sanity ==<br />
<br />
{| class="wikitable sortable" border=1<br />
|HitZoomInSpeed||The zoom in speed of the sanity drain effect when hit for sanity damage<br />
|-<br />
|HitZoomOutSpeed||The zoom out speed of the sanity drain effect when hit for sanity damage<br />
|-<br />
|HitZoomInFOVMul||The field of view multiplier when zooming in<br />
|-<br />
|HitZoomInAspectMul||The aspect ratio multiplier when zooming in<br />
|-<br />
|SanityRegainSpeed||The speed for regaining sanity when in light<br />
|-<br />
|SanityRegainLimit||The maximum limit for automatically regaining sanity<br />
|-<br />
|SanityVeryLowLimit||The limit to determine very low sanity<br />
|-<br />
|SanityEffectsStart||The maximum amount of sanity before sanity effects can play<br />
|-<br />
|SanityWaveAlphaMul||The alpha multiplier for the wave effect during sanity drain<br />
|-<br />
|SanityWaveSpeedMul||The speed multiplier for the wave effect during sanity drain<br />
|-<br />
|CheckNearEnemyInterval||The frequency of the interval to check for nearby enemies<br />
|-<br />
|NearEnemyDecrease||The sanity decrease when near enemies<br />
|-<br />
|NearCritterDecrease||The sanity decrease when near critters<br />
|-<br />
|StartSwayMaxSanity||The maximum amount of sanity before the swaying sanity effect plays<br />
|-<br />
|SwayMaxSavedPositions||Add info<br />
|-<br />
|SanityLowLimit||The limit to determine low sanity<br />
|-<br />
|SanityLowLimitMaxTime||Add info<br />
|-<br />
|SanityLowNewSanityAmount||Add info<br />
|-<br />
|LightLampMinSanityIncrease||The minimum sanity increase while in the light of the lantern<br />
|-<br />
|LightLampMaxSanityIncrease||The maximum sanity increase while in the light of the lantern<br />
|}<br />
<br />
== Player_Lantern ==<br />
<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|Color||The color of the lantern light (red, green, blue, alpha)<br />
|-<br />
|Radius||The radius of the lantern light<br />
|-<br />
|Gobo||The gobo file for the lantern light<br />
|-<br />
|LocalOffset||Add info<br />
|-<br />
|TurnOnSound||The sound for enabling the lantern<br />
|-<br />
|TurnOffSound||The sound for disabling the lantern<br />
|-<br />
|OutOfOilSound||The sound for when the lantern is out of oil<br />
|-<br />
|DisabledSound||The sound for when the lantern is disabled<br />
|-<br />
|CastShadows||Whether the lantern light should cast shadows<br />
|-<br />
|LowerOilSpeed||The speed at which the oil is drained from the lantern<br />
|-<br />
|FadeLightOilAmount||The level of oil at which to fade the lantern ligth<br />
|}<br />
<br />
== Player_Ladder ==<br />
<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|UpSpeed||The speed the player climbs up the ladder<br />
|-<br />
|DownSpeed||The speed the player climbs down the ladder<br />
|-<br />
|StepLength||The length of each step in the ladder<br />
|}<br />
<br />
== Player_Movement_Default ==<br />
<br />
{| class="wikitable sortable" border=1<br />
|ForwardAcc||The forwards acceleration speed<br />
|-<br />
|SidewayAcc||The sideways acceleration speed<br />
|-<br />
|ForwardDeacc||The forwards deacceleration speed<br />
|-<br />
|SidewayDeacc||The sideways deacceleration speed<br />
|-<br />
|ForwardOppositeDirAccMul||The acceleration speed when changing to the opposite direction while moving forwards<br />
|-<br />
|SidewayOppositeDirAccMul||The acceleration speed when changing to the opposite direction while moving sideways<br />
|}<br />
<br />
== Player_Movement_Normal ==<br />
<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|JumpSound||The sound played when jumping<br />
|-<br />
|CrouchSound||The sound played when crouching<br />
|-<br />
|StandSound||The sound played when un-crouching<br />
|-<br />
|MaxForwardSpeed||The maximum speed when walking forwards<br />
|-<br />
|MaxBackwardSpeed||The maximum speed when walking backwards<br />
|-<br />
|MaxSidwaySpeed||The maximum speed when walking sideways<br />
|-<br />
|RunForwardMul||The forwards running multiplier<br />
|-<br />
|RunBackwardMul||The backwards running mulitplier<br />
|-<br />
|RunSidewayMul||The sideways running multiplier<br />
|-<br />
|CrouchForwardMul||The multiplier for crouching forwards<br />
|-<br />
|CrouchBackwardMul||The multiplier for crouching backwards<br />
|-<br />
|CrouchSidewayMul||The multiplier for crouching sideways<br />
|-<br />
|InAirForwardMul||The multiplier for moving forwards while in mid-air<br />
|-<br />
|InAirBackwardMul||The multiplier for moving backwards while in mid-air<br />
|-<br />
|InAirSidewayMul||The multiplier for moving sideways while in mid-air<br />
|-<br />
|MaxJumpCount||Add info<br />
|-<br />
|JumpStartForce||The force applied when jumping<br />
|-<br />
|JumpCrouchStartForce||The force applied when crouch jumping<br />
|-<br />
|CrouchBobMax||The maximum amount of camera bobbing while crouching<br />
|-<br />
|WalkBobMax||The maximum amount of camera bobbing while walking<br />
|-<br />
|RunBobMax||The maximum amount of camera bobbing while running<br />
|-<br />
|CrouchMinBobSpeed||The minimum speed of bobbing while crouching<br />
|-<br />
|CrouchMaxBobSpeed||The maximum speed of bobbing while crouching<br />
|-<br />
|WalkMinBobSpeed||The minimum speed of bobbing while walking<br />
|-<br />
|WalkMaxBobSpeed||The maximum speed of bobbing while walking<br />
|-<br />
|RunMinBobSpeed||The minimum speed of bobbing while running<br />
|-<br />
|RunMaxBobSpeed||The maximum speed of bobbing while running<br />
|-<br />
|GroundBounceSize||Add info<br />
|-<br />
|GroundBounceSpeed||Add info<br />
|-<br />
|MinHitGroundBounceSpeed||Add info<br />
|}<br />
<br />
== Player_Movement_ClimbLedge ==<br />
<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|CheckUpdatesPerSecond||The amount of updates per second while climbing<br />
|-<br />
|ClimbLedgeCheckDistForward||Add info<br />
|-<br />
|ClimbLedgeCheckDistFromTop||Add info<br />
|-<br />
|ClimbLedgeCheckDistTopToEnd||Add info<br />
|-<br />
|CheckMaxPushDist||Add info<br />
|-<br />
|HeadMoveSpeed||The speed at which the player's head (the camera) moves<br />
|-<br />
|HeadMoveSlowdownDist||The distance where the head starts slowing down<br />
|-<br />
|GivePlayerControlDist||The distance at which the player regains control from the edge of the ladder<br />
|-<br />
|MovePitchFactor||Add info<br />
|-<br />
|MaxMovePitchSpeed||Add info<br />
|}</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/game.cfg&diff=5358HPL2/game.cfg2020-09-16T19:28:30Z<p>Mudbill: Fixed buggy tables</p>
<hr />
<div>{{DISPLAYTITLE:game.cfg}}<br />
{{TocRight}}<br />
This page lists entries within the '''game.cfg''' file found in '''/config''' and in full conversion mods. Warning: Some of the descriptions are missing and some are currently untested assumptions. WIP page.<br />
== Input ==<br />
<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|MaxSmoothMousePos||Add info<br />
|-<br />
|PrevSmoothMousePosMul||Add info<br />
|}<br />
<br />
== Sound ==<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|InGameMusicvolume||Global volume for music<br />
|}<br />
<br />
== Effects ==<br />
<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|VoiceTextFontSize||Subtitle font size<br />
|-<br />
|VoiceTextRowWidth||Subtitle width limit before it breaks a new line<br />
|}<br />
<br />
== Quest ==<br />
<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|QuestCompletionValue||Add info<br />
|-<br />
|ItemCompletionValue||Add info<br />
|-<br />
|NoteCompletionValue||Add info<br />
|-<br />
|DiaryCompletionValue||Add info<br />
|-<br />
|FlashbackCompletionValue||Add info<br />
|-<br />
|ChestCompletionValue||Add info<br />
|}<br />
<br />
== Saving ==<br />
<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|MaxAutoSaves||Amount of maximum auto saves to store in user files<br />
|}<br />
<br />
== Enemy ==<br />
<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|EnemyDarknessGlowMaxDistance||Maximum distance from player that enemies glow in darkness<br />
|}<br />
<br />
== Insanity ==<br />
<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|EventsFile||Name of file to use for insanity events. Default: '''misc/main_sanity_events.cfg''' <br />
|-<br />
|MinTimeBetweenEvents||Minimum time until another insanity event can happen again<br />
|-<br />
|MaxEventSanity||Maximum sanity the player can have to experience insanity events<br />
|-<br />
|MaxSanity_LongWait||Add info<br />
|-<br />
|MaxSanity_MedWait||Add info<br />
|-<br />
|MaxSanity_ShortWait||Add info<br />
|-<br />
|TimeBetween_LongWait||Add info<br />
|-<br />
|TimeBetween_MedWait||Add info<br />
|-<br />
|TimeBetween_ShortWait||Add info<br />
|-<br />
|MaxExamineSanity||Maximum sanity the player can have to use ExamineAreas<br />
|-<br />
|InsanityArea_CheckTimeMin||Add info<br />
|-<br />
|InsanityArea_CheckTimeMax||Add info<br />
|}<br />
<br />
== Slime ==<br />
<br />
{| class="wikitable sortable" border=1<br />
|SlimeType0_AttackSound||Sound played when attacked by a slime area<br />
|-<br />
|SlimeType0_AttackPS||Particles played when attacked by a slime area<br />
|-<br />
|SlimeType0_MinAttackDamage||Minimum damage a slime area can inflict<br />
|-<br />
|SlimeType0_MaxAttackDamage||Maximum damage a slime area can inflict<br />
|-<br />
|SlimeType0_ScreenShakeAmount||Amount of screen shake applied when hit by a slime area<br />
|}<br />
<br />
== Player_General ==<br />
<br />
{| class="wikitable sortable" border=1<br />
|FOV||The "Field of View" visible from the player's perspective<br />
|-<br />
|FarClipPlane||For optimization, the distance in which objects aren't rendered<br />
|-<br />
|NearClipPlane||Add info||<br />
|-<br />
|FocusTextFont||The font used when displaying text in focus by the player (extension .fnt)<br />
|-<br />
|HeadSpinDamageSpeed||The speed at which the player's head spins when damaged<br />
|-<br />
|HeadSpinDeacc||The deacceleration to slow down head spin<br />
|-<br />
|MaxCameraSmoothAngles||Add info<br />
|-<br />
|TerrorSound||The sound played when chased by an enemy<br />
|-<br />
|TerrorIncSpeed||Add info<br />
|-<br />
|TerrorDecSpeed||Add info<br />
|-<br />
|MaxPrevSpeedsSaved||Add info<br />
|-<br />
|AutoKillYPos||The Y co-ordinate position in the level to automatically kill the player at if they pass<br />
|-<br />
|FlashbackRadialBlurSize||The size of the radial blur effect applied during flashbacks<br />
|-<br />
|FlashbackRadialBlurStartDist||The start distance at which the radial blur starts<br />
|-<br />
|FlashbackWorldSoundVolume||The global sound level used during a flashback<br />
|-<br />
|FlashbackMoveSpeedMul||The walk speed multiplier used for the player during flashbacks<br />
|-<br />
|FlashbackRunSpeedMul||The run speed multiplier used for the player during flashbacks<br />
|-<br />
|Death_HeightAdd||The height change of the camera during death<br />
|-<br />
|Death_HeightAddCrouch||The height change of the camera during death (while crouching)<br />
|-<br />
|Death_FadeTime||The fade out time during death<br />
|-<br />
|Death_MaxSanityGain||The maximum amount of sanity the player respawns with<br />
|-<br />
|Death_MaxHealthGain||The maximum amount of health the player respawns with<br />
|-<br />
|Death_MaxOilGain||The maximum amount of oil the player respawns with<br />
|-<br />
|Death_MinSanityGain||The minimum amount of sanity the player respawns with<br />
|-<br />
|Death_MinHealthGain||The minimum amount of health the player respawns with<br />
|-<br />
|Death_MinOilGain||The minimum amount of oil the player respawns with<br />
|-<br />
|Death_HeightAddSpeed||The speed of which the height change of the camera changes<br />
|-<br />
|Death_RollSpeed||The speed of camera roll<br />
|-<br />
|Death_StartSound||The sound played when dying<br />
|-<br />
|Death_AwakenSound||The sound played when respawning<br />
|-<br />
|InsanityCollapse_HeightAddGoal||The height change of the camera during a sanity collapse<br />
|-<br />
|InsanityCollapse_HeightAddCollapseSpeed||The speed of which the camera change happens<br />
|-<br />
|InsanityCollapse_HeightAddAwakeSpeed||The speed of which the camera changes back to normal<br />
|-<br />
|InsanityCollapse_RollCollapseSpeed||The speed of which the camera rolls when collapsing<br />
|-<br />
|InsanityCollapse_RollAwakeSpeed||The speed of which the camera rolls back to normal<br />
|-<br />
|InsanityCollapse_AwakenSanity||The sanity the player is left with after awaking a sanity collapse<br />
|-<br />
|InsanityCollapse_SleepTime||The time the player is collapsed<br />
|-<br />
|InsanityCollapse_SleepSpeedMul||The speed multiplier while collapsed<br />
|-<br />
|InsanityCollapse_WakeUpSpeedMul||The speed multiplier while waking up<br />
|-<br />
|InsanityCollapse_StartSound||The sound played when collapsing<br />
|-<br />
|InsanityCollapse_AwakenSound||The sound played when awaking a collapse<br />
|-<br />
|InsanityCollapse_SleepLoopSound||The sound played while being collapsed<br />
|-<br />
|InsanityCollapse_SleepLoopSoundVolume||The sound volume while collapsed<br />
|-<br />
|InsanityCollapse_SleepRandomSound||Random sounds being played while collapsed<br />
|-<br />
|InsanityCollapse_SleepRandomMinTime||The minimum amount of time between a random sound<br />
|-<br />
|InsanityCollapse_SleepRandomMaxTime||The maximum amount of time between a random sound<br />
|-<br />
|Hurt_EffectStartHealth||At what health amount should damage effects start playing<br />
|-<br />
|Hurt_MinSpeedMul||Minimum speed multiplier while hurt<br />
|-<br />
|Hurt_MaxPantCount||Add info<br />
|-<br />
|Hurt_PantSpeed||Add info<br />
|-<br />
|Hurt_PantSize||Add info<br />
|-<br />
|HealthRegainSpeed||Add info<br />
|-<br />
|HealthRegainLimit||Add info<br />
|-<br />
|Hurt_NoiseAlpha||The amount of opacity for the noise effect when on low health<br />
|-<br />
|Hurt_NoiseFreq||The frequency of the noise effect<br />
|-<br />
|Hurt_NoiseColor||The color of the noise effect (red, green, blue, alpha)<br />
|-<br />
|SanityGain_Color||The color of the sanity boost effect (red, green, blue, alpha)<br />
|-<br />
|SanityGain_Sound||The sound played when given a sanity boost<br />
|-<br />
|SanityGain_FadeInTime||The time it takes to fade in a sanity boost<br />
|-<br />
|SanityGain_FadeOutTime||The time it takes to fade out a sanity boost<br />
|-<br />
|HandsRotationSmoothNum||Add info<br />
|-<br />
|HandsPosAddMul||Add info<br />
|-<br />
|FallDamageBounceSizeMul||Add info<br />
|-<br />
|FallDamageBounceSpeedMul||Add info<br />
|-<br />
|FallDamageSpeed_Min||The minimum amount of speed needed to receive minimum fall damage<br />
|-<br />
|FallDamage_Min||The minimum amount of damage received from minor falls<br />
|-<br />
|FallDamageSound_Min||The sound played when taking minimum fall damage<br />
|-<br />
|FallDamageSpeed_Med||The minimum amount of speed needed to receive medium fall damage<br />
|-<br />
|FallDamage_Med||The minimum amount of damage received from medium falls<br />
|-<br />
|FallDamageSound_Med||The sound played when taking medium fall damage<br />
|-<br />
|FallDamageSpeed_Max||The minimum amount of speed needed to receive maximum fall damage<br />
|-<br />
|FallDamage_Max||The minimum amount of damage received from major falls<br />
|-<br />
|FallDamageSound_Max||The sound played when taking maximum fall damage<br />
|}<br />
<br />
== Player_Interaction ==<br />
<br />
{| class="wikitable sortable" border=1<br />
|GrabMaxForce||Maximum force applied to a thrown object<br />
|-<br />
|GrabMaxTorque||Add info<br />
|-<br />
|GrabMaxAngularSpeed||Maximum angular speed for thrown object<br />
|-<br />
|GrabMinSlowPlayerMass||Add info<br />
|-<br />
|GrabMaxSlowPlayerMass||Add info<br />
|-<br />
|GrabMinSlowPlayerMul||Add info<br />
|-<br />
|GrabMaxLeaveAngularSpeed||Add info<br />
|-<br />
|GrabMaxLeaveLinearSpeed||Add info<br />
|-<br />
|PushMaxSpeedWalk||The maximum amount of force applied to a push object while walking<br />
|-<br />
|PushMaxSpeedRun||The maximum amount of force applied to a push object while running<br />
|-<br />
|PushMaxSpeedCrouch||The maximum amount of force applied to a push object while crouching<br />
|-<br />
|PushForceWalk||The amount of force applied to a push object while walking<br />
|-<br />
|PushForceRun||The amount of force applied to a push object while running<br />
|-<br />
|PushForceCrouch||The amount of force applied to a push object while crouching<br />
|-<br />
|PushYawRange||Add info<br />
|-<br />
|PushPitchMinRange||Add info<br />
|-<br />
|PushPitchMaxRange||Add info<br />
|-<br />
|PushMaxForce||Maximum amount of force applied when pushing<br />
|-<br />
|MoveToMouseAddFactor||Add info<br />
|-<br />
|MoveMaxForce||Maximum amount of force applied when moving<br />
|-<br />
|SlideMaxForce||Maximum amount of force applied to a slide object<br />
|-<br />
|Default_DefaultMaxFocusDist||The default maximum distance at which the player can focus objects from<br />
|-<br />
|Grab_DefaultMaxFocusDist||The default maximum distance at which the player can grab objects from<br />
|-<br />
|Push_DefaultMaxFocusDist||The default maximum distance at which the player can push objects from<br />
|-<br />
|Slide_DefaultMaxFocusDist||The default maximum distance at which the player can slide objects from<br />
|-<br />
|SwingDoor_DefaultMaxFocusDist||The default maximum distance at which the player can use a swing door from<br />
|-<br />
|Lever_DefaultMaxFocusDist||The default maximum distance at which the player can use a lever from<br />
|-<br />
|Wheel_DefaultMaxFocusDist||The default maximum distance at which the player can use a wheel from<br />
|-<br />
|Item_DefaultMaxFocusDist||The default maximum distance at which the player can use an item from<br />
|-<br />
|LevelDoor_DefaultMaxFocusDist||The default maximum distance at which the player can use a level door from<br />
|-<br />
|MultiSlider_DefaultMaxFocusDist||The default maximum distance at which the player can use a multi slider from<br />
|-<br />
|Commentary_MaxFocusDist||The maximum distance at which the player can activate a commentary icon from<br />
|-<br />
|Ladder_MaxFocusDist||The maximum distance at which the player can use a ladder from<br />
|-<br />
|Examine_MaxFocusDist||The maximum distance at which the player can focus an examine area from<br />
|-<br />
|Sign_MaxFocusDist||The maximum distance at which the player can focus a sign area from<br />
|-<br />
|ScriptArea_MaxFocusDist||The maximum distance at which the player can focus a script area from<br />
|-<br />
|MinUseItemDistance||The minimum distance an item can be used from<br />
|}<br />
<br />
== Player_Body ==<br />
<br />
{| class="wikitable sortable" border=1<br />
|Mass||The mass of the player's body<br />
|-<br />
|Size||The size of the player's cylinder shape body<br />
|-<br />
|CrouchSize||the size of the player while crouching<br />
|-<br />
|GravityForce||The amount and direction of the gravitational pull (X, Y, Z)<br />
|-<br />
|CameraPosAdd||The position of the camera on the player (X, Y, Z)<br />
|-<br />
|CameraSmoothPosNum||Add info<br />
|-<br />
|AccurateClimbing||Whether climbing on ladders should be accurate<br />
|-<br />
|MaxNoSlideSlopeAngle||Maximum angle of environment before the player starts sliding down<br />
|-<br />
|MaxPushMass||The maximum mass the player can push by the use of objects<br />
|-<br />
|PushForce||The force used when pushing by object collision<br />
|-<br />
|CharacterMaxPushMass||The maximum mass the player's body can push<br />
|-<br />
|CharacterPushForce||The force used when pushing by player collision.<br />
|-<br />
|MaxStepSize||The maximum size of the player's steps<br />
|-<br />
|MaxStepSizeInAir||The maximum step size while in the air<br />
|-<br />
|StepClimbSpeed||The speed at which the player's steps happen when climbing a ladder<br />
|}<br />
<br />
== Player_Darkness ==<br />
<br />
{| class="wikitable sortable" border=1<br />
|MinLightLevel||The minimum level of light before the night vision is activated<br />
|-<br />
|RadiusAdd||The radius of the active night vision effect<br />
|-<br />
|AmbientLightMinLightLevel||The minimum light level for the night vision effect<br />
|-<br />
|AmbientLightRadius||Add info<br />
|-<br />
|AmbientLightIntensity||The intensity of the night vision effect's light level<br />
|-<br />
|AmbientLightFadeInTime||The time it takes to fade in the full night vision effect<br />
|-<br />
|AmbientLightFadeOutTime||The time it takes to fade out from the full night vision effect<br />
|-<br />
|AmbientLightColor||The color for the night vision effect<br />
|-<br />
|LoopSoundFile||The sound file played and looped while in the darkness<br />
|-<br />
|LoopSoundVolume||The volume for the darkness sound<br />
|-<br />
|LoopSoundStartupTime||The time it takes for the darkness sound to start playing<br />
|-<br />
|LoopSoundFadeInSpeed||The time it takes for the darkness sound to fade in<br />
|-<br />
|LoopSoundFadeOutSpeed||The time it takes for the darkness sound to fade out<br />
|-<br />
|SanityLossPerSecond||The amount of sanity drained per second while in the darkness<br />
|}<br />
<br />
== Player_Sanity ==<br />
<br />
{| class="wikitable sortable" border=1<br />
|HitZoomInSpeed||The zoom in speed of the sanity drain effect when hit for sanity damage<br />
|-<br />
|HitZoomOutSpeed||The zoom out speed of the sanity drain effect when hit for sanity damage<br />
|-<br />
|HitZoomInFOVMul||The field of view multiplier when zooming in<br />
|-<br />
|HitZoomInAspectMul||The aspect ratio multiplier when zooming in<br />
|-<br />
|SanityRegainSpeed||The speed for regaining sanity when in light<br />
|-<br />
|SanityRegainLimit||The maximum limit for automatically regaining sanity<br />
|-<br />
|SanityVeryLowLimit||The limit to determine very low sanity<br />
|-<br />
|SanityEffectsStart||The maximum amount of sanity before sanity effects can play<br />
|-<br />
|SanityWaveAlphaMul||The alpha multiplier for the wave effect during sanity drain<br />
|-<br />
|SanityWaveSpeedMul||The speed multiplier for the wave effect during sanity drain<br />
|-<br />
|CheckNearEnemyInterval||The frequency of the interval to check for nearby enemies<br />
|-<br />
|NearEnemyDecrease||The sanity decrease when near enemies<br />
|-<br />
|NearCritterDecrease||The sanity decrease when near critters<br />
|-<br />
|StartSwayMaxSanity||The maximum amount of sanity before the swaying sanity effect plays<br />
|-<br />
|SwayMaxSavedPositions||Add info<br />
|-<br />
|SanityLowLimit||The limit to determine low sanity<br />
|-<br />
|SanityLowLimitMaxTime||Add info<br />
|-<br />
|SanityLowNewSanityAmount||Add info<br />
|-<br />
|LightLampMinSanityIncrease||The minimum sanity increase while in the light of the lantern<br />
|-<br />
|LightLampMaxSanityIncrease||The maximum sanity increase while in the light of the lantern<br />
|}<br />
<br />
== Player_Lantern ==<br />
<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|Color||The color of the lantern light (red, green, blue, alpha)<br />
|-<br />
|Radius||The radius of the lantern light<br />
|-<br />
|Gobo||The gobo file for the lantern light<br />
|-<br />
|LocalOffset||Add info<br />
|-<br />
|TurnOnSound||The sound for enabling the lantern<br />
|-<br />
|TurnOffSound||The sound for disabling the lantern<br />
|-<br />
|OutOfOilSound||The sound for when the lantern is out of oil<br />
|-<br />
|DisabledSound||The sound for when the lantern is disabled<br />
|-<br />
|CastShadows||Whether the lantern light should cast shadows<br />
|-<br />
|LowerOilSpeed||The speed at which the oil is drained from the lantern<br />
|-<br />
|FadeLightOilAmount||The level of oil at which to fade the lantern ligth<br />
|}<br />
<br />
== Player_Ladder ==<br />
<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|UpSpeed||The speed the player climbs up the ladder<br />
|-<br />
|DownSpeed||The speed the player climbs down the ladder<br />
|-<br />
|StepLength||The length of each step in the ladder<br />
|}<br />
<br />
== Player_Movement_Default ==<br />
<br />
{| class="wikitable sortable" border=1<br />
|ForwardAcc||The forwards acceleration speed<br />
|-<br />
|SidewayAcc||The sideways acceleration speed<br />
|-<br />
|ForwardDeacc||The forwards deacceleration speed<br />
|-<br />
|SidewayDeacc||The sideways deacceleration speed<br />
|-<br />
|ForwardOppositeDirAccMul||The acceleration speed when changing to the opposite direction while moving forwards<br />
|-<br />
|SidewayOppositeDirAccMul||The acceleration speed when changing to the opposite direction while moving sideways<br />
|}<br />
<br />
== Player_Movement_Normal ==<br />
<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|JumpSound||The sound played when jumping<br />
|-<br />
|CrouchSound||The sound played when crouching<br />
|-<br />
|StandSound||The sound played when un-crouching<br />
|-<br />
|MaxForwardSpeed||The maximum speed when walking forwards<br />
|-<br />
|MaxBackwardSpeed||The maximum speed when walking backwards<br />
|-<br />
|MaxSidwaySpeed||The maximum speed when walking sideways<br />
|-<br />
|RunForwardMul||The forwards running multiplier<br />
|-<br />
|RunBackwardMul||The backwards running mulitplier<br />
|-<br />
|RunSidewayMul||The sideways running multiplier<br />
|-<br />
|CrouchForwardMul||The multiplier for crouching forwards<br />
|-<br />
|CrouchBackwardMul||The multiplier for crouching backwards<br />
|-<br />
|CrouchSidewayMul||The multiplier for crouching sideways<br />
|-<br />
|InAirForwardMul||The multiplier for moving forwards while in mid-air<br />
|-<br />
|InAirBackwardMul||The multiplier for moving backwards while in mid-air<br />
|-<br />
|InAirSidewayMul||The multiplier for moving sideways while in mid-air<br />
|-<br />
|MaxJumpCount||Add info<br />
|-<br />
|JumpStartForce||The force applied when jumping<br />
|-<br />
|JumpCrouchStartForce||The force applied when crouch jumping<br />
|-<br />
|CrouchBobMax||The maximum amount of camera bobbing while crouching<br />
|-<br />
|WalkBobMax||The maximum amount of camera bobbing while walking<br />
|-<br />
|RunBobMax||The maximum amount of camera bobbing while running<br />
|-<br />
|CrouchMinBobSpeed||The minimum speed of bobbing while crouching<br />
|-<br />
|CrouchMaxBobSpeed||The maximum speed of bobbing while crouching<br />
|-<br />
|WalkMinBobSpeed||The minimum speed of bobbing while walking<br />
|-<br />
|WalkMaxBobSpeed||The maximum speed of bobbing while walking<br />
|-<br />
|RunMinBobSpeed||The minimum speed of bobbing while running<br />
|-<br />
|RunMaxBobSpeed||The maximum speed of bobbing while running<br />
|-<br />
|GroundBounceSize||Add info<br />
|-<br />
|GroundBounceSpeed||Add info<br />
|-<br />
|MinHitGroundBounceSpeed||Add info<br />
|}<br />
<br />
== Player_Movement_ClimbLedge ==<br />
<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|CheckUpdatesPerSecond||The amount of updates per second while climbing<br />
|-<br />
|ClimbLedgeCheckDistForward||Add info<br />
|-<br />
|ClimbLedgeCheckDistFromTop||Add info<br />
|-<br />
|ClimbLedgeCheckDistTopToEnd||Add info<br />
|-<br />
|CheckMaxPushDist||Add info<br />
|-<br />
|HeadMoveSpeed||The speed at which the player's head (the camera) moves<br />
|-<br />
|HeadMoveSlowdownDist||The distance where the head starts slowing down<br />
|-<br />
|GivePlayerControlDist||The distance at which the player regains control from the edge of the ladder<br />
|-<br />
|MovePitchFactor||Add info<br />
|-<br />
|MaxMovePitchSpeed||Add info<br />
|}</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/game.cfg&diff=5356HPL2/game.cfg2020-09-16T19:17:36Z<p>Mudbill: Mudbill moved page HPL2/TDD/game.cfg to HPL2/game.cfg: Moved to engine level because it is the same for both HPL2 games</p>
<hr />
<div>{{DISPLAYTITLE:game.cfg}}<br />
{{TocRight}}<br />
This page lists entries within the '''game.cfg''' file found in '''/config''' and in full conversion mods. Warning: Some of the descriptions are missing and some are currently untested assumptions. WIP page.<br />
== Input ==<br />
<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|MaxSmoothMousePos||Add info||<br />
|-<br />
|PrevSmoothMousePosMul||Add info||<br />
|-<br />
|}<br />
<br />
== Sound ==<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|InGameMusicvolume||Global volume for music||<br />
|-<br />
|}<br />
<br />
== Effects ==<br />
<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|VoiceTextFontSize||Subtitle font size||<br />
|-<br />
|VoiceTextRowWidth||Subtitle width limit before it breaks a new line||<br />
|-<br />
|}<br />
<br />
== Quest ==<br />
<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|QuestCompletionValue||Add info||<br />
|-<br />
|ItemCompletionValue||Add info||<br />
|-<br />
|NoteCompletionValue||Add info||<br />
|-<br />
|DiaryCompletionValue||Add info||<br />
|-<br />
|FlashbackCompletionValue||Add info||<br />
|-<br />
|ChestCompletionValue||Add info||<br />
|-<br />
|}<br />
<br />
== Saving ==<br />
<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|MaxAutoSaves||Amount of maximum auto saves to store in user files||<br />
|-<br />
|}<br />
<br />
== Enemy ==<br />
<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|EnemyDarknessGlowMaxDistance||Maximum distance from player that enemies glow in darkness||<br />
|-<br />
|}<br />
<br />
== Insanity ==<br />
<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|EventsFile||Name of file to use for insanity events. Default: '''misc/main_sanity_events.cfg''' ||<br />
|-<br />
<br />
|MinTimeBetweenEvents||Minimum time until another insanity event can happen again||<br />
|-<br />
<br />
|MaxEventSanity||Maximum sanity the player can have to experience insanity events||<br />
|-<br />
<br />
|MaxSanity_LongWait||Add info||<br />
|-<br />
<br />
|MaxSanity_MedWait||Add info||<br />
|-<br />
<br />
|MaxSanity_ShortWait||Add info||<br />
|-<br />
<br />
|TimeBetween_LongWait||Add info||<br />
|-<br />
<br />
|TimeBetween_MedWait||Add info||<br />
|-<br />
<br />
|TimeBetween_ShortWait||Add info||<br />
|-<br />
<br />
|MaxExamineSanity||Maximum sanity the player can have to use ExamineAreas||<br />
|-<br />
<br />
|InsanityArea_CheckTimeMin||Add info||<br />
|-<br />
<br />
|InsanityArea_CheckTimeMax||Add info||<br />
|-<br />
|}<br />
<br />
== Slime ==<br />
<br />
{| class="wikitable sortable" border=1<br />
|SlimeType0_AttackSound||Sound played when attacked by a slime area||<br />
|-<br />
<br />
|SlimeType0_AttackPS||Particles played when attacked by a slime area||<br />
|-<br />
<br />
|SlimeType0_MinAttackDamage||Minimum damage a slime area can inflict||<br />
|-<br />
<br />
|SlimeType0_MaxAttackDamage||Maximum damage a slime area can inflict||<br />
|-<br />
<br />
|SlimeType0_ScreenShakeAmount||Amount of screen shake applied when hit by a slime area||<br />
|-<br />
|}<br />
<br />
== Player_General ==<br />
<br />
{| class="wikitable sortable" border=1<br />
|FOV||The "Field of View" visible from the player's perspective||<br />
|-<br />
<br />
|FarClipPlane||For optimization, the distance in which objects aren't rendered||<br />
|-<br />
<br />
|NearClipPlane||Add info||<br />
|-<br />
<br />
|FocusTextFont||The font used when displaying text in focus by the player (extension .fnt)||<br />
|-<br />
<br />
|HeadSpinDamageSpeed||The speed at which the player's head spins when damaged||<br />
|-<br />
<br />
|HeadSpinDeacc||The deacceleration to slow down head spin||<br />
|-<br />
<br />
|MaxCameraSmoothAngles||Add info||<br />
|-<br />
<br />
|TerrorSound||The sound played when chased by an enemy||<br />
|-<br />
<br />
|TerrorIncSpeed||Add info||<br />
|-<br />
<br />
|TerrorDecSpeed||Add info||<br />
|-<br />
<br />
|MaxPrevSpeedsSaved||Add info||<br />
|-<br />
<br />
|AutoKillYPos||The Y co-ordinate position in the level to automatically kill the player at if they pass||<br />
|-<br />
<br />
|FlashbackRadialBlurSize||The size of the radial blur effect applied during flashbacks||<br />
|-<br />
<br />
|FlashbackRadialBlurStartDist||The start distance at which the radial blur starts||<br />
|-<br />
<br />
|FlashbackWorldSoundVolume||The global sound level used during a flashback||<br />
|-<br />
<br />
|FlashbackMoveSpeedMul||The walk speed multiplier used for the player during flashbacks||<br />
|-<br />
<br />
|FlashbackRunSpeedMul||The run speed multiplier used for the player during flashbacks||<br />
|-<br />
<br />
|Death_HeightAdd||The height change of the camera during death||<br />
|-<br />
<br />
|Death_HeightAddCrouch||The height change of the camera during death (while crouching)||<br />
|-<br />
<br />
|Death_FadeTime||The fade out time during death||<br />
|-<br />
<br />
|Death_MaxSanityGain||The maximum amount of sanity the player respawns with||<br />
|-<br />
<br />
|Death_MaxHealthGain||The maximum amount of health the player respawns with||<br />
|-<br />
<br />
|Death_MaxOilGain||The maximum amount of oil the player respawns with||<br />
|-<br />
<br />
|Death_MinSanityGain||The minimum amount of sanity the player respawns with||<br />
|-<br />
<br />
|Death_MinHealthGain||The minimum amount of health the player respawns with||<br />
|-<br />
<br />
|Death_MinOilGain||The minimum amount of oil the player respawns with||<br />
|-<br />
<br />
|Death_HeightAddSpeed||The speed of which the height change of the camera changes||<br />
|-<br />
<br />
|Death_RollSpeed||The speed of camera roll||<br />
|-<br />
<br />
|Death_StartSound||The sound played when dying||<br />
|-<br />
<br />
|Death_AwakenSound||The sound played when respawning||<br />
|-<br />
<br />
|InsanityCollapse_HeightAddGoal||The height change of the camera during a sanity collapse||<br />
|-<br />
<br />
|InsanityCollapse_HeightAddCollapseSpeed||The speed of which the camera change happens||<br />
|-<br />
<br />
|InsanityCollapse_HeightAddAwakeSpeed||The speed of which the camera changes back to normal||<br />
|-<br />
<br />
|InsanityCollapse_RollCollapseSpeed||The speed of which the camera rolls when collapsing||<br />
|-<br />
<br />
|InsanityCollapse_RollAwakeSpeed||The speed of which the camera rolls back to normal||<br />
|-<br />
<br />
|InsanityCollapse_AwakenSanity||The sanity the player is left with after awaking a sanity collapse||<br />
|-<br />
<br />
|InsanityCollapse_SleepTime||The time the player is collapsed||<br />
|-<br />
<br />
|InsanityCollapse_SleepSpeedMul||The speed multiplier while collapsed||<br />
|-<br />
<br />
|InsanityCollapse_WakeUpSpeedMul||The speed multiplier while waking up||<br />
|-<br />
<br />
|InsanityCollapse_StartSound||The sound played when collapsing||<br />
|-<br />
<br />
|InsanityCollapse_AwakenSound||The sound played when awaking a collapse||<br />
|-<br />
<br />
|InsanityCollapse_SleepLoopSound||The sound played while being collapsed||<br />
|-<br />
<br />
|InsanityCollapse_SleepLoopSoundVolume||The sound volume while collapsed||<br />
|-<br />
<br />
|InsanityCollapse_SleepRandomSound||Random sounds being played while collapsed||<br />
|-<br />
<br />
|InsanityCollapse_SleepRandomMinTime||The minimum amount of time between a random sound||<br />
|-<br />
<br />
|InsanityCollapse_SleepRandomMaxTime||The maximum amount of time between a random sound||<br />
|-<br />
<br />
|Hurt_EffectStartHealth||At what health amount should damage effects start playing||<br />
|-<br />
<br />
|Hurt_MinSpeedMul||Minimum speed multiplier while hurt||<br />
|-<br />
<br />
|Hurt_MaxPantCount||Add info||<br />
|-<br />
<br />
|Hurt_PantSpeed||Add info||<br />
|-<br />
<br />
|Hurt_PantSize||Add info||<br />
|-<br />
<br />
|HealthRegainSpeed||Add info||<br />
|-<br />
<br />
|HealthRegainLimit||Add info||<br />
|-<br />
<br />
|Hurt_NoiseAlpha||The amount of opacity for the noise effect when on low health||<br />
|-<br />
<br />
|Hurt_NoiseFreq||The frequency of the noise effect||<br />
|-<br />
<br />
|Hurt_NoiseColor||The color of the noise effect (red, green, blue, alpha)||<br />
|-<br />
<br />
|SanityGain_Color||The color of the sanity boost effect (red, green, blue, alpha)||<br />
|-<br />
<br />
|SanityGain_Sound||The sound played when given a sanity boost||<br />
|-<br />
<br />
|SanityGain_FadeInTime||The time it takes to fade in a sanity boost||<br />
|-<br />
<br />
|SanityGain_FadeOutTime||The time it takes to fade out a sanity boost||<br />
|-<br />
<br />
|HandsRotationSmoothNum||Add info||<br />
|-<br />
<br />
|HandsPosAddMul||Add info||<br />
|-<br />
<br />
|FallDamageBounceSizeMul||Add info||<br />
|-<br />
<br />
|FallDamageBounceSpeedMul||Add info||<br />
|-<br />
<br />
|FallDamageSpeed_Min||The minimum amount of speed needed to receive minimum fall damage||<br />
|-<br />
<br />
|FallDamage_Min||The minimum amount of damage received from minor falls||<br />
|-<br />
<br />
|FallDamageSound_Min||The sound played when taking minimum fall damage||<br />
|-<br />
<br />
|FallDamageSpeed_Med||The minimum amount of speed needed to receive medium fall damage||<br />
|-<br />
<br />
|FallDamage_Med||The minimum amount of damage received from medium falls||<br />
|-<br />
<br />
|FallDamageSound_Med||The sound played when taking medium fall damage||<br />
|-<br />
<br />
|FallDamageSpeed_Max||The minimum amount of speed needed to receive maximum fall damage||<br />
|-<br />
<br />
|FallDamage_Max||The minimum amount of damage received from major falls||<br />
|-<br />
<br />
|FallDamageSound_Max||The sound played when taking maximum fall damage||<br />
|-<br />
|}<br />
<br />
== Player_Interaction ==<br />
<br />
{| class="wikitable sortable" border=1<br />
|GrabMaxForce||Maximum force applied to a thrown object||<br />
|-<br />
<br />
|GrabMaxTorque||Add info||<br />
|-<br />
<br />
|GrabMaxAngularSpeed||Maximum angular speed for thrown object||<br />
|-<br />
<br />
|GrabMinSlowPlayerMass||Add info||<br />
|-<br />
<br />
|GrabMaxSlowPlayerMass||Add info||<br />
|-<br />
<br />
|GrabMinSlowPlayerMul||Add info||<br />
|-<br />
<br />
|GrabMaxLeaveAngularSpeed||Add info||<br />
|-<br />
<br />
|GrabMaxLeaveLinearSpeed||Add info||<br />
|-<br />
<br />
|PushMaxSpeedWalk||The maximum amount of force applied to a push object while walking||<br />
|-<br />
<br />
|PushMaxSpeedRun||The maximum amount of force applied to a push object while running||<br />
|-<br />
<br />
|PushMaxSpeedCrouch||The maximum amount of force applied to a push object while crouching||<br />
|-<br />
<br />
|PushForceWalk||The amount of force applied to a push object while walking||<br />
|-<br />
<br />
|PushForceRun||The amount of force applied to a push object while running||<br />
|-<br />
<br />
|PushForceCrouch||The amount of force applied to a push object while crouching||<br />
|-<br />
<br />
|PushYawRange||Add info||<br />
|-<br />
<br />
|PushPitchMinRange||Add info||<br />
|-<br />
<br />
|PushPitchMaxRange||Add info||<br />
|-<br />
<br />
|PushMaxForce||Maximum amount of force applied when pushing||<br />
|-<br />
<br />
|MoveToMouseAddFactor||Add info||<br />
|-<br />
<br />
|MoveMaxForce||Maximum amount of force applied when moving||<br />
|-<br />
<br />
|SlideMaxForce||Maximum amount of force applied to a slide object||<br />
|-<br />
<br />
|Default_DefaultMaxFocusDist||The default maximum distance at which the player can focus objects from||<br />
|-<br />
<br />
|Grab_DefaultMaxFocusDist||The default maximum distance at which the player can grab objects from||<br />
|-<br />
<br />
|Push_DefaultMaxFocusDist||The default maximum distance at which the player can push objects from||<br />
|-<br />
<br />
|Slide_DefaultMaxFocusDist||The default maximum distance at which the player can slide objects from||<br />
|-<br />
<br />
|SwingDoor_DefaultMaxFocusDist||The default maximum distance at which the player can use a swing door from||<br />
|-<br />
<br />
|Lever_DefaultMaxFocusDist||The default maximum distance at which the player can use a lever from||<br />
|-<br />
<br />
|Wheel_DefaultMaxFocusDist||The default maximum distance at which the player can use a wheel from||<br />
|-<br />
<br />
|Item_DefaultMaxFocusDist||The default maximum distance at which the player can use an item from||<br />
|-<br />
<br />
|LevelDoor_DefaultMaxFocusDist||The default maximum distance at which the player can use a level door from||<br />
|-<br />
<br />
|MultiSlider_DefaultMaxFocusDist||The default maximum distance at which the player can use a multi slider from||<br />
|-<br />
<br />
|Commentary_MaxFocusDist||The maximum distance at which the player can activate a commentary icon from||<br />
|-<br />
<br />
|Ladder_MaxFocusDist||The maximum distance at which the player can use a ladder from||<br />
|-<br />
<br />
|Examine_MaxFocusDist||The maximum distance at which the player can focus an examine area from||<br />
|-<br />
<br />
|Sign_MaxFocusDist||The maximum distance at which the player can focus a sign area from||<br />
|-<br />
<br />
|ScriptArea_MaxFocusDist||The maximum distance at which the player can focus a script area from||<br />
|-<br />
<br />
|MinUseItemDistance||The minimum distance an item can be used from||<br />
|-<br />
|}<br />
<br />
== Player_Body ==<br />
<br />
{| class="wikitable sortable" border=1<br />
|Mass||The mass of the player's body||<br />
|-<br />
<br />
|Size||The size of the player's cylinder shape body||<br />
|-<br />
<br />
|CrouchSize||the size of the player while crouching||<br />
|-<br />
<br />
|GravityForce||The amount and direction of the gravitational pull (X, Y, Z)||<br />
|-<br />
<br />
|CameraPosAdd||The position of the camera on the player (X, Y, Z)||<br />
|-<br />
<br />
|CameraSmoothPosNum||Add info||<br />
|-<br />
<br />
|AccurateClimbing||Whether climbing on ladders should be accurate||<br />
|-<br />
<br />
|MaxNoSlideSlopeAngle||Maximum angle of environment before the player starts sliding down||<br />
|-<br />
<br />
|MaxPushMass||The maximum mass the player can push by the use of objects||<br />
|-<br />
<br />
|PushForce||The force used when pushing by object collision||<br />
|-<br />
<br />
|CharacterMaxPushMass||The maximum mass the player's body can push||<br />
|-<br />
<br />
|CharacterPushForce||The force used when pushing by player collision.||<br />
|-<br />
<br />
|MaxStepSize||The maximum size of the player's steps||<br />
|-<br />
<br />
|MaxStepSizeInAir||The maximum step size while in the air||<br />
|-<br />
<br />
|StepClimbSpeed||The speed at which the player's steps happen when climbing a ladder||<br />
|-<br />
|}<br />
<br />
== Player_Darkness ==<br />
<br />
{| class="wikitable sortable" border=1<br />
|MinLightLevel||The minimum level of light before the night vision is activated||<br />
|-<br />
<br />
|RadiusAdd||The radius of the active night vision effect||<br />
|-<br />
<br />
|AmbientLightMinLightLevel||The minimum light level for the night vision effect||<br />
|-<br />
<br />
|AmbientLightRadius||Add info||<br />
|-<br />
<br />
|AmbientLightIntensity||The intensity of the night vision effect's light level||<br />
|-<br />
<br />
|AmbientLightFadeInTime||The time it takes to fade in the full night vision effect||<br />
|-<br />
<br />
|AmbientLightFadeOutTime||The time it takes to fade out from the full night vision effect||<br />
|-<br />
<br />
|AmbientLightColor||The color for the night vision effect||<br />
|-<br />
<br />
|LoopSoundFile||The sound file played and looped while in the darkness||<br />
|-<br />
<br />
|LoopSoundVolume||The volume for the darkness sound||<br />
|-<br />
<br />
|LoopSoundStartupTime||The time it takes for the darkness sound to start playing||<br />
|-<br />
<br />
|LoopSoundFadeInSpeed||The time it takes for the darkness sound to fade in||<br />
|-<br />
<br />
|LoopSoundFadeOutSpeed||The time it takes for the darkness sound to fade out||<br />
|-<br />
<br />
|SanityLossPerSecond||The amount of sanity drained per second while in the darkness||<br />
|-<br />
|}<br />
<br />
== Player_Sanity ==<br />
<br />
{| class="wikitable sortable" border=1<br />
|HitZoomInSpeed||The zoom in speed of the sanity drain effect when hit for sanity damage||<br />
|-<br />
<br />
|HitZoomOutSpeed||The zoom out speed of the sanity drain effect when hit for sanity damage||<br />
|-<br />
<br />
|HitZoomInFOVMul||The field of view multiplier when zooming in||<br />
|-<br />
<br />
|HitZoomInAspectMul||The aspect ratio multiplier when zooming in||<br />
|-<br />
<br />
|SanityRegainSpeed||The speed for regaining sanity when in light||<br />
|-<br />
<br />
|SanityRegainLimit||The maximum limit for automatically regaining sanity||<br />
|-<br />
<br />
|SanityVeryLowLimit||The limit to determine very low sanity||<br />
|-<br />
<br />
|SanityEffectsStart||The maximum amount of sanity before sanity effects can play||<br />
|-<br />
<br />
|SanityWaveAlphaMul||The alpha multiplier for the wave effect during sanity drain||<br />
|-<br />
<br />
|SanityWaveSpeedMul||The speed multiplier for the wave effect during sanity drain||<br />
|-<br />
<br />
|CheckNearEnemyInterval||The frequency of the interval to check for nearby enemies||<br />
|-<br />
<br />
|NearEnemyDecrease||The sanity decrease when near enemies||<br />
|-<br />
<br />
|NearCritterDecrease||The sanity decrease when near critters||<br />
|-<br />
<br />
|StartSwayMaxSanity||The maximum amount of sanity before the swaying sanity effect plays||<br />
|-<br />
<br />
|SwayMaxSavedPositions||Add info||<br />
|-<br />
<br />
|SanityLowLimit||The limit to determine low sanity||<br />
|-<br />
<br />
|SanityLowLimitMaxTime||Add info||<br />
|-<br />
<br />
|SanityLowNewSanityAmount||Add info||<br />
|-<br />
<br />
|LightLampMinSanityIncrease||The minimum sanity increase while in the light of the lantern||<br />
|-<br />
<br />
|LightLampMaxSanityIncrease||The maximum sanity increase while in the light of the lantern||<br />
|-<br />
|}<br />
<br />
== Player_Lantern ==<br />
<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|Color||The color of the lantern light (red, green, blue, alpha)||<br />
|-<br />
<br />
|Radius||The radius of the lantern light||<br />
|-<br />
<br />
|Gobo||The gobo file for the lantern light||<br />
|-<br />
<br />
|LocalOffset||Add info||<br />
|-<br />
<br />
|TurnOnSound||The sound for enabling the lantern||<br />
|-<br />
<br />
|TurnOffSound||The sound for disabling the lantern||<br />
|-<br />
<br />
|OutOfOilSound||The sound for when the lantern is out of oil||<br />
|-<br />
<br />
|DisabledSound||The sound for when the lantern is disabled||<br />
|-<br />
<br />
|CastShadows||Whether the lantern light should cast shadows||<br />
|-<br />
<br />
|LowerOilSpeed||The speed at which the oil is drained from the lantern||<br />
|-<br />
<br />
|FadeLightOilAmount||The level of oil at which to fade the lantern ligth||<br />
|-<br />
|}<br />
<br />
== Player_Ladder ==<br />
<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|UpSpeed||The speed the player climbs up the ladder||<br />
|-<br />
<br />
|DownSpeed||The speed the player climbs down the ladder||<br />
|-<br />
<br />
|StepLength||The length of each step in the ladder||<br />
|-<br />
|}<br />
<br />
== Player_Movement_Default ==<br />
<br />
{| class="wikitable sortable" border=1<br />
|ForwardAcc||The forwards acceleration speed||<br />
|-<br />
<br />
|SidewayAcc||The sideways acceleration speed||<br />
|-<br />
<br />
|ForwardDeacc||The forwards deacceleration speed||<br />
|-<br />
<br />
|SidewayDeacc||The sideways deacceleration speed||<br />
|-<br />
<br />
|ForwardOppositeDirAccMul||The acceleration speed when changing to the opposite direction while moving forwards||<br />
|-<br />
<br />
|SidewayOppositeDirAccMul||The acceleration speed when changing to the opposite direction while moving sideways||<br />
|-<br />
|}<br />
<br />
== Player_Movement_Normal ==<br />
<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|JumpSound||The sound played when jumping||<br />
|-<br />
<br />
|CrouchSound||The sound played when crouching||<br />
|-<br />
<br />
|StandSound||The sound played when un-crouching||<br />
|-<br />
<br />
|MaxForwardSpeed||The maximum speed when walking forwards||<br />
|-<br />
<br />
|MaxBackwardSpeed||The maximum speed when walking backwards||<br />
|-<br />
<br />
|MaxSidwaySpeed||The maximum speed when walking sideways||<br />
|-<br />
<br />
|RunForwardMul||The forwards running multiplier||<br />
|-<br />
<br />
|RunBackwardMul||The backwards running mulitplier||<br />
|-<br />
<br />
|RunSidewayMul||The sideways running multiplier||<br />
|-<br />
<br />
|CrouchForwardMul||The multiplier for crouching forwards||<br />
|-<br />
<br />
|CrouchBackwardMul||The multiplier for crouching backwards||<br />
|-<br />
<br />
|CrouchSidewayMul||The multiplier for crouching sideways||<br />
|-<br />
<br />
|InAirForwardMul||The multiplier for moving forwards while in mid-air||<br />
|-<br />
<br />
|InAirBackwardMul||The multiplier for moving backwards while in mid-air||<br />
|-<br />
<br />
|InAirSidewayMul||The multiplier for moving sideways while in mid-air||<br />
|-<br />
<br />
|MaxJumpCount||Add info||<br />
|-<br />
<br />
|JumpStartForce||The force applied when jumping||<br />
|-<br />
<br />
|JumpCrouchStartForce||The force applied when crouch jumping||<br />
|-<br />
<br />
|CrouchBobMax||The maximum amount of camera bobbing while crouching||<br />
|-<br />
<br />
|WalkBobMax||The maximum amount of camera bobbing while walking||<br />
|-<br />
<br />
|RunBobMax||The maximum amount of camera bobbing while running||<br />
|-<br />
<br />
|CrouchMinBobSpeed||The minimum speed of bobbing while crouching||<br />
|-<br />
<br />
|CrouchMaxBobSpeed||The maximum speed of bobbing while crouching||<br />
|-<br />
<br />
|WalkMinBobSpeed||The minimum speed of bobbing while walking||<br />
|-<br />
<br />
|WalkMaxBobSpeed||The maximum speed of bobbing while walking||<br />
|-<br />
<br />
|RunMinBobSpeed||The minimum speed of bobbing while running||<br />
|-<br />
<br />
|RunMaxBobSpeed||The maximum speed of bobbing while running||<br />
|-<br />
<br />
|GroundBounceSize||Add info||<br />
|-<br />
<br />
|GroundBounceSpeed||Add info||<br />
|-<br />
<br />
|MinHitGroundBounceSpeed||Add info||<br />
|-<br />
|}<br />
<br />
== Player_Movement_ClimbLedge ==<br />
<br />
{| class="wikitable sortable" border=1<br />
!Parameter!!Functionality<br />
|-<br />
|CheckUpdatesPerSecond||The amount of updates per second while climbing||<br />
|-<br />
<br />
|ClimbLedgeCheckDistForward||Add info||<br />
|-<br />
<br />
|ClimbLedgeCheckDistFromTop||Add info||<br />
|-<br />
<br />
|ClimbLedgeCheckDistTopToEnd||Add info||<br />
|-<br />
<br />
|CheckMaxPushDist||Add info||<br />
|-<br />
<br />
|HeadMoveSpeed||The speed at which the player's head (the camera) moves||<br />
|-<br />
<br />
|HeadMoveSlowdownDist||The distance where the head starts slowing down||<br />
|-<br />
<br />
|GivePlayerControlDist||The distance at which the player regains control from the edge of the ladder||<br />
|-<br />
<br />
|MovePitchFactor||Add info||<br />
|-<br />
<br />
|MaxMovePitchSpeed||Add info||<br />
|-<br />
|}</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/TDD/game.cfg&diff=5357HPL2/TDD/game.cfg2020-09-16T19:17:36Z<p>Mudbill: Mudbill moved page HPL2/TDD/game.cfg to HPL2/game.cfg: Moved to engine level because it is the same for both HPL2 games</p>
<hr />
<div>#REDIRECT [[HPL2/game.cfg]]</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/pre_menu.cfg&diff=5355HPL2/pre menu.cfg2020-09-16T19:16:55Z<p>Mudbill: Fixed code block error and highlighting</p>
<hr />
<div>{{DISPLAYTITLE:pre_menu.cfg}}<br />
<br />
==Pre-Menu - Config - Amnesia==<br />
<br />
This page talks about the file '''pre_menu.cfg''' found in '''/config''' but more importantly within a full conversion mod. If you are creating a mod and want to know more about this file, read on.<br />
<br />
This file makes up the different banners and events that show up before the menu is loaded. This includes for example the Frictional Games logo and the gamma adjustment screen. Some are set to show up every time the game is started (the logos) whereas some are set to show only the first time (gamma and introduction). After starting the game/mod for the first time, a file named '''first_start_flag''' is created within the game/mod's GameSaveFolder. This file tells the game whether to show the first startup entries or not.<br />
====Banners====<br />
<br />
If you want to edit/add/remove banners to the pre menu, open the file and play with the line:<br />
<br />
<syntaxhighlight lang="xml"><br />
<Section Image="startup_fg_logo.jpg" Time="2" ShowFirstStartOnly="false" /><br />
</syntaxhighlight><br />
<br />
This line shows the Frictional Games logo during startup. You can copy this line and add it underneath for display your own logo after it, or edit it to display your own instead of it. Input your own '''logo.jpg''' file, the amount of time you want it to show and whether it should display only the first time or every time.<br />
====Introduction and gamma====<br />
<br />
The other part of this file includes the sections that show up as a first introduction to the player. These sections also include the gamma screen where they can adjust the amount. The sections look like this in the file:<br />
<br />
<syntaxhighlight lang="xml"><br />
<Section Image="welcome_bg01.jpg" ShowFirstStartOnly="true" Music="12_amb.ogg" MusicVolume="0.5" MusicFadeTime="10" ><br />
<Text Pos="80 210 0" FrameSize="640 300" FontSize="18 18" TextCat="PreMenu" TextEntry="WelcomeMessage01" Color="1 1 1 1" Align="Left" /><br />
</Section><br />
</syntaxhighlight><br />
<br />
This section can be repeated for as many times as you want, depending on how many pages of text you want to display. Here you can specify the background image, whether it starts first time or every time, the music to play + volume and fade time (only include these tags in the first section as it keep playing throughout the next ones). In the text line, you define what will display. The position of the text (X and Y co-ordinate), the size of the text's boundary box and size of the font can also be defined here. After that is the category and entry from the english.lang file, as well as the color and alignment. The color is defined in values of red, green, blue and alpha (opacity).<br />
<br />
Another thing that can be added to this section is whether the gamma selection should appear or not. You can add it to your section header, like so:<br />
<br />
<syntaxhighlight lang="xml"><br />
<Section Image="welcome_bg01.jpg" ShowFirstStartOnly="true" HasGammaSettings="true"><br />
</syntaxhighlight><br />
<br />
This gives the player the option to edit their gamma amount before starting. You can completely exclude it if you wish, along with the entirety of the introduction pre menu, should you wish to jump directly to the menu.</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/pre_menu.cfg&diff=5353HPL2/pre menu.cfg2020-09-16T19:14:30Z<p>Mudbill: Mudbill moved page HPL2/TDD/pre menu.cfg to HPL2/pre menu.cfg: Moved to engine level because it is the same for both HPL2 games</p>
<hr />
<div>{{DISPLAYTITLE:pre_menu.cfg}}<br />
<br />
== Pre-Menu - Config - Amnesia ==<br />
<br />
This page talks about the file '''pre_menu.cfg''' found in '''/config''' but more importantly within a full conversion mod. If you are creating a mod and want to know more about this file, read on.<br />
<br />
This file makes up the different banners and events that show up before the menu is loaded. This includes for example the Frictional Games logo and the gamma adjustment screen. Some are set to show up every time the game is started (the logos) whereas some are set to show only the first time (gamma and introduction). After starting the game/mod for the first time, a file named '''first_start_flag''' is created within the game/mod's GameSaveFolder. This file tells the game whether to show the first startup entries or not.<br />
==== Banners ====<br />
<br />
If you want to edit/add/remove banners to the pre menu, open the file and play with the line:<br />
<br />
<syntaxhighlight lang="c++"><br />
<Section Image="startup_fg_logo.jpg" Time="2" ShowFirstStartOnly="false"/><br />
</syntaxhighlight><br />
<br />
This line shows the Frictional Games logo during startup. You can copy this line and add it underneath for display your own logo after it, or edit it to display your own instead of it. Input your own '''logo.jpg''' file, the amount of time you want it to show and whether it should display only the first time or every time.<br />
==== Introduction and gamma ====<br />
<br />
The other part of this file includes the sections that show up as a first introduction to the player. These sections also include the gamma screen where they can adjust the amount. The sections look like this in the file:<br />
<br />
<syntaxhighlight lang="c++"><br />
<Section Image="welcome_bg01.jpg" ShowFirstStartOnly="true" Music="12_amb.ogg" MusicVolume="0.5" MusicFadeTime="10" ><br />
&lt;Text Pos="80 210 0" FrameSize="640 300" FontSize="18 18" TextCat="PreMenu" TextEntry="WelcomeMessage01" Color="1 1 1 1" Align="Left" /&gt;<br />
</Section><br />
</syntaxhighlight><br />
<br />
This section can be repeated for as many times as you want, depending on how many pages of text you want to display. Here you can specify the background image, whether it starts first time or every time, the music to play + volume and fade time (only include these tags in the first section as it keep playing throughout the next ones). In the text line, you define what will display. The position of the text (X and Y co-ordinate), the size of the text's boundary box and size of the font can also be defined here. After that is the category and entry from the english.lang file, as well as the color and alignment. The color is defined in values of red, green, blue and alpha (opacity).<br />
<br />
Another thing that can be added to this section is whether the gamma selection should appear or not. You can add it to your section header, like so:<br />
<br />
<syntaxhighlight lang="c++"><br />
<Section Image="welcome_bg01.jpg" ShowFirstStartOnly="true" HasGammaSettings="true"><br />
</syntaxhighlight><br />
<br />
This gives the player the option to edit their gamma amount before starting. You can completely exclude it if you wish, along with the entirety of the introduction pre menu, should you wish to jump directly to the menu.</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/TDD/pre_menu.cfg&diff=5354HPL2/TDD/pre menu.cfg2020-09-16T19:14:30Z<p>Mudbill: Mudbill moved page HPL2/TDD/pre menu.cfg to HPL2/pre menu.cfg: Moved to engine level because it is the same for both HPL2 games</p>
<hr />
<div>#REDIRECT [[HPL2/pre menu.cfg]]</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/menu.cfg&diff=5351HPL2/menu.cfg2020-09-16T19:14:19Z<p>Mudbill: Mudbill moved page HPL2/TDD/menu.cfg to HPL2/menu.cfg: Moved to engine level because it is the same for both HPL2 games</p>
<hr />
<div>{{DISPLAYTITLE:menu.cfg}}<br />
{{TocRight}}<br />
<br />
== General ==<br />
<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|TextDuration_StartTime||Text duration start time<br />
|-<br />
|TextDuration_MinTime||Text duration minimal time<br />
|-<br />
|TextDuration_CharTime||Text duration character time<br />
|}<br />
<br />
== Main ==<br />
<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|MainFadeInTime||Fade-in time<br />
|-<br />
|MainFadeOutTimeFast||Fade-out time when fast<br />
|-<br />
|MainFadeOutTimeSlow||Fade-out time when slow<br />
|-<br />
|TopMenuFadeInTime||Main menu fade-in time<br />
|-<br />
|TopMenuFadeOutTime||Main menu fade-out time<br />
|-<br />
|TopMenuFontRelativeSize||Main menu font size<br />
|-<br />
|TopMenuStartRelativePos||Main menu relative position<br />
|-<br />
|TopMenuStartRelativePosInGame||Main menu relative position in game<br />
|-<br />
|TopMenuFont||Main menu font<br />
|-<br />
|MainMenuLogoStartRelativePos||Main menu logo start relative position<br />
|-<br />
|MainMenuLogoRelativeSize||Main menu logo relative size<br />
|-<br />
|BGScene||Menu background map file<br />
|-<br />
|BGCamera_FOV||Background camera start face-of-view<br />
|-<br />
|BGCamera_ZoomedFOV||Background camera zoomed face-of-view<br />
|-<br />
|ZoomSound||Sound played when the game is loaded<br />
|-<br />
|Music||Music that will be played in main menu<br />
|-<br />
|}<br />
<br />
<br />
== Options ==<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|ShowCommentary||Commentary-mod setting<br />
|-<br />
|}<br />
<br />
== Credits ==<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|NormalFont||Main text font name<br />
|-<br />
|HeaderFont||Header font name<br />
|-<br />
|NormalFontSize||Main text font size<br />
|-<br />
|HeaderFontSize||Header font size<br />
|-<br />
|TheEndFontSize||"The End" text font size<br />
|-<br />
|ScrollSpeed||Speed of scroll<br />
|-<br />
|FadeSpeed||Speed of fade<br />
|-<br />
|}<br />
<br />
== Profiles ==<br />
<br />
<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|WindowSize||Profiles window size<br />
|-<br />
|InformationWidth||Information width<br />
|-<br />
|ListFontSize||List font size<br />
|-<br />
|EnterNameWindowSize||Enter name window size<br />
|-<br />
|EnterNameButtonLength||Enter name button length<br />
|-<br />
|}<br />
<br />
== Inventory ==<br />
<br />
<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|FadeInTime||Inv fade-in time<br />
|-<br />
|FadeOutTime||Inv fade-out time<br />
|-<br />
|DefaultFont||Inv default font<br />
|-<br />
|HeaderFont||Inv Header font<br />
|-<br />
|PopUpMessageCenter||Inv pop-up messages center<br />
|-<br />
|SlotImage||Inv slot image<br />
|-<br />
|SlotColor||Inv slot color<br />
|-<br />
|SlotSize||Inv slot size<br />
|-<br />
|SlotMouseOverImage||Inv slot mouse over image<br />
|-<br />
|SlotMouseOverColor||Inv slot mouse over color<br />
|-<br />
|SlotMouseOverOffset||Inv slot mouse over offset<br />
|-<br />
|SlotPulsatingMin||Inv slot pulsating minimal<br />
|-<br />
|SlotPulsatingAmp||Inv slot pulsating amplitude<br />
|-<br />
|SlotPulsatingFreq||Inv pulsating frequency<br />
|-<br />
|SlotsRows||Inv slots rows<br />
|-<br />
|SlotsColumns||Inv slots columns<br />
|-<br />
|SlotsStart||Inv slots start<br />
|-<br />
|SlotsSeparation||Inv slots separation<br />
|-<br />
|SlotsGridColor||Inv slots grid color<br />
|-<br />
|SlotsDrawGrid||Inv slots draw grid<br />
|-<br />
|SlotsDrawFrame||Inv slots draw frame<br />
|-<br />
|SlotsFrameSize||Inv slots frame size<br />
|-<br />
|SlotsFrameHPadding||Inv slots frame horizontal-padding<br />
|-<br />
|SlotsFrameVPadding||Inv slots frame vertical-padding<br />
|-<br />
|SlotsFrameOffset||Inv slots frame offset<br />
|-<br />
|SlotsGridHExtension||Inv slots grid horizontal-extension<br />
|-<br />
|SlotsGridVExtension||Inv slots grid vertical-extension<br />
|-<br />
|SlotsGridOffset||Inv slots grid offset<br />
|-<br />
|HealthCenter||Inv health center<br />
|-<br />
|HealthLabelCenter||Inv health label center<br />
|-<br />
|HealthFrameSize||Inv health grame size<br />
|-<br />
|HealthFrameHPadding||Inv health frame horizontal-padding<br />
|-<br />
|HealthFrameVPadding||Inv health frame vertical-padding<br />
|-<br />
|HealthFrameOffset||Inv health frame offset<br />
|-<br />
|SanityCenter||Inv sanity center<br />
|-<br />
|SanityLabelCenter||Inv sanity label center<br />
|-<br />
|SanityFrameSize||Inv sanity frame size<br />
|-<br />
|SanityFrameHPadding||Inv sanity frame horizontal-padding<br />
|-<br />
|SanityFrameVPadding||Inv frame vertical-padding<br />
|-<br />
|SanityFrameOffset||Inv sanity frame offset<br />
|-<br />
|TinderboxesCenter||Inv tinderboxes center<br />
|-<br />
|TinderboxesLabelCenter||Inv tinderboxes label center<br />
|-<br />
|TinderboxesFrameSize||Inv tinderboxes frame size<br />
|-<br />
|TinderboxesFrameHPadding||Inv tinderboxes frame horizontal-padding<br />
|-<br />
|TinderboxesFrameVPadding||Inv tinderboxes frame vertical-padding<br />
|-<br />
|TinderboxesFrameOffset||Inv tinderboxes frame offset<br />
|-<br />
|OilCenter||Inv oil center<br />
|-<br />
|OilLabelCenter||Inv oil label center<br />
|-<br />
|OilFrameSize||Inv oil frame size<br />
|-<br />
|OilFrameHPadding||Inv oil frame horizontal-padding<br />
|-<br />
|OilFrameVPadding||Inv oil frame vertical-padding<br />
|-<br />
|OilFrameOffset||Inv oil frame offset<br />
|-<br />
|JournalCenter||Inv journal center<br />
|-<br />
|JournalLabelCenter||Inv journal label center<br />
|-<br />
|JournalFrameSize||Inv journal frame size<br />
|-<br />
|JournalFrameHPadding||Inv journal frame horizontal-padding<br />
|-<br />
|JournalFrameVPadding||Inv journal frame vertical-padding<br />
|-<br />
|JournalFrameOffset||Inv journal frame offset<br />
|-<br />
|ItemHeaderCenter||Inv item-header center<br />
|-<br />
|ItemDescCenter||Inv item-description center<br />
|-<br />
|ItemTextFrameSize||Inv item-text frame size<br />
|-<br />
|ItemTextFrameHPadding||Inv item-text frame horizontal-padding<br />
|-<br />
|ItemTextFrameVPadding||Inv item-text frame vertical-padding<br />
|-<br />
|ItemTextFrameOffset||Inv item-text frame offset<br />
|-<br />
|ItemDescTextWidth||Inv item-desc text width<br />
|-<br />
|ItemCountOffset||Inv item-count offset<br />
|-<br />
|FontSize_ItemCount||Inv font-size of item-count<br />
|-<br />
|FontSize_Label||Inv font-size of label<br />
|-<br />
|FontSize_Header||Inv font-size of header<br />
|-<br />
|FontSize_Description||Inv font-size of description<br />
|-<br />
|FontSize_Message||Inv font-size of message<br />
|-<br />
|}<br />
<br />
== CompletionCounter ==<br />
<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|DefaultFont||Default font of completion counter<br />
|-<br />
|}<br />
<br />
== Messages ==<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|QuestAddedIcon||Icon that will be shown when new quest will be added<br />
|-<br />
|QuestAddedSound||Sound of quest-addition<br />
|-<br />
|GameMessageFontSize||Message font size<br />
|-<br />
|}<br />
<br />
== Hints ==<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|DefaultFont||Default hints font<br />
|-<br />
|YPos||The Y-position of hints<br />
|-<br />
|FontSize||Hints font size<br />
|-<br />
|TextDurationMul||Hints text duration<br />
|-<br />
|}<br />
<br />
== Journal ==<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|DefaultFont||Default journal font<br />
|-<br />
|MenuFont||Journal menu font<br />
|-<br />
|NoteTextWidth||Note text width<br />
|-<br />
|NoteMaxPageRows||Note max page rows<br />
|-<br />
|NoteFontSize||Note font size<br />
|-<br />
|NoteRowDist||Note row distantion<br />
|-<br />
|NoteHeaderFontSize||Note header font size<br />
|-<br />
|NoteTextStartY||Note text start y-position<br />
|-<br />
|}<br />
<br />
== LoadScreen ==<br />
<br />
<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|DefaultFont||Default font in loading screen<br />
|-<br />
|LoadingFontSize||Loading text size<br />
|-<br />
|TextFontSize||Loading text size<br />
|-<br />
|LoadingY||Loading text y-position<br />
|-<br />
|TextWithImageY||Text with image y-position<br />
|-<br />
|TextAloneY||Loading text y-position(without image)<br />
|-<br />
|ImageY||Image y-position<br />
|-<br />
|TextMaxWidth||Max text width<br />
|-<br />
|FadeOutTime||Screen fade-out time<br />
|-<br />
|TextDurationMul||Text duration<br />
|-<br />
|}</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/TDD/menu.cfg&diff=5352HPL2/TDD/menu.cfg2020-09-16T19:14:19Z<p>Mudbill: Mudbill moved page HPL2/TDD/menu.cfg to HPL2/menu.cfg: Moved to engine level because it is the same for both HPL2 games</p>
<hr />
<div>#REDIRECT [[HPL2/menu.cfg]]</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/menu.cfg&diff=5350HPL2/menu.cfg2020-09-16T19:13:34Z<p>Mudbill: Added short title</p>
<hr />
<div>{{DISPLAYTITLE:menu.cfg}}<br />
{{TocRight}}<br />
<br />
== General ==<br />
<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|TextDuration_StartTime||Text duration start time<br />
|-<br />
|TextDuration_MinTime||Text duration minimal time<br />
|-<br />
|TextDuration_CharTime||Text duration character time<br />
|}<br />
<br />
== Main ==<br />
<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|MainFadeInTime||Fade-in time<br />
|-<br />
|MainFadeOutTimeFast||Fade-out time when fast<br />
|-<br />
|MainFadeOutTimeSlow||Fade-out time when slow<br />
|-<br />
|TopMenuFadeInTime||Main menu fade-in time<br />
|-<br />
|TopMenuFadeOutTime||Main menu fade-out time<br />
|-<br />
|TopMenuFontRelativeSize||Main menu font size<br />
|-<br />
|TopMenuStartRelativePos||Main menu relative position<br />
|-<br />
|TopMenuStartRelativePosInGame||Main menu relative position in game<br />
|-<br />
|TopMenuFont||Main menu font<br />
|-<br />
|MainMenuLogoStartRelativePos||Main menu logo start relative position<br />
|-<br />
|MainMenuLogoRelativeSize||Main menu logo relative size<br />
|-<br />
|BGScene||Menu background map file<br />
|-<br />
|BGCamera_FOV||Background camera start face-of-view<br />
|-<br />
|BGCamera_ZoomedFOV||Background camera zoomed face-of-view<br />
|-<br />
|ZoomSound||Sound played when the game is loaded<br />
|-<br />
|Music||Music that will be played in main menu<br />
|-<br />
|}<br />
<br />
<br />
== Options ==<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|ShowCommentary||Commentary-mod setting<br />
|-<br />
|}<br />
<br />
== Credits ==<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|NormalFont||Main text font name<br />
|-<br />
|HeaderFont||Header font name<br />
|-<br />
|NormalFontSize||Main text font size<br />
|-<br />
|HeaderFontSize||Header font size<br />
|-<br />
|TheEndFontSize||"The End" text font size<br />
|-<br />
|ScrollSpeed||Speed of scroll<br />
|-<br />
|FadeSpeed||Speed of fade<br />
|-<br />
|}<br />
<br />
== Profiles ==<br />
<br />
<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|WindowSize||Profiles window size<br />
|-<br />
|InformationWidth||Information width<br />
|-<br />
|ListFontSize||List font size<br />
|-<br />
|EnterNameWindowSize||Enter name window size<br />
|-<br />
|EnterNameButtonLength||Enter name button length<br />
|-<br />
|}<br />
<br />
== Inventory ==<br />
<br />
<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|FadeInTime||Inv fade-in time<br />
|-<br />
|FadeOutTime||Inv fade-out time<br />
|-<br />
|DefaultFont||Inv default font<br />
|-<br />
|HeaderFont||Inv Header font<br />
|-<br />
|PopUpMessageCenter||Inv pop-up messages center<br />
|-<br />
|SlotImage||Inv slot image<br />
|-<br />
|SlotColor||Inv slot color<br />
|-<br />
|SlotSize||Inv slot size<br />
|-<br />
|SlotMouseOverImage||Inv slot mouse over image<br />
|-<br />
|SlotMouseOverColor||Inv slot mouse over color<br />
|-<br />
|SlotMouseOverOffset||Inv slot mouse over offset<br />
|-<br />
|SlotPulsatingMin||Inv slot pulsating minimal<br />
|-<br />
|SlotPulsatingAmp||Inv slot pulsating amplitude<br />
|-<br />
|SlotPulsatingFreq||Inv pulsating frequency<br />
|-<br />
|SlotsRows||Inv slots rows<br />
|-<br />
|SlotsColumns||Inv slots columns<br />
|-<br />
|SlotsStart||Inv slots start<br />
|-<br />
|SlotsSeparation||Inv slots separation<br />
|-<br />
|SlotsGridColor||Inv slots grid color<br />
|-<br />
|SlotsDrawGrid||Inv slots draw grid<br />
|-<br />
|SlotsDrawFrame||Inv slots draw frame<br />
|-<br />
|SlotsFrameSize||Inv slots frame size<br />
|-<br />
|SlotsFrameHPadding||Inv slots frame horizontal-padding<br />
|-<br />
|SlotsFrameVPadding||Inv slots frame vertical-padding<br />
|-<br />
|SlotsFrameOffset||Inv slots frame offset<br />
|-<br />
|SlotsGridHExtension||Inv slots grid horizontal-extension<br />
|-<br />
|SlotsGridVExtension||Inv slots grid vertical-extension<br />
|-<br />
|SlotsGridOffset||Inv slots grid offset<br />
|-<br />
|HealthCenter||Inv health center<br />
|-<br />
|HealthLabelCenter||Inv health label center<br />
|-<br />
|HealthFrameSize||Inv health grame size<br />
|-<br />
|HealthFrameHPadding||Inv health frame horizontal-padding<br />
|-<br />
|HealthFrameVPadding||Inv health frame vertical-padding<br />
|-<br />
|HealthFrameOffset||Inv health frame offset<br />
|-<br />
|SanityCenter||Inv sanity center<br />
|-<br />
|SanityLabelCenter||Inv sanity label center<br />
|-<br />
|SanityFrameSize||Inv sanity frame size<br />
|-<br />
|SanityFrameHPadding||Inv sanity frame horizontal-padding<br />
|-<br />
|SanityFrameVPadding||Inv frame vertical-padding<br />
|-<br />
|SanityFrameOffset||Inv sanity frame offset<br />
|-<br />
|TinderboxesCenter||Inv tinderboxes center<br />
|-<br />
|TinderboxesLabelCenter||Inv tinderboxes label center<br />
|-<br />
|TinderboxesFrameSize||Inv tinderboxes frame size<br />
|-<br />
|TinderboxesFrameHPadding||Inv tinderboxes frame horizontal-padding<br />
|-<br />
|TinderboxesFrameVPadding||Inv tinderboxes frame vertical-padding<br />
|-<br />
|TinderboxesFrameOffset||Inv tinderboxes frame offset<br />
|-<br />
|OilCenter||Inv oil center<br />
|-<br />
|OilLabelCenter||Inv oil label center<br />
|-<br />
|OilFrameSize||Inv oil frame size<br />
|-<br />
|OilFrameHPadding||Inv oil frame horizontal-padding<br />
|-<br />
|OilFrameVPadding||Inv oil frame vertical-padding<br />
|-<br />
|OilFrameOffset||Inv oil frame offset<br />
|-<br />
|JournalCenter||Inv journal center<br />
|-<br />
|JournalLabelCenter||Inv journal label center<br />
|-<br />
|JournalFrameSize||Inv journal frame size<br />
|-<br />
|JournalFrameHPadding||Inv journal frame horizontal-padding<br />
|-<br />
|JournalFrameVPadding||Inv journal frame vertical-padding<br />
|-<br />
|JournalFrameOffset||Inv journal frame offset<br />
|-<br />
|ItemHeaderCenter||Inv item-header center<br />
|-<br />
|ItemDescCenter||Inv item-description center<br />
|-<br />
|ItemTextFrameSize||Inv item-text frame size<br />
|-<br />
|ItemTextFrameHPadding||Inv item-text frame horizontal-padding<br />
|-<br />
|ItemTextFrameVPadding||Inv item-text frame vertical-padding<br />
|-<br />
|ItemTextFrameOffset||Inv item-text frame offset<br />
|-<br />
|ItemDescTextWidth||Inv item-desc text width<br />
|-<br />
|ItemCountOffset||Inv item-count offset<br />
|-<br />
|FontSize_ItemCount||Inv font-size of item-count<br />
|-<br />
|FontSize_Label||Inv font-size of label<br />
|-<br />
|FontSize_Header||Inv font-size of header<br />
|-<br />
|FontSize_Description||Inv font-size of description<br />
|-<br />
|FontSize_Message||Inv font-size of message<br />
|-<br />
|}<br />
<br />
== CompletionCounter ==<br />
<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|DefaultFont||Default font of completion counter<br />
|-<br />
|}<br />
<br />
== Messages ==<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|QuestAddedIcon||Icon that will be shown when new quest will be added<br />
|-<br />
|QuestAddedSound||Sound of quest-addition<br />
|-<br />
|GameMessageFontSize||Message font size<br />
|-<br />
|}<br />
<br />
== Hints ==<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|DefaultFont||Default hints font<br />
|-<br />
|YPos||The Y-position of hints<br />
|-<br />
|FontSize||Hints font size<br />
|-<br />
|TextDurationMul||Hints text duration<br />
|-<br />
|}<br />
<br />
== Journal ==<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|DefaultFont||Default journal font<br />
|-<br />
|MenuFont||Journal menu font<br />
|-<br />
|NoteTextWidth||Note text width<br />
|-<br />
|NoteMaxPageRows||Note max page rows<br />
|-<br />
|NoteFontSize||Note font size<br />
|-<br />
|NoteRowDist||Note row distantion<br />
|-<br />
|NoteHeaderFontSize||Note header font size<br />
|-<br />
|NoteTextStartY||Note text start y-position<br />
|-<br />
|}<br />
<br />
== LoadScreen ==<br />
<br />
<br />
{| class="wikitable sortable" border=1<br />
! Parameter name !! Functionality<br />
|-<br />
|DefaultFont||Default font in loading screen<br />
|-<br />
|LoadingFontSize||Loading text size<br />
|-<br />
|TextFontSize||Loading text size<br />
|-<br />
|LoadingY||Loading text y-position<br />
|-<br />
|TextWithImageY||Text with image y-position<br />
|-<br />
|TextAloneY||Loading text y-position(without image)<br />
|-<br />
|ImageY||Image y-position<br />
|-<br />
|TextMaxWidth||Max text width<br />
|-<br />
|FadeOutTime||Screen fade-out time<br />
|-<br />
|TextDurationMul||Text duration<br />
|-<br />
|}</div>Mudbillhttps://wiki.frictionalgames.com/page?title=HPL2/main_init.cfg&diff=5349HPL2/main init.cfg2020-09-16T19:12:02Z<p>Mudbill: Made title only filename</p>
<hr />
<div>{{DISPLAYTITLE:main_init.cfg}}<br />
==ConfigFiles==<br />
{| class="wikitable sortable" border="1"<br />
!Parameter!!Functionality<br />
|-<br />
|Resources||File with all resource directories<br />
|-<br />
|Materials||The file with all physics materials<br />
|-<br />
|Game||Path for [[HPL2/TDD/game.cfg|game settings]]<br />
|-<br />
|Menu||Path for [[HPL2/TDD/menu.cfg|menu settings]]<br />
|-<br />
|PreMenu||Path for [[HPL2/TDD/pre_menu.cfg|pre-menu settings]]<br />
|-<br />
|Demo||Path for [[HPL2/TDD/demo.cfg|demo settings]]<br />
|-<br />
|DefaultMainSettings||Main game settings<br />
|-<br />
|DefaultMainSettingsMedium||"Medium" game settings<br />
|-<br />
|DefaultMainSettingsHigh||"High" game settings<br />
|-<br />
|DefaultUserSettings||Default user settings<br />
|-<br />
|DefaultUserKeys||Default user keys settings<br />
|-<br />
|DefaultBaseLanguage||The base language file. Should probably remains<br />
|-<br />
|DefaultGameLanguage||The default language file to load. Note that directory below is used to find this<br />
|-<br />
|}<br />
<br />
==Directories==<br />
<br />
<br />
{| class="wikitable sortable" border="1"<br />
!Parameter!!Functionality<br />
|-<br />
|MainSaveFolder||This is very important to change. This is where the save games and user settings are stored<br />
|-<br />
|BaseLanguageFolder||Folder where the base language folder placed.<br />
|-<br />
|GameLanguageFolder||Folder where the game specific language files can be found<br />
|-<br />
|CustomStoryPath||Path for custom stories<br />
|-<br />
|}<br />
<br />
==Variables==<br />
<br />
{| class="wikitable sortable" border="1"<br />
|-<br />
|GameName||Name of the game window<br />
|-<br />
|AllowHardMode<br />
|Whether to allow the game to prompt to user to start in "Normal" mode or "Hard" mode when they start a new game. Setting this to <code>false</code> (default) skips the prompt and starts in "Normal" mode. This is only applicable to TDD, not AMFP.<br />
|-<br />
|}<br />
<br />
==StartMap==<br />
<br />
{| class="wikitable sortable" border="1"<br />
!Parameter!!Functionality<br />
|-<br />
|File||The map where the game starts<br />
|-<br />
|Folder||The base folder for all maps<br />
|-<br />
|Pos||The start position of the player<br />
|-<br />
|}</div>Mudbill