Hello gamers, this is the first devlog for blok
a new visual scripting plugin for Roblox. You might be thinking:
Well you’re right. Here are a few reason why I’m still making it and why you should use it (there a bit mixed-up):
- I like writing code so why not make something?
- This project will be fully open-source on Github & free forever.
- Built with things I want to learn or grow in.
I started off creating a new Rojo project (bare in mind I’m quite new to Rojo and all the other formatting, linting, autocompleting and package managing tools). Then I got into thinking what things I needed to make it. In the end I chose Fusion and Janitor (I probs will need more later).
The start of the “Backend”
First I started with writing the blocks file. It holds all the info for the blocks and it also has a thing called type
which follows the Scratch docs (reporter
, c
, hat
, stack
, cap
and boolean
are the types a block can have).
Then I started writing the code generator. This is the bit that parses the BlockTree (as I’m calling it). Btw this is what a BlockTree looks like:
BlockTree
{
{
type = "onstart",
inputs = {
{
type = "print",
inputs = {
{
type = "join",
inputs = {
{
type = "string",
inputs = {
"Hello, ",
},
},
{
type = "string",
inputs = {
"world!",
},
},
},
},
},
},
{
type = "ifthen",
inputs = {
{
type = "equal",
inputs = {
{
type = "string",
inputs = {
"abc",
},
},
{
type = "string",
inputs = {
"def",
},
},
},
},
{
type = "print",
inputs = {
{
type = "string",
inputs = {
"What!?",
},
},
},
},
},
},
},
},
}
What the code generator should do is turn the above BlockTree into these few lines:
-- @generated by blok. This is not intended for manual editing.
local function start()
print('Hello, ' .. 'world!')
if ('abc' == 'def') then
print('What!?')
end
end
start()
that’s not formatted right …
15 minutes later
-- @generated by blok. This is not intended for manual editing.
local function start()
print('Hello, ' .. 'world!')
if ('abc' == 'def') then
print('What!?')
end
end
start()
Better .
Here is a list of things that still need to be done:
- Clean up the Blocks file; add categories.
- Write the BlockTree generator.
- Upload to Github and add a TODO project for it.
- Frontend .
Anyway, if you have any ideas or think I could be doing something differently let me know below.
Thanks for reading,
Almost89