TechOFreak

Episode 15 Functions

Dec 4th, 2020
667
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //From my Amnesia Rebirth Tutorial Series
  2. //Episode 15 Enemies Pt.5! Ghoul Hole Networks!
  3. //https://www.youtube.com/playlist?list=PL4KkjlmOwLwwMVqedCNpi6caUxhgyf8Qr
  4. //-----------------------------------------------------------
  5.  
  6. /////////////////////////////////////////////
  7. //Hole functionality with command functions
  8. /////////////////////////////////////////////
  9.  
  10. //Command a ghoul to go to a hole, either the closest one or a random one
  11. Ghoul_CommandGoToHole_Execute("ghoul_hallway", Map_GetEntity("ghoul_hallway").GetPosition(),
  12.         false, false, false, true, eGhoulSpeed_Run, -1, -1, false, false, "OnEnterHole_GhoulHallway");
  13.                            
  14. //ghoulName (String)- name of ghoul as it appears in your level editor.
  15. //ghoulPosition (cVector3f)- the coordinates that the ghoul is at.
  16. //forceModeChange (bool)- should the ghoul immediately switch into the new state or should he do it at the next best opportunity.
  17. //teleportToHole (bool)- should the ghoul be teleported into the hole or should he make his way there on foot.
  18. //deactivateAfter (bool)- deactivate this command after completed.
  19. //useClosestHole (bool)- if true the ghoul will go to the nearest hole, otherwise if false it will pick a random one.
  20. //ghoulSpeed (eGhoulSpeed)- the speed at which the ghoul should move.
  21. //minRadius (float)- the minimum radius that the ghoul will look for a hole (-1 for unlimited).
  22. //maxRadius (float)- the maximum radius that the ghoul will look for a hole (-1 for unlimited).
  23. //freeHole (bool)- should the ghoul only use holes that arent occupied by other ghouls.
  24. //outPlayerSight (bool)- should the ghoul avoid a hole if the player is looking at the hole.
  25. //completedCallback (String)- the name of the function you want to run when the ghoul enters the hole.
  26.  
  27. //Command ghoul to go to a specific hole
  28. Ghoul_CommandGoToSpecificHole_Execute("ghoul_hallway", "hole_hallway_1", false, false, false, eGhoulSpeed_Walk, "OnEnterHole_GhoulHallway");
  29. //ghoulName (String)- name of ghoul as it appears in your level editor.
  30. //ghoulHoleName (String)- name of your ghoul hole area as it appears in your level editor.
  31. //forceModeChange (bool)- should the ghoul immediately switch into the new state or should he do it at the next best opportunity.
  32. //teleportToHole (bool)- should the ghoul be teleported into the hole or should he make his way there on foot.
  33. //deactivateAfter (bool)- deactivate this command after completed.
  34. //ghoulSpeed (eGhoulSpeed)- the speed at which the ghoul should move.
  35. //completedCallback (String)- the name of the function you want to run when the ghoul enters the hole.
  36.  
  37. //Syntax for the Ghoul_CommandGoToHole_Execute and Ghoul_CommandGoToSpecificHole_Execute completed callbacks
  38. void OnEnterHole_GhoulHallway(const tString &in asEntity){
  39.     cLux_AddDebugMessage("Ghoul entered hole");
  40. }
  41.  
  42. //Command a ghoul to leave from a specified hole
  43. Ghoul_CommandEmergeFromHole_Execute("ghoul_hallway", "hole_hallway_2", false, "OnEmergeCompleted_GhoulHallway", "", "");
  44. //ghoulName (String)- name of ghoul as it appears in your level editor.
  45. //ghoulHoleName (String)- name of your ghoul hole area as it appears in your level editor.
  46. //forceModeChange (bool)- should the ghoul immediately switch into the new state or should he do it at the next best opportunity.
  47. //completedCallback (String)- the name of the function you want to run when the ghoul exits the hole.
  48. //customAnimationEmerge (String)- the animation you want the ghoul to play when he is emerging.
  49. //customAnimationCmergeComplete (String)- the animation for the ghoul to play after emerging from the hole.
  50.  
  51. //Syntax for Ghoul_CommandEmergeFromHole_Execute completed callback
  52. void OnEmergeCompleted_GhoulHallway(const tString &in asEntity){
  53.     cLux_AddDebugMessage("Ghoul emerged from hole");
  54. }
  55.  
  56. /////////////////////////////////////////////
  57. //Hole functionality with mode functions
  58. /////////////////////////////////////////////
  59.  
  60. //Have the ghoul go into the nearest hole and follow the player by jumping through holes
  61. Ghoul_ModeStalkThroughHoles_Setup("ghoul_hallway", "hole_hallway_*", "", "", false);
  62. //ghoulName (String)- name of ghoul as it appears in your level editor.
  63. //ghoulHoleNetwork (String)- name of your ghoul holes by providing a wildcard.
  64. //playerPath (String)- name of your path nodes that outline the general direction the player will head, provide a wildcard.
  65. //ghoulHoleConnections (String)- name of another network of holes that this one is connected to, provide a wildcard.
  66. //hideUnlessDisturbed (bool)- should the ghoul hide until the player makes a noise.
  67.  
  68. //Sets the mode that the ghoul should operate in
  69. Ghoul_Mode_Set("ghoul_hallway", eGhoulMode_StalkThroughHoles, false);
  70. //ghoulName (String)- name of ghoul as it appears in your level editor.
  71. //ghoulMode (eGhoulMode)- the mode we want the ghoul to be in, eGhoulMode_StalkThroughHoles for a hole stalking ghoul.
  72. //forceModeChange (bool)- should the ghoul immediately switch into the new state or should he do it at the next best opportunity.
RAW Paste Data