Narrator

API Reference of Narrator

Narrator

To use Narrator, you'll need to create a bootstrapper to set up Narrator.

A basic bootstrapper would look like this:

local Narrator = require(game:GetService("ReplicatedStorage").Narrator)

Narrator.Narrate({})

Narrator.Narrate(acts: {Act})

Narrate accepts an array of Act which will be discussed later on. The position of the Act in the array passed to Narrate is important as it is the arrangement of the Act.

Narrator:WaitForAct(name: string)

Waits for an Act to start. Giving invalid Act names will result in infinite yield.

Narrator.ActStarted

A signal which will fire when an Act is started. The Act will be passed.

Narrator.ActEnded

A signal which will fire when an Act is ended. The Act will be passed.

Act

Act is the core component of Narrator. Act is where your individual in-game event should be kept. Act should be kept in individual modules.

A simple Act should look like this:

local Act = {

    Name = "ExampleAct"

}

function Act:Start(Proceed, Trove)
    

end

function Act:End()
    
        
end

Name is required. It is basically a string representing the name of the Act. Custom properties or methods can be also added to it.

Using Act lifecycle

Act has two lifecycle methods: Start and End

1.Start is a method that will be called when an Act is started that accepts two arguments which are: Proceed, Trove

Proceed is a function that needs to be called in order to proceed to the next Act. You can also pass some values to it which will be passed to the next Start method.

Trove is a cleanup object. Clean will be called when Proceed is called. Check the docs of Trove here: https://sleitnick.github.io/RbxUtil/api/Trove

2.End is a method that will be called when Proceed is called.

It is a method for cleaning up things or preparing things for the next Act.

FUTURE UPDATES WILL BE COMING TO THE DOCS SOON!

Last updated