CutsceneManger 2.0 - Create and manage cutscenes in a clean and organised way


v2.0
GithubModel

Previous version:


Testing


Demo place

Info


What is CutsceneManager?

CutsceneManager is a module designed to make your cutscenes easier to make and more organised. It can:

  • Make your cutscene code look cleaner!
  • Organise your cutscene logic by a big amount.
    And so much more!

Why use CutsceneManager?

This module contains a lot of advanced methods which can be useful while creating cutscenes. It also has an uniq way to make a cutscene which makes it easy to customise to how you like to organise it.

What scenario can you use this?

  • Start/End cutscenes
  • Fighting scenes
  • Dialogs
  • Intros
  • To show something

How can i see what version im on?

If your 2.0 and over, you can see this by doing this:

What’s new?


:new: New features

  • CutsceneCustomisable is now called Editor
  • Cutscene is now called Scene
  • Tons of new method to make it easier to create cutscenes and making them more uniq
  • More signals added.
  • New demo place.
  • Module is completly revamped.
  • Types is much better.
  • Github page is open to check out the previous version.

:exclamation:Important changes!

  • The new version has renamed its create method to CreateScene and added a category argument!
  • CutsceneCustomisable is now called Editor
  • Cutscene is now called Scene

How to use it


Example script:

local CutsceneManager = require(script["CutsceneManager(2.0)"])

local scene = CutsceneManager:CreateScene("Topic", "Category", function(Editor : CutsceneManager.Editor, message : string)
	Editor:Start()
	Editor:LockCharacter()
	
	local camera = Editor:CreateCamera({
		Destination = CFrame.new(100, 100, 100),
		CameraType = "Tween"
	})
	
	camera:Play()
	camera.Completed:Wait()
	
	print(message)
	
	task.wait(2)
	
	Editor:Finalise()
	Editor:UnLockCharacter()
end)

scene.OnCutsceneEnded:Connect(function(result : CutsceneManager.Result)
	print(result)
end)

task.wait(5)

scene:Execute("This.. is CutsceneManager!")
Guide

To start of, we need to know what a Scene is and how we can use it in our cutscenes.
A Scene is the main cutscene handler which we can Execute, or just Close. The way you make one is by calling the method inside of CutsceneManager called CreateScene like this:

local scene = CutsceneManager:CreateScene()

This method takes in 3 arguments. the Topic, Category and Callback. The topic is what the cutscene shall be saved and used as, the category is where the cutscene shall be saved and the callback is where we create the main logic of a cutscne. the callback recives an Editor and a thing i like to call Custom arguments. This is arguments which has to be passed in when executed.

local scene = CutsceneManager:CreateScene("MyTopic", "MyCategory", function(Editor : CutsceneManager.Editor, message : string --[[Custom argument]])
	
end)

To execute the cutscene, all you have to do is to call the Execute method in the scene. There are 2 main ways to do this. You can ether do it like this:

local scene = CutsceneManager:CreateScene("MyTopic", "MyCategory", function(Editor : CutsceneManager.Editor, message : string --[[Custom argument]])
	
end)

scene:Execute("Hi")

Or like this:

local scene = CutsceneManager:CreateScene("MyTopic", "MyCategory", function(Editor : CutsceneManager.Editor, message : string --[[Custom argument]])
	
end):Execute("Hi")

For this guide, ill use the first example because its more flexeble then the other one. Now that we know how to execute it, we can learn how the Editor works.


The editor has some methods which can help you create your cutscenes a lot quicker. The main one you’ll be using is the CreateCamera. This creates a basic camera object which can be played or stopped. When you call the method you have to create a configuration table which consists of a few componets. There are 2 of them which has to be filled in. the other ones are optinal.

local scene = CutsceneManager:CreateScene("MyTopic", "MyCategory", function(Editor : CutsceneManager.Editor, message : string --[[Custom argument]])
	local camera = Editor:CreateCamera({
		Destination = CFrame.new(0, 100, 0),
		CameraType = "Tween"
	})
end)

scene:Execute("Hi")

The Camera has 2 methods, but we will be using the Play function to play the camera transition and a signal called completed which will fire off when it finishes the transition.

local scene = CutsceneManager:CreateScene("MyTopic", "MyCategory", function(Editor : CutsceneManager.Editor, message : string --[[Custom argument]])
	local camera = Editor:CreateCamera({
		Destination = CFrame.new(0, 100, 0),
		CameraType = "Tween"
	})
	
	camera:Play()
	camera.Completed:Wait()
end)

scene:Execute("Hi")

You need to know to create a basic cutscene is the Start and Finalize methods. These two is essential for switching the CameraType on the CurrentCamera to Scriptable and Custom. The finalize function has different feature from what the Start function has. It has a feature to have a transition at the end or not to switch from The cutsom camera to the normal player camera.

local scene = CutsceneManager:CreateScene("MyTopic", "MyCategory", function(Editor : CutsceneManager.Editor, message : string --[[Custom argument]])
	Editor:Start()
	
	local camera = Editor:CreateCamera({
		Destination = CFrame.new(0, 100, 0),
		CameraType = "Tween"
	})
	
	camera:Play()
	
	Editor:Finalise("Tween")
end)

scene:Execute("Hi")

Now the last thing you should know is how you can lock the player to the position. The way you can do this is by using the two methods called LockCharacter and UnLockCharacter. These we can implement like this:

local scene = CutsceneManager:CreateScene("MyTopic", "MyCategory", function(Editor : CutsceneManager.Editor, message : string --[[Custom argument]])
	Editor:Start()
	Editor:LockCharacter()
	
	local camera = Editor:CreateCamera({
		Destination = CFrame.new(0, 100, 0),
		CameraType = "Tween"
	})
	
	camera:Play()
	
	Editor:Finalise("Tween")
	Editor:UnLockCharacter()
end)

scene:Execute("Hi")

There is a lot of things i havent covered which the 2.0 got to offer, but it would get too long to read. If you want to know them, you can find them in the Documentation


Documentation

Every argument with a questionmark behind it, is an optinal arguemnt,
which means its not necessary to fill it in.


Methods


CutsceneManager

:CreateScene CutsceneManager

:CreateScene(topic, category, callback) -> (scene)

Creates a cutscene and stores it in the specified category as the specified topic.
The callback expects a Editor and cutstom arguments if needed.


:Eliminate CutsceneManager

:Eliminate(topic, category?) -> (none)

Closes the cutscene and removes it from CutsceneManager’s storage container.


:GetCutscene CutsceneManager

:GetCutscene(topic) -> (scene)

Gets a cutscene from the topic above.


:GetCutscenes CutsceneManager

:GetCutscenes() -> ( {[topic] : scene} )

Returns a dictionary of all the cutscenes saved in CutsceneManager.


:GetCutscenesFromCategory CutsceneManager

:GetCutscenesFromCategory(category) -> ( {[topic] : scene} )

Returns a dictionary of all the cutscenes in the specified
category.


:GetCutsceneFromCategory CutsceneManager

:GetCutsceneFromCategory(topic, category) -> (scene)

Gets the cutscene in the specified category.


:WaitForCutscene CutsceneManager

:WaitForCutscene(topic, category?, timeout?, checksPerSecond) -> (scene)

Waits to see if it can find the cutscene specified.


:GetRunningCutscene CutsceneManager

:GetRunningCutscene() -> (scene)

Returns the current running cutscene.


:Interrupt CutsceneManager

:Interrupt(topic) -> ( {[topic] : cutscene} )

Stops the cutscene attached to the topic specified.


Scene

:Execute Scene

:Execute(...) -> ()

Executes the cutscenes and gives the cutscene the arguments
given.


:Stop Scene

:Stop() -> ()

Stops the cutscene if its playing.


:Close Scene

:Close() -> ()

Closes the cutscene(this means that it cant get used again). It also removes
it from the storage container.


:IsClosed Scene

:IsClosed() -> (bool)

Checks if the cutscene is closed or not.


Editor

:CreateCamera Editor

:CreateCamera(cameraConfigurations) -> (Camera)

Creates a camera object with the specified camera configurations.
Here are all the configurations

local configurations : CutsceneManager.CameraConfigurations = {
	--// Required to fill in
	Destination = CFrame.new(0, 100, 0),
	CameraType = "Tween",
	
	--// Optinal to fill in
	Properties = {
		Duration = 5,
		RotateWithMove = false,
		EasingStyle = Enum.EasingStyle.Sine,
		EasingDirection = Enum.EasingDirection.In
	}
}

Learn about EasingStyle and EasingDirection here(click me)


:LockCharacter Editor

:LockCharacter() -> ()

Anchored the player to the ground.


:UnLockCharacter Editor

:UnLockCharacter() -> ()

UnAnchored the player.


:Start Editor

:Start() -> ()

Makes the camera able to be modified.


:Finalise Editor

:Finalise(cameraType, properties) -> ()

Finishes the cutscene and makes the camera not able to be modified


Camera

:Play Camera

:Play(cameraType, properties) -> ()

Plays the camera and applies the properties.


:Stop Camera

:Stop(cameraType, properties) -> ()

Stops the camera from completing.


Signals


Scene

.Stopped:Connect() Scene

.Stopped:Connect(function()
	
end)

Fires when the cutscene is being stopped.


.Closing:Connect() Scene

.Closing:Connect(function()
	
end)

Fires when the cutscene is closing.


.OnCutsceneEnded:Connect() Scene

.OnCutsceneEnded:Connect(function(result)
	
end)

Fires when the cutscene ends and returns a result.


Camera

.Completed:Connect() Camera

.Completed:Connect(function()
	
end

Fires when the camera completes.


3 Likes