User Tools

Site Tools


hpl2:machine_for_pigs:notes

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
hpl2:machine_for_pigs:notes [2020/03/30 01:26]
mudbill [Entities] Added SetPropAnimationPosition
hpl2:machine_for_pigs:notes [2020/04/04 14:14] (current)
mudbill [Player]
Line 1: Line 1:
-===== Temp notes for wiki =====+===== Engine scripts ​=====
  
-Just gonna use this page for organizing some new content – it will eventually go into other pages of this wiki.+A list of script functions available in A Machine For Pigs (that are not present in The Dark Descent). Many of TDD's scripts are available in AMFP, but not all. Some are replaced by ones listed below, and others are removed.
  
-- Mudbill +<font inherit/​inherit;;#​FF0000;;​inherit>​NOTE</​font> ​   : This page is partially incomplete. Some arguments for the functions listed here have unknown effects. If you wish to contribute, feel free to test them. It's also possible there are additional script functions not listed here that exist within the engine.
- +
-===== Engine scripts =====+
  
-A list of script functions available in A Machine For Pigs (that are not present in The Dark Descent)+----
  
 ==== General ==== ==== General ====
Line 56: Line 54:
   - //​afFadeInTime// ​ - How long, in seconds, the fade in spends   - //​afFadeInTime// ​ - How long, in seconds, the fade in spends
   - //​afFadeOutTime// ​ - How long, in seconds, the fade out spends   - //​afFadeOutTime// ​ - How long, in seconds, the fade out spends
- 
 ==== Journal ==== ==== Journal ====
  
Line 63: Line 60:
 </​code>​ </​code>​
  
-Adds a hint to the player'​s journal.\\ +Adds a hint to the player'​s journal. \\ This function replaces TDD's ''​AddDiary''​.
-This function replaces TDD's ''​AddDiary''​.+
  
-   - //​asNameAndTextEntry// ​ - The .lang text entry of the hint. The entry must be in category "​Journal"​ and begin with "​Hint_"​ and end with "​_Name" ​for the title and end with "​_Text" ​for the body.+  ​- //​asNameAndTextEntry// ​ - The .lang text entry of the hint. The entry must be in category "​Journal"​ and use the format Hint_MyHint_Name ​for the title and Hint_MyHint_Text ​for the body, where MyHint replaces the value you put in this argument.
   - //​asImage// ​ - This argument does not seem to be used. Presumed to be for displaying an image but possibly removed functionality. All existing occurrences are empty.   - //​asImage// ​ - This argument does not seem to be used. Presumed to be for displaying an image but possibly removed functionality. All existing occurrences are empty.
 <code c++> <code c++>
Line 75: Line 71:
  
   - //​abDisabled// ​ - True to disable, false to enable again   - //​abDisabled// ​ - True to disable, false to enable again
- 
 ==== Player ==== ==== Player ====
  
Line 86: Line 81:
   - //​abActive// ​ - True to flicker, false to not flicker   - //​abActive// ​ - True to flicker, false to not flicker
 <code c++> <code c++>
-void SetPlayerInfection(const float afInfectionLevel);+void SetPlayerInfection(const float afAmount);
 </​code>​ </​code>​
  
-Sets the infection level for the player. Infection replaces sanity from TDD and acts similar, however it goes from 0-100 instead of 100-0. An infection level above approximately 20 will affect the player'​s ability to move. Infection level above 80 will kill the player. Infection slowly decreases over time, unless high enough. \\ This function replaces TDD's ''​SetPlayerSanity''​.+Sets the [[:​hpl2:​machine_for_pigs:​infection|infection]] ​level for the player. Infection replaces sanity from TDD and acts similar, however it goes from 0-100 instead of 100-0. An infection level above approximately 20 will affect the player'​s ability to move. Infection level above 80 will kill the player. Infection slowly decreases over time, unless high enough. \\ 
 +This function replaces TDD's ''​SetPlayerSanity''​.
  
-  - //afInfectionLevel//  - The level of infection to set+  - //afAmount//  - The level of infection to set
 <code c++> <code c++>
-void FadePlayerPitchTo(const float afPitch, const float afDeaccelleration,​ const float afSpeed);+void AddPlayerInfection(const float afAmount);
 </​code>​ </​code>​
  
-Moves the player'​s ​pitch (up and down rotation).+Adds an amount of infection to the player'​s ​current amount. \\ This function replaces TDD's ''​AddPlayerSanity''​.
  
-  - //​afPitch//  ​- The target pitch to move towards. 0 = straight forward. Clamped to range: -70 to +70. +  - afAmount ​- The amount ​to add
-  - //​afDeaccelleration// ​ - The deaccelleration when nearing the target pitch. A low value makes a slow change. +
-  - //​afSpeed// ​ - The speed of the movement. Speed is affected by deaccelleration. +
-<code c++> +
-void SetPlayerUsesDragFootsteps(const bool abX); +
-</​code>​+
  
-Sets whether the player'​s footstep sounds are replaced with "​drag"​ versions. Some surface materials do not have drag steps, and will therefore play no footstep sounds. +<​code ​c00
- +float GetPlayerInfection();
-  - abX - Whether to use "​drag"​ step sounds +
- +
-==== Screen effects ==== +
- +
-<​code ​c+
-void ShowScreenImage(string@&​ asImageFile,​ int alX, int alY, const float afUnknown1, const bool abUnknown2, const float afDuration, const float afFadeInTime,​ const float afFadeOutTime);+
 </​code>​ </​code>​
  
-Shows a 2D image on the screen. Originally used for showing ​the intro logo during a sequence.+Returns ​the amount of infection ​the player currently has. \\ This function replaces TDD's ''​GetPlayerSanity''​.
  
-  - //​asImageFile// ​ - The image file to show. Does not have to be pow2 (although it gives a warning if not) +<code c++>
-  - //alX -//  The X position of the top left corner, starting from the center of the screen. Use negative half of the width of the image to center it. +
-  - //alY -//  The Y position of the top left corner, starting from the center of the screen. +
-  - //​afUnknown1// ​ - Unsure what this is. Any value 0 or greater results in the image not showing up, so use -1 +
-  - //​abUnknown2// ​ - Unsure what this is. If set to true, image does not display, so use false +
-  - //​afDuration// ​ - How long, in seconds, the image displays. This does not include fade times +
-  - //​afFadeInTime// ​ - How long, in seconds, the fade in spends +
-  - //​afFadeOutTime// ​ - How long, in seconds, the fade out spends +
-==== Journal ==== +
- +
-<code c> +
-void AddHint(string&​ asNameAndTextEntry,​ string@&​ asImage); +
-</​code>​ +
- +
-Adds a hint to the player'​s journal. \\ This function replaces TDD's ''​AddDiary''​. +
- +
-  - //​asNameAndTextEntry// ​ - The .lang text entry of the hint. The entry must be in category "​Journal"​ and begin with "​Hint__ckgedit____>​ and end with _ckgedit_____QUOT__Name"​ for the title and end with "​_Text"​ for the body. +
-  - //​asImage// ​ - This argument does not seem to be used. Presumed to be for displaying an image but possibly removed functionality. All existing occurrences are empty. +
-<code c> +
-void SetJournalDisabled(const bool abDisabled);​ +
-</​code>​ +
- +
-Disables the player'​s ability to open their journal. +
- +
-  - //​abDisabled// ​ - True to disable, false to enable again +
-==== Player ==== +
- +
-<code c> +
-void SetLanternFlickerActive(const bool abActive);​ +
-</​code>​ +
- +
-Enables/​disables the flicker effect for the lantern'​s light. +
- +
-  - //​abActive// ​ - True to flicker, false to not flicker +
-<code c> +
-void SetPlayerInfection(const float afInfectionLevel);​ +
-</​code>​ +
- +
-Sets the infection level for the player. Infection replaces sanity from TDD and acts similar, however it goes from 0-100 instead of 100-0. An infection level above approximately 20 will affect the player'​s ability to move. Infection level above 80 will kill the player. Infection slowly decreases over time, unless high enough. \\ This function replaces TDD's ''​SetPlayerSanity''​. +
- +
-  - //​afInfectionLevel// ​ - The level of infection to set +
-<code c>+
 void FadePlayerPitchTo(const float afPitch, const float afDeaccelleration,​ const float afSpeed); void FadePlayerPitchTo(const float afPitch, const float afDeaccelleration,​ const float afSpeed);
 </​code>​ </​code>​
Line 164: Line 108:
 Moves the player'​s pitch (up and down rotation). Moves the player'​s pitch (up and down rotation).
  
-  - //​afPitch// ​ - The target pitch to move towards. 0 = straight forward. Clamped to range: -70 to 70.+  - //​afPitch// ​ - The target pitch to move towards. 0 = straight forward. Clamped to range: -70 to +70.
   - //​afDeaccelleration// ​ - The deaccelleration when nearing the target pitch. A low value makes a slow change.   - //​afDeaccelleration// ​ - The deaccelleration when nearing the target pitch. A low value makes a slow change.
   - //​afSpeed// ​ - The speed of the movement. Speed is affected by deaccelleration.   - //​afSpeed// ​ - The speed of the movement. Speed is affected by deaccelleration.
-<code c>+<code c++>
 void SetPlayerUsesDragFootsteps(const bool abX); void SetPlayerUsesDragFootsteps(const bool abX);
 </​code>​ </​code>​
Line 177: Line 121:
 ==== Entities ==== ==== Entities ====
  
-<code c>+<code c++>
 void SetPhysicsAutoDisable(string@&​ asEntity, const bool abDisabled);​ void SetPhysicsAutoDisable(string@&​ asEntity, const bool abDisabled);​
 </​code>​ </​code>​
Line 185: Line 129:
   - //​asEntity// ​ - The entity to affect   - //​asEntity// ​ - The entity to affect
   - //​abDisabled// ​ - Whether this effect auto disables or not   - //​abDisabled// ​ - Whether this effect auto disables or not
-<code c>+<code c++>
 void SetLampFlickerActive(string@&​ asLamp, const bool abActive); void SetLampFlickerActive(string@&​ asLamp, const bool abActive);
 </​code>​ </​code>​
Line 193: Line 137:
   - //​asLamp// ​ - The lamp entity   - //​asLamp// ​ - The lamp entity
   - //​abActive// ​ - Whether to enable flicker   - //​abActive// ​ - Whether to enable flicker
-<code c>+<code c++>
 void StartPhoneRinging(string@&​ asEntity); void StartPhoneRinging(string@&​ asEntity);
 </​code>​ </​code>​
Line 200: Line 144:
  
   - //​asEntity// ​ - The PhoneBox entity   - //​asEntity// ​ - The PhoneBox entity
-<code c>+<code c++>
 void StopPhoneRinging(string@&​ asEntity) void StopPhoneRinging(string@&​ asEntity)
 </​code>​ </​code>​
Line 207: Line 151:
  
   - //​asEntity// ​ - The PhoneBox entity   - //​asEntity// ​ - The PhoneBox entity
-<code c>+<code c++>
 bool GetEntityActive(string@&​ asEntity); bool GetEntityActive(string@&​ asEntity);
 </​code>​ </​code>​
Line 214: Line 158:
  
   - //​asEntity// ​ - The entity to check   - //​asEntity// ​ - The entity to check
-<code c>+<code c++>
 void StopPropAnimation(string@&​ asProp); void StopPropAnimation(string@&​ asProp);
 </​code>​ </​code>​
Line 222: Line 166:
   - //​asProp// ​ - The name of the entity/prop   - //​asProp// ​ - The name of the entity/prop
 <code c++> <code c++>
-void SetPropAnimationPosition(string@&​ asProp, const float afState);+void SetPropAnimationPosition(string@&​ asProp, const float afPosition);
 </​code>​ </​code>​
  
Line 228: Line 172:
  
   - //​asProp// ​ - The entity that is being animated   - //​asProp// ​ - The entity that is being animated
-  - //afState//  - The time within the animation, in seconds, to jump to +  - //afPosition//  - The time within the animation, in seconds, to jump to 
-<code c>+<code c++>
 void SetSwingDoorOpenAmount(string@&​ asEntity, const float afOpenAmount,​ const float afTime, const bool abUnknown); void SetSwingDoorOpenAmount(string@&​ asEntity, const float afOpenAmount,​ const float afTime, const bool abUnknown);
 </​code>​ </​code>​
Line 239: Line 183:
   - //​afTime// ​ - The time in seconds until the door has changed state   - //​afTime// ​ - The time in seconds until the door has changed state
   - //​abUnknown// ​ - Unsure what this does. If set to true, nothing happens (?), so use false.   - //​abUnknown// ​ - Unsure what this does. If set to true, nothing happens (?), so use false.
-<code c>+<code c++>
 void FadeLampTo(string@&​ asEntity, const uint alR, const uint alG, const uint alB, const uint alA, int alRadius, const double afTime); void FadeLampTo(string@&​ asEntity, const uint alR, const uint alG, const uint alB, const uint alA, int alRadius, const double afTime);
 </​code>​ </​code>​
Line 252: Line 196:
   - //​alRadius// ​ - The new radius to use (affects illumination strength)   - //​alRadius// ​ - The new radius to use (affects illumination strength)
   - //​afTime// ​ - Time in seconds until the light properties have changed   - //​afTime// ​ - Time in seconds until the light properties have changed
-<code c>+<code c++>
 void SetButtonCanBeSwitchedOn(string@&​ asEntity, const bool abX); void SetButtonCanBeSwitchedOn(string@&​ asEntity, const bool abX);
 </​code>​ </​code>​
Line 260: Line 204:
   - //​asEntity// ​ - The button entity   - //​asEntity// ​ - The button entity
   - //​abX// ​ - Whether it can be switched on   - //​abX// ​ - Whether it can be switched on
-<code c>+<code c++>
 void CreateEntityAtArea(string@&​ asName, string@&​ asFile, string@&​ asArea, const bool abUnknown, const float afOffsetX, const float afOffsetY, const float afOffsetZ, const float afRotX, const float afRotY, const float afRotZ); void CreateEntityAtArea(string@&​ asName, string@&​ asFile, string@&​ asArea, const bool abUnknown, const float afOffsetX, const float afOffsetY, const float afOffsetZ, const float afRotX, const float afRotY, const float afRotZ);
 </​code>​ </​code>​
Line 276: Line 220:
   - //​afRotY// ​ - The rotation on the Y axis in degrees   - //​afRotY// ​ - The rotation on the Y axis in degrees
   - //​afRotZ// ​ - The rotation on the Z axis in degrees   - //​afRotZ// ​ - The rotation on the Z axis in degrees
-<code c>+<code c++>
 void AttachPropToBone(string@&​ asProp, string@&​ asEntity, string@&​ asBone, const float afOffsetX, const float afOffsetY, const float afOffsetZ, const float afRotX, const float afRotY, const float afRotZ); void AttachPropToBone(string@&​ asProp, string@&​ asEntity, string@&​ asBone, const float afOffsetX, const float afOffsetY, const float afOffsetZ, const float afRotX, const float afRotY, const float afRotZ);
 </​code>​ </​code>​
Line 291: Line 235:
   - //​afRotY// ​ - Rotation along the Y axis   - //​afRotY// ​ - Rotation along the Y axis
   - //​afRotZ// ​ - Rotation along the Z axis   - //​afRotZ// ​ - Rotation along the Z axis
-<code c>+<code c++>
 void DetachPropFromBone(string@&​ asProp); void DetachPropFromBone(string@&​ asProp);
 </​code>​ </​code>​
Line 298: Line 242:
  
   - //​asProp// ​ - The attached prop   - //​asProp// ​ - The attached prop
-==== Sounds ==== +<code c++
- +void AttachAreaToProp(string@& ​asArea, string@& ​asProp, const float afUnknown);
-<code c> +
-void AddEffectVoice2(string@& ​asVoiceFile, string@& ​asEffectFile,​ string@&​ asTextCat, string@&​ asTextEntry1,​ const float afStartTime1,​ string@&​ asTextEntry2,​ const float afStartTime2,​ const bool abUsePosition,​ string@&​ asPosEntity,​ const float afMinDistance, const float afMaxDistance);+
 </​code>​ </​code>​
  
-Plays an audio file with 2 consecutive subtitles. +Attaches ​an area to a prophowever testing has not yielded any useful resultsOriginally ​used to attach ​liquid area to a movable water plane entity ​in the sewers map.
- +
-  - //​asVoiceFile// ​ - The entire voice file to play (intended to include 2 sections) +
-  - //​asEffectFile// ​ - The background effect file to play during voices. Leave empty for no extra effect +
-  - //​asTextCat// ​ - The .lang text category for the subtitles +
-  - //​asTextEntry1// ​ - The first .lang subtitle entry +
-  - //​afStartTime1// ​ - The time to wait until the first subtitle starts +
-  - //​asTextEntry2// ​ - The second .lang subtitle entry +
-  - //​afStartTime2// ​ - The time to wait until the second subtitle starts +
-  - //​abUsePosition// ​ - Whether to use 3D to play the sound from an entity +
-  - //​asPosEntity// ​ - The entity to play the sound from. If empty, plays from player +
-  - //​afMinDistance// ​ - The minimum distance required between the player and the entity in order to hear the audio +
-  - //​afMaxDistance// ​ - The maximum distance allowed between the player and the entity in order to hear the audio +
-<code c> +
-void AddEffectVoice3(string@&​ asVoiceFile,​ string@&​ asEffectFile,​ string@&​ asTextCat, string@&​ asTextEntry1,​ const float afStartTime1,​ string@&​ asTextEntry2,​ const float afStartTime2,​ string@&​ asTextEntry3,​ const float afStartTime3,​ const bool abUsePosition,​ string@&​ asPosEntity,​ const float afMinDistance,​ const float afMaxDistance);​ +
-</​code>​ +
- +
-Plays an audio file with 3 consecutive subtitles. +
- +
-  - //​asVoiceFile// ​ - The entire voice file to play (intended to include 3 sections) +
-  - //​asEffectFile// ​ - The background effect file to play during voices. Leave empty for no extra effect +
-  - //​asTextCat// ​ - The .lang text category for the subtitles +
-  - //​asTextEntry1// ​ - The first .lang subtitle entry +
-  - //​afStartTime1// ​ - The time to wait until the first subtitle starts +
-  - //​asTextEntry2// ​ - The second .lang subtitle entry +
-  - //​afStartTime2// ​ - The time to wait until the second subtitle starts +
-  - //​asTextEntry3// ​ - The third .lang subtitle entry +
-  - //​afStartTime3// ​ - The time to wait until the third subtitle starts +
-  - //​abUsePosition// ​ - Whether to use 3D to play the sound from an entity +
-  - //​asPosEntity// ​ - The entity to play the sound from. If empty, plays from player +
-  - //​afMinDistance// ​ - The minimum distance required between the player and the entity in order to hear the audio +
-  - //​afMaxDistance// ​ - The maximum distance allowed between the player and the entity in order to hear the audio +
-<code c> +
-void AddEffectVoice4(string@&​ asVoiceFile,​ string@&​ asEffectFile,​ string@&​ asTextCat, string@&​ asTextEntry1,​ const float afStartTime1,​ string@&​ asTextEntry2,​ const float afStartTime2,​ string@&​ asTextEntry3,​ const float afStartTime3,​ string@&​ asTextEntry4,​ const float afStartTime4,​ const bool abUsePosition,​ string@&​ asPosEntity,​ const float afMinDistance,​ const float afMaxDistance);​ +
-</​code>​ +
- +
-Plays an audio file with 4 consecutive subtitles. +
- +
-  - //​asVoiceFile// ​ - The entire voice file to play (intended to include 4 sections) +
-  - //​asEffectFile// ​ - The background effect file to play during voices. Leave empty for no extra effect +
-  - //​asTextCat// ​ - The .lang text category for the subtitles +
-  - //​asTextEntry1// ​ - The first .lang subtitle entry +
-  - //​afStartTime1// ​ - The time to wait until the first subtitle starts +
-  - //​asTextEntry2// ​ - The second .lang subtitle entry +
-  - //​afStartTime2// ​ - The time to wait until the second subtitle starts +
-  - //​asTextEntry3// ​ - The third .lang subtitle entry +
-  - //​afStartTime3// ​ - The time to wait until the third subtitle starts +
-  - //​asTextEntry4// ​ - The fourth .lang subtitle entry +
-  - //​afStartTime4// ​ - The time to wait until the fourth subtitle starts +
-  - //​abUsePosition// ​ - Whether to use 3D to play the sound from an entity +
-  - //​asPosEntity// ​ - The entity to play the sound from. If empty, plays from player +
-  - //​afMinDistance// ​ - The minimum distance required between the player and the entity in order to hear the audio +
-  - //​afMaxDistance// ​ - The maximum distance allowed between the player and the entity in order to hear the audio +
-<code c> +
-void AddEffectVoice5(string@&​ asVoiceFile,​ string@&​ asEffectFile,​ string@&​ asTextCat, string@&​ asTextEntry1,​ const float afStartTime1,​ string@&​ asTextEntry2,​ const float afStartTime2,​ string@&​ asTextEntry3,​ const float afStartTime3,​ string@&​ asTextEntry4,​ const float afStartTime4,​ string@&​ asTextEntry5,​ const float afStartTime5,​ const bool abUsePosition,​ string@&​ asPosEntity,​ const float afMinDistance,​ const float afMaxDistance);​ +
-</​code>​ +
- +
-Plays an audio file with 5 consecutive subtitles. +
- +
-  - //​asVoiceFile// ​ - The entire voice file to play (intended to include 5 sections) +
-  - //​asEffectFile// ​ - The background effect file to play during voices. Leave empty for no extra effect +
-  - //​asTextCat// ​ - The .lang text category for the subtitles +
-  - //​asTextEntry1// ​ - The first .lang subtitle entry +
-  - //​afStartTime1// ​ - The time to wait until the first subtitle starts +
-  - //​asTextEntry2// ​ - The second .lang subtitle entry +
-  - //​afStartTime2// ​ - The time to wait until the second subtitle starts +
-  - //​asTextEntry3// ​ - The third .lang subtitle entry +
-  - //​afStartTime3// ​ - The time to wait until the third subtitle starts +
-  - //​asTextEntry4// ​ - The fourth .lang subtitle entry +
-  - //​afStartTime4// ​ - The time to wait until the fourth subtitle starts +
-  - //​asTextEntry5// ​ - The fifth .lang subtitle entry +
-  - //​afStartTime5// ​ - The time to wait until the fifth subtitle starts +
-  - //​abUsePosition// ​ - Whether to use 3D to play the sound from an entity +
-  - //​asPosEntity// ​ - The entity to play the sound from. If empty, plays from player +
-  - //​afMinDistance// ​ - The minimum distance required between the player and the entity in order to hear the audio +
-  - //​afMaxDistance// ​ - The maximum distance allowed between the player and the entity in order to hear the audio +
-<code c> +
-void AddEffectVoice6(string@&​ asVoiceFile,​ string@&​ asEffectFile,​ string@&​ asTextCat, string@&​ asTextEntry1,​ const float afStartTime1,​ string@&​ asTextEntry2,​ const float afStartTime2,​ string@&​ asTextEntry3,​ const float afStartTime3,​ string@&​ asTextEntry4,​ const float afStartTime4,​ string@&​ asTextEntry5,​ const float afStartTime5,​ string@&​ asTextEntry6,​ const float afStartTime6,​ const bool abUsePosition,​ string@&​ asPosEntity,​ const float afMinDistance,​ const float afMaxDistance);​ +
-</​code>​ +
- +
-Plays an audio file with 6 consecutive subtitles. +
- +
-  - //​asVoiceFile// ​ - The entire voice file to play (intended to include 6 sections) +
-  - //​asEffectFile// ​ - The background effect file to play during voices. Leave empty for no extra effect +
-  - //​asTextCat// ​ - The .lang text category for the subtitles +
-  - //​asTextEntry1// ​ - The first .lang subtitle entry +
-  - //​afStartTime1// ​ - The time to wait until the first subtitle starts +
-  - //​asTextEntry2// ​ - The second .lang subtitle entry +
-  - //​afStartTime2// ​ - The time to wait until the second subtitle starts +
-  - //​asTextEntry3// ​ - The third .lang subtitle entry +
-  - //​afStartTime3// ​ - The time to wait until the third subtitle starts +
-  - //​asTextEntry4// ​ - The fourth .lang subtitle entry +
-  - //​afStartTime4// ​ - The time to wait until the fourth subtitle starts +
-  - //​asTextEntry5// ​ - The fifth .lang subtitle entry +
-  - //​afStartTime5// ​ - The time to wait until the fifth subtitle starts +
-  - //​asTextEntry6// ​ - The sixth .lang subtitle entry +
-  - //​afStartTime6// ​ - The time to wait until the sixth subtitle starts +
-  - //​abUsePosition// ​ - Whether to use 3D to play the sound from an entity +
-  - //​asPosEntity// ​ - The entity to play the sound from. If empty, plays from player +
-  - //​afMinDistance// ​ - The minimum distance required between the player and the entity in order to hear the audio +
-  - //​afMaxDistance// ​ - The maximum distance allowed between the player and the entity in order to hear the audio +
-<code c> +
-void AddEffectVoice7(string@&​ asVoiceFile,​ string@&​ asEffectFile,​ string@&​ asTextCat, string@&​ asTextEntry1,​ const float afStartTime1,​ string@&​ asTextEntry2,​ const float afStartTime2,​ string@&​ asTextEntry3,​ const float afStartTime3,​ string@&​ asTextEntry4,​ const float afStartTime4,​ string@&​ asTextEntry5,​ const float afStartTime5,​ string@&​ asTextEntry6,​ const float afStartTime6,​ string@&​ asTextEntry7,​ const float afStartTime7,​ const bool abUsePosition,​ string@&​ asPosEntity,​ const float afMinDistance,​ const float afMaxDistance);​ +
-</​code>​ +
- +
-Plays an audio file with 7 consecutive subtitles. +
- +
-  - //​asVoiceFile// ​ - The entire voice file to play (intended to include 7 sections) +
-  - //​asEffectFile// ​ - The background effect file to play during voices. Leave empty for no extra effect +
-  - //​asTextCat// ​ - The .lang text category for the subtitles +
-  - //​asTextEntry1// ​ - The first .lang subtitle entry +
-  - //​afStartTime1// ​ - The time to wait until the first subtitle starts +
-  - //​asTextEntry2// ​ - The second .lang subtitle entry +
-  - //​afStartTime2// ​ - The time to wait until the second subtitle starts +
-  - //​asTextEntry3// ​ - The third .lang subtitle entry +
-  - //​afStartTime3// ​ - The time to wait until the third subtitle starts +
-  - //​asTextEntry4// ​ - The fourth .lang subtitle entry +
-  - //​afStartTime4// ​ - The time to wait until the fourth subtitle starts +
-  - //​asTextEntry5// ​ - The fifth .lang subtitle entry +
-  - //​afStartTime5// ​ - The time to wait until the fifth subtitle starts +
-  - //​asTextEntry6// ​ - The sixth .lang subtitle entry +
-  - //​afStartTime6// ​ - The time to wait until the sixth subtitle starts +
-  - //​asTextEntry7// ​ - The seventh .lang subtitle entry +
-  - //​afStartTime7 //- The time to wait until the seventh subtitle starts +
-  - //​abUsePosition// ​ - Whether to use 3D to play the sound from an entity +
-  - //​asPosEntity// ​ - The entity to play the sound from. If empty, plays from player +
-  - //​afMinDistance// ​ - The minimum distance required between the player and the entity in order to hear the audio +
-  - //​afMaxDistance// ​ - The maximum distance allowed between the player and the entity in order to hear the audio +
-==== Enemies ==== +
- +
-<code c> +
-void AddEnemyPatrolNode(string@&​ asEnemy, string@&​ asPathNode, const float afWaitTime, string@&​ asAnimation,​ const bool abUnknown) +
-</​code>​ +
- +
-Adds patrol node to the enemy'​s walking path. A path is restarted from the beginning when the final node is reached. Note: Inputting an invalid animation in asAnimation at the final node will make the enemy wait there indefinitely. \\ This function replaces TDD's AddEnemyPatrolNode. +
- +
-  - //​asEnemy// ​ - The name of the enemy +
-  - //​asPathNode// ​ - Internal name of path node +
-  - //​afWaitTime// ​ - The timein seconds, the enemy waits at this node before continuing. Note: A time of 0.0f does not seem to skip waiting, use 0.01f instead if you want the enemy to immediately continue to the next node. +
-  - //​asAnimation// ​ - The animation to play on the enemy when they arrive at this path node. Animations can be found in the Model Editor. Leave empty to play no special animation (uses default Idle animation). Note: If the animation lasts longer than afWaitTime, the enemy waits until the animation is complete before continuing the path. +
-  - //​abUnknown// ​ - Unknown variableOnly false is ever used in the campaign. If set to true, seems to affect how animations are played, however they seem to just stutter or loop. +
-<code c> +
-void SetEnemyMoveType(string@&​ asEnemy, string@&​ asMoveType);​ +
-</​code>​ +
- +
-Changes how an enemy moves. +
- +
-  - //​asEnemy// ​ - The name of the enemy +
-  - //​asMoveType// ​ - The type to change to. Type can be "​WalkBiped",​ "​RunBiped",​ "​ChargeBiped",​ "​Idle"​ +
-<code c> +
-void SetManPigType(string@&​ asEnemy, string@&​ asType); +
-</​code>​ +
- +
-Sets the type for ManPig enemy. It is unknown whether this function does anything or if it's just left over from an earlier state of the game. Only "​Freddy"​ is used as the type, but supposedly it should also accept "​Rod"​ and "​Jane"​. +
- +
-  - //​asEnemy// ​ - The ManPig enemy. +
-  - //​asType// ​ - The type to set. Type can be "​Freddy",​ "​Rod",​ "​Jane"​ +
-<code c> +
-void PlayEnemyAnimation(string@&​ asEnemy, string@&​ asAnimation,​ const bool abLoop, const float afDelay); +
-</​code>​ +
- +
-Plays specific animation for an enemy. +
- +
-  - //​asEnemy// ​ - Internal name of the enemy (asterisk is allowed) +
-  - //​asAnimation// ​ - The name of an animation registered to the enemy +
-  - //​abLoop// ​ - Whether the animation loops +
-  - //​afDelay// ​ - Seems to affect how the animation plays out. A higher value makes the animation slower, although it seems to also skip some keyframes or perhaps merge them, making the animation look incorrect. Experiment to see what works based on the animation. +
-<code c> +
-void ChangeEnemyPose(string@&​ asEnemy, string@&​ asPose); +
-</​code>​ +
- +
-Changes the pose for an enemy. Can be either "​Biped"​ or "​Quadruped"​. +
- +
-  - //​asEnemy// ​ - Internal name of the enemy +
-  - //​asPose// ​ - The pose to change to +
-<code c> +
-void ForceEnemyWaitState(string@&​ asEnemy); +
-</​code>​ +
- +
-Forces the enemy'​s AI to change the state to "​Wait"​ which makes the enemy wait for a short while before continuing its' normal actions. An enemy without patrol nodes defaults to the "​Wait"​ state. Otherwise, if patrol nodes are added, the enemy will continue the path after waiting is done. +
- +
-  - //​asEnemy// ​ - Internal name of the enemy +
-<code c> +
-void SetEnemyBlind(string@&​ asEnemy, const bool abX); +
-</​code>​ +
- +
-Sets whether the enemy can see the player if they are within visible range. +
- +
-  - //​asEnemy// ​ - Internal name of the enemy +
-  - //​abX// ​ - Whether enemy is blind +
-<code c> +
-void SetEnemyDeaf(string@&​ asEnemy, const bool abX); +
-</​code>​ +
- +
-Sets whether the enemy can hear the player make sound if they are within audible range. +
- +
-  - //​asEnemy// ​ - Internal name of the enemy +
-  - //​abX// ​ - Whether enemy is deaf +
-<code c> +
-bool GetPlayerCanSeeEnemy(string@&​ asEnemy); +
-</​code>​ +
- +
-Returns whether the enemy is within visible range of the player. +
- +
-  - //​asEnemy// ​ - Internal name of the enemy +
-<code c> +
-float GetEnemyPlayerDistance(string@&​ asEnemy); +
-</​code>​ +
- +
-Returns the distance (in HPL units) between ​the enemy and the player. +
- +
-  - asEnemy - Internal name of the enemy +
- +
-==== Particles ==== +
- +
-<code c> +
-void SetParticleSystemActive(string@&​ asParticleSystem,​ const bool abActive);​ +
-</​code>​ +
- +
-Pauses a particle system in its current frame. The paused particle system remains frozen at this frame until reactivated or destroyed. +
- +
-  - //​asParticleSystem// ​ - The name of the particle system +
-  - //​abActive// ​ - False to pause, true to unpause +
-<code c> +
-void DestroyParticleSystemInstantly(string@&​ asParticleSystem);​ +
-</​code>​ +
- +
-Destroys a particle system and any existing particles already emitted from it. Similar to ''​DestroyParticleSystem'',​ except that one will not destroy the existing particles and rather let them live out their lives. This function will cut all particles'​ lives short. +
- +
-  - //​asParticleSystem// ​ - The PS to destroy+
  
 +  - //​asArea// ​ - The area to attach
 +  - //​asProp// ​ - The prop to attach area to
 +  - //​alUnknown// ​ - Unknown float value
 ==== Sounds ==== ==== Sounds ====
  
Line 669: Line 385:
   - //​afMinDistance// ​ - The minimum distance required between the player and the entity in order to hear the audio   - //​afMinDistance// ​ - The minimum distance required between the player and the entity in order to hear the audio
   - //​afMaxDistance// ​ - The maximum distance allowed between the player and the entity in order to hear the audio   - //​afMaxDistance// ​ - The maximum distance allowed between the player and the entity in order to hear the audio
- 
 ==== Enemies ==== ==== Enemies ====
  
Line 676: Line 391:
 </​code>​ </​code>​
  
-Adds a patrol node to the enemy'​s walking path. A path is restarted from the beginning when the final node is reached. Note: Inputting an invalid animation in asAnimation at the final node will make the enemy wait there indefinitely.\\ +Adds a patrol node to the enemy'​s walking path. A path is restarted from the beginning when the final node is reached. Note: Inputting an invalid animation in asAnimation at the final node will make the enemy wait there indefinitely. \\ This function replaces TDD's AddEnemyPatrolNode.
-This function replaces TDD's AddEnemyPatrolNode.+
  
   - //​asEnemy// ​ - The name of the enemy   - //​asEnemy// ​ - The name of the enemy
Line 700: Line 414:
   - //​asEnemy// ​ - The ManPig enemy.   - //​asEnemy// ​ - The ManPig enemy.
   - //​asType// ​ - The type to set. Type can be "​Freddy",​ "​Rod",​ "​Jane"​   - //​asType// ​ - The type to set. Type can be "​Freddy",​ "​Rod",​ "​Jane"​
 +The three types allegedly describe three different personality types for the AI, according to Peter Howell in [[https://​researchportal.port.ac.uk/​portal/​files/​3364888/​PeterHowell_PhD.pdf|his PhD, section 7.4.4]].
 +
 +Extract:
 +
 +//The initial design of the game’s enemy artificial intelligence system contained three unique sets of behavioural controls. There was only one visual enemy style, however every enemy agent in the game would be assigned one of three possible ‘personalities’,​ referred to in the game’s code as the ‘Rod’, ‘Jane’ and ‘Freddy’ personality types. These personalities each had a different set of behavioural rules, thus allowing enemy agents that may otherwise appear identical to behave very differently to one another.//
 +
 +^Enemy Agent Personality Type ^Primary Behavioural Traits |
 +|Rod |– Will maintain a '​safe'​ distance to the player-character. \\ – unable to do so, will approach player character, investigate them (by getting close and smelling them), before continuing its patrol. |
 +|Jane |– Will maintain a ‘safe’ distance from player-character,​ whilst observing the player-character’s movements. \\ – If unable to maintain ‘safe’ distance, will panic and flee. \\ – If cornered and unable to flee, will attack and knock player-character to floor, then flee. \\ – Will only attack and kill player-character as a last resort. |
 +|Freddy |– Will actively hunt the player-character. \\ – Will attack and kill them if given the opportunity. |
 +
 <code c++> <code c++>
 void PlayEnemyAnimation(string@&​ asEnemy, string@&​ asAnimation,​ const bool abLoop, const float afDelay); void PlayEnemyAnimation(string@&​ asEnemy, string@&​ asAnimation,​ const bool abLoop, const float afDelay);
Line 773: Line 498:
  
   - //​asParticleSystem// ​ - The PS to destroy   - //​asParticleSystem// ​ - The PS to destroy
 +
 +\\
  
hpl2/machine_for_pigs/notes.1585531562.txt.gz · Last modified: 2020/03/30 01:26 (external edit)