Advertisement
TechOFreak

Episode 40 Functions

Apr 26th, 2021
721
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.15 KB | None | 0 0
  1. //From my Amnesia Rebirth Tutorial Series
  2. //Episode 40 Animations Pt.1! Player Body!
  3. //https://www.youtube.com/playlist?list=PL4KkjlmOwLwwMVqedCNpi6caUxhgyf8Qr
  4. //-----------------------------------------------------------
  5.  
  6. //Change the playerbody to a different one
  7. PlayerBody_SetModel("player6");
  8. //playerBodyName (String)- Name of player body entity file. You may need to put .ent at the end of the name for custom entities.
  9.  
  10. //Play an animation on the players body (only first 5 variables required)
  11. PlayerBody_PlayAnimation("dragged_by_ghoul",ePlayerBodyAnimationLayer_FullBody,false,false,false);
  12. //animationName (String)- the name of the animation.
  13. //animationLayer (ePlayerBodyAnimationLayer)- the player body layer that the animation should be played on (ePlayerBodyAnimationLayer_ to see all options).
  14. //loop (bool)- should the animation loop (true or false).
  15. //idle (bool)- unknown, devs never toggle this to be true. No description or source code available. Use false.
  16. //returnToIdleAfterAnim (bool)- after the animation finishes playing return the players animation to idle (true or false).
  17. //fadeInTime (float)- how long should the transition into the animation take.
  18. //animationPlaybackSpeed (float)- multiplier that increases how quickly an animation plays back.
  19. //animationStartTime (float)- the starting point of the animation. (Ex. 1.0f would start the animation at the 1 second mark of the animation)
  20. //fadeWeights (bool)- unknown, devs never set this to be false. No description or source code available. Use true.
  21.  
  22. //Stop a currently playing animation
  23. PlayerBody_StopAnimation("dragged_by_ghoul", 5);
  24. //animationName (String)- the name of the animation.
  25. //fadeOutTime (float)- how long should it take for the animation to stop completely.
  26.  
  27. //Play animation on top of a currently playing one instead of replacing it
  28. PlayerBody_PlayAdditativeAnimation("player_rarm_protect_from_storm_start", false, 1.0f, 1.0f,0.0f);
  29. //animationName (String)- the name of the animation.
  30. //loop (bool)- should the animation loop (true or false).
  31. //fadeInTime (float)- how long should the transition into the animation take.
  32. //animationPlaybackSpeed (float)- multiplier that increases how quickly an animation plays back.
  33. //animationStartTime (float)- the starting point of the animation. (Ex. 1.0f would start the animation at the 1 second mark of the animation)
  34.  
  35. ///////////////////////////////////////////////////
  36. // All code written
  37. //////////////////////////////////////////////////
  38.  
  39. //Version 1
  40. bool OnCollide_Player_TriggerFaceCover(const tString &in asParent, const tString &in asChild, int alState)
  41.     {
  42.         if(alState == 1){
  43.             PlayerBody_PlayAnimation("player_rarm_protect_from_storm_start",ePlayerBodyAnimationLayer_RightArm,false,false,false);
  44.             return true;
  45.         }else{
  46.             PlayerBody_StopAnimation("player_rarm_protect_from_storm_start", 1.0f);
  47.             PlayerBody_PlayAnimation("idle_stand_rarm",ePlayerBodyAnimationLayer_RightArm,false,false,false);
  48.             return true;
  49.         }
  50.     }
  51.    
  52. //Version 2
  53. bool OnCollide_Player_TriggerFaceCover(const tString &in asParent, const tString &in asChild, int alState)
  54.     {
  55.         if(alState == 1){
  56.             PlayerBody_PlayAnimation("player_rarm_protect_from_storm_start",ePlayerBodyAnimationLayer_RightArm,false,false,false);
  57.             return true;
  58.         }else{
  59.             PlayerBody_PlayAnimation("player_rarm_protect_from_storm_end",ePlayerBodyAnimationLayer_RightArm,false,false,true);
  60.             return true;
  61.         }
  62.     }
  63.  
  64. //Version 3
  65. bool OnCollide_Player_TriggerFaceCover(const tString &in asParent, const tString &in asChild, int alState)
  66.     {
  67.         if(alState == 1){
  68.             PlayerBody_PlayAnimation("player_rarm_protect_from_storm_start",ePlayerBodyAnimationLayer_RightArm,false,false,false);
  69.             PlayerBody_PlayAdditativeAnimation("crouch_idle", true, 1.0f, 1.0f, 0.0f);
  70.             return true;
  71.         }else{
  72.             PlayerBody_PlayAnimation("player_rarm_protect_from_storm_end",ePlayerBodyAnimationLayer_RightArm,false,false,true);
  73.             PlayerBody_StopAnimation("crouch_idle", 1.0f);
  74.             return true;
  75.         }
  76.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement