Can´t import custom block into blockly (lua)

507 views
Skip to first unread message

Arthur G.

unread,
Jan 12, 2017, 8:18:15 AM1/12/17
to Blockly
Hello guys, 

I´m having some issues with the custom block section from blockly. I have already read the custom blocks guide, however i only achieved success on creating custom blocks that generate javascript, it seems that i´m missing something to create new blocks with lua generators. 

I have followed these steps:
  • Created block definition and added it to roblox.js on /blocks folder. 
  • Created block code and added it to roblox.js on /generator/lua. 
  • Added <script src="../../roblox.js"></script> at the main page.
  • and finally, added the <block type="rb_create_new_part"></blocks> on the toolbox. 

After all that, i always get an empty black block on my index.html, i retraced my steps and could not found any errors yet. So i´m trying to create lua blocks to generate scripts for Roblox! I just need to define a few blocks and then i will test it on the Roblox Studio. 

Could you guys give me a light? I´m going to retrace my steps agains generating javascript blocks to see one more time if i´m skipping something, but some advice would be great! My code is uploaded at this publi link on dropbox, just click here to download. In the /demos folder there is a index_lua_v2, that is the one file i´m having problems with.


Rachel Fenichel

unread,
Jan 12, 2017, 1:56:57 PM1/12/17
to Blockly
Hi Arthur,

First off, thanks for the full debug info!

If you're seeing an empty black block on your index.html that usually means that the block definition is not being imported, rather than that the block generator is missing.  In this case it looks like you're putting the block definition and generator info in two different files, but only importing one roblox.js file:
  • Added <script src="../../roblox.js"></script> at the main page.
Make sure you're importing both files.  As an example, the playground imports the blocks in blocks/logic.js and also the generators for logic blocks in each language (dart, python, etc.).

Rachel
Reply all
Reply to author
Forward
0 new messages