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/29 22:40]
mudbill [Enemies] Added GetEnemyPlayerDistance
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 29: Line 27:
  
 Respawns the player if stuck in "​limbo"​. Limbo can be enabled with ''​CheckPoint''​. Limbo is the state between life and death. The player enters limbo upon dying but won't respawn until this function is called. Respawns the player if stuck in "​limbo"​. Limbo can be enabled with ''​CheckPoint''​. Limbo is the state between life and death. The player enters limbo upon dying but won't respawn until this function is called.
 +
 +<code c++>
 +void PlayScriptedAnimation(string@&​ asEntity, string@&​ asAnimation,​ const bool abLoop);
 +</​code>​
 +
 +Plays an animation that has been added to an entity through the Model Editor. Similar to ''​PlayEnemyAnimation''​.
 +
 +  - asEntity - Internal name of the entity
 +  - asAnimation - The animation name inside the entity
 +  - abLoop - Whether to loop the animation or play it only once
  
 ==== Screen effects ==== ==== Screen effects ====
Line 46: 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 53: 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 65: Line 71:
  
   - //​abDisabled// ​ - True to disable, false to enable again   - //​abDisabled// ​ - True to disable, false to enable again
- 
 ==== Player ==== ==== Player ====
  
Line 76: 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''​. 
 + 
 +  - //​afAmount// ​ - The level of infection to set 
 +<code c++> 
 +void AddPlayerInfection(const float afAmount);​ 
 +</​code>​ 
 + 
 +Adds an amount of infection to the player'​s current amount. \\ This function replaces TDD's ''​AddPlayerSanity''​. 
 + 
 +  - afAmount - The amount to add 
 + 
 +<code c00> 
 +float GetPlayerInfection();​ 
 +</​code>​ 
 + 
 +Returns the amount of infection the player currently has. \\ This function replaces TDD's ''​GetPlayerSanity''​.
  
-  - //​afInfectionLevel// ​ - The level of infection to set 
 <code c++> <code c++>
 void FadePlayerPitchTo(const float afPitch, const float afDeaccelleration,​ const float afSpeed); void FadePlayerPitchTo(const float afPitch, const float afDeaccelleration,​ const float afSpeed);
Line 91: Line 111:
   - //​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++>
 +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.
 +
 +  - abX - Whether to use "​drag"​ step sounds
  
 ==== Entities ==== ==== Entities ====
Line 138: Line 165:
  
   - //​asProp// ​ - The name of the entity/prop   - //​asProp// ​ - The name of the entity/prop
 +<code c++>
 +void SetPropAnimationPosition(string@&​ asProp, const float afPosition);​
 +</​code>​
 +
 +Jumps to a specifc point in an animation. Generally used in conjunction with ''​PlayPropAnimation''​.
 +
 +  - //​asProp// ​ - The entity that is being animated
 +  - //​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);
Line 207: Line 242:
  
   - //​asProp// ​ - The attached prop   - //​asProp// ​ - The attached prop
 +<code c++>
 +void AttachAreaToProp(string@&​ asArea, string@&​ asProp, const float afUnknown);
 +</​code>​
 +
 +Attaches an area to a prop, however testing has not yielded any useful results. Originally used to attach a liquid area to a movable water plane entity in the sewers map.
  
 +  - //​asArea// ​ - The area to attach
 +  - //​asProp// ​ - The prop to attach area to
 +  - //​alUnknown// ​ - Unknown float value
 ==== Sounds ==== ==== Sounds ====
  
Line 342: 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 349: 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 373: 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 446: Line 498:
  
   - //​asParticleSystem// ​ - The PS to destroy   - //​asParticleSystem// ​ - The PS to destroy
 +
 +\\
  
hpl2/machine_for_pigs/notes.1585521651.txt.gz · Last modified: 2020/03/29 22:40 by mudbill