Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //From my Amnesia Rebirth Tutorial Series
- //Episode 41 Animations Pt.2! Cutscenes!
- //https://www.youtube.com/playlist?list=PL4KkjlmOwLwwMVqedCNpi6caUxhgyf8Qr
- //-----------------------------------------------------------
- //Play a cutscene animation
- 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);
- //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.
- //callbackFunction (String)- name of the function that should be called when done.
- //animationPlaybackSpeed (float)- multiplier that increases how quickly an animation plays back.
- //animationStartTime (float)- the starting point of the animation (between 0 and 1).
- //global (bool)- whether or not the animation should be played relative to the global space.
- //position (cVector)- coordinates where the animation should be played. (cLux_GetPlayer().GetCharacterBody().GetFeetPosition() for player's current position)
- //angle (float)- the angle at which the animation should be played. (cLux_GetPlayer().GetCharacterBody().GetYaw() for player's current yaw)
- //fadeSpeed (bool)- fade away the speed of the animation.
- //ignoreAngle (bool)- ignore the angle of the player (or any specified yaw).
- //Play cutscene animation at entity
- 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);
- //animationName (String)- the name of the animation.
- //entityName (String)- the name of an entity as it appears in the level editor.
- //loop (bool)- should the animation loop (true or false).
- //fadeInTime (float)- how long should the transition into the animation take.
- //callbackFunction (String)- name of the function that should be called when done.
- //animationPlaybackSpeed (float)- multiplier that increases how quickly an animation plays back.
- //animationStartTime (float)- the starting point of the animation (between 0 and 1).
- //offsetPosition (cVector)- the x, y and z offsets that will will be added/subtracted to the position of the entity.
- //offsetAngle (float)- the offset angle that will be added/subtracted to the yaw/angle of the entity (-360 to 360).
- //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).
- //fadeSpeed (bool)- fade away the speed of the animation.
- //ignoreAngle (bool)- ignore the angle of the player (or any specified yaw).
- //Example of the animation completed callback
- void OnEndOfAnim_DoorBreak(const tString &in asAnim){
- cLux_AddDebugMessage("Animation Complete");
- }
- //The max allowed angle at which the player can look up or down
- PlayerBody_SetCutsceneMaxPitch(200.f);
- //angle (float)- value between -360 and 360 that indicates an angle.
- //The max allowed angle at which the player can look left or right
- PlayerBody_SetCutsceneMaxYaw(200.f);
- //angle (float)- value between -360 and 360 that indicates an angle.
- //Resets the pitch and yaw to game defaults for cutscenes
- PlayerBody_ResetCutscenePitchYawLimits();
- //Get the current max pitch that cutscenes are using
- PlayerBody_GetCutscenePitch();
- //Get the current max pitch that cutscenes are using
- PlayerBody_GetCutsceneMaxYaw();
- //Same as last episode
- PlayerBody_StopAnimation("spooked_fall_back_permafail_ghoul_encounter", 3.0f);
Advertisement
Add Comment
Please, Sign In to add comment