TechOFreak

Episode 13 Functions

Nov 30th, 2020
889
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //From my Amnesia Rebirth Tutorial Series
  2. //Episode 13 Enemies Pt.3! Patrolling!
  3. //https://www.youtube.com/playlist?list=PL4KkjlmOwLwwMVqedCNpi6caUxhgyf8Qr
  4. //-----------------------------------------------------------
  5.  
  6. /////////////////////////////////////////////
  7. //Patrolling using the Patrol Mode functions
  8. /////////////////////////////////////////////
  9.  
  10. //Will disable the agents senses meaning he will ignore the player entirely
  11. Agent_SetSensesActive("ghoul_hallway", false);
  12. //agentName (String)- name of agent(an enemy for example).
  13. //enabled (bool)- whether or not this effect should be enabled.
  14.  
  15. //Setups the ghoul's patrol mode
  16. Ghoul_ModePatrol_Setup("ghoul_hallway", false, eGhoulSpeed_Walk);
  17. //ghoulName (String)- name of ghoul as it appears in your level editor.
  18. //randomNodes (bool)- whether or not the ghoul should it's added patrol nodes at random. If false it will patrol the nodes in the order the nodes were added.
  19. //ghoulSpeed (eGhoulSpeed)- the speed at which the ghould should patrol the added path nodes.
  20.  
  21. //Sets the mode that the ghoul should operate in
  22. Ghoul_Mode_Set("ghoul_hallway", eGhoulMode_Patrol, false);
  23. //ghoulName (String)- name of ghoul as it appears in your level editor.
  24. //ghoulMode (eGhoulMode)- the mode we want the ghoul to be in eGhoulMode_Patrol for a patrolling ghoul.
  25. //forceModeChange (bool)- should the ghoul immediately switch into the new state or should he do it at the next best opportunity.
  26.  
  27. //Adds a node that the ghoul should patrol to
  28. Ghoul_ModePatrol_AddNode("ghoul_hallway", "PathNode_14", 0, -1, "", false);
  29. //ghoulName (String)- name of ghoul as it appears in your level editor.
  30. //pathNodeName (String)- name of path node as it appears in your level editor.
  31. //minWaitTime (float)- the minimum amount of time a ghoul should wait at each node.
  32. //maxWaitTime (float)- the maximum amount of time a ghoul should wait at each node. (-1 for instant).
  33. //animationName (String)- name of animation that the ghoul should play after reaching the point.
  34. //loopAnimation (bool)- whether the animation should loop.
  35.  
  36. Ghoul_ModePatrol_AddNode("ghoul_hallway", "PathNode_1", 0, -1, "", false);
  37.  
  38. //Change speed of a patrolling ghoul
  39. Ghoul_ModePatrol_SetSpeed("ghoul_hallway", eGhoulSpeed_FastWalk);
  40. //ghoulName (String)- name of ghoul as it appears in your level editor.
  41. //ghoulSpeed (eGhoulSpeed)- the speed at which the ghould should patrol the added path nodes.
  42.  
  43. //Clear any nodes that have been added to the ghouls patrol memory
  44. Ghoul_ModePatrol_ClearNodes("ghoul_hallway");
  45. //ghoulName (String)- name of ghoul as it appears in your level editor.
  46.  
  47. ///////////////////////////////////////////////
  48. //Patrolling using the Command Patrol functions
  49. ///////////////////////////////////////////////
  50.  
  51. //Adds a node that the ghoul should patrol to
  52. Ghoul_CommandPatrol_AddNode("ghoul_hallway", "PathNode_14", 0, -1, "", false);
  53. //ghoulName (String)- name of ghoul as it appears in your level editor.
  54. //pathNodeName (String)- name of path node as it appears in your level editor.
  55. //minWaitTime (float)- the minimum amount of time a ghoul should wait at each node.
  56. //maxWaitTime (float)- the maximum amount of time a ghoul should wait at each node. (-1 for instant).
  57. //animationName (String)- name of animation that the ghoul should play after reaching the point.
  58. //loopAnimation (bool)- whether the animation should loop.
  59.  
  60. //Command the ghoul to start protrolling with certain values
  61. Ghoul_CommandPatrol_Execute("ghoul_hallway", false, 1, false, eGhoulSpeed_Walk, "OnPatrolFinish_GhoulHallway");
  62. //ghoulName (String)- name of ghoul as it appears in your level editor.
  63. //forceModeChange (bool)- should the ghoul immediately switch into the new state or should he do it at the next best opportunity.
  64. //#ofLoops (int)- number of times the ghould should patrol the added nodes.
  65. //randomNodes (bool)- whether or not the ghoul should it's added patrol nodes at random. If false it will patrol the nodes in the order the nodes were added.
  66. //ghoulSpeed (eGhoulSpeed)- the speed at which the ghould should patrol the added path nodes.
  67. //completedCallbackName (String)- the name of the function that should be called when the ghoul finishes patrolling the number of times you specified.
  68.  
  69. //Syntax for the completed callback
  70. void OnPatrolFinish_GhoulHallway(const tString &in asEntity){
  71.         cLux_AddDebugMessage("Patrol finished");
  72. }
RAW Paste Data