Cuberite Forum
What program do you use to write Lua? - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Plugins (https://forum.cuberite.org/forum-1.html)
+--- Forum: Plugin Discussion (https://forum.cuberite.org/forum-8.html)
+--- Thread: What program do you use to write Lua? (/thread-1677.html)



What program do you use to write Lua? - bittiez - 12-14-2014

I'm new to Lua and mcsever so I'm wondering what you guys use to write Lua, is there any ide that can use the docs to make plugin writing easier?


RE: What program do you use to write Lua? - xoft - 12-14-2014

Hello, welcome to the forum.

I personally use ZeroBraneStudio; I've also written a guide on how to set it up so that you can debug plugins directly in the server, and so that ZBS provides MCServer-specific code-completion. You can find it in the online Lua API reference:
http://mc-server.xoft.cz/LuaAPI/
Specifically the article: http://mc-server.xoft.cz/LuaAPI/SettingUpZeroBrane.html

I've used Decoda in the past, there's also an article on setting that up. However, I've found that ZeroBraneStudio is better for my style of programming. Additionally, it's also multi-platform.
Note: ZBS is free; but it will ask you for donation once, when you click the Download button on their webpage. It won't nag you anymore and it is full featured even without payment.


RE: What program do you use to write Lua? - tonibm19 - 12-15-2014

I use decoda, quite simple and powerful.


RE: What program do you use to write Lua? - bittiez - 12-15-2014

Okay so I started using ZeroBane, everything seems pretty good except when typing out functions it doesn't tell me what parameters are required, is this normal?


RE: What program do you use to write Lua? - xoft - 12-15-2014

Yes, that's normal, because in Lua the parameters are somewhat "fuzzy". There's no such thing as parameter types, a function can check what type of parameter it received and behave completely different on various types. Also the number of params is arbitrary in the core Lua language - if a function wants more params than it received, Lua will fill the "missing" parameters with nil values. And if you pass more values than a function expects, they will get silently discarded.

That said, most functions in MCServer interface are pretty strict about their parameters, so you should consult the API docs closely. Most of the time you'll get a warning at runtime if you try to pass the wrong parameter type.

If you followed the article on setting up ZBS, you should have a basic code completion. For me it works about 50% of the time, listing the function parameters; the other 50% it's completely silent. Better than nothing Smile


RE: What program do you use to write Lua? - bittiez - 12-15-2014

Haha better than nothing, I agree, well thanks!