CutsceneManager: version 1.0
#resources:community-resources
Roblox model
CutsceneManager is an easy and organized way to store and create cutscene! this can also allow for outside features to be played in the cutscene like: Dialog, animations etc…
Demo place:
local CutsceneManager = require(script.CutsceneManager)
local cutscene = CutsceneManager:Create("MyCutscene", function(CutsceneCustomizable)
CutsceneCustomizable:Start()
local camera = CutsceneCustomizable:CreateCamera({Cframe = CFrame.new(0, 100, 0), CameraType = "Fade"})
camera:Play()
camera.Completed:Wait()
CutsceneCustomizable:Finalize()
end)
cutscene:Execute()
cutscene.OnCutsceneEnded:Connect(function(result: CutsceneManager.Result)
print(result)
end)
Why use CutsceneManager?
There are reasons to use CutsceneManager, but here is 3 of them:
-
Organization: With this module, you can easily organize all your
cutscenes in many different ways. -
Features: It has a lot of features which can help you improve your
cutscenes by alot and make it easier to create them. -
Openness: Because of the design of the module, you have a lot of
openness to really make your cutscenes stand out from all the others.
What is new about the new module?
-
name argument changed to topic.
-
func argument changed to callback.
-
Eliminate functions can now have a fade end.
-
2 new functions to get cutscenes from the mudule
(aka, it stores all the cutscens created in the module). -
Cutscenes do now have a status properti which can range from
NotPlaying to Playing. -
Cutscens also has a new event called OnCutsceneEnded which
gets fired when the cutscene ended and returns an arugment called result
which can ether be SUCCESS or FAILED. -
Cutscenes got a new function called Start which makes the camera able
to be scripted. -
Arguments to create a camera has been abbreviated to a single table.
-
Finalize can now also have a fade effect to it.
-
Function descriptions has now been redone.
-
Module is now better type annotated!
Guides
To start of creating a cutscene, you have to use the CutsceneManager:Create(topic, callback)
which will create the cutscene.
The topic argument is the name of the cutscene, while the callback is the function
that the cutscene is going to run in. this callback gets returned an argument called CutsceneCustomizable, which has the functions to create the cutscene.
First you need to start the cutscene using the CutsceneCustomizable:Start
CutsceneManager:Create("MyCutscene", function(CutsceneCustomizable)
CutsceneCustomizable:Start()
end)
then to create a camera you can use the CutsceneCustomizable:CreateCamera
which
takes in a table with:
Cframe = CFrame,
CameraType = CameraType,
-- this table is optional
Properties = {
EasingStyle = Enum.EasingStyle?,
EasingDirection = Enum.EasingDirection?,
Length = number?
}
And of course we to end the cutscene, we have to use CutsceneCustomizable:Finalize
Every thing which returns a object can you make a table infront of. With this
our script will look like this:
local cutscene = CutsceneManager:Create("MyCutscene", function(CutsceneCustomizable)
CutsceneCustomizable:Start()
local camera = CutsceneCustomizable:CreateCamera({Cframe = CFrame.new(0, 100, 0), CameraType = "Fade"})
CutsceneCustomizable:Finalize({}) -- if you want to create a fade, you have to put a table with params(or just leave it blank for defult setting like i do right here)
end)
To execute the cutscene, you have to do Cutscene:Execute
The camera option also include 2 other thing:
Camera:Play() -- Plays the camera animation
Camera.Completed -- Fires when the cutscene is completed
If you want to know when the cutscene finished, you can use the Event:
Cutscene.OnCutsceneEnded -- Fires when the cutscene ended with a value of ether "SUCCESS" or "FAILED"
Functions
CutsceneManager
- CutsceneManager:Create(topic, callback):
Creates a new
Cutscene
object inside the specified topic with optinal arguments
which can be executed using
theCutscene:Execute
.It has a lot of configurations inside of the
CutsceneCustomizable
object.
- CutsceneManager:Eliminate(topic, fade):
Eliminates the specified cutscene.
It will also fire the
One tip where you can use this: For a cutscene skipping mechanicOnCutsceneEnded
event with the resultFAILED
.
- CutsceneManager:GetCutscenes():
Returns a list of all the cutscenes made in this place
- CutsceneManager:GetCutscene();
Returns the cutscene with the specified topic
Cutscene
- Cutscene:Execute(…):
Executes the cutscene which makes the
callback
run with optinal agruments
CutsceneCustomizable
- CutsceneCustomizable:Start():
Starts the cutscene by changing the camera mode to scriptable
- CutsceneCustomisable:CreateCamera(customize):
Creates a camera which can be ether
Tweened
,Faded
orMoved instantly
It requres a table with atleast the
Cframe
and theCameraType
- CutsceneCustomizable:Finalize(fade)
Finishes the cutscene and fires the
OnCutsceneEnded
event
to notify the end of the cutscene.If the cutscene was successful, it will fire with the result
SUCCESS
, else if it was unsuccessful, it will fire with the resultFAILED
.
Camera
- Camera:Play()
Plays the set camera animation on the camera to the specific cframe assigned
If any bugs/requested features, please leave them down in the replies section!