User Tools

Site Tools


hpl1:documentation:script_reference

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
hpl1:documentation:script_reference [2011/03/28 16:00]
pandemoneus old revision restored
hpl1:documentation:script_reference [2018/05/06 17:05] (current)
abion47 [Physics]
Line 1: Line 1:
 ====== Script Reference document ====== ====== Script Reference document ======
-This document is not perfectly structured, sometimes a certain script function is perhaps not in the most logical position and so forth. It's recommended you search with the browser for what you need. Almost all scripts are used in Penumbra/​Penumbra:​ Overture so it's always a good idea to locate a script in an actual level .hps file to see how it is used.\\ 
-\\ 
-\\ 
-\\ 
-\\ 
-\\ 
-\\ 
  
 +
 +This document is not perfectly structured, sometimes a certain script function is perhaps not in the most logical position and so forth. It's recommended you search with the browser for what you need. Almost all scripts are used in Penumbra/​Penumbra:​ Overture so it's always a good idea to locate a script in an actual level .hps file to see how it is used.\\ ​
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 ===== Engine scripts ===== ===== Engine scripts =====
 +
  
 ==== General ==== ==== General ====
-<code c++>void Print(std::​string asText)</​code>​ 
-Prints a string to the log.\\ 
-\\ 
  
-<code c++>​std::​string FloatToString(float afX)</​code>​ 
-Converts a float to string\\ 
-\\ 
  
-<code c++>​std::​string ​IntToString(int alX)</​code>​ +<code c++>void Print(std::​string ​asText) 
-Converts an integer to string,\\ +</​code>​
-\\+
  
-<code c++>​float RandFloat(float afMin, float afMax)</​code>​ 
-Generates a random float. \\ 
-\\ 
- 
-<code c++>int RandInt(int alMin, int alMax)</​code>​ 
-Generates a random int.\\ 
-\\ 
- 
-<code c++>​StringContains(std::​string asString, std::string asSubString)</​code>​ 
-Checks what a string contains.\\ 
-asString what string to check\\ 
-asSubString what to check the string against\\ 
-\\ 
-\\ 
- 
- 
- 
-==== Resources ====                ​ 
-<code c++>​static std::string stdcall Translate(std::​string asCat, std::string asName)</​code>​ 
-Gets a string in the current language.\\ 
-asCat The translation category\\ 
-asName The name of the category entry.\\ 
-\\ 
- 
-<code c++>​static void stdcall PreloadSound(std::​string asFile)</​code>​ 
-Preloads the data for a sound.\\ 
-asFile This can be a wav, ogg, mp3 or snt file.\\ 
-\\ 
- 
-<code c++>void ResetLogicTimer()</​code>​ 
-Resync screen frames to logic timer. \\ 
-\\ 
-\\ 
- 
-==== Particle Systems ==== 
-<code c++>void SetParticleSystemActive(std::​string asName, bool abActive)</​code>​ 
-Set if a particle system should be active or not.\\ ​               ​ 
-asName The name of the particle system.\\ 
-abActive If it should be active or not.\\ 
-\\ 
  
 +Prints a string to the log.\\ ​
 <code c++> <code c++>
-void CreateParticleSystem(std::​string ​asName, std::string asType, std::string asArea, +std::​string ​FloatToString(float afX) 
-                                                     float afX, float afY, float afZ)</​code>​ +</​code>​
-Create a particle system at the position of an area\\ +
-asName The name of the particle system.\\ +
-asType The type of aprticle system\\ +
-asArea The name of the area\\ +
-X Y and Z the variables of the particle system.\\ +
-\\+
  
-<code c++> 
-CreateParticleSystemOnCamera(string asName ,string asFile)</​code>​ 
  
-Create an particle on the position of the camera(player).\\ +Converts a float to string\\ ​
-asName the name of the particle system ingame.\\ +
-asFile the name of the file for the particle system.\\ +
-\\ +
- +
-<code c++>void KillParticleSystem(std::​string ​asName)</​code>​ +
-Kill a particle system\\ +
-asName The name of the particle system.\\ +
-\\ +
-\\ +
- +
- +
-==== Beams ====+
 <code c++> <code c++>
-void CreateBeam(string asName, string asFile, string asStartArea,​ string asEndArea)</​code>​ +std::string IntToString(int alX) 
-Creates a beam between 2 areas\\ +</​code>​
-asName the name of the beam\\ +
-asFile the name of the .beam file \\ +
-asStartArea name of the area to start the beam\\ +
-asEndArea name of the area to end the beam\\ +
-\\+
  
-<code c++> 
-void DestroyBeam(string asName)</​code>​ 
-Destroy a beam\\ 
-asName name of the beam to destory\\ 
-\\ 
-\\ 
  
 +Converts an integer to string,​\\ ​
 +<code c++>​float RandFloat(float afMin, float afMax)
 +</​code>​
  
  
-==== Lights ==== +Generates a random float. \\  
-<code c++> +<code c++>int RandInt(int alMinint alMax) 
-void FadeLight3D(std::string asName,  +</​code>​
-                    float afR,float afG, float afB, float afA, float afRadius, float afTime)</​code>​ +
-Fades a sound to a color and a radius\\ +
-asName The name of the light\\ +
-afR The red channel to fade to.\\ +
-afG The green channel to fade to.\\ +
-afB The blue channel to fade to.\\ +
-afA The alpha channel to fade to.\\ +
-afRadius The radius to fade to.\\ +
-afTime The amount of seconds the fade should last.\\ +
-\\+
  
-<code c++>void AttachBillboardToLight3D(std::​string asBillboardName,​ std::string asLightName,​bool abX)</​code>​ 
-Attaches a billboard to a light\\ 
-asBillboardName The billbaord name\\ 
-asLightName The light name\\ 
-abX True if it should be attached, false if you want to remove.\\ 
-\\ 
- 
-<code c++>void SetLight3DVisible(std::​string asName, bool abX)</​code>​ 
-Sets on/off a light\\ 
-asName The light name\\ 
-abX if the light should be on or off.\\ 
-\\ 
- 
-<code c++>void SetLight3DFlickerActive(std::​string asName, bool abX)</​code>​ 
-Sets flickering on/off a light\\ 
-asName The light name\\ 
-abX if the light flicker should be on or off.\\ 
-\\ 
- 
-<code c++>void SetLight3DFlicker(std::​string asName, 
-                          float afR,float afG, float afB, float afA, 
-                          float afRadius, 
-                          float afOnMinLength,​ float afOnMaxLength,​ 
-                          std::string asOnSound,​std::​string asOnPS, 
-                          float afOffMinLength,​ float afOffMaxLength,​ 
-                          std::string asOffSound,​std::​string asOffPS, 
-                          bool abFade, 
-                          float afOnFadeLength,​ float afOffFadeLength)</​code>​ 
-Sets flickering parameters\\ 
-asName The light name\\ 
-abR, afG, afB, afA The color of the light when off\\ 
-afRadius The radius of the light when off.\\ 
-afOnMinLength Minimum time before going from off to on.\\ 
-afOnMaxLength Maximum time before going from off to on.\\ 
-asOnSound Name of the sound played when going from off to on. ""​ means no sound.\\ 
-asOnPS Name of the particle system played when going from off to on. ""​ means none.\\ 
-afOffMinLength Minimum time before going from on to off.\\ 
-afOffMaxLength Maximum time before going from on to off.\\ 
-asOffSound Name of the sound played when going from on to off. ""​ means no sound.\\ 
-asOffPS Name of the particle system played when going from on to off. ""​ means none.\\ 
-abFade If there should be a fade between off and on.\\ 
-afOnFadeLength Fade length from off to on.\\ 
-afOffFadeLength Fade length from on to off.\\ 
-\\ 
- 
-<code c++>void CreateLightFlashAtArea( std::​string asArea, float afRadius, 
- float afR,float afG, float afB, float afA, 
- float afAddTime, float afNegTime);</​code>​ 
-Creates a flash of light at an area.\\ 
-asArea Name of the area to create the flash in\\ 
-afRadius Radius of the flash\\ 
-afR, afG, afB, afA  Red, Green, Blue and alpha of the flash..\\ 
-afAddTime Time it will take to reach full strenght.\\ 
-afNegTime Time it will take to end flash, turning black.\\ 
-\\ 
- 
-<code c++>void SetLight3DOnlyAffectInSector(std::​string asName, bool abX);</​code>​ 
-If a light should cast its light and shadow, affecting the surroundings in its sector(_room grouping) or in all sectors it reaches. By default static lights added in the editor to a level is true, the same goes for lights that are part of an Lamp entity. \\ 
-asName The light name\\ 
-abX if it should only affect the sector or not.\\ 
-\\ 
-\\ 
- 
- 
-==== Audio ==== 
-<code c++>void CreateSoundEntity(std::​string asName, std::string asFile, std::string asArea)</​code>​ 
-Creates a sound entity at the postion of an area.\\ 
-asName Name of the created sound entity.\\ 
-asFile The snt file to load.\\ 
-asArea The area to create at.\\ 
-\\ 
  
 +Generates a random int.\\ ​
 <code c++> <code c++>
-void CreateSoundEntityAt(std::​string ​asType,​std::​string ​asDestName, ​ +StringContains(std::​string ​asString, std::​string ​asSubString) 
-                   std::string asSoundName,​std::​string asSoundFile);​</​code>​ +</​code>​
-Creates a sound entity at the position of an entity.\\ +
-asType The type of entity. This can be: "​Joint","​Body"​ or "​Entity"​.\\ +
-asDestName The entity/​body/​joint name\\ +
-asSoundName The name of created sound entity.\\ +
-asSoundFile The name of the snt file.\\ +
-\\+
  
-<code c++>void PlaySoundEntity(std::​string asName, bool abPlayStart)</​code>​ 
-Play a sound entity\\ 
-asName The entity name\\ 
-abPlayStart If the start sound should be played.\\ 
-\\ 
  
-<code c++>void StopSoundEntity(std::​string asName, bool abPlayEnd)</​code>​ +Checks what string contains.\\  
-Stop sound entity\\ +asString what string to check\\  
-asName The entity name\\ +asSubString what to check the string against\\  
-abPlayEnd If the end sound should be played.\\ +\\  
-\\+==== Resources ====
  
-<code c++>void FadeInSoundEntity(std::​string asName, float afSpeed)</​code>​ 
-Play a sound entity fading it\\ 
-asName The entity name\\ 
-afSpeed Volume increase per second.\\ 
-\\ 
  
-<code c++>void FadeOutSoundEntity(std::​string ​asNamefloat afSpeed)</​code>​ +<code c++>static std::string stdcall Translate(std::​string ​asCatstd::string asName) 
-Stop a sound entity fading it\\ +</​code>​
-asName The entity name\\ +
-afSpeed Volume decrease per second.\\ +
-\\+
  
-<code c++>void PlayMusic(std::​string asName, float afVol, float afStepSize, bool abLoop)</​code>​ 
-Play music track.\\ 
-asName Name of the music file.\\ 
-afVol Volume of the music\\ 
-afStepSize The increase in volume per second when fading in.\\ 
-\\ 
  
-<code c++>​void ​StopMusic(float afStepSize)</​code>​ +Gets a string in the current language.\\  
-Stop music track.\\ +asCat The translation category\\  
-afStepSize The decrease in volume per second when fading out.\\ +asName The name of the category entry.\\  
-\\+<code c++>static ​void stdcall PreloadSound(std::string asFile) 
 +</​code>​
  
-<code c++>​PlayGameMusic(string asFile, float afVolume,​float afFadeStep,​bool abLoop, int alPrio);</​code>​ 
-Play music track with prio, added to episode 1 to be able to play different tracks that mix in and out depending on prio.\\ 
-asFile The name of the music file.\\ 
-afVolume The volume to play the music at 0 to 1.\\ 
-afFadeStep The decrease in volume per second when fading out.\\ 
-abLoop If the music should loop.\\ 
-alPrio The priority of the track, 0 to 10. A higher numbers fades a lower number out, if you have an ambient music track using prio 0 it will fade out if you add a music track to an enemy entity with prio 1 and the enemy attacks the player. When the attack is over the ambient track will fade back in.\\ 
-\\ 
  
-<code c++>StopGameMusic(float afFadeStep, int alPrio);</​code>​ +Preloads the data for a sound.\\  
-Stop game music track with prio.\\ +asFile This can be a wav, ogg, mp3 or snt file.\\  
-afFadeStepThe decrease in volume per second when fading out.\\ +<code c++>void ResetLogicTimer() 
-alPrio priority of the music track.\\ +</​code>​
-\\+
  
-<code c++>void PlayGuiSound(std::​string asName, float afVol)</​code>​ 
-Play a sound gui sound, with out any position.\\ 
-asName The sound name\\ 
-afVol Volume of the sound\\ 
-\\ 
-\\ 
  
 +Resync screen frames to logic timer. \\ 
 +\\ 
 +==== Particle Systems ====
  
  
 +<code c++>void SetParticleSystemActive(std::​string asName, bool abActive)
 +</​code>​
  
  
 +Set if a particle system should be active or not.\\ ​
 +asName The name of the particle system.\\ ​
 +abActive If it should be active or not.\\ ​
 +<code c++>void CreateParticleSystem(std::​string asName, std::string asType, std::string asArea,
 +                                                     float afX, float afY, float afZ)
 +</​code>​
  
  
- +Create ​particle system at the position ​of an area\\  
-==== Physics ====                    +asName ​The name of the particle system.\\  
-<code c++>void SetJointCallback(std::​string asJointName,​ std::string asType,​std::​string asFunc)</​code>​ +asType ​The type of aprticle system\\  
-Sets callback for a joint.\\ +asArea ​The name of the area\\  
-The syntax for the function is: void MyFunction(string asJointName)\\ +X Y and Z the variables ​of the particle ​system.\\ ​
-asJointName The joint name\\ +
-asType The type, can be: "​OnMax"​ or "​OnMin"​.\\ +
-asFunc The script function to be called. Must be in the current script file. ""​ = disabled.\\ +
-\\ +
- +
-<code c++>void BreakJoint(std::​string asJointName)</​code>​ +
-Breaks a joint.\\ +
-asJointName The joint name\\ +
-\\ +
- +
-<code c++>void SetJointControllerActive(std::​string asJointName,​std::​string asCtrlName, bool abActive)</​code>​ +
-Sets if a joint controller is active or not.\\ +
-asJointName The joint name\\ +
-asCtrlName The controller name\\ +
-abActive If the controller is to be active or not.\\ +
-\\ +
- +
-<code c++>​SetJointControllerPropertyFloat(std::​string asJointName,​std::​string asCtrlName, std::string asProperty, float afValue)</​code>​ +
-Sets if a joint controller is active or not.\\ +
-asJointName The joint name\\ +
-asCtrlName The controller name\\ +
-asProperty The property to change.\\ +
-afValue The value of the property to change.\\ +
-\\ +
- +
-<code c++>void ChangeJointController(std::​string asJointName,​std::​string asCtrlName)</​code>​ +
-Change the active controller. All other controllers are set to false.\\ +
-asJointName ​The joint name\\ +
-asCtrlName The controller name\\ +
-\\ +
- +
-<code c++>​float GetJointProperty(std::​string asJointName,​ std::string asProp)</​code>​ +
-Gets a property from the joint.\\ +
-Valid properties are:\\ +
-"​Angle"​ The angle between the bodies (in degrees) (Not working for ball joint)\\ +
-"​Distance"​ The distance between the bodies (in meter)\\ +
-"​LinearSpeed"​ The relative linear speed between the bodies (in m/s)\\ +
-"​AngularSpeed"​ The relative angular speed between the bodies (in m/s)\\ +
-"​Force"​ The size of the force (in newton, kg*m/s^2).\\ +
-"​MinLimit" ​The minimum limit of the joint.\\ +
-"​MaxLimit" ​The maximum limit of the joint.\\ +
-asJointName The joint name\\ +
-asProp The property to get\\ +
-\\ +
- +
-<code c++>​SetJointProperty(string asJoint, string asProp, float afVal)</​code>​ +
-Sets a property to the joint.\\ +
-asJoint the joint to change property for\\ +
-asProp what property to change:\\ +
-"​MinLimit"​ the min limit on joint, does not work on ball joint.\\ +
-"​MaxLimit"​ the max limit on joint, does not work on ball joint.\\ +
-afVal the value in float to set.\\ +
-\\ +
- +
-<code c++>​float GetBodyProperty(std::​string asBodyName, std::string asProp)</​code>​ +
-Gets a property from the body.\\ +
-Valid properties are:\\ +
-"​Mass"​ The mass of the body (in kg)\\ +
-"​LinearSpeed"​ The linear speed the body has (in m/s)\\ +
-"​AngularSpeed"​ The angular speed the body has (in m/s)\\ +
-asBodyName The body name\\ +
-asProp The property to get\\ +
-\\ +
- +
-<code c++>void SetBodyProperty(std::​string asBodyName, std::string asProp, float afVal)</​code>​ +
-Sets a property to the body.\\ +
-Valid properties are:\\ +
-"​Mass"​ The mass of the body (in kg)\\ +
-"​CollideCharacter"​ If the body should collide with the character or not, 0=false 1=true.\\ +
-"​HasGravity"​ If a body is affected by gravity. 0=false 1=true.\\ +
-asBodyName The body name\\ +
-asProp The property to get\\ +
-afVal The new value of the property\\ +
-\\ +
- +
-<code c++>void AddBodyForce(std::​string asBodyName, std::string asCoordType,​ float afX, float afY, float afZ)</​code>​ +
-Adds a force to the body. This can either be in the bodies local coord system ​or the world'​s.\\ +
-asBodyName The body name\\ +
-asCoordType The coordinate system type. "​World"​ or "​Local"​.\\ +
-afX force in the x direction. (in newton, kg*m/​s^2)\\ +
-afY force in the y direction. (in newton, kg*m/​s^2)\\ +
-afZ force in the z direction. (in newton, kg*m/​s^2)\\ +
-\\ +
 <code c++> <code c++>
-void AddBodyImpulse(std::string ​asBodyNamestd::string ​asCoordType,​ +CreateParticleSystemOnCamera(string ​asName ​,​string ​asFile) 
-                                    float afX, float afY, float afZ)</​code>​ +</​code>​
-Adds an impule (a change in velocity) to the body. This can either be in the bodies local coord system or the world'​s.\\ +
-asBodyName The body name\\ +
-asCoordType The coordinate system type. "​World"​ or "​Local"​.\\ +
-afX velocity in the x direction. (in m/s)\\ +
-afY velocity in the y direction. (in m/s)\\ +
-afZ velocity in the z direction. (in m/s)\\ +
-\\ +
-\\+
  
-==== Local Variables ==== 
-<code c++>void CreateLocalVar(std::​string asName, int alVal)</​code>​ 
-<code c++>void SetLocalVar(std::​string asName, int alVal)</​code>​ 
-<code c++>void AddLocalVar(std::​string asName, int alVal)</​code>​ 
-<code c++>int GetLocalVar(std::​string asName)</​code>​ 
-\\ 
-\\ 
  
-==== Global Variables ==== +Create an particle on the position of the camera(player).\\  
-<code c++>​void ​ CreateGlobalVar(std::string asName, int alVal)</​code>​ +asName ​the name of the particle system ingame.\\  
-<code c++>void SetGlobalVar(std::​string ​asName, int alVal)</​code>​ +asFile the name of the file for the particle system.\\ ​ 
-<code c++>​void ​AddGlobalVar(std::​string asName, int alVal)</​code>​ +<code c++>​void ​KillParticleSystem(std::​string asName) 
-<code c++>int GetGlobalVar(std::​string asName)</​code>​ +</​code>​
-\\ +
-\\ +
-\\+
  
-===== Game scripts ===== 
  
 +Kill a particle system\\ ​
 +asName The name of the particle system.\\ ​
 +\\ 
 +==== Beams ====
  
  
 +<code c++>void CreateBeam(string asName, string asFile, string asStartArea,​ string asEndArea)
 +</​code>​
  
  
 +Creates a beam between 2 areas\\ ​
 +asName the name of the beam\\ ​
 +asFile the name of the .beam file \\ 
 +asStartArea name of the area to start the beam\\ ​
 +asEndArea name of the area to end the beam\\ ​
 +<code c++>void DestroyBeam(string asName)
 +</​code>​
  
  
 +Destroy a beam\\ ​
 +asName name of the beam to destory\\ ​
 +\\ 
 +==== Lights ====
  
  
 +<code c++>void FadeLight3D(std::​string asName, ​
 +                    float afR,float afG, float afB, float afA, float afRadius, float afTime)
 +</​code>​
  
  
 +Fades a sound to a color and a radius\\ ​
 +asName The name of the light\\ ​
 +afR The red channel to fade to.\\ 
 +afG The green channel to fade to.\\ 
 +afB The blue channel to fade to.\\ 
 +afA The alpha channel to fade to.\\ 
 +afRadius The radius to fade to.\\ 
 +afTime The amount of seconds the fade should last.\\ ​
 +<code c++>void AttachBillboardToLight3D(std::​string asBillboardName,​ std::string asLightName,​bool abX)
 +</​code>​
  
  
 +Attaches a billboard to a light\\ ​
 +asBillboardName The billbaord name\\ ​
 +asLightName The light name\\ ​
 +abX True if it should be attached, false if you want to remove.\\ ​
 +<code c++>void SetLight3DVisible(std::​string asName, bool abX)
 +</​code>​
  
  
 +Sets on/off a light\\ ​
 +asName The light name\\ ​
 +abX if the light should be on or off.\\ ​
 +<code c++>void SetLight3DFlickerActive(std::​string asName, bool abX)
 +</​code>​
  
  
-==== General ==== +Sets flickering on/off a light\\  
-<code c++>​void ​ResetGame();</​code>​ +asName The light name\\  
-Resets the game and returns to main menu\\ +abX if the light flicker should be on or off.\\ ​ 
-\\+<code c++>​void ​SetLight3DFlicker(std::string asName, 
 +                          float afR,float afG, float afB, float afA, 
 +                          float afRadius, 
 +                          float afOnMinLength,​ float afOnMaxLength,​ 
 +                          std::string asOnSound,​std::​string asOnPS, 
 +                          float afOffMinLength,​ float afOffMaxLength,​ 
 +                          std::string asOffSound,​std::​string asOffPS, 
 +                          bool abFade, 
 +                          float afOnFadeLength,​ float afOffFadeLength) 
 +</​code>​
  
-<code c++>void StartCredits();</​code>​ 
-Starts the end credits screen, uses .lang Category "​MainMenu"​ and .lang Entry "​CreditsText"​ as well as music file "​penumbra_music_E1_E.ogg"​\\ 
-\\ 
  
-<code c++>​void ​StartDemoEndText();</​code>​ +Sets flickering parameters\\  
-Starts the end images that are used in the demo of episode 1, images are named "​demo_end01.jpg"​ increase the number for each image you want to use.\\ +asName The light name\\  
-\\+abR, afG, afB, afA The color of the light when off\\  
 +afRadius The radius of the light when off.\\  
 +afOnMinLength Minimum time before going from off to on.\\  
 +afOnMaxLength Maximum time before going from off to on.\\  
 +asOnSound Name of the sound played when going from off to on. _fckg_QUOT__fckg_QUOT_ means no sound.\\  
 +asOnPS Name of the particle system played when going from off to on. _fckg_QUOT__fckg_QUOT_ means none.\\  
 +afOffMinLength Minimum time before going from on to off.\\  
 +afOffMaxLength Maximum time before going from on to off.\\  
 +asOffSound Name of the sound played when going from on to off. _fckg_QUOT__fckg_QUOT_ means no sound.\\  
 +asOffPS Name of the particle system played when going from on to off. _fckg_QUOT__fckg_QUOT_ means none.\\  
 +abFade If there should be a fade between off and on.\\  
 +afOnFadeLength Fade length from off to on.\\  
 +afOffFadeLength Fade length from on to off.\\  
 +<code c++>​void ​CreateLightFlashAtArea( std::string asArea, float afRadius, 
 + float afR,float afG, float afB, float afA, 
 + float afAddTime, float afNegTime); 
 +</​code>​
  
-<code c++>​string GetActionKeyString(std::​string asAction);</​code>​ 
-Gets the key for a certain action, for example can be used in tutorials to create text that uses the user configured key for "​Interact"​.\\ 
-asAction The name of the action\\ 
-\\ 
  
-<code c++>​void ​AddMessageTrans(std::​string ​asTransCatstd::string asTransName);</​code>​ +Creates a flash of light at an area.\\  
-Adds on on screen game message.\\ +asArea Name of the area to create the flash in\\  
-TransCat The translation category\\ +afRadius Radius of the flash\\  
-TransName The translation name\\ +afR, afG, afB, afA  Red, Green, Blue and alpha of the flash..\\  
-\\+afAddTime Time it will take to reach full strenght.\\  
 +afNegTime Time it will take to end flash, turning black.\\  
 +<code c++>​void ​SetLight3DOnlyAffectInSector(std::​string ​asNamebool abX); 
 +</​code>​
  
-<code c++>void AddMessage(std::​string asMessage);</​code>​ 
-Adds on on screen game message.\\ 
-asMessage The text to be shown.\\ 
-\\ 
  
-<code c++>void SetMessagesOverCallback(std::string asFunction);</​code>​ +If a light should cast its light and shadow, affecting the surroundings in its sector(_room groupingor in all sectors it reaches. By default static lights added in the editor to level is true, the same goes for lights that are part of an Lamp entity. \\  
-Sets callback that is called (and removed) when the last message as been shown.\\ +asName ​The light name\\  
-asFunction ​The function to be called, syntax "​MyFunc()"​\\ +abX if it should only affect the sector or not.\\  
-\\+\\  
 +==== Audio ====
  
-<code c++>AddSubTitleTrans(std::​string ​asTransCat,​std::​string ​asTransNamefloat afTime);</​code>​ +<code c++> 
-Adds a onscreen message at the bottom, that does not interrupt the gameplay.\\ +void CreateSoundEntity(std::​string ​asName, std::​string ​asFilestd::string asArea) 
-asTransCat The translation files category.\\ +</​code>​
-asTransName The translation files name of the entry to be displayed.\\ +
-afTime the length of time it should be displayed.\\ +
-\\+
  
-<code c++>​AddSubTitle(std::​string asMessage, float afTime);</​code>​ +Creates ​sound entity ​at the postion of an area.\\ 
-Adds onscreen message ​at the bottom, that does not interrupt the gameplay.\\ +asName Name of the created sound entity.\\ 
-asMessage ​the text you want to appear on screen.\\ +asFile The snt file to load.\\ 
-afTime the length of time it should be displayed.\\ +asArea The area to create at.
-\\+
  
-<code c++>SetMessageBlackText(bool abX)</​code>​ +<code c++> 
-Makes the onscreen text invert colours to be easier to read on bright backgrounds.\\ +void CreateSoundEntityAt(std::string asType,​std::​string asDestName,​ 
-abX enable or disabled the function.\\ +                   ​std::​string asSoundName,​std::​string asSoundFile)
-\\+</​code>​
  
 +Creates a sound entity at the position of an entity.\\
 +asType The type of entity. This can be: "​Joint","​Body"​ or "​Entity"​.\\
 +asDestName The entity/​body/​joint name\\
 +asSoundName The name of created sound entity.\\
 +asSoundFile The name of the snt file.
  
-<code c++>​void ​AddRadioMessage( std::​string ​asTransCat,​std::​string asTransName,  +<code c++> 
- std::​string asSound);</​code>​ +void PlaySoundEntity(std::​string ​asNamebool abPlayStart) 
-Plays an audio file and displays subtitles for it.\\ +</​code>​
-asTransCat the Category in the translations file\\ +
-asTransName the name of the entry in the translations file\\ +
-asSound the sound file to play for the text.\\ +
-\\+
  
-<code c++>void SetRadioOnEndCallback(std::​string asFunc);</​code>​ +Play sound entity\\ 
-Callback that activates when Radio message is over\\ +asName ​The entity ​name\\ 
-asFunc ​The name of the callback to activate\\ +abPlayStart If the start sound should be played.
-\\ +
- +
-VARIOUS TEMP STRINGS\\ +
-<code c++>void AddToTempString(std::​string asString); //A piece of text to add to a string +
-void AddToTempStringTrans(std::​string asCat,​std::​string asEntry); //A text from the translations file in Category from Entry +
-void AddToTempStringAction(string);​ //Get user configured key for a certain action +
-void AddMessageTempString();​ //Add the strings to one temporary string to print as a Message on screen +
-void AddSubTitleTempString(float);​ //Add the strings to one temporary string to print as a Subtitle on screen</​code>​  +
-Used to create a flow of text that uses various sources, as an example from episode 1: +
-<code c++>​AddToTempStringTrans("​00_01_boat_cabin",​ "​PadLock01"​);​ +
-AddToTempStringAction("​Inventory"​);​ +
-AddToTempStringTrans("​Misc",​ "​ParentDot"​);​ +
-AddMessageTempString();</​code>​ +
-Wrote the message "​Always travel with a padlockAnd a key, preferably. Mine's in the inventory (TAB)."​ as a message.\\ +
-\\+
  
 <code c++> <code c++>
-static ​void __stdcall ChangeMap(std::​string ​asMapFile, std::string asMapPos,  +void StopSoundEntity(std::​string ​asNamebool abPlayEnd) 
- std::​string asStartSound,​ std::string asStopSound,​ +</​code>​
- float afFadeOutTime,​ float afFadeInTime,​ +
- std::​string asLoadTextCat,​ std::string asLoadTextEntry);​</​code>​ +
-Changes the map.\\ +
-asMapFile The file to be loaded\\ +
-asMapPos The position on the map to be spawned on.\\ +
-asStartSound The sound that is played when the change starts.\\ +
-asStopsSound The sound that is played when the new map is loaded\\ +
-afFadeOutTime Time in seconds it takes for the fade out.\\ +
-afFadeInTime Time in seconds it takes for the fade in.\\ +
-asLoadTextCat Category in .lang file to use\\ +
-asLoadTextEntry Entry in .lang file to use\\ +
-\\+
  
-<code c++> +Stop sound entity\\ 
-void AddNotebookTask(std::​string asName, std::string asTransCat,​ +asName ​The entity name\\ 
-                                       ​std::​string asTransEntry);</​code>​ +abPlayEnd If the end sound should be played.
-Adds new task note in the notebook\\ +
-asName ​Name of the task\\ +
-asTransCat Translation category of text.\\ +
-asTransEntry Translation entry of text.\\ +
-\\+
  
 <code c++> <code c++>
-void AddNotebookTaskText(std::​string asName,std::string asText);</​code>​ +void FadeInSoundEntity(std::​string asName, ​float afSpeed) 
-Adds new task note in the notebook without using the lang file.\\ +</​code>​ 
-asName ​Name of the task\\ + 
-asText ​The text for the task\\ +Play sound entity fading it\\ 
-\\+asName The entity name\\ 
 +afSpeed Volume increase per second.
  
 <code c++> <code c++>
-void AddNotebookNote(std::​string ​asNameCat, std::string asNameEntry+void FadeOutSoundEntity(std::​string ​asNamefloat afSpeed) 
-                     std::string asTextCat, std::string asTextEntry);​</​code>​ +</​code>​
-Adds a note to the note book\\ +
-asNameCat\\ +
-asNameEntry Name of the note\\ +
-asTextCat\\ +
-asTextEntry The note text.\\ +
-\\+
  
-<code c++>void RemoveNotebookTask(std::​string asName);</​code>​ +Stop sound entity fading it\\ 
-Removes ​task note in the notebook.\\ +asName ​The entity name\\ 
-asName ​Name of the task\\ +afSpeed Volume decrease per second.
-\\+
  
 <code c++> <code c++>
-void StartNumericalPanel(std::​string asName,int alCode1,int alCode2,int alCode3, +void PlayMusic(std::​string asName, ​float afVol, float afStepSizebool abLoop) 
-                       ​int ​ alCode4, float afDifficultystd::string asCallback);</​code>​ +</​code>​
-Starts the numerical panel\\ +
-asName Name of the panel\\ +
-alCode1 1st code digit.\\ +
-alCode2 2nd code digit.\\ +
-alCode3 3rd code digit.\\ +
-alCode4 4th code digit.\\ +
-afDifficulty How difficult it is to hack.\\ +
-asCallback Called when the code as been entered. Syntax: **MyCallback(string asName, bool abCodeWasCorrect)**\\ +
-\\+
  
-<code c++>void SetInventoryActive(bool abX);</​code>​ +Play music track.\\ 
-Set if the inventory should be active.\\ +asName Name of the music file.\\ 
-abX If it is active or not.\\ +afVol Volume of the music\\ 
-\\+afStepSize The increase in volume per second when fading in.
  
-<code c++>void FadeIn(float afTime);</​code>​ 
-Fades the screen to full color.\\ 
-afTime Time the fade will take in seconds.\\ 
-\\ 
- 
-<code c++>void FadeOut(float afTime);</​code>​ 
-Fades the screen to black.\\ 
-afTime ​ Time the fade will take in seconds.\\ 
-\\ 
- 
-<code c++>bool IsFading();</​code>​ 
-Check if a fade is going on.\\ 
-\\ 
- 
-<code c++>void SetWideScreenActive(bool abActive);</​code>​ 
-Sets wide screen mode on or off.\\ 
-\\ 
- 
-<code c++>void AutoSave();</​code>​ 
-Save the game to the auto save.\\ 
-\\ 
- 
-<code c++>void ClearSavedMaps();</​code>​ 
-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. It's a must to clear the save history a couple of times during the length of a game, in Penumbra: Overture ​ we do it 5-7 times during the whole game.\\ 
-\\ 
- 
-<code c++>​SetDepthOfFieldActive(bool abX, float afFadeTime);</​code>​ 
-Sets depth of field on/off\\ 
-abX if true/​false\\ 
-afFadeTime how long for it to focus.\\ 
-\\ 
- 
-<code c++>​SetupDepthOfField(float afNearPlane,​ float afFocalPlane,​ float afFarPlane);</​code>​ 
-How the depth of field should appear\\ 
-afNearPlane where the focus should begin\\ 
-afFocalPlane how large area that is in focus\\ 
-afFarPlane where the focus should end\\ 
-\\ 
- 
-<code c++>​FocusOnEntity(std::​string asEntity);</​code>​ 
-Set focus on a particular entity.\\ 
-asEntity name of the entity\\ 
-\\ 
- 
-<code c++>​SetConstantFocusOnEntity(std::​string asEntity);</​code>​ 
-Set focus on a particular entity and keep focus on it if it moves or the player moves.\\ 
-asEntity name of the entity\\ 
-\\ 
- 
-<code c++>void StartFlash(float afFadeIn, float afWhite, float afFadeOut);</​code>​ 
-Creates a white flash on screen.\\ 
-afFadeIn The time the fade in takes.\\ 
-afWhite The time it stays white.\\ 
-afFadeOut The time the fade out takes.\\ 
-\\ 
- 
-<code c++>​StartScreenShake(float afAmount, float afTime,​float afFadeInTime,​float afFadeOutTime);</​code>​ 
-Makes the screen shake.\\ 
-afAmount The ammount of shaking.\\ 
-afTime How long the shake should be.\\ 
-afFadeInTime How fast the shake should fade in.\\ 
-afFadeOutTime How fast the shake should fade out.\\ 
-\\ 
- 
-<code c++>​SetupSaveArea(std::​string asName,​std::​string asMessageCat,​std::​string asMessageEntry,​ std::string asSound);</​code>​ 
-Properties for an area to type "​save",​ eg "​_area_save_gamename"​. 
-asName the name of the area\\ 
-asMessageCat The message category in lang file\\ 
-asMessageEntry The message entry in lang file\\ 
-asSound The sound to play during the save\\ 
-\\ 
-\\ 
- 
- 
- 
- 
- 
- 
-==== Attacks ==== 
 <code c++> <code c++>
-void CreateSplashDamage(std::string asAreaName, ​float afRadius, float afMinDamage,​ float afMaxDamge, +void StopMusic(float ​afStepSize) 
-                                             float afMinForce, float afMaxForce, float afMaxImpulse,​ int alStrength);​</​code>​ +</​code>​
-Creates a ball shaped splash damage at the center of an area.\\ +
-asAreaName Name of the area.\\ +
-afRadius Radius of the slash damage in meters.\\ +
-afMinDamage The minimum damage if in side radius\\ +
-afMaxDamge The maximum damage, this is when you are at center.\\ +
-afMinForce The minimum force if you are inside the radius.\\ +
-afMaxForce The maximum force, this is when you are at center.\\ +
-afMaxImpulse Impulse is ForceSize / Mass and this is the max value for that. This is useful to insure that samll objects to no gain very high speed.\\ +
-alStrength The strength of the the damage.\\ +
-\\+
  
-<code c++> +Stop music track.\\ 
-void SetupDamageArea( string asName, float afDamage, +afStepSize ​The decrease in volume ​per second ​when fading out.
- float afUpdatesPerSec,​ int alStrength,​ +
- bool abDisableObjects,​ bool abDisableEnemies,​ +
- string asDamageType,​ string asDamageSound);</​code>​ +
-Properties for an area of type "​damage",​ eg "​_area_damage_gamename"​. Will inflict damage on player and entites while in it.\\ +
-asName ​The name of the area\\ +
-afDamage Damage to do for each update\\ +
-afUpdatesPerSec How many updates ​per second\\ +
-alStrength The strength of each update\\ +
-abDisableObjects If objects should be disabled on destruction\\ +
-abDisableEnemies If enemies should be disabled on destruction\\ +
-asDamageType What sort of damage graphics to use"​BloodSplash",​ "​Ice",​ "​Poison"​.\\ +
-asDamageSound What sound to play at each damage.\\ +
-\\+
  
 <code c++> <code c++>
-void DamageEntity(std::string ​asName, float afDamage, int alStrength);</​code>​ +PlayGameMusic(string ​asFile, float afVolume,​float afFadeStep,​bool abLoop, int alPrio); 
-Gives damage to an entity\\ +</​code>​
-asName the name of the entity\\ +
-afDamage the amount of damage to do\\ +
-alStrength the strength of the damage\\ +
-\\ +
-\\+
  
-==== Game Timer ==== +Play music track with prioadded to episode 1 to be able to play different tracks ​that mix in and out depending ​on prio.\\ 
-<code c++>void CreateTimer(std::​string asNamefloat afTime, std::string asCallback, bool abGlobal);</​code>​ +asFile ​The name of the music file.\\ 
-Creates a new timer which calls a callback function when the time is out.\\ +afVolume ​The volume to play the music at to 1.\\ 
-Syntax: **MyCallback(string asTimerName)**,​ the prefix "​@"​ (ie "​@Func()"​) shows that the function is in the global script\\ +afFadeStep ​The decrease ​in volume per second when fading out.\\ 
-asName Name of the timer\\ +abLoop If the music should loop.\\ 
-afTime The time til time out in seconds.\\ +alPrio ​The priority ​of the track, 0 to 10. A higher numbers fades lower number out, if you have an ambient music track using prio 0 it will fade out if you add music track to an enemy entity with prio and the enemy attacks ​the playerWhen the attack is over the ambient track will fade back in.
-asCallback The callback fucntion\\ +
-abGlobal If the timer is global. Global timers are not deleted at map change.\\ +
-\\ +
- +
-<code c++>void DestroyTimer(std::​string asName);</​code>​ +
- +
-<code c++>void SetTimerPaused(std::​string asName, bool abPaused);</​code>​ +
- +
-<code c++>void SetTimerTime(std::​string asName, float afTime);</​code>​ +
- +
-<code c++>void AddTimerTime(std::​string asName, float afTime);</​code>​ +
- +
-<code c++>​float GetTimerTime(std::​string asName);</​code>​\\ +
-\\ +
- +
- +
- +
- +
- +
- +
- +
-==== Player ==== +
-<code c++>​static void GivePlayerDamage(float afAmount, ​ std::string asType);</​code>​ +
-Gives the player a hit + damage\\ +
-afAmount The amount of health taken.\\ +
-asType what sort of damage effect\\ +
-"​BloodSplash"​\\ +
-"​Ice"​\\ +
-"​Poison"​\\ +
-\\ +
- +
-<code c++>void SetPlayerHealth(float afHealth);</​code>​ +
-Sets the health of the player.\\ +
-afHealth The amount the health should be set to.\\ +
-\\ +
- +
-<code c++>​float GetPlayerHealth();</​code>​ +
-Gets the current health of the player.\\ +
-\\ +
- +
-<code c++>void SetPlayerPose(std::​string asPose,bool abChangeDirectly);</​code>​ +
-Sets the pose of the player.\\ +
-asPose The pose, can be "​Stand"​ or "​Crouch"​\\ +
-abChangeDirectly,​ if the pose should change instantly or in a movement\\ +
-\\ +
- +
-<code c++>void SetPlayerActive(bool abActive);</​code>​ +
-Sets if player can be moved or not.\\ +
-abActive If the player is active or not.\\ +
-\\ +
- +
-<code c++>void StartPlayerLookAt(std::​string asEntityName,​ float afSpeedMul, float afMaxSpeed);</​code>​ +
-This turns the players head towards a specific entity.\\ +
-asEntityName The entity name\\ +
-afSpeedMul The speed of the head movement is determined by the angle length multiplied by this.\\ +
-afMaxSpeed The maximum speed the head will turn.\\ +
-\\ +
- +
-<code c++>void StopPlayerLookAt();</​code>​ +
-Stops the look at motion.\\ +
-\\ +
- +
-<code c++>void StartPlayerFearFilter(float afStrength);</​code>​ +
-Starts a fear effect filter.\\ +
-afStrength strength of the filter.\\ +
-\\ +
- +
-<code c++>​SetFlashlightDisabled(bool abDisabled);</​code>​ +
-Disabled the flashlight.\\ +
-abDisabled true/false for flashlight on/off.\\ +
-\\ +
- +
-<code c++>void StopPlayerFearFilter();</​code>​ +
-Stops the fear filter.\\ +
-\\ +
- +
-<code c++>void TeleportPlayerToArea(string asArea);</​code>​ +
-Teleports the player ​to an area, players feet is aligned to the center of the area.\\ +
-asArea the name of the area to teleport to.\\ +
-\\ +
- +
-<code c++>bool GetPlayerHasGasMask();</​code>​ +
-Get if the player has gasmask or not.\\ +
-\\ +
-\\ +
- +
- +
-==== Inventory ==== +
-<code c++>void AddPickupCallback(std::​string asItem, std::string asFunction);</​code>​ +
-Add a callback ​that is called when the player picks up an item.\\ +
-The syntax for the callback function is:\\ +
-**void MyFunction(string asItem)**, the prefix "​@"​ (ie "​@Func()"​) shows that the function is in the global script\\ +
-asItem The name of the item.\\ +
-asFuntion The name of the function called.\\ +
-\\ +
- +
-<code c++>void AddUseCallback(std::​string asItem, std::string asEntity, std::string asFunction);</​code>​ +
-Add a callback that is called when the player uses the item on en entity\\ +
-The syntax for the callback function is:\\ +
-**void MyFunction(string asItem, string asEntity)**,​ the prefix "​@"​ (ie "​@Func()"​) shows that the function is in the global script.\\ +
-asItem ​The name of the item.\\ +
-asEntity ​The name of the entity.\\ +
-asFuntion The name of the function called.\\ +
-\\ +
- +
-<code c++>void AddCombineCallback(std::​string asItem1,​std::​string asItem2, std::string asFunction);</​code>​ +
-Add a callback that is called when the player combines two items\\ +
-The syntax for the callback function is (alSlotIndex = slot at which combination occurd):​\\ +
-**void MyFunction(string asItem1, string asItem2, int alSlotIndex)**,​ the prefix "​@"​ (ie "​@Func()"​) shows that the function is in the global script.\\ +
-asItem1 The name of the first item.\\ +
-asItem2 The name of the second item.\\ +
-asFuntion The name of the function called.\\ +
-\\ +
- +
-<code c++>void RemovePickupCallback(std::​string asFunction);</​code>​ +
- +
-<code c++>void RemoveUseCallback(std::​string asFunction);</​code>​ +
- +
-<code c++>void RemoveCombineCallback(std::​string asFunction);</​code>​ +
-Removes the callback.\\ +
-asFuntion The name of the function used by the callback.\\ +
-\\ +
- +
-<code c++>bool HasItem(std::​string asName);</​code>​ +
-Checks if the player has a certain item.\\ +
-asName The name of the item.\\ +
-\\ +
- +
-<code c++>void RemoveItem(std::​string asName);</​code>​ +
-Removes an item from the inventory.\\ +
-asName The name of the item.\\ +
-\\ +
- +
-<code c++>void GiveItem(std::​string asName,​std::​string asEntityFile,​ int alSlotIndex);</​code>​ +
-Give an item to the player.\\ +
-asName The name of the entity\\ +
-asEntityFile The file to load it from.\\ +
-lSlotIndex The index of the slot to put the item in. -= first empty slot\\ +
-\\ +
- +
-<code c++>​SetInventoryMessage(std::​string asMessage);</​code>​ +
-Displays a message in the inventory.\\ +
-asMessage ​The message to write in the inventory.\\ +
-\\ +
- +
-<code c++>​SetInventoryMessageTrans(std::​string asTransCat, std::string asTransName);</​code>​ +
-Displays a message from the lang file in the inventory.\\ +
-asTransCat ​The name of the category in the lang file.\\ +
-asTransName The name of the entry in the lang file.\\ +
-\\ +
-\\ +
- +
- +
- +
- +
- +
- +
- +
- +
-==== Map / Level Properties ==== +
-<code c++>​SetAmbientColor(float rfloat g, float b);</​code>​ +
-Sets the ambient color of the level, this should always be part of a level as it gives it a bit of light otherwise shadows will be pitch black.\\ +
-\\ +
- +
-<code c++>​SetSectorProperties(string asSector, float afAmbR,​float afAmbG, float afAmbB);</​code>​ +
-Sets the ambient color of a sector(individual groups of _room. \\ +
-asSector the name of the sector.\\ +
-afAmbR red 0-1\\ +
-afAmbG green 0-1\\ +
-afAmbB blue 0-1\\ +
-The values are multiplied with the SetAmbientColor(f,​f,​f);​ values. This script function will most likely be expanded ​to include specific ambient sounds etc for each sector.\\ +
-\\ +
- +
-<code c++>​SetSkybox(string asTexture);</​code>​ +
-Sets a texture as a sky box.\\ +
-\\ +
- +
-<code c++>​SetSkyboxActive(bool);</​code>​ +
-Set the skybox active with true/​False\\ +
-\\ +
- +
-<code c++>​SetSkyboxColor(float R, float G, float B, float A);</​code>​ +
-What color should the Skybox have\\ +
-R, G, B and Alpha\\ +
-\\ +
- +
-<code c++>​SetFogActive(bool abX);</​code>​ +
-If level should have fog or not.\\ +
-bool abXfalse/​true\\ +
-\\ +
- +
-<code c++>​SetFogProperties(float afStart, float afEnd, float r,float g, float b);</​code>​ +
-The properties of the fog.\\ +
-afStart how many meters from the camera should the fog begin.\\ +
-afEnd how many meters from the camera should the fog reach full thickness.\\ +
-float r,float g, float b the color of the fog in RGB.\\ +
-\\ +
- +
-<code c++>​SetFogCulling(bool);</​code>​ +
-Should the game stop rendering the level when the fog is full thickness\\ +
-true/​false\\ +
-\\ +
- +
-<code c++>​SetWaveGravityActive(bool abX);</​code>​ +
-Enable a dynamic gravity that mimics waves, ture/​false\\ +
-\\ +
- +
-<code c++>​SetupWaveGravity(float afMaxAngle, float afSwingLength,​ float afGravitySize,​ std::string asAxis);</​code>​ +
-Set the properties for the dynamic wave gravity\\ +
-afMaxAngle The maximum angel of the wave\\ +
-afSwingLength The length for going from top to bottom\\ +
-afGravitySize The strength of the gravity\\ +
-asAxis Along which axis should the wave "​move"​\\ +
-\\ +
- +
-<code c++>​SetMapGameName(std::​string asName);</​code>​ +
-Set the name of the current map, is used for naming the saved games.\\ +
-asName the name of the map\\ +
-\\ +
- +
-<code c++>​SetMapGameNameTrans(std::​string asTransCat,​std::​string asTransEntry);</​code>​ +
-Set the name of the current map using the lang file, is used for naming the saved games.\\ +
-asTransCat the category in the lang file\\ +
-asTransEntry the entry in the lang file with the name of the map\\ +
-\\ +
-\\ +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
-==== Game Entity Properties ==== +
-<code c++>void SetGameEntityActive(std::​string asName, bool abX);</​code>​ +
-Set if a game entity is active.\\ +
-asName The name of the game entity\\ +
-abX If active or not.\\ +
-\\ +
- +
-<code c++>bool GetGameEntityActive(std::​string asName);</​code>​ +
-Get if a game entity is active.\\ +
-asName The name of the game entity\\ +
-return if active or not.\\ +
-\\ +
- +
-<code c++>void ReplaceEntity(std::​string asName, std::string asBodyName, std::string asNewName, std::string asNewFile);</​code>​ +
-Replaces ​an ingame entity with another entity, the new entity ​will appear at the center of the old entities location\\ +
-asName Name of the ingame entity\\ +
-asBodyName The name of the body in the old entity that will be used as a center for the new entity, leave as "" ​if entity only has 1 body\\ +
-asNewName The ingame name given to the new entity\\  +
-asNewFile The .ent file to be used for the new entity\\ +
-\\ +
- +
-<code c++>void CreateGameEntityVar(std::​string asEntName, std::string asVarName, int alVal);</​code>​ +
-Create ​variable for a game entity. Nothing happens if it is already created.\\ +
-asEntName The name of the game entity\\ +
-asVarName The name of variable\\ +
-alVal value to set the variable to.\\ +
-\\ +
- +
-<code c++>void SetGameEntityVar(std::​string asEntName, std::string asVarName, int alVal);</​code>​ +
-Change the value of a entity variable to a new value\\ +
-asEntName The name of the game entity\\ +
-asVarName The name of variable\\ +
-alVal value to set the variable to.\\ +
-\\ +
- +
-<code c++>void AddGameEntityVar(std::​string asEntName, std::string asVarName, int alVal);</​code>​ +
-Change the value of an entity ​variable by adding to the previous value\\ +
-asEntName The name of the game entity\\ +
-asVarName The name of variable\\ +
-alVal value to add to the existing variable.\\ +
-\\ +
- +
-<code c++>int GetGameEntityVar(std::​string asEntName, std::string asVarName);</​code>​ +
-Get the value of a variable for a game entity.\\ +
-asEntName The name of the game entity\\ +
-asVarName The name of variable\\ +
-alVal value to set the variable to.\\ +
-\\ +
- +
-<code c++>void SetGameEntityMaxExamineDist(std::​string asName,​float afDist);</​code>​ +
-Set the maximum distance at which a game entity can be examined.\\ +
-asName The name of the game entity\\ +
-afDist The distance in meters\\ +
-\\ +
- +
-<code c++>void SetGameEntityMaxInteractDist(std::​string asName,​float afDist);</​code>​ +
-Set the maximum distance at which a game entity can be interacted ​with.\\ +
-asName The name of the game entity\\ +
-afDist The distance in meters\\ +
-\\ +
- +
-<code c++>void SetGameEntityDescriptionTrans(std::​string asName,​std::​string asTransCat, std::string asTransName);</​code>​ +
-Set a description on a game entity.\\ +
-asName The name of the game entity\\ +
-asTransCat The translation category\\ +
-asTransName The translation name\\ +
-\\ +
- +
-<code c++>​SetGameEntityDescriptionOnceTrans(std::​string asName,​std::​string asTransCat,​std::​string asTransName);</​code>​ +
-Set a description on a game entity BUT display the eye only time, after that the you can still examine but the eye wont show unless in Interact mode.\\ +
-asName The name of the game entity\\ +
-asTransCat The translation category\\ +
-asTransName The translation name\\ +
-\\ +
- +
-<code c++>void SetGameEntityDescription(std::​string asName, std::string asMessage);</​code>​ +
-Set a description on a game entity.\\ +
-asName The name of the game entity\\ +
-asMessage The message\\ +
-\\ +
- +
-<code c++>void SetGameEntityGameNameTrans(std::​string asName, std::string asTransCat,​std::​string asTransName);</​code>​ +
-Set a game name on a game entity.\\ +
-asName The name of the game entity\\ +
-asTransCat The translation category\\ +
-asTransName The translation name\\ +
-\\ +
- +
-<code c++>void SetDoorState(std::​string asName,​std::​string asState);</​code>​ +
-Sets the state of a door with animation. This entity was only used in early test builds of HPL.\\ +
-asName The name of the game entity\\ +
-asState The state to set, thís can be "​Open","​Closed",​ "​Opening"​ or "​Closing"​.\\ +
-\\ +
- +
-<code c++>​SetDoorLocked(std::​string asDoor, bool abLocked);</​code>​ +
-Sets a door locked or unlocked, only works with SwingDoor entities(set in the .ent file)\\ +
-asDoor the name of the entity.\\ +
-abLocked true or false if locked or not.\\ +
-\\ +
- +
-<code c++>​SetDoorLockedProperties(std::​string asDoor,  +
- std::​string asMessCat,​std::​string asMessEntry,​ +
- std::​string asSound, +
- bool RepeatLockedMessage);</​code>​ +
-Gives properties to a locked door, how it should sound what message to show etc. Only works with SwingDoor entities(set in the .ent file)\\ +
-asDoor the name of the entity.\\ +
-asMessCat the name of the category in the translations file.\\ +
-asMessEntry the name of the entry in the translations file to use.\\ +
-asSound sound to play for the locked door when player interacts.\\ +
-RepeatLockedMessage true or false if the event should be every time or only the first time.\\ +
-\\ +
- +
-<code c++>void SetObjectInteractMode(std::​string asName,​std::​string asMode);</​code>​ +
-Sets the interact mode of an game object.\\ +
-asName The name of the game object\\ +
-asState The mode to set, valid modes are "​Static",​ "​Grab",​ "​Move"​ and "​Push"​.\\ +
-\\+
  
 <code c++> <code c++>
-static void __stdcall SetupLink(std::string asName, std::string asMapFile, std::string asMapPos, +StopGameMusic(float ​afFadeStepint alPrio); 
-                                              std::string asStartSound,​ std::string asStopSound,​ +</​code>​
-                                                        ​float afFadeOutTimefloat afFadeInTime);</​code>​ +
-Sets up the properties for a link.\\ +
-asName The name of the link\\ +
-asMapFile The file to be loaded\\ +
-asMapPos The position on the map to be spawned on.\\ +
-asStartSound The sound that is played when the change starts.\\ +
-asStopsSound The sound that is played when the new map is loaded\\ +
-afFadeOutTime Time in seconds it takes for the fade out.\\ +
-afFadeInTime Time in seconds it takes for the fade in.\\ +
-\\+
  
-<code c++> +Stop game music track with prio.\\ 
-static void __stdcall SetupLinkLoadText(string asName, +afFadeStepThe decrease in volume per second ​when fading ​out.\\ 
- string asMapFile, string asMapPos,  +alPrio priority of the music track.
- string asStartSound,​ string asStopSound,​ +
- float afFadeOutTime,​ float afFadeInTime,​ +
- string asTextCat, string asTextEntry);</​code>​ +
-Sets up the properties for a link and displays a screen ​with text/​picture while loading.\\ +
-asName The name of the link\\ +
-asMapFile The file to be loaded\\ +
-asMapPos The position on the map to be spawned on.\\ +
-asStartSound The sound that is played ​when the change starts.\\ +
-asStopsSound The sound that is played when the new map is loaded\\ +
-afFadeOutTime Time in seconds it takes for the fade out.\\ +
-afFadeInTime Time in seconds it takes for the fade in.\\ +
-asTextCat The text category in translations file .lang\\ +
-asTextEntry The text entry in translations file .lang\\ +
-\\+
  
 <code c++> <code c++>
-void SetupLinkLockedProp(std::​string asName,std::string asLockedSound,​ +void PlayGuiSound(std::​string asName, ​float afVol) 
- std::string asLockedDescCat,​std::​string asLockedDescEntry);​</​code>​ +</​code>​
-Properties for an area of type "​link",​ eg "​_area_link_gamename",​ to be used if the link is "​locked"​.\\ +
-asName The name of the link\\ +
-asLockedSound The "​locked sound" to play\\ +
-asLockedDescCat In what category the text to use is in the .lang file.\\ +
-asLockedDescEntry In what entry the text is found in the .lang file.\\ +
-\\+
  
-<code c++>void SetLinkLocked(std::​string asNamebool abLocked);</​code>​ +Play a sound gui soundwith out any position.\\ 
-Set an area of type "​link"​ as locked or unlocked.\\ +asName The sound name\\ 
-asName The name of the link\\ +afVol Volume of the sound\\
-abLocked True/false for locked or not.\\ +
-\\+
  
-<code c++>void SetAreaCustomIcon(std::​string asName, std::string asIcon);</​code>​ +==== Physics ====
-Makes the area show a custom icon on player focus.\\ +
-asName The name of the area\\ +
-asIcon The icon, can be: "​Inactive",​ "​Active",​ "​Invalid",​ "​Grab",​ "​Examine",,​ "​PickUp",​ "​Pointer",​ "​Item",​ "​DoorLink"​ or "​None"​.\\ +
-\\+
  
-<code c++>void AddEnemyPatrolNode(std::​string asEnemy,​std::​string asNode,​float afTime,​std::​string asAnimation);</​code>​ 
-Adds node that the enemy will have on his patrol path.\\ 
-asEnemy Name of the enemy\\ 
-asNode The Node to walk to.\\ 
-afTime The time to stay at the node when reached.\\ 
-asAnimation The animation to be played when at the node. ""​ = idle.\\ 
-\\ 
  
-<code c++>​void ​ClearEnemyPatrolNodes(std::​string ​asEnemy);</​code>​ +<code c++>​void ​SetJointCallback(std::​string ​asJointName,​ std::string asType,​std::​string asFunc) 
-Clears all the patrol nodes for the enemy\\ +</​code>​
-asEnemy The Name of the enemy.\\ +
-\\+
  
-<code c++>void SetEntityHealth(std::​string asName, float afHealth);</​code>​ 
-Sets the health of an entity\\ 
-asName Name of the entity\\ 
-afHealth the amount to set the health to.\\ 
-\\ 
  
-<code c++>float GetEnemyHealth(std::​string ​asEnemy);</code> +Sets a callback for a joint.\\  
-Gets the health ​of an enemy\\ +The syntax for the function is: void MyFunction(string asJointName)\\  
-asEnemyName Name of the enemy\\ +asJointName The joint name\\  
-return ​the health.\\ +asType The type, can be: "​OnMax"​ or "​OnMin"​.\\  
-\\+asFunc The script function to be called. Must be in the current script file. %%_fckg_QUOT__fckg_QUOT_ = disabled.%%\\  
 +\\  
 +''​void BreakJoint(std::​string asJointName)''​  
 +Breaks a joint.\\  
 +asJointName The joint name\\  
 +\\  
 +''​void SetJointControllerActive(std::​string asJointName,​std::​string asCtrlName, bool abActive)''​  
 +Sets if a joint controller is active or not.\\  
 +asJointName The joint name\\  
 +asCtrlName The controller name\\  
 +abActive If the controller is to be active or not.\\  
 +\\  
 +''​SetJointControllerPropertyFloat(std::​string asJointName,​std::​string asCtrlName, std::string asProperty, ​float afValue)''​  
 +Sets if a joint controller is active or not.\\  
 +asJointName The joint name\\  
 +asCtrlName The controller name\\  
 +asProperty The property to change.\\  
 +afValue The value of the property to change.\\  
 +\\  
 +''​void ChangeJointController(std::​string ​asJointName,​std::​string asCtrlName)''​  
 +Change the active controller. All other controllers are set to false.\\  
 +asJointName The joint name\\  
 +asCtrlName The controller name\\  
 +\\  
 +''​float GetJointProperty(std::​string asJointName,​ std::string asProp)''​  
 +Gets a property from the joint.\\  
 +Valid properties are:\\  
 +"​Angle"​ The angle between the bodies (in degrees) (Not working for ball joint)\\  
 +"​Distance"​ The distance between the bodies (in meter)\\  
 +"​LinearSpeed"​ The relative linear speed between the bodies (in m/s)\\  
 +"​AngularSpeed"​ The relative angular speed between the bodies (in m/s)\\  
 +"​Force"​ The size of the force (in newton, kg%%*%%m/​s^2).\\  
 +"​MinLimit"​ The minimum limit of the joint.\\  
 +"​MaxLimit"​ The maximum limit of the joint.\\  
 +asJointName The joint name\\  
 +asProp The property to get\\  
 +\\  
 +''​SetJointProperty(string asJoint, string asProp, float afVal)''​  
 +Sets a property to the joint.\\  
 +asJoint the joint to change property for\\  
 +asProp what property to change:\\  
 +"​MinLimit"​ the min limit on joint, does not work on ball joint.\\  
 +"​MaxLimit"​ the max limit on joint, does not work on ball joint.\\  
 +afVal the value in float to set.\\  
 +\\  
 +''​float GetBodyProperty(std::​string asBodyName, std::string asProp)'' ​ 
 +Gets a property from the body.\\  
 +Valid properties are:\\  
 +"​Mass"​ The mass of the body (in kg)\\  
 +"​LinearSpeed"​ The linear speed the body has (in m/s)\\  
 +"​AngularSpeed"​ The angular speed the body has (in m/s)\\  
 +asBodyName The body name\\  
 +asProp The property to get\\  
 +\\  
 +''​void SetBodyProperty(std::​string asBodyName, std::string asProp, float afVal)''​  
 +Sets a property to the body.\\  
 +Valid properties are:\\  
 +"​Mass"​ The mass of the body (in kg)\\  
 +"​CollideCharacter"​ If the body should collide with the character or not, 0=false 1=true.\\  
 +"​HasGravity"​ If a body is affected by gravity. 0=false 1=true.\\  
 +asBodyName The body name\\  
 +asProp The property to get\\  
 +afVal The new value of the property\\  
 +\\  
 +''​void AddBodyForce(std::​string asBodyName, std::string asCoordType,​ float afX, float afY, float afZ)''​  
 +Adds a force to the body. This can either be in the bodies local coord system or the world'​s.\\  
 +asBodyName The body name\\  
 +asCoordType The coordinate system type. "​World"​ or "​Local"​.\\  
 +afX force in the x direction. (in newton, kg%%*%%m/​s^2)\\  
 +afY force in the y direction. (in newton, kg%%*%%m/​s^2)\\  
 +afZ force in the z direction. (in newton, kg%%*%%m/​s^2)\\  
 +\\  
 +''​void AddBodyImpulse(std::​string asBodyName, std::string asCoordType, ​  float afX, float afY, float afZ)''​  
 +Adds an impule (a change in velocity) to the body. This can either be in the bodies local coord system or the world'​s.\\  
 +asBodyName The body name\\  
 +asCoordType The coordinate system type. "​World"​ or "​Local"​.\\  
 +afX velocity in the x direction. (in m/s)\\  
 +afY velocity in the y direction. (in m/s)\\  
 +afZ velocity in the z direction. (in m/s)\\  
 +\\  
 +\\ 
  
-<code c++>void ShowEnemyPlayer(std::​string asEnemy);</​code>​ +==== Local Variables ==== 
-Show the enemy the position of the player and sets the enemy into hunt mode.\\ +
-asEnemy The name of the Enemy.\\ +
-\\+
  
-<code c++>void SetEnemyUseTriggers(std::​string ​asEnemybool abUseTriggers);</​code>​ +''​void CreateLocalVar(std::​string ​asNameint alVal)'' ​ 
-If an enemy should use triggersfor example if an enemy should react to sounds.\\ +''​void SetLocalVar(std::​string asNameint alVal)'' ​ 
-asEnemy The name of the Enemy.\\ +''​void AddLocalVar(std::​string asName, int alVal)''​  
-abUseTriggers use triggers or not.\\ +''​int GetLocalVar(std::​string asName)'' ​ 
-\\+\\  
 +\\ 
  
-<code c++>void SetEnemyAttackCallback(std::​string asEnemy,​std::​string asFunction);</​code>​ +==== Global Variables ==== 
-Activates a callback when an enemy attacks the player.\\ +
-asEnemy The name of the Enemy.\\ +
-asFunction The name of the callback to activate.\\ +
-\\+
  
-<code c++>​SetLampLit(std::​string asName,bool abLitbool abFade);</​code>​ +''​void ​ CreateGlobalVar(std::​string asName, ​int alVal)''​  
-Sets a Lamp entity light on/offrequires the entity file to be a Type="​Lamp"​.\\ +''​void SetGlobalVar(std::​string asNameint alVal)'' ​ 
-asName ​The name of the lamp entity.\\ +''​void AddGlobalVar(std::​string asNameint alVal)'' ​ 
-abLit if it should be lit or not.\\ +''​int GetGlobalVar(std::​string ​asName)'' ​ 
-abFade if it should fade on/off, properties are set in the entity file.\\ +\\  
-\\+\\  
 +\\ 
  
-<code c++>void SetLampFlicker(std::​string asName,bool abFlicker);</​code>​ +===== Game scripts =====   
-Sets a Lamp entity lights flicker, requires the entity file to be a Type="​Lamp"​.\\ +
-asName The name of the lamp entity.\\ +
-abFlicker starts/​stops the flicker.\\ +
-Flicker properties are set in the entity file.\\ +
-\\+
  
-<code c++>​SetupStickArea(std::​string asArea, bool abCanDeatch,​ +==== General ==== 
- bool abMoveBody, bool abRotateBody,​ +
- bool abCheckCenterInArea,​ float afPoseTime,​ +
- std::​string asAttachSound,​ std::string asDetachSound,​ +
- std::​string asAttachPS, std::string asDetachPS,​ +
- std::​string asAttachFunc,​ std::string asDetachFunc);</​code>​ +
-Give properties to an area of type "​stick"​. Used to make an object attach itself to another etc.\\ +
-asArea The name of the stick area\\ +
-abCanDeatch if the area will allow to detach and attached object\\ +
-abMoveBody Should the attached object be moved into the center\\ +
-abRotateBody should the attached object be rotated to attach in a certain direction(rotating the stick area in the level will decide this)\\ +
-abCheckCenterInArea only attach if the object to be attached is in the center of the stick area \\ +
-afPoseTime how long will the attach movement(move/​rotate) take \\ +
-asAttachSound what attach sound to play\\ +
-asDetachSound what detach sound to play\\ +
-asAttachPS what particle effect to use on attach\\ +
-asDetachPS what particle effect to use on detach\\ +
-asAttachFunc name of attach callback\\ +
-asDetachFunc name of detach callback\\ +
-\\+
  
-<code c++>void AllowAttachment();</​code>​ +''​void ResetGame();'' ​ 
-Executes ​the attachment settings ​in SetupStickArea.\\ +Resets ​the game and returns to main menu\\  
-\\ +\\  
-//​Example ​of an attach ​callback//​ +''​void StartCredits();''​  
-<code c++> +Starts the end credits screen, uses .lang Category "​MainMenu"​ and .lang Entry "​CreditsText"​ as well as music file "​penumbra_music_E1_E.ogg"​\\  
-void MyAttach(string ​asArea, string ​asBody+\\  
-{ +''​void StartDemoEndText();''​  
- if(StringContains(asBody, "entityname")) +Starts the end images that are used in the demo of episode 1, images are named "​demo_end01.jpg"​ increase the number for each image you want to use.\\  
- { +\\  
- AllowAttachment();  +''​string GetActionKeyString(std::​string asAction);''​  
- } +Gets the key for a certain action, for example can be used in tutorials to create text that uses the user configured key for "​Interact"​.\\  
-}  +asAction The name of the action\\  
-</​code>​ +\\  
-\\+''​void AddMessageTrans(std::​string asTransCat, std::string asTransName);''​  
 +Adds on on screen game message.\\  
 +TransCat The translation category\\  
 +TransName The translation name\\  
 +\\  
 +''​void AddMessage(std::​string asMessage);''​  
 +Adds on on screen game message.\\  
 +asMessage The text to be shown.\\  
 +\\  
 +''​void SetMessagesOverCallback(std::​string asFunction);''​  
 +Sets a callback that is called (and removed) when the last message as been shown.\\  
 +asFunction The function to be called, syntax "​MyFunc()"​\\  
 +\\  
 +''​AddSubTitleTrans(std::​string asTransCat,​std::​string asTransName,​ float afTime);''​  
 +Adds a onscreen message at the bottom, that does not interrupt the gameplay.\\  
 +asTransCat The translation files category.\\  
 +asTransName The translation files name of the entry to be displayed.\\  
 +afTime the length of time it should be displayed.\\  
 +\\  
 +''​AddSubTitle(std::​string asMessage, float afTime);''​  
 +Adds a onscreen message at the bottom, that does not interrupt the gameplay.\\  
 +asMessage the text you want to appear on screen.\\  
 +afTime the length of time it should be displayed.\\  
 +\\  
 +''​SetMessageBlackText(bool abX)''​  
 +Makes the onscreen text invert colours to be easier to read on bright backgrounds.\\  
 +abX enable or disabled the function.\\  
 +\\  
 +''​void AddRadioMessage( std::​string asTransCat,​std::​string asTransName,​ std::string asSound);''​  
 +Plays an audio file and displays subtitles for it.\\  
 +asTransCat the Category in the translations file\\  
 +asTransName the name of the entry in the translations file\\  
 +asSound the sound file to play for the text.\\  
 +\\  
 +''​void SetRadioOnEndCallback(std::​string asFunc);''​  
 +Callback that activates when a Radio message is over\\  
 +asFunc The name of the callback ​to activate\\  
 +\\  
 +VARIOUS TEMP STRINGS\\  
 +''​void AddToTempString(std::​string asString); ​//A piece of text to add to a string void AddToTempStringTrans(std::​string asCat,​std::​string asEntry); // A text from the translations file in Category from Entry void AddToTempStringAction(string);​ //Get user configured key for a certain action void AddMessageTempString();​ // Add the strings to one temporary string to print as a Message on screen void AddSubTitleTempString(float);​ //Add the strings to one temporary string to print as a Subtitle on screen//''​ //Used to create a flow of text that uses various sources, as an example from episode 1: ''​AddToTempStringTrans(__GESHI_QUOT__00_01_boat_cabin__GESHI_QUOT__,​ __GESHI_QUOT__PadLock01__GESHI_QUOT__);​ AddToTempStringAction(__GESHI_QUOT__Inventory__GESHI_QUOT__);​ AddToTempStringTrans(__GESHI_QUOT__Misc__GESHI_QUOT__,​ __GESHI_QUOT__ParentDot__GESHI_QUOT__);​ AddMessageTempString();'' ​ 
 +Wrote the message "​Always travel with a padlock. And a key, preferably. Mine's in the inventory (TAB)."​ as a message.\\ ​ 
 +\\  
 +''​static ​void __stdcall ChangeMap(std::string ​asMapFilestd::string ​asMapPos, ​ std::​string asStartSound,​ std::string asStopSound,​ float afFadeOutTime,​ float afFadeInTime,​ std::​string asLoadTextCat,​ std::string asLoadTextEntry);​__''​__Changes the map.\\ ​ 
 +asMapFile The file to be loaded\\ ​ 
 +asMapPos The position on the map to be spawned on.\\  
 +asStartSound The sound that is played when the change starts.\\  
 +asStopsSound The sound that is played when the new map is loaded\\  
 +afFadeOutTime Time in seconds it takes for the fade out.\\  
 +afFadeInTime Time in seconds it takes for the fade in.\\  
 +asLoadTextCat Category in .lang file to use\\  
 +asLoadTextEntry Entry in .lang file to use\\  
 +\\  
 +''​void AddNotebookTask(std::string asName, std::string asTransCat, ​  ​std::​string asTransEntry);''​  
 +Adds a new task note in the notebook\\  
 +asName Name of the task\\  
 +asTransCat Translation category of text.\\  
 +asTransEntry Translation entry of text.\\  
 +\\  
 +''​void AddNotebookTaskText(std::string asName,std::string asText);''​  
 +Adds a new task note in the notebook without using the lang file.\\  
 +asName Name of the task\\  
 +asText The text for the task\\  
 +\\  
 +''​void AddNotebookNote(std::​string asNameCat, std::string asNameEntry, ​  ​std::​string asTextCat, std::string asTextEntry);''​  
 +Adds a note to the note book\\  
 +asNameCat\\  
 +asNameEntry Name of the note\\  
 +asTextCat\\  
 +asTextEntry The note text.\\  
 +\\  
 +''​void RemoveNotebookTask(std::​string asName);''​  
 +Removes a task note in the notebook.\\  
 +asName Name of the task\\  
 +\\  
 +''​void StartNumericalPanel(std::​string asName,int alCode1,int alCode2,int alCode3, ​  ​int ​ alCode4, float afDifficulty,​ std::string asCallback);''​  
 +Starts the numerical panel\\  
 +asName Name of the panel\\  
 +alCode1 1st code digit.\\  
 +alCode2 2nd code digit.\\  
 +alCode3 3rd code digit.\\  
 +alCode4 4th code digit.\\  
 +afDifficulty How difficult it is to hack.\\  
 +asCallback Called when the code as been entered. Syntax: **MyCallback(string asName, bool abCodeWasCorrect)** \\  
 +\\  
 +''​void SetInventoryActive(bool abX);''​  
 +Set if the inventory should be active.\\  
 +abX If it is active or not.\\  
 +\\  
 +''​void FadeIn(float afTime);''​  
 +Fades the screen to full color.\\  
 +afTime Time the fade will take in seconds.\\  
 +\\  
 +''​void FadeOut(float afTime);''​  
 +Fades the screen to black.\\  
 +afTime ​ Time the fade will take in seconds.\\  
 +\\  
 +''​bool IsFading();''​  
 +Check if a fade is going on.\\  
 +\\  
 +''​void SetWideScreenActive(bool abActive);''​  
 +Sets wide screen mode on or off.\\  
 +\\  
 +''​void AutoSave();''​  
 +Save the game to the auto save.\\  
 +\\  
 +''​void ClearSavedMaps();''​  
 +Clears the "history" ​of the save, useful to do when you know the player will not be able to go back anymore. Makes the next save much smaller in size. It's a must to clear the save history a couple of times during the length of a game, in Penumbra: Overture ​ we do it 5-7 times during the whole game.\\  
 +\\  
 +''​SetDepthOfFieldActive(bool abX, float afFadeTime);''​  
 +Sets depth of field on/off\\  
 +abX if true/​false\\  
 +afFadeTime how long for it to focus.\\  
 +\\  
 +''​SetupDepthOfField(float afNearPlane,​ float afFocalPlane,​ float afFarPlane);'' ​ 
 +How the depth of field should appear\\ ​ 
 +afNearPlane where the focus should begin\\  
 +afFocalPlane how large area that is in focus\\  
 +afFarPlane where the focus should end\\  
 +\\  
 +''​FocusOnEntity(std::string asEntity);'' ​ 
 +Set focus on a particular entity.\\ ​ 
 +asEntity name of the entity\\ ​ 
 +\\  
 +''​SetConstantFocusOnEntity(std::​string asEntity);''​  
 +Set focus on a particular entity and keep focus on it if it moves or the player moves.\\  
 +asEntity name of the entity\\  
 +\\  
 +''​void StartFlash(float afFadeIn, float afWhite, float afFadeOut);''​  
 +Creates a white flash on screen.\\  
 +afFadeIn The time the fade in takes.\\  
 +afWhite The time it stays white.\\  
 +afFadeOut The time the fade out takes.\\  
 +\\  
 +''​StartScreenShake(float afAmount, float afTime,​float afFadeInTime,​float afFadeOutTime);''​  
 +Makes the screen shake.\\  
 +afAmount The ammount of shaking.\\  
 +afTime How long the shake should be.\\  
 +afFadeInTime How fast the shake should fade in.\\  
 +afFadeOutTime How fast the shake should fade out.\\  
 +\\  
 +''​SetupSaveArea(std::​string asName,​std::​string asMessageCat,​std::​string asMessageEntry,​ std::string asSound);''​  
 +Properties for an area to type "​save",​ eg _fckg_QUOT__area_save_gamename"​. asName the name of the area\\  
 +asMessageCat The message category in lang file\\  
 +asMessageEntry The message entry in lang file\\  
 +asSound The sound to play during the save\\  
 +\\  
 +\\ 
  
-<code c++> +==== Attacks ==== 
-DetachBodyFromStickArea(string asArea);</​code>​ +
-Detach a body from a stick area.\\ +
-asArea Name of the area.\\ +
-\\+
  
-<code c++> +''​void CreateSplashDamage(std::​string asAreaName, float afRadius, float afMinDamage,​ float afMaxDamge, ​  float afMinForce, float afMaxForce, float afMaxImpulse,​ int alStrength);'' ​ 
-SetupLadder(string asName,string asAttachSound, string ​asClimbUpSound, string ​asClimbDownSound);</​code>​ +Creates a ball shaped splash damage at the center of an area.\\  
-Sets properties ​for an area of type "ladder"eg "_area_ladder_gamename"​\\ +asAreaName Name of the area.\\  
-asName ​Name of the area.\\ +afRadius Radius of the slash damage in meters.\\  
-asAttachSound Sound to be played as player grabs onto ladder\\ +afMinDamage The minimum damage if in side radius\\  
-asClimbUpSound Sound to be played as player climbs up.\\ +afMaxDamge The maximum damage, this is when you are at center.\\  
-asClimbDownSound Sound to be played as player climbs down.\\ +afMinForce The minimum force if you are inside the radius.\\  
-\\+afMaxForce The maximum force, this is when you are at center.\\  
 +afMaxImpulse Impulse is ForceSize / Mass and this is the max value for that. This is useful to insure that samll objects to no gain very high speed.\\  
 +alStrength The strength of the the damage.\\  
 +\\  
 +''​void SetupDamageArea( string asName, ​float afDamage float afUpdatesPerSec,​ int alStrength, bool abDisableObjects,​ bool abDisableEnemies,​  string ​asDamageType, string ​asDamageSound);'' ​ 
 +Properties ​for an area of type "damage"eg _fckg_QUOT__area_damage_gamename". Will inflict damage on player and entites while in it.\\  
 +asName ​The name of the area\\  
 +afDamage Damage ​to do for each update\\  
 +afUpdatesPerSec How many updates per second\\  
 +alStrength The strength of each update\\  
 +abDisableObjects If objects should ​be disabled on destruction\\  
 +abDisableEnemies If enemies should ​be disabled on destruction\\  
 +asDamageType What sort of damage graphics to use. "​BloodSplash",​ "​Ice",​ "​Poison"​.\\  
 +asDamageSound What sound to play at each damage.\\  
 +\\  
 +''​void DamageEntity(std::​string asName, float afDamage, int alStrength);''​  
 +Gives damage to an entity\\  
 +asName the name of the entity\\  
 +afDamage the amount of damage to do\\  
 +alStrength the strength of the damage\\  
 +\\  
 +\\ 
  
-<code c++> +==== Game Timer ==== 
-void ChangeEntityAnimation(string asName,​string asAnimation,​bool abLoop);</​code>​ +
-Change the animation of an entity.\\ +
-asName Name of the entity.\\ +
-asAnimation the animation that should be used\\ +
-abLoop if it should loop or not.\\ +
-\\+
  
-<code c++> +''​void CreateTimer(std::string asName, float afTimestd::string asCallback, bool abGlobal);'' ​ 
-void SetupForceArea( string asName, ​ +Creates a new timer which calls a callback function when the time is out.\\  
- float afMaxForcefloat afConstant,​ +Syntax: **MyCallback(string asTimerName)**, the prefix "​@"​ (ie "​@Func()"​) shows that the function ​is in the global script\\  
- float afDestSpeed,​ float afMaxMass,​ +asName Name of the timer\\  
- bool abMulWithMass,​ bool abForceAtPoint,​ +afTime The time til time out in seconds.\\  
- bool abAffectBodies, bool abAffectCharacters);</​code>​ +asCallback The callback fucntion\\  
-Properties for an area of type "​force",​ eg "​_area_force_gamename"​.\\ +abGlobal If the timer is globalGlobal timers are not deleted at map change.\\  
-asName Name of the entity.\\ +\\  
-afMaxForce the value for the maximum force to apply\\ +''​void DestroyTimer(std::string asName);''​  
-afConstant Used in the formula. Force = Constant ​DistanceToDestSpeedmeaning it determines ​the force based on how far from the dest speed the object ​is.\\ +''​void SetTimerPaused(std::​string asName, bool abPaused);''​  
-afDestSpeed the value of the speed an object will travel at when reached maximum\\ +''​void SetTimerTime(std::​string asName, float afTime);''​  
-afMaxMass the maximum mass that will be affected by the force\\ +''​void AddTimerTime(std::​string asName, float afTime);''​  
-abMulWithMass if the force should apply the same amount to all objects of different mass\\ +''​float GetTimerTime(std::​string asName);''​  
-abForceAtPoint if force is to be applied to the collison point with the areaFalse = just use center of object.\\ +\\  
-abAffectBodies affect dynamic objects/​bodies\\ +\\ 
-abAffectCharacters affect charaters(player/​enemies/​etc)\\ +
-\\+
  
-<code c++> +==== Player ====
-SetupLiquidArea(std::​string asName,​float afDensity, float afLinearViscosity,​float afAngularViscosity,​string asPhysicsMaterial. +
- float fR, float fG, float fB, abHasWaves);</​code>​ +
-Properties for an area of type "​liquid",​ eg "​_area_liquid_gamename"​.\\ +
-asName Name of the entity.\\ +
-afDensity The density of the liquid\\ +
-afLinearViscosity How much "​friction"​ the liquid should have in linear direction.\\ +
-afAngularViscosity How much "​friction"​ the liquid should have in angular direction\\ +
-asPhysicsMaterial What physics material to use\\ +
-fR, fG, fB The color of the liquid in Red, Green, Blue\\ +
-abHasWaves if objects should bob in the water. +
-\\+
  
-<code c++> ​void SetupGameButton(std::​string ​asName,​string asCallback,​string asAffectedEntities);</​code>​ + ''​static ​void GivePlayerDamage(float afAmount,  ​std::​string ​asType);'' ​ 
-Creates ​callback for entity ​of type "button", eg .ent says Type="Button".\\ +Gives the player ​hit + damage\\  
-asName Name of the entity.\\ +afAmount The amount ​of health taken.\\  
-asCallback ​the name of the callback to activate.\\ +asType what sort of damage effect\\  
-asAffectedEntities The names of the entities that should be activatedexample ​"light01" or "light01light02light03".\\+"BloodSplash"\\  
 +"Ice"\\  
 +"​Poison"​\\  
 +\\  
 +''​void SetPlayerHealth(float afHealth);''​  
 +Sets the health ​of the player.\\  
 +afHealth The amount ​the health should be set to.\\  
 +\\  
 +''​float GetPlayerHealth();''​  
 +Gets the current health ​of the player.\\  
 +\\  
 +''​void SetPlayerPose(std::​string asPose,bool abChangeDirectly);''​  
 +Sets the pose of the player.\\  
 +asPose The posecan be "Stand" or "Crouch"​\\  
 +abChangeDirectlyif the pose should change instantly or in a movement\\  
 +\\  
 +''​void SetPlayerActive(bool abActive);''​  
 +Sets if player can be moved or not.\\  
 +abActive If the player is active or not.\\  
 +\\  
 +''​void StartPlayerLookAt(std::​string asEntityNamefloat afSpeedMul, float afMaxSpeed);''​  
 +This turns the players head towards a specific entity.\\  
 +asEntityName The entity name\\  
 +afSpeedMul The speed of the head movement is determined by the angle length multiplied by this.\\  
 +afMaxSpeed The maximum speed the head will turn.\\  
 +\\  
 +''​void StopPlayerLookAt();''​  
 +Stops the look at motion.\\  
 +\\  
 +''​void StartPlayerFearFilter(float afStrength);''​  
 +Starts a fear effect filter.\\  
 +afStrength strength of the filter.\\  
 +\\  
 +''​SetFlashlightDisabled(bool abDisabled);''​  
 +Disabled the flashlight.\\  
 +abDisabled true/false for flashlight on/off.\\  
 +\\  
 +''​void StopPlayerFearFilter();''​  
 +Stops the fear filter.\\  
 +\\  
 +''​void TeleportPlayer(string asArea);''​  
 +Teleports the player to an area, players feet is aligned to the center of the area.\\  
 +asArea the name of the area to teleport to (ie TeleportPlayer("PlayerStartArea_2"​);​.__ //__ __//__\\  
 +\\  
 +''​bool GetPlayerHasGasMask();''​  
 +Get if the player has gasmask or not.\\  
 +\\  
 +\\ 
  
-Callback syntax: **void OnStateChange(string asButton,​bool asInOn);​** +==== Inventory ==== 
-\\+
  
-<code c++> +''​void AddPickupCallback(std::​string asItem, std::string asFunction);''​  
-void SetGameButtonOn(std::​string ​asNamebool abOnbool abUseEffects);</​code>​ +Add a callback that is called when the player picks up an item.\\  
-Sets button entity ​on/off.\\ +The syntax for the callback function is:\\  
-asName Name of the entity.\\ +**void MyFunction(string asItem)**, the prefix "​@"​ (ie "​@Func()"​) shows that the function is in the global script\\  
-abOn On or offtrue/false\\ +asItem The name of the item.\\  
-abUseEffects if various effects set in the entity files of the entities affected by the button switch should be used or not.\\+asFuntion The name of the function called.\\  
 +\\  
 +''​void AddUseCallback(std::​string ​asItemstd::string asEntitystd::string asFunction);'' ​ 
 +Add callback that is called when the player uses the item on en entity\\  
 +The syntax for the callback function is:\\  
 +**void MyFunction(string asItem, string asEntity)**,​ the prefix "​@"​ (ie "​@Func()"​) shows that the function is in the global script.\\  
 +asItem The name of the item.\\  
 +asEntity The name of the entity.\\  
 +asFuntion The name of the function called.\\  
 +\\  
 +''​void AddCombineCallback(std::​string asItem1,std::string asItem2, std::string asFunction);''​  
 +Add a callback that is called when the player combines two items\\  
 +The syntax for the callback function is (alSlotIndex = slot at which combination occurd):\\  
 +**void MyFunction(string asItem1, string asItem2, int alSlotIndex)**,​ the prefix "​@"​ (ie "​@Func()"​) shows that the function is in the global script.\\  
 +asItem1 The name of the first item.\\  
 +asItem2 The name of the second item.\\  
 +asFuntion The name of the function called.\\  
 +\\  
 +''​void RemovePickupCallback(std::​string asFunction);''​  
 +''​void RemoveUseCallback(std::​string asFunction);''​  
 +''​void RemoveCombineCallback(std::​string asFunction);''​  
 +Removes the callback.\\  
 +asFuntion The name of the function ​used by the callback.\\  
 +\\  
 +''​bool HasItem(std::​string asName);''​  
 +Checks if the player has a certain item.\\  
 +asName The name of the item.\\  
 +\\  
 +''​void RemoveItem(std::​string asName);''​  
 +Removes an item from the inventory.\\  
 +asName The name of the item.\\  
 +\\  
 +''​void GiveItem(std::​string asName,​std::​string asEntityFile,​ int alSlotIndex);''​  
 +Give an item to the player.\\  
 +asName The name of the entity\\  
 +asEntityFile The file to load it from.\\  
 +lSlotIndex The index of the slot to put the item in. -1 = first empty slot\\  
 +\\  
 +''​SetInventoryMessage(std::​string asMessage);''​  
 +Displays a message in the inventory.\\  
 +asMessage The message to write in the inventory.\\  
 +\\  
 +''​SetInventoryMessageTrans(std::​string asTransCat, std::string asTransName);''​  
 +Displays a message from the lang file in the inventory.\\  
 +asTransCat The name of the category in the lang file.\\  
 +asTransName The name of the entry in the lang file.\\  
 +\\ 
 \\ \\
 + 
 +==== Map / Level Properties ==== 
  
-<code c++> +''​SetAmbientColor(float r, float g, float b);'' ​ 
-int GetLeverState(std::​string asName);</​code>​ +Sets the ambient color of the level, this should always be part of a level as it gives it a bit of light otherwise shadows will be pitch black.\\  
-Gets the current state of a Lever entity.\\ +\\  
-asName ​Name of the entity.\\ +''​SetSectorProperties(string asSector, float afAmbR,​float afAmbG, float afAmbB);''​  
-returns int as -1 = min0=middle1=max\\ +Sets the ambient color of a sector(individual groups of _room. \\  
-\\+asSector the name of the sector.\\  
 +afAmbR red 0-1\\  
 +afAmbG green 0-1\\  
 +afAmbB blue 0-1\\  
 +The values are multiplied with the SetAmbientColor(f,​f,​f);​ values. This script function will most likely be expanded to include specific ambient sounds etc for each sector.\\  
 +\\  
 +''​SetSkybox(string asTexture);''​  
 +Sets a texture as a sky box.\\  
 +\\  
 +''​SetSkyboxActive(bool);''​  
 +Set the skybox active with true/​False\\  
 +\\  
 +''​SetSkyboxColor(float R, float G, float B, float A);''​  
 +What color should the Skybox have\\  
 +R, G, B and Alpha\\  
 +\\  
 +''​SetFogActive(bool abX);''​  
 +If a level should have fog or not.\\  
 +bool abX, false/​true\\  
 +\\  
 +''​SetFogProperties(float afStart, float afEnd, float r,float g, float b);''​  
 +The properties of the fog.\\  
 +afStart how many meters from the camera should the fog begin.\\  
 +afEnd how many meters from the camera should the fog reach full thickness.\\  
 +float r,float g, float b the color of the fog in RGB.\\  
 +\\  
 +''​SetFogCulling(bool);''​  
 +Should the game stop rendering the level when the fog is full thickness\\  
 +true/​false\\  
 +\\  
 +''​SetWaveGravityActive(bool abX);''​  
 +Enable a dynamic gravity that mimics waves, ture/​false\\  
 +\\  
 +''​SetupWaveGravity(float afMaxAngle, float afSwingLength,​ float afGravitySize,​ std::string asAxis);''​  
 +Set the properties for the dynamic wave gravity\\  
 +afMaxAngle The maximum angel of the wave\\  
 +afSwingLength The length for going from top to bottom\\  
 +afGravitySize The strength of the gravity\\  
 +asAxis Along which axis should the wave "​move"​\\  
 +\\  
 +''​SetMapGameName(std::​string asName);'' ​ 
 +Set the name of the current map, is used for naming the saved games.\\  
 +asName ​the name of the map\\  
 +\\  
 +''​SetMapGameNameTrans(std::​string asTransCat,std::string asTransEntry);''​  
 +Set the name of the current map using the lang fileis used for naming the saved games.\\  
 +asTransCat the category in the lang file\\  
 +asTransEntry the entry in the lang file with the name of the map\\  
 +\\  
 +\\ 
  
-<code c++> +==== Game Entity Properties ==== 
-void SetLeverStuck(std::​string asName,int alState);</​code>​ +
-Sets a Lever entity stuck at a certain position.\\ +
-asName Name of the entity.\\ +
-alState What position to stick it in, state: -1 min, 0=middle, 1=max\\ +
-\\+
  
-<code c++> +''​void SetGameEntityActive(std::​string asName, bool abX);'' ​ 
-int GetWheelState(std::​string asName);</code> +Set if a game entity is active.\\  
-Gets the current state of a Wheel entity.\\ +asName The name of the game entity\\  
-asName Name of the entity.\\ +abX If active or not.\\  
-returns int as -1 = min, 0=middle, 1=max\\ +\\  
-\\+''​bool GetGameEntityActive(std::​string asName);''​  
 +Get if a game entity is active.\\  
 +asName The name of the game entity\\  
 +return if active or not.\\  
 +\\  
 +''​void ReplaceEntity(std::​string asName, std::string asBodyName, std::string asNewName, std::string asNewFile);''​  
 +Replaces an ingame entity with another entity, the new entity will appear at the center of the old entities location\\  
 +asName Name of the ingame entity\\  
 +asBodyName The name of the body in the old entity that will be used as a center for the new entity, leave as _fckg_QUOT__fckg_QUOT_ if entity only has 1 body\\  
 +asNewName The ingame name given to the new entity\\  
 +asNewFile The .ent file to be used for the new entity\\  
 +\\  
 +''​void CreateGameEntityVar(std::​string asEntName, std::string asVarName, ​int alVal);''​  
 +Create a variable for a game entity. Nothing happens if it is already created.\\  
 +asEntName The name of the game entity\\  
 +asVarName The name of variable\\  
 +alVal value to set the variable to.\\  
 +\\  
 +''​void SetGameEntityVar(std::​string asEntName, std::string asVarName, int alVal);''​  
 +Change the value of a entity variable to a new value\\  
 +asEntName The name of the game entity\\  
 +asVarName The name of variable\\  
 +alVal value to set the variable to.\\  
 +\\  
 +''​void AddGameEntityVar(std::​string asEntName, std::string asVarName, int alVal);''​  
 +Change the value of an entity variable by adding to the previous value\\  
 +asEntName The name of the game entity\\  
 +asVarName The name of variable\\  
 +alVal value to add to the existing variable.\\  
 +\\  
 +''​int GetGameEntityVar(std::​string asEntName, std::string asVarName);''​  
 +Get the value of a variable for a game entity.\\  
 +asEntName The name of the game entity\\  
 +asVarName The name of variable\\  
 +alVal value to set the variable to.\\  
 +\\  
 +''​void SetGameEntityMaxExamineDist(std::​string asName,float afDist);''​  
 +Set the maximum distance at which a game entity can be examined.\\  
 +asName The name of the game entity\\  
 +afDist The distance in meters\\  
 +\\  
 +''​void SetGameEntityMaxInteractDist(std::​string asName,​float afDist);''​  
 +Set the maximum distance at which a game entity can be interacted with.\\  
 +asName The name of the game entity\\  
 +afDist The distance in meters\\  
 +\\  
 +''​void SetGameEntityDescriptionTrans(std::​string asName,​std::​string asTransCat, std::string asTransName);''​  
 +Set a description on a game entity.\\  
 +asName The name of the game entity\\  
 +asTransCat The translation category\\  
 +asTransName The translation name\\  
 +\\  
 +''​SetGameEntityDescriptionOnceTrans(std::​string asName,​std::​string asTransCat,​std::​string asTransName);''​  
 +Set a description on a game entity BUT display the eye only 1 time, after that the you can still examine but the eye wont show unless in Interact mode.\\  
 +asName The name of the game entity\\  
 +asTransCat The translation category\\  
 +asTransName The translation name\\  
 +\\  
 +''​void SetGameEntityDescription(std::​string asName, std::string asMessage);''​  
 +Set a description on a game entity.\\  
 +asName The name of the game entity\\  
 +asMessage The message\\  
 +\\  
 +''​void SetGameEntityGameNameTrans(std::​string asName, std::string asTransCat,​std::​string asTransName);''​  
 +Set a game name on a game entity.\\  
 +asName The name of the game entity\\  
 +asTransCat The translation category\\  
 +asTransName The translation name\\  
 +\\  
 +''​void SetDoorState(std::​string asName,​std::​string asState);''​  
 +Sets the state of a door with animation. This entity was only used in early test builds of HPL.\\  
 +asName The name of the game entity\\  
 +asState The state to set, thís can be "​Open","​Closed",​ "​Opening"​ or "​Closing"​.\\  
 +\\  
 +''​SetDoorLocked(std::​string asDoor, bool abLocked);''​  
 +Sets a door locked or unlocked, only works with SwingDoor entities(set in the .ent file)\\  
 +asDoor the name of the entity.\\  
 +abLocked true or false if locked or not.\\  
 +\\  
 +''​SetDoorLockedProperties(std::​string asDoor, ​ std::​string asMessCat,​std::​string asMessEntry,​ std::​string asSound, bool RepeatLockedMessage);''​  
 +Gives properties to a locked door, how it should sound what message to show etc. Only works with SwingDoor entities(set in the .ent file)\\  
 +asDoor the name of the entity.\\  
 +asMessCat the name of the category in the translations file.\\  
 +asMessEntry the name of the entry in the translations file to use.\\  
 +asSound sound to play for the locked door when player interacts.\\  
 +RepeatLockedMessage true or false if the event should be every time or only the first time.\\  
 +\\  
 +''​void SetObjectInteractMode(std::​string asName,​std::​string asMode);''​  
 +Sets the interact mode of an game object.\\  
 +asName The name of the game object\\  
 +asState The mode to set, valid modes are "​Static",​ "​Grab",​ "​Move"​ and "​Push"​.\\  
 +\\  
 +''​static void __stdcall SetupLink(std::​string asName, std::string asMapFile, std::string asMapPos, ​  ​std::​string asStartSound,​ std::string asStopSound, ​                                                        float afFadeOutTime,​ float afFadeInTime);​__''​__Sets up the properties for a link.\\  
 +asName The name of the link\\  
 +asMapFile The file to be loaded\\  
 +asMapPos The position on the map to be spawned on.\\  
 +asStartSound The sound that is played when the change starts.\\  
 +asStopsSound The sound that is played when the new map is loaded\\  
 +afFadeOutTime Time in seconds it takes for the fade out.\\  
 +afFadeInTime Time in seconds it takes for the fade in.\\  
 +\\  
 +''​static void ''​ __''​stdcall SetupLinkLoadText(string asName, string asMapFile, string asMapPos, ​ string asStartSound,​ string asStopSound,​ float afFadeOutTime,​ float afFadeInTime,​ string asTextCat, string asTextEntry);''​  
 +Sets up the properties for a link and displays a screen with text/picture while loading.\\  
 +asName The name of the link\\  
 +asMapFile The file to be loaded\\  
 +asMapPos The position on the map to be spawned on.\\  
 +asStartSound The sound that is played when the change starts.\\  
 +asStopsSound The sound that is played when the new map is loaded\\  
 +afFadeOutTime Time in seconds it takes for the fade out.\\  
 +afFadeInTime Time in seconds it takes for the fade in.\\  
 +asTextCat The text category in translations file .lang\\  
 +asTextEntry The text entry in translations file .lang\\  
 +\\  
 +''​void SetupLinkLockedProp(std::​string asName,​std::​string asLockedSound,​ std::string asLockedDescCat,​std::​string asLockedDescEntry);''​  
 +Properties for an area of type "​link",​ eg _fckg_QUOT__area_link_gamename",​ to be used if the link is "​locked"​.\\  
 +asName The name of the link\\  
 +asLockedSound The "​locked sound" to play\\  
 +asLockedDescCat In what category the text to use is in the .lang file.\\  
 +asLockedDescEntry In what entry the text is found in the .lang file.\\  
 +\\  
 +''​void SetLinkLocked(std::​string asName, bool abLocked);''​  
 +Set an area of type "​link"​ as locked or unlocked.\\  
 +asName The name of the link\\  
 +abLocked True/false for locked or not.\\  
 +\\  
 +''​void SetAreaCustomIcon(std::​string asName, std::string asIcon);''​  
 +Makes the area show a custom icon on player focus.\\  
 +asName The name of the area\\  
 +asIcon The icon, can be: "​Inactive",​ "​Active",​ "​Invalid",​ "​Grab",​ "​Examine",,​ "​PickUp",​ "​Pointer",​ "​Item",​ "​DoorLink"​ or "​None"​.\\  
 +\\  
 +''​void AddEnemyPatrolNode(std::​string asEnemy,​std::​string asNode,​float afTime,​std::​string asAnimation);''​  
 +Adds node that the enemy will have on his patrol path.\\  
 +asEnemy Name of the enemy\\  
 +asNode The Node to walk to.\\  
 +afTime The time to stay at the node when reached.\\  
 +asAnimation The animation to be played when at the node. _fckg_QUOT__fckg_QUOT_ = idle.\\  
 +\\  
 +''​void ClearEnemyPatrolNodes(std::​string asEnemy);''​  
 +Clears all the patrol nodes for the enemy\\  
 +asEnemy The Name of the enemy.\\  
 +\\  
 +''​void SetEntityHealth(std::​string asName, float afHealth);''​  
 +Sets the health of an entity\\  
 +asName Name of the entity\\  
 +afHealth the amount to set the health to.\\  
 +\\  
 +''​float GetEnemyHealth(std::​string asEnemy);''​  
 +Gets the health of an enemy\\  
 +asEnemyName Name of the enemy\\  
 +return the health.\\  
 +\\  
 +''​void ShowEnemyPlayer(std::​string asEnemy);''​  
 +Show the enemy the position of the player and sets the enemy into hunt mode.\\  
 +asEnemy The name of the Enemy.\\  
 +\\  
 +''​void SetEnemyUseTriggers(std::​string asEnemy, bool abUseTriggers);''​  
 +If an enemy should use triggers, for example if an enemy should react to sounds.\\  
 +asEnemy The name of the Enemy.\\  
 +abUseTriggers use triggers or not.\\  
 +\\  
 +''​void SetEnemyAttackCallback(std::​string asEnemy,​std::​string asFunction);''​  
 +Activates a callback when an enemy attacks the player.\\  
 +asEnemy The name of the Enemy.\\  
 +asFunction The name of the callback to activate.\\  
 +\\  
 +''​SetLampLit(std::​string asName,bool abLit, bool abFade);''​  
 +Sets a Lamp entity light on/off, requires the entity file to be a Type="​Lamp"​.\\  
 +asName The name of the lamp entity.\\  
 +abLit if it should be lit or not.\\  
 +abFade if it should fade on/off, properties are set in the entity file.\\  
 +\\  
 +''​void SetLampFlicker(std::​string asName,bool abFlicker);''​  
 +Sets a Lamp entity lights flicker, requires the entity file to be a Type="​Lamp"​.\\  
 +asName The name of the lamp entity.\\  
 +abFlicker starts/​stops the flicker.\\  
 +Flicker properties are set in the entity file.\\  
 +\\  
 +''​SetupStickArea(std::​string asArea, bool abCanDeatch,​ bool abMoveBody, bool abRotateBody,​ bool abCheckCenterInArea,​ float afPoseTime, std::​string asAttachSound,​ std::string asDetachSound,​ std::​string asAttachPS, std::string asDetachPS, std::​string asAttachFunc,​ std::string asDetachFunc);''​  
 +Give properties to an area of type "​stick"​. Used to make an object attach itself to another etc.\\  
 +asArea The name of the stick area\\  
 +abCanDeatch if the area will allow to detach and attached object\\  
 +abMoveBody Should the attached object be moved into the center\\  
 +abRotateBody should the attached object be rotated to attach in a certain direction(rotating the stick area in the level will decide this)\\  
 +abCheckCenterInArea only attach if the object to be attached is in the center of the stick area \\  
 +afPoseTime how long will the attach movement(move/​rotate) take \\  
 +asAttachSound what attach sound to play\\  
 +asDetachSound what detach sound to play\\  
 +asAttachPS what particle effect to use on attach\\  
 +asDetachPS what particle effect to use on detach\\  
 +asAttachFunc name of attach callback\\  
 +asDetachFunc name of detach callback\\  
 +\\  
 +''​void AllowAttachment();''​  
 +Executes the attachment settings in SetupStickArea.\\  
 +\\  
 +// Example of an attach callback//''​void MyAttach(string asArea, string asBody) { if(StringContains(asBody,​ __GESHI_QUOT__entityname__GESHI_QUOT__)) { AllowAttachment();​ } } ''​  
 +\\  
 +''​DetachBodyFromStickArea(string asArea);''​  
 +Detach a body from a stick area.\\  
 +asArea Name of the area.\\  
 +\\  
 +''​SetupLadder(string asName,​string asAttachSound,​ string asClimbUpSound,​ string asClimbDownSound);''​  
 +Sets properties for an area of type "​ladder"​. eg _fckg_QUOT__area_ladder_gamename"​\\  
 +asName Name of the area.\\  
 +asAttachSound Sound to be played as player grabs onto ladder\\  
 +asClimbUpSound Sound to be played as player climbs up.\\  
 +asClimbDownSound Sound to be played as player climbs down.\\  
 +\\  
 +''​void ChangeEntityAnimation(string asName,​string asAnimation,​bool abLoop);''​  
 +Change the animation of an entity.\\  
 +asName Name of the entity.\\  
 +asAnimation the animation that should be used\\  
 +abLoop if it should loop or not.\\  
 +\\  
 +''​void SetupForceArea( string asName, ​ float afMaxForce, float afConstant, float afDestSpeed,​ float afMaxMass, bool abMulWithMass,​ bool abForceAtPoint,​ bool abAffectBodies,​ bool abAffectCharacters);''​  
 +Properties for an area of type "​force",​ eg _fckg_QUOT__area_force_gamename"​.\\  
 +asName Name of the entity.\\  
 +afMaxForce the value for the maximum force to apply\\  
 +afConstant Used in the formula. Force = Constant %%*%% DistanceToDestSpeed,​ meaning it determines the force based on how far from the dest speed the object is.\\  
 +afDestSpeed the value of the speed an object will travel at when reached maximum\\  
 +afMaxMass the maximum mass that will be affected by the force\\  
 +abMulWithMass if the force should apply the same amount to all objects of different mass\\  
 +abForceAtPoint if force is to be applied to the collison point with the area. False = just use center of object.\\  
 +abAffectBodies affect dynamic objects/​bodies\\  
 +abAffectCharacters affect charaters(player/​enemies/​etc)\\  
 +\\  
 +''​SetupLiquidArea(std::​string asName,​float afDensity, float afLinearViscosity,​float afAngularViscosity,​string asPhysicsMaterial. float fR, float fG, float fB, abHasWaves);''​  
 +Properties for an area of type "​liquid",​ eg "​_area_liquid_gamename"​.\\  
 +asName Name of the entity.\\  
 +afDensity The density of the liquid\\  
 +afLinearViscosity How much "​friction"​ the liquid should have in linear direction.\\  
 +afAngularViscosity How much "​friction"​ the liquid should have in angular direction\\  
 +asPhysicsMaterial What physics material to use\\  
 +fR, fG, fB The color of the liquid in Red, Green, Blue\\  
 +abHasWaves if objects should bob in the water. \\  
 +''​void SetupGameButton(std::​string asName,​string asCallback,​string asAffectedEntities);''​  
 +Creates a callback for entity of type "​button",​ eg .ent says Type="​Button"​.\\  
 +asName Name of the entity.\\  
 +asCallback the name of the callback to activate.\\  
 +asAffectedEntities The names of the entities that should be activated, example "​light01"​ or "​light01,​ light02, light03"​.\\  
 +Callback syntax: **void OnStateChange(string asButton,​bool asInOn);** \\  
 +''​void SetGameButtonOn(std::​string asName, bool abOn, bool abUseEffects);''​  
 +Sets a button entity on/off.\\  
 +asName Name of the entity.\\  
 +abOn On or off, true/​false\\  
 +abUseEffects if various effects set in the entity files of the entities affected by the button switch should be used or not.\\  
 +\\  
 +''​int GetLeverState(std::​string asName);''​  
 +Gets the current state of a Lever entity.\\  
 +asName Name of the entity.\\  
 +returns int as -1 = min, 0=middle, 1=max\\  
 +\\  
 +''​void SetLeverStuck(std::​string asName,int alState);''​  
 +Sets a Lever entity stuck at a certain position.\\  
 +asName Name of the entity.\\  
 +alState What position to stick it in, state: -1 = min, 0=middle, 1=max\\  
 +\\  
 +''​int GetWheelState(std::​string asName);'' ​ 
 +Gets the current state of a Wheel entity.\\  
 +asName Name of the entity.\\  
 +returns int as -1 = min, 0=middle, 1=max\\  
 +\\  
 +''​void SetWheelStuck(std::​string asName,int alState );''​  
 +Sets a Wheel entity stuck at a certain position.\\  
 +asName Name of the entity.\\  
 +alState What position to stick it in, state: -1 = min, 0=turn off stuck, 1=max\\  
 +\\  
 +''​float GetWheelAngle(std::​string asName);''​  
 +Gets the current angle of a Wheel entity.\\  
 +asName Name of the entity.\\  
 +returns the value as float.\\  
 +\\  
 +''​float GetWheelSpeed(std::​string asName);''​  
 +Gets the current speed of a Wheel entity.\\  
 +asName Name of the entity.\\  
 +returns the value as float.\\  
 +\\  
 +''​ConnectWheelToController(string asWheelName,​string asEntName,​string asCtrlName, float afMinDest, float afMaxDest);''​  
 +Connects a controller in the .ent file to the wheel.\\  
 +asWheelName Name of the wheel entity in level.\\  
 +asEntName Name of the entity file to use.\\  
 +asCtrlName Name of the controller.\\  
 +afMinDest Value of the minimum destination.\\  
 +afMaxDest Value of the maximum destination.\\  
 +\\  
 +''​MoveEntityToArea(string asEntityName,​ string asAreaName, float afSpeed, float afAcceleration,​   float afSlowDownRange,​ string asCallback);''​  
 +Moves an entity to an area. This can be used to create moving platforms, elevators etc.\\  
 +asEntityName Name of the entity.\\  
 +asAreaName Name of the area to move the entity to.\\  
 +afSpeed At what speed to move the entity.\\  
 +afAcceleration Acceleration of the entity.\\  
 +afSlowDownRange How far away from the area to begind deceleration.\\  
 +asCallback name of the callback to trigger when entity reaches area.\\  
 +**Callback syntax: MyFunc(string asEntityName)** \\  
 +\\  
 +\\ 
  
-<code c++> +==== Game Entity Callbacks ==== 
-void SetWheelStuck(std::​string asName,int alState );</​code>​ +
-Sets a Wheel entity stuck at a certain position.\\ +
-asName Name of the entity.\\ +
-alState What position to stick it in, state: -1 min, 0=turn off stuck, 1=max\\ +
-\\+
  
-<code c++> +''​void AddEntityCollideCallback(std::​string asType, std::string asDestName, ​  ​std::​string asEntityName,​ std::string asFuncName);''​  
-float GetWheelAngle(std::​string ​asName);</​code>​ +Add a collide callback to an entity.\\  
-Gets the current angle of a Wheel entity.\\ +The syntax for the callback function is:\\  
-asName ​Name of the entity.\\ +**void MyFunction(string asParent, string asChild)**, the prefix "​@"​ (ie "​@Func()"​) shows that the function is in the global script.\\  
-returns ​the value as float.\\ +asParent is the entity the function is attached to and asChild is the other entity in the collision.\\  
-\\+asType The type of callback, this can be "​Enter",​ "​During"​ or "​Leave"​\\  
 +asDestName The entity that should have the callback. "​Player"​ will add it to the player.\\  
 +asEntityName The entity to check for collision with.\\  
 +asFuncName The name of the script function to add. This must be in the level'​s script file and not the global.\\  
 +\\  
 +''​void RemoveEntityCollideCallback(std::​string ​asType, std::string asDestName, std::string asEntityName);'' ​ 
 +Removes a collide callback on an entity.\\  
 +asType The type of callback, this can be "​Enter",​ "​During"​ or "​Leave"​\\  
 +asDestName The entity that has the callback\\  
 +asEntityName The entity to check for collision with.\\  
 +\\  
 +''​void AddEntityCallback(std::​string asType, std::string asDestName, std::string asFuncName);''​  
 +Add a callback to an entity.\\  
 +The syntax for the callback function is:\\  
 +**void MyFunction(string asEntity)**,​ the prefix "​@"​ (ie "​@Func()"​) shows that the function is in the global script.\\  
 +The different types are the following\\  
 +"​PlayerInteract"​ The player interacts with the entity.\\  
 +"​PlayerExamine"​ The player examines the entity.\\  
 +"​PlayerLook"​ The player is looking at the entity (it is in "​focus"​).\\  
 +"​OnUpdate"​ When the entity is updated.\\  
 +"​OnBreak"​ When the entity breaks.\\  
 +asType The type of callback\\  
 +asDestName The entity that should have the callback\\  
 +asFuncName The name of the script function to add. This must be in the level'​s script file and not the global.\\  
 +\\  
 +''​void RemoveEntityCallback(std::​string asType, std::string asDestName);''​  
 +Removes ​callback on an entity.\\  
 +asType The type of callback. The same types as for AddEntityCallback applies.\\  
 +asDestName The entity that has the callback\\  
 +\\  
 +''​void SetEnemyDeathCallback(std::​string asEnemy,​std::​string asFunction);''​  
 +Sets the function that is called when the enemy dies.\\  
 +asEnemyName ​Name of the enemy\\  
 +asFunction The function, syntax: **MyFunc(string asEnemyName)** \\  
 +\\  
 +''​SetLampLitChangeCallback(std::​string asName,​std::​string asCallback);''​  
 +Adds a callback for a Lamp entity, Type="​Lamp"​ in .ent, as it changes from on to off or vice versa.\\  
 +asName The name of the lamp entity.\\  
 +asCallback The name of the callback, syntax: **MyFunc(bool abActive)** \\  
 +\\  
 +''​SetLeverCallback(std::​string asName,​std::​string asType, std::string asCallback);''​  
 +Adds a callback for a Lever entity, Type="​Lever"​ in .ent, as it changes states.\\  
 +asName The name of the lever entity.\\  
 +asType What type: "​Enter",​ "​Leave"​ or "​During"​.\\  
 +asCallback The name of the callback, syntax: **void MyFunc(string asName, int alType, int alState)** \\  
 +type: 0=enter, 1=leave, 2=during\\  
 +state: -1 = min, 0=middle, 1=max\\  
 +\\  
 +''​SetWheelCallback(std::​string asName,​std::​string asType,​std::​string asCallback);''​  
 +Adds a callback for a Wheel entity, Type="​Wheel"​ in .ent.\\  
 +asName The name of the wheel entity.\\  
 +asType What type: "​Enter",​ "​Leave"​ or "​During"​.\\  
 +asCallback The name of the callback, syntax: **void MyFunc(string asName, int alType, int alState)** \\  
 +type: 0=enter, 1=leave, 2=during \\  
 +state: -1 = min, 0=middle, 1=max\\  
 +\\  
 +\\  
 +// __ 
  
-<code c++> 
-float GetWheelSpeed(std::​string asName);</​code>​ 
-Gets the current speed of a Wheel entity.\\ 
-asName Name of the entity.\\ 
-returns the value as float.\\ 
-\\ 
  
-<code c++> +__//// __ 
-ConnectWheelToController(string asWheelName,​string asEntName,​string asCtrlName,​ +
- float afMinDest, float afMaxDest);<​/code> +
-Connects a controller in the .ent file to the wheel.\\ +
-asWheelName Name of the wheel entity in level.\\ +
-asEntName Name of the entity file to use.\\ +
-asCtrlName Name of the controller.\\ +
-afMinDest Value of the minimum destination.\\ +
-afMaxDest Value of the maximum destination.\\ +
-\\+
  
-<code c++> 
-MoveEntityToArea(string asEntityName,​ string asAreaName, 
- float afSpeed, float afAcceleration,​ 
-   float afSlowDownRange,​ string asCallback);</​code>​ 
-Moves an entity to an area. This can be used to create moving platforms, elevators etc.\\ 
-asEntityName Name of the entity.\\ 
-asAreaName Name of the area to move the entity to.\\ 
-afSpeed At what speed to move the entity.\\ 
-afAcceleration Acceleration of the entity.\\ 
-afSlowDownRange How far away from the area to begind deceleration.\\ 
-asCallback name of the callback to trigger when entity reaches area.\\ 
-**Callback syntax: MyFunc(string asEntityName)**\\ 
-\\ 
-\\ 
  
 +__//// __
  
- 
- 
-==== Game Entity Callbacks ==== 
-<code c++> 
-void AddEntityCollideCallback(std::​string asType, std::string asDestName, ​ 
-                        std::string asEntityName,​ std::string asFuncName);</​code>​ 
-Add a collide callback to an entity.\\ 
-The syntax for the callback function is:\\ 
-**void MyFunction(string asParent, string asChild)**, the prefix "​@"​ (ie "​@Func()"​) shows that the function is in the global script.\\ 
-asParent is the entity the function is attached to and asChild is the other entity in the collision.\\ 
-asType The type of callback, this can be "​Enter",​ "​During"​ or "​Leave"​\\ 
-asDestName The entity that should have the callback. "​Player"​ will add it to the player.\\ 
-asEntityName The entity to check for collision with.\\ 
-asFuncName The name of the script function to add. This must be in the level'​s script file and not the global.\\ 
-\\ 
- 
-<code c++> 
-void RemoveEntityCollideCallback(std::​string asType, std::string asDestName, std::string asEntityName);</​code>​ 
-Removes a collide callback on an entity.\\ 
-asType The type of callback, this can be "​Enter",​ "​During"​ or "​Leave"​\\ 
-asDestName The entity that has the callback\\ 
-asEntityName The entity to check for collision with.\\ 
-\\ 
- 
-<code c++> 
-void AddEntityCallback(std::​string asType, std::string asDestName, std::string asFuncName);</​code>​ 
-Add a callback to an entity.\\ 
-The syntax for the callback function is:\\ 
-**void MyFunction(string asEntity)**,​ the prefix "​@"​ (ie "​@Func()"​) shows that the function is in the global script.\\ 
-The different types are the following\\ 
-"​PlayerInteract"​ The player interacts with the entity.\\ 
-"​PlayerExamine"​ The player examines the entity.\\ 
-"​PlayerLook"​ The player is looking at the entity (it is in "​focus"​).\\ 
-"​OnUpdate"​ When the entity is updated.\\ 
-"​OnBreak"​ When the entity breaks.\\ 
-asType The type of callback\\ 
-asDestName The entity that should have the callback\\ 
-asFuncName The name of the script function to add. This must be in the level'​s script file and not the global.\\ 
-\\ 
- 
-<code c++>void RemoveEntityCallback(std::​string asType, std::string asDestName);</​code>​ 
-Removes a callback on an entity.\\ 
-asType The type of callback. The same types as for AddEntityCallback applies.\\ 
-asDestName The entity that has the callback\\ 
-\\ 
- 
-<code c++>void SetEnemyDeathCallback(std::​string asEnemy,​std::​string asFunction);</​code>​ 
-Sets the function that is called when the enemy dies.\\ 
-asEnemyName Name of the enemy\\ 
-asFunction The function, syntax: **MyFunc(string asEnemyName)**\\ 
-\\ 
- 
-<code c++>​SetLampLitChangeCallback(std::​string asName,​std::​string asCallback);</​code>​ 
-Adds a callback for a Lamp entity, Type="​Lamp"​ in .ent, as it changes from on to off or vice versa.\\ 
-asName The name of the lamp entity.\\ 
-asCallback The name of the callback, syntax: **MyFunc(bool abActive)**\\ 
-\\ 
- 
-<code c++>​SetLeverCallback(std::​string asName,​std::​string asType, std::string asCallback);</​code>​ 
-Adds a callback for a Lever entity, Type="​Lever"​ in .ent, as it changes states.\\ 
-asName The name of the lever entity.\\ 
-asType What type: "​Enter",​ "​Leave"​ or "​During"​.\\ 
-asCallback The name of the callback, syntax: **void MyFunc(string asName, int alType, int alState)**\\ 
-type: 0=enter, 1=leave, 2=during\\ 
-state: -1 = min, 0=middle, 1=max\\ 
-\\ 
- 
-<code c++>​SetWheelCallback(std::​string asName,​std::​string asType,​std::​string asCallback);</​code>​ 
-Adds a callback for a Wheel entity, Type="​Wheel"​ in .ent.\\ 
-asName The name of the wheel entity.\\ 
-asType What type: "​Enter",​ "​Leave"​ or "​During"​.\\ 
-asCallback The name of the callback, syntax: **void MyFunc(string asName, int alType, int alState)**\\ 
-type: 0=enter, 1=leave, 2=during \\ 
-state: -1 = min, 0=middle, 1=max\\ 
-\\ 
-\\ 
-  
hpl1/documentation/script_reference.1301328045.txt.gz · Last modified: 2011/03/28 16:00 by pandemoneus