TechOFreak

Episode 41 Functions

May 1st, 2021
1,102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.61 KB | None | 0 0
  1. //From my Amnesia Rebirth Tutorial Series
  2. //Episode 41 Animations Pt.2! Cutscenes!
  3. //https://www.youtube.com/playlist?list=PL4KkjlmOwLwwMVqedCNpi6caUxhgyf8Qr
  4. //-----------------------------------------------------------
  5.  
  6. //Play a cutscene animation
  7. PlayerBody_PlayCutsceneAnimation("spooked_fall_back_permafail_ghoul_encounter", false, 0.3f, "OnEndOfAnim_DoorBreak", 1.f, 0.f, true, cLux_GetPlayer().GetCharacterBody().GetFeetPosition(), cLux_GetPlayer().GetCharacterBody().GetYaw(), false, false);
  8. //animationName (String)- the name of the animation.
  9. //loop (bool)- should the animation loop (true or false).
  10. //fadeInTime (float)- how long should the transition into the animation take.
  11. //callbackFunction (String)- name of the function that should be called when done.
  12. //animationPlaybackSpeed (float)- multiplier that increases how quickly an animation plays back.
  13. //animationStartTime (float)- the starting point of the animation (between 0 and 1).
  14. //global (bool)- whether or not the animation should be played relative to the global space.
  15. //position (cVector)- coordinates where the animation should be played. (cLux_GetPlayer().GetCharacterBody().GetFeetPosition() for player's current position)
  16. //angle (float)- the angle at which the animation should be played. (cLux_GetPlayer().GetCharacterBody().GetYaw() for player's current yaw)
  17. //fadeSpeed (bool)- fade away the speed of the animation.
  18. //ignoreAngle (bool)- ignore the angle of the player (or any specified yaw).
  19.  
  20. //Play cutscene animation at entity
  21. PlayerBody_PlayCutsceneAtEntity("spooked_fall_back_permafail_ghoul_encounter", "PosArea_DoorScare", false, 0.3, "OnEndOfAnim_DoorBreak", 1.0f, 0.f, 0.0f, 30.0f, true, false, false);
  22. //animationName (String)- the name of the animation.
  23. //entityName (String)- the name of an entity as it appears in the level editor.
  24. //loop (bool)- should the animation loop (true or false).
  25. //fadeInTime (float)- how long should the transition into the animation take.
  26. //callbackFunction (String)- name of the function that should be called when done.
  27. //animationPlaybackSpeed (float)- multiplier that increases how quickly an animation plays back.
  28. //animationStartTime (float)- the starting point of the animation (between 0 and 1).
  29. //offsetPosition (cVector)- the x, y and z offsets that will will be added/subtracted to the position of the entity.
  30. //offsetAngle (float)- the offset angle that will be added/subtracted to the yaw/angle of the entity (-360 to 360).
  31. //offsetLocally (bool)- should the offsets be applied based on the position and angle of the entity or should it be relative to the map (true = entity, false = map).
  32. //fadeSpeed (bool)- fade away the speed of the animation.
  33. //ignoreAngle (bool)- ignore the angle of the player (or any specified yaw).
  34.  
  35. //Example of the animation completed callback
  36. void OnEndOfAnim_DoorBreak(const tString &in asAnim){
  37.     cLux_AddDebugMessage("Animation Complete");
  38. }
  39.  
  40. //The max allowed angle at which the player can look up or down
  41. PlayerBody_SetCutsceneMaxPitch(200.f);
  42. //angle (float)- value between -360 and 360 that indicates an angle.
  43.  
  44. //The max allowed angle at which the player can look left or right
  45. PlayerBody_SetCutsceneMaxYaw(200.f);
  46. //angle (float)- value between -360 and 360 that indicates an angle.
  47.  
  48. //Resets the pitch and yaw to game defaults for cutscenes
  49. PlayerBody_ResetCutscenePitchYawLimits();
  50.  
  51. //Get the current max pitch that cutscenes are using
  52. PlayerBody_GetCutscenePitch();
  53.  
  54. //Get the current max pitch that cutscenes are using
  55. PlayerBody_GetCutsceneMaxYaw();
  56.  
  57. //Same as last episode
  58. PlayerBody_StopAnimation("spooked_fall_back_permafail_ghoul_encounter", 3.0f);
Advertisement
Add Comment
Please, Sign In to add comment