Hello. I created a Framework that I personally use. The link for downloading/viewing this framework will be here!
Rojo: https://rojo.space/docs/
VS Code Extensions (Optional):
Material-Icons
vscode-rbxlua
First and foremost, this framework is HEAVILY inspired by AeroGameFramework. I highly suggest you check out AeroGameFramework.
Shared Modules (Authors):
Promise: evaera
Maid: Quenty
Signal: sleitnick (Stephen Leitnick): (Based off Anaminus’s Signal Class)
FastWait: CloneTrooper1019
TweenModule: Me
UnGex: Me
ProfileService: ProfileService
Here are some of them explained in rdc 2020: 5 Powerful Code Patterns Behind Roblox Games with Quenty, AxisAngle, IntegerUnderflow,and Badcc(RDC) - YouTube
I do not take credit for any modules that are not made by me. I’ve only modified maid a tiny bit to work on promises, but other than that I’ve barely changed them.
Why CEngine?
CEngine allows anyone to change how CEngine runs. CEngine also allows functions to be removed, added, or changed.
This framework is best used in Visual Studio Code, however you could use this framework in Roblox Studio if you add all of them in this order:
How to Setup Framework (Visual Studio Code Version):
- Go to the github link provided in the top, and also Install the rojo extension in vs Code
- Click on “Code”, then click on “Download Zip”
- After you’ve downloaded the file, extract to a location (Documents is a preferred place of storage)
- Open up Visual Studio Code, and Roblox Studio.
- Get the roblox rojo plugin, and start rojo in vs Code with the current project file
- Open the roblox rojo plugin, click connect, and you’re synced!
How to Setup Framework(Roblox Studio Version)
- Open the github link provided above, and open roblox studio.
- Create a Folder for each corresponding folder in the repo
- Add all run modules into run folder in ReplicatedStorage
- Add All Shared Modules into Shared (Don’t need to add any Modules that are in server or client)
- on Github, go to the very bottom of src/run/server and src/run/client and follow the steps below.
- create/add 2 new Folders called “Remotes” and Storage and place them both in ReplicatedStorage
- and You’re all set!
Notes While Using Framework in vs Code:
Don’t touch Storage OR Remotes while using vs Code. Don’t try to change the name of Storage or Remotes, as it will break the code unless you modify it.
Functions in CEngine/What they do.
all Services, Controllers, Classes, Util, and Shared Modules have access to functions in CEngine, so while defining the said Module, you can access functions such as :RegisterFunction().
:Start() and :Init() are only run on RunTime if that said module is a Controller or a Service. However, :Start() and :Init() could be put in as functions for modules, classes, shared, etc. It’s just that it will not run on runtime.
:Start() and :Init() work pretty similarly to AeroGameFramework, however there are some differences.
the Init function is only used to register functions or events, or to define values early. This is run before Start.
the Start function will run anything that is put inside of it. You’ll probably know what I mean by that. It’s pretty hard to give a unvague description of start, seeing that it is so easy to put the pieces together on what it does.
“RegisterFunction” has only 1 argument (Which IS a string), and if not defined, then it will by default look for functions in Module.Client if RegisterFunction is being run on the server, or Module.Server if RegisterFunction is being run on the client. This means that RegisterFunction can be used from both server AND client-side. If it’s on the client, since it cannot create events or functions, it relies on the server’s input to move those said remote on ReplicatedStorage, making it accessible to the client.
ConnectEvent can also be used for both client and server, and it has two arguments. The first argument is a string, and the second is a function. This function will most likely error if it is not created by :RegisterEvent().
RegisterEvent is a function with 1 argument. This function will create a new RemoteEvent place it in Remotes. The one argument in this function is a string, which will be the name of that said RemoteEvent.
Fire (Technically FireServer), FireClient, and FireAllClients. The Fire (Server) function has 1 argument, and a seemingly infinite capacity of parameters. (…) Fire Server basically runs the parameters into arguments into running the event. This can be run on the client. FireClient is the same thing, except the (…) argument is the third argument, after the second argument which is the player. This can be run on the server. FireAllClients is the Same thing as FireClient, but it runs on all Clients.
vsCode Extra Information:
Please DO NOT remove StorageHolder and RemoteHolder. Do not touch these in vs code.
if you ever want to add a new script to vsCode, all you do is this:
After which, simply rename said file to “anything you want”.lua.
Finally, The Yield function is a short for Promise.new().
Remember, Controllers and Services is the go to place to run methods.
Here is an example of the Framework being used in vs Code.
One last thing, here is my user snippet for vs Code.
{
"Controller": {
"prefix": "controller",
"body": [
"local ${0:$TM_FILENAME_BASE} = {}",
"",
"function ${0:$TM_FILENAME_BASE}:Start()",
"",
"",
"end",
"",
"",
"function ${0:$TM_FILENAME_BASE}:Init()",
"",
"end",
"",
"return ${0:$TM_FILENAME_BASE}"
],
"description": "Controller"
},
"Class": {
"prefix": "class",
"body": [
"local ${0:$TM_FILENAME_BASE} = {}",
"${0:$TM_FILENAME_BASE}.__index = ${0:$TM_FILENAME_BASE}",
"",
"function ${0:$TM_FILENAME_BASE}.new()",
"local self = setmetatable({",
" ",
"}, ${0:$TM_FILENAME_BASE})",
"",
" return self",
"end",
"",
"function ${0:$TM_FILENAME_BASE}:Destroy()",
"",
"",
"end",
"",
"return ${0:$TM_FILENAME_BASE}"
],
"description": "Class"
},
"Service": {
"prefix": "service",
"body": [
"local ${0:$TM_FILENAME_BASE} = {}",
"",
"function ${0:$TM_FILENAME_BASE}:Start()",
"",
"end",
"",
"function ${0:$TM_FILENAME_BASE}:Init()",
"",
"",
"end",
"",
"return ${0:$TM_FILENAME_BASE}"
],
"description": "Service"
},
"module": {
"prefix": "module",
"body": [
"local ${0:$TM_FILENAME_BASE} = {}",
"",
"return ${0:$TM_FILENAME_BASE}"
],
"description": "module"
},
"Create Server Event": {
"prefix": "event server",
"body": [
"self:ConnectEvent(nil, function(player, ...)",
"",
"",
"end)"
],
"description": "Create Framework Event"
},
"Create Client Event": {
"prefix": "event client",
"body": [
"self:ConnectClientEvent(nil, function(player, ...)",
"",
"",
"end)"
],
"description": "Create Framework Event"
},
"Create promise": {
"prefix": "promise",
"body": [
" local promise = self.Shared.Promise.new(function(resolve, reject, onCancel)",
"",
"",
"end)"
],
"description": "Create promise"
},
"Create signal": {
"prefix": "signal",
"body": [
"local signal = self.Shared.Signal.new();",
"",
"local connection = signal:Connect(function(arg)",
"",
"",
"end)"
],
"description": "Create signal"
},
"Tween": {
"prefix": "tween",
"body": [
"local ti = TweenInfo.new();",
"local Instance",
"local Properties = {",
"",
"}",
"",
"local Tween = self.Shared.TweenModule.GetTween(ti, Instance, Properties)",
"",
"Tween:Start()",
""
],
"description": "Create tween"
},
"Add In Fast Wait": {
"prefix": "wait",
"body": [
"self.Shared.FastWait.Wait()"
],
"description": "Add In Fast Wait"
},
"in pairs loop": {
"prefix": "pairs",
"body": [
"for i, v in pairs() do",
"",
"",
"end"
],
"description": "in pairs loop"
}
}