Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //From my Amnesia Rebirth Tutorial Series
- //Episode 40 Animations Pt.1! Player Body!
- //https://www.youtube.com/playlist?list=PL4KkjlmOwLwwMVqedCNpi6caUxhgyf8Qr
- //-----------------------------------------------------------
- //Change the playerbody to a different one
- PlayerBody_SetModel("player6");
- //playerBodyName (String)- Name of player body entity file. You may need to put .ent at the end of the name for custom entities.
- //Play an animation on the players body (only first 5 variables required)
- PlayerBody_PlayAnimation("dragged_by_ghoul",ePlayerBodyAnimationLayer_FullBody,false,false,false);
- //animationName (String)- the name of the animation.
- //animationLayer (ePlayerBodyAnimationLayer)- the player body layer that the animation should be played on (ePlayerBodyAnimationLayer_ to see all options).
- //loop (bool)- should the animation loop (true or false).
- //idle (bool)- unknown, devs never toggle this to be true. No description or source code available. Use false.
- //returnToIdleAfterAnim (bool)- after the animation finishes playing return the players animation to idle (true or false).
- //fadeInTime (float)- how long should the transition into the animation take.
- //animationPlaybackSpeed (float)- multiplier that increases how quickly an animation plays back.
- //animationStartTime (float)- the starting point of the animation. (Ex. 1.0f would start the animation at the 1 second mark of the animation)
- //fadeWeights (bool)- unknown, devs never set this to be false. No description or source code available. Use true.
- //Stop a currently playing animation
- PlayerBody_StopAnimation("dragged_by_ghoul", 5);
- //animationName (String)- the name of the animation.
- //fadeOutTime (float)- how long should it take for the animation to stop completely.
- //Play animation on top of a currently playing one instead of replacing it
- PlayerBody_PlayAdditativeAnimation("player_rarm_protect_from_storm_start", false, 1.0f, 1.0f,0.0f);
- //animationName (String)- the name of the animation.
- //loop (bool)- should the animation loop (true or false).
- //fadeInTime (float)- how long should the transition into the animation take.
- //animationPlaybackSpeed (float)- multiplier that increases how quickly an animation plays back.
- //animationStartTime (float)- the starting point of the animation. (Ex. 1.0f would start the animation at the 1 second mark of the animation)
- ///////////////////////////////////////////////////
- // All code written
- //////////////////////////////////////////////////
- //Version 1
- bool OnCollide_Player_TriggerFaceCover(const tString &in asParent, const tString &in asChild, int alState)
- {
- if(alState == 1){
- PlayerBody_PlayAnimation("player_rarm_protect_from_storm_start",ePlayerBodyAnimationLayer_RightArm,false,false,false);
- return true;
- }else{
- PlayerBody_StopAnimation("player_rarm_protect_from_storm_start", 1.0f);
- PlayerBody_PlayAnimation("idle_stand_rarm",ePlayerBodyAnimationLayer_RightArm,false,false,false);
- return true;
- }
- }
- //Version 2
- bool OnCollide_Player_TriggerFaceCover(const tString &in asParent, const tString &in asChild, int alState)
- {
- if(alState == 1){
- PlayerBody_PlayAnimation("player_rarm_protect_from_storm_start",ePlayerBodyAnimationLayer_RightArm,false,false,false);
- return true;
- }else{
- PlayerBody_PlayAnimation("player_rarm_protect_from_storm_end",ePlayerBodyAnimationLayer_RightArm,false,false,true);
- return true;
- }
- }
- //Version 3
- bool OnCollide_Player_TriggerFaceCover(const tString &in asParent, const tString &in asChild, int alState)
- {
- if(alState == 1){
- PlayerBody_PlayAnimation("player_rarm_protect_from_storm_start",ePlayerBodyAnimationLayer_RightArm,false,false,false);
- PlayerBody_PlayAdditativeAnimation("crouch_idle", true, 1.0f, 1.0f, 0.0f);
- return true;
- }else{
- PlayerBody_PlayAnimation("player_rarm_protect_from_storm_end",ePlayerBodyAnimationLayer_RightArm,false,false,true);
- PlayerBody_StopAnimation("crouch_idle", 1.0f);
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement