User Tools

Site Tools


hpl2:machine_for_pigs:new_scripts

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
hpl2:machine_for_pigs:new_scripts [2020/03/07 16:18]
darkfire [Enemies] table fix
hpl2:machine_for_pigs:new_scripts [2020/04/04 14:04]
mudbill Deprecated page. Replaced by /hpl2/machine_for_pigs/notes
Line 2: Line 2:
  
 Many scripts from TDD work in MFP, but some of them have been removed (e.g. SetInventoryDisabled).\\ Many scripts from TDD work in MFP, but some of them have been removed (e.g. SetInventoryDisabled).\\
-However, MFP has a set of its own new scripts:+However, MFP has a set of its own new scripts, which are listed below. 
 + 
 +<font inherit/​inherit;;#​FF0000;;​inherit>//​ This list might be incomplete. You can contribute by going through original MFP .hps files and listing any new scripts ("​new"​ meaningnot a TDD script and not a function which is declared in the same file). ​ //</​font>​ 
 + 
 +<font inherit/​inherit;;#​FF0000;;​inherit>//​ You can also contribute by testing the untested functions or function arguments with uncertain usage. ​ //</​font>​
  
 ===== Player ===== ===== Player =====
Line 37: Line 41:
 //afFadeIn //- fade in time. It's added to the base display time.\\ //afFadeIn //- fade in time. It's added to the base display time.\\
 //afFadeOut //- fade out time. It's added to the base display time. //afFadeOut //- fade out time. It's added to the base display time.
- 
 ===== Enemies ===== ===== Enemies =====
  
Line 44: Line 47:
 </​code>​ </​code>​
  
-**{{http://​wiki.frictionalgames.com/​lib/​images/​smileys/​icon_question.gif?​nolink&​15x15}}This script ​hasn'​t ​been tested.**+**{{http://​wiki.frictionalgames.com/​lib/​images/​smileys/​icon_question.gif?​nolink&​15x15}}This script ​has been tested, but yielded no results.**
  
-Sets the enemy move type. +Sets the enemy move type. This applies to ???; Patrol move type is set in the LevelEditor.\\ 
- +Doesn'​t seem to apply to player chasing animation either.
-//asEnemy //- the in-game enemy entity+
  
 +//asEnemy //- the in-game enemy entity\\
 //​asMoveType //- options include: WalkBiped, RunBiped, ChargeBiped,​ and probably Quadruped variations as well. //​asMoveType //- options include: WalkBiped, RunBiped, ChargeBiped,​ and probably Quadruped variations as well.
 +<​code>​
 +void AddEnemyPatrolNode(string&​ asName, string& asNodeName, float afWaitTime, string& asAnimation,​ bool abContinue);​
 +</​code>​
 +
 +Adds a patrol node to the enemy'​s path. It has an additional argument when compared to TDD.
 +
 +//asName //- internal name of the enemy\\
 +//​asNodeName //- path node\\
 +//​afWaitTime //- time in seconds that the enemy waits at the path node before continuing\\
 +//​asAnimation //- the animation the enemy uses when reaching the path node\\
 +abContinue - if false, the enemy will stop at the last patrolnode indefinitely(?​)
 +
 <​code>​ <​code>​
 void SetManPigType(string &in asEntity, string &in asType); void SetManPigType(string &in asEntity, string &in asType);
 </​code>​ </​code>​
  
-**{{http://​wiki.frictionalgames.com/​lib/​images/​smileys/​icon_question.gif?​nolink&​15x15}}This script ​hasn'​t ​been tested.**+**{{http://​wiki.frictionalgames.com/​lib/​images/​smileys/​icon_question.gif?​nolink&​15x15}}This script ​has been tested ​and yielded no results.**
  
 Seems to alter the enemy AI. It was mostly used in conjunction with Child enemies (but also with Wretches). Seems to alter the enemy AI. It was mostly used in conjunction with Child enemies (but also with Wretches).
  
-//asEntity //- the enemy in question. Can be Enemy_ManPig or Enemy_Child type.+In testing it doesn'​t seem to have any effects.
  
 +//asEntity //- the enemy in question. Can be Enemy_ManPig or Enemy_Child type.\\
 //asType //- only "​Freddy"​ has been used in the entire game. It is unknown whether other options work. //asType //- only "​Freddy"​ has been used in the entire game. It is unknown whether other options work.
  
 From Peter Howell'​s PhD paper(("​Disruptive Game Design: A Commercial Design and Development Methodology for Supporting Player Cognitive Engagement in Digital Games",​ Peter Howell, 2015)) : From Peter Howell'​s PhD paper(("​Disruptive Game Design: A Commercial Design and Development Methodology for Supporting Player Cognitive Engagement in Digital Games",​ Peter Howell, 2015)) :
  
-"The initial design of the game’s enemy artificial intelligence system contained three unique sets of behavioural controls. […] 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."​+//"The initial design of the game’s enemy artificial intelligence system contained three unique sets of behavioural controls. […] 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."​//
  
 //Overview of proposed enemy agent personality types and key behavioural traits (Pre-Development,​ December 2011):// //Overview of proposed enemy agent personality types and key behavioural traits (Pre-Development,​ December 2011)://
  
-|**Enemy Agent Personality Type** ​  ​|**Primary Behavioural Traits** ​  | +**‘Rod’:**
-|‘Rod’ ​|• Will maintain a ‘safe’ distance from the player-character._PARA__TABLE_INS_• If 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._PARA__TABLE_INS_• If unable to maintain ‘safe’ distance, will panic and flee._PARA__TABLE_INS_• If cornered and unable to flee, will attack and knock player-character to floor, then flee._PARA__TABLE_INS_• Will only attack and kill player-character as a last resort. | +
-|‘Freddy’ |• Will actively hunt the player-character._PARA__TABLE_INS_• Will attack and kill them if given the opportunity. |+
  
-  ​[[https://​researchportal.port.ac.uk/​portal/​files/​3364888/​PeterHowell_PhD.pdf|[source]]]+• Will maintain a ‘safe’ distance from the player-character.\\ 
 +• If 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. 
 + 
 +[[https://​researchportal.port.ac.uk/​portal/​files/​3364888/​PeterHowell_PhD.pdf|Source]]
  
 ===== Other ===== ===== Other =====
  
 +<​code>​
 +StartPhoneRinging(string &in asPhonebox);​
 +StopPhoneRinging(string &in asPhonebox);​
 +</​code>​
 +
 +Enables/​Disables the phonecall interactions. See the [[:​hpl2:​machine_for_pigs:​new_entity_types#​phonebox|New entity types ]]artice for more detail about using phones.
 +
 +//​asPhonebox //- the phone box entity to use
 <​code>​ <​code>​
 void SetParticleSystemActive(string &in asParticle, bool abX); void SetParticleSystemActive(string &in asParticle, bool abX);
 </​code>​ </​code>​
  
-**{{http://​wiki.frictionalgames.com/​lib/​images/​smileys/​icon_question.gif?​nolink&​15x15}}This script hasn't been tested.**+"​Freezes"​ a particle (meaning, the last texture will linger).
  
 +Manual particle optimising might have been the intended usage. It was seen used next to //​SetPhysicsAutoDisable//​.\\
 +Another apparent usage is to place an inactive particle in the map and activate it when convenient (which might be a simpler way than //​CreateParticleSystemAtEntity//​)
 +
 +//​asParticle //- the particle in question\\
 +//abX //- whether to freeze or unfreeze the particle
 <​code>​ <​code>​
-void AddHint(string &​in ​asEntity, string asUnknown);+void AddHint(string &​in ​asEntryName, string asUnknown);
 </​code>​ </​code>​
  
-**{{http://​wiki.frictionalgames.com/​lib/​images/​smileys/​icon_question.gif?​nolink&​15x15}}This script hasn't been tested.**+Adds a journal entry in the "My Journal"​ category.
  
-Might be a replacement for GiveHint from TDD.\\ +ui_add_quest.snt is played, but MFP has only silence in those sounds. 
-Another option is that it gives a specified hint  (//asUnknown//) upon touching ​the //asEntity//.+ 
 +//​asEntryName -// entries the lang file.\\ 
 +Like Notes, ​it must consist of two actual entries: ​//Hint_EntryName_Name ​// and //​Hint_EntryName_Text//​. Both must be in the "​Journal"​ category.\\ 
 +See english.lang for examples.\\ 
 +//asUnknown - // this argument was never used. It always contained an empty string. Writing in it doesn'​t yield any error messages or log entries.
 <code c++> <code c++>
 SetLightVisible(string&​ asLightName,​ bool abVisible); SetLightVisible(string&​ asLightName,​ bool abVisible);
 </​code>​ </​code>​
  
-**{{http://​wiki.frictionalgames.com/​lib/​images/​smileys/​icon_question.gif?​nolink&​15x15}}This script hasn't been tested.** +Enables/​disables lights. ​Works with all 3 light types.
- +
-Enables/​disables lights. +
- +
-It was used in the main game scripts (in conjunction ​with SpotLights),​ which might indicate that unlike in TDD, this time it actually works.+
  
-//​asLightName //- internal name\\+//​asLightName //- internal ​light name\\
 //abVisible //- determines the state of the light //abVisible //- determines the state of the light
 <​code>​ <​code>​
Line 108: Line 149:
 </​code>​ </​code>​
  
-**{{http://​wiki.frictionalgames.com/​lib/​images/​smileys/​icon_question.gif?​nolink&​15x15}}This script ​hasn'​t ​been tested.**+**{{http://​wiki.frictionalgames.com/​lib/​images/​smileys/​icon_question.gif?​nolink&​15x15}}This script ​has been tested, but yielded no results.**
  
-Unknown usage.+Unknown usage. Using it doesn'​t seem to have an effect on movement or collission.
  
-//asEntity //- entity in question. ​It was used with chandelier_nice.+It seems to be used for optimising, so it might be something that only happens when the player is far from the object (not looking at it still makes it behave normally).
  
 +//asEntity //- entity in question. It was used only with chandelier_nice.\\
 //abX //- whether to disable the object physics (//​when?//​). //abX //- whether to disable the object physics (//​when?//​).