Working & wonderfull Mintest IDE, based on ZeroBrane Studio

Post Reply
wintermute
Member
Posts: 13
Joined: Wed Jun 24, 2015 18:44
IRC: freeemint_
In-game: aulin

Working & wonderfull Mintest IDE, based on ZeroBrane Studio

by wintermute » Post

Dear Minetest-Community,

I am happy to announce that, the thing nobody waited for and one may actually use and like is ready.
We can hope that this lowers the burden of developing mods and brings fun in to programing.
Minetest lives and dies with its Mods, for Minetest to survive and to strive for better content, one thing is inevitable a environment which produces code. While in the past one may wrote his Mods in notepad.exe or notepad+, Vim or Emacs. We can now strive for unity, one experience across Mac, Linux and Windows. The ZeroBrane Studio IDE, a lightweight, easy-to-learn, highly-customizable piece of Free Software allows for this.

It provides not only keyword highlighting of LUA words, but an excellent autocompletion enriched with the wisest comments from celeron55 and the community.
It unites in a heroic afford the dev.minetest wiki and the Minetest Lua Modding API Reference. This was possible due ZeroBrane Studio is highly modable and has many parts written in Lua.

wintermute

Examples
Try to type these examples:

Code: Select all

minetest.get_worldpath():lower():reverse():upper():len()

Code: Select all

minetest.get_meta(minetest.get_player_by_name("wintermute"):get_look_dir():multiply({x = 2, y = -3, z = 4}):get_inventory():get_width()
Installation
  1. visit the Download Site http://studio.zerobrane.com/download?not-this-time, download and install the fitting version
  2. Download the attached Zip, and extract it in the ZeroBraine Studio root directory (Linux: /opt/zbstudio).
  3. (optional) go in to interpreters and change (line 18) the command line option to run Minetest on your OS. This allows you to start Minetest from inside the IDE. The current configuration assumes global installation on Linux.
Usage
ZeroBrane provides different ¸Interpreters, , each with its own auto completion and different syntax highlighting. My afford went into an creation of an (nearly complete) api reference which is embedded ZeroBrane. Each function has specified parameters with helpful additions and descriptions what it does and additional comments on the return values.
The default value for the interpreter is a plain lua, when you installed my files correctly and restart ZeroBrane, then an additional interpreter appears under Project -> Lua Interpreter. When you select minetest, then you have full access to the auto-completion and comments, if you made the optional configuration or use an Linux with a global installation of Minetest, you can also test your mods by pressing the green fast-forward-like button.

Disclaimer
The information used for auto-completion were written by me, mistakes are not only possible, but highly probable. I have no problem with including fixes from other persons. Based on the feedback of the people and the necessity for improvements, i will decide whether to spend time improving the comment texts, the descriptions of return values and the arguments or move my attention to bigger projects.

License
The informations contained are partly inspired, partly part of the following resources:
  • lua-users.org/ - License unknown
  • dev.minetest.net - Creative Commons Attribution Share Alike
  • lua_api.txt.md - celeron55 and others
Project Status
left to be decided,
initial version 1.0 was released on 27th of July 2015
Staff
wintermute
edit1: changed topic name since mine is not the first.
edit2: Described usage
Attachments
MinetestIDEvers1(dot)0.zip
version 1.0 contains necessary files + a README which is essentially the forum post
(17.41 KiB) Downloaded 263 times
Last edited by wintermute on Tue Jul 28, 2015 18:10, edited 1 time in total.

est31
Developer
Posts: 173
Joined: Mon Dec 29, 2014 01:49

Re: Working & wonderfull Mintest IDE, based on ZeroBrane Stu

by est31 » Post

Very nice!

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: Working & wonderfull Mintest IDE, based on ZeroBrane Stu

by 4aiman » Post

Nice, indeed.
But... how it's different from Geany? (no offense intended)

User avatar
ExeterDad
Member
Posts: 1717
Joined: Sun Jun 01, 2014 20:00
In-game: ExeterDad
Location: New Hampshire U.S.A

Re: Working & wonderfull Mintest IDE, based on ZeroBrane Stu

by ExeterDad » Post

I'm trying really hard to be excited... but I don't have a clue how to use this once I got the IDE and your files installed.
I'm assuming it's all correct as I can see Projects > Lua Interpreters > Minetest in the ZeroBrane dropdowns.

Do you happen to have a little Minetest specific tutorial handy? :D

wintermute
Member
Posts: 13
Joined: Wed Jun 24, 2015 18:44
IRC: freeemint_
In-game: aulin

Re: Working & wonderfull Mintest IDE, based on ZeroBrane Stu

by wintermute » Post

@4aimain: As far as i know Geanie has no build in support for Lua, but i can be wrong. Zerobrane just provided a very nice way for adding new auto completion. The difference is that I wrote my auto completion stuff for ZeroBrane. Geany is indeed very similar to Geany even when it comes to UI.
@ExeterDad: Thx, i forget telling the most important part the usage. Look in the first post.

wintermute

User avatar
Calinou
Moderator
Posts: 3169
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou
Location: Troyes, France
Contact:

Re: Working & wonderfull Mintest IDE, based on ZeroBrane Stu

by Calinou » Post

wintermute wrote:@4aimain: As far as i know Geanie has no build in support for Lua, but i can be wrong.
Geany does support Lua syntax.

User avatar
ExeterDad
Member
Posts: 1717
Joined: Sun Jun 01, 2014 20:00
In-game: ExeterDad
Location: New Hampshire U.S.A

Re: Working & wonderfull Mintest IDE, based on ZeroBrane Stu

by ExeterDad » Post

@wintermute
Thanks for adding the usage bit. That changes everything :)
Perhaps I'll get a chance to play with it tomorrow.
Thanks for your work!

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: Working & wonderfull Mintest IDE, based on ZeroBrane Stu

by 4aiman » Post

Calinou wrote:Geany does support Lua syntax.
+1

Moreover, code completion works for all files opened in session.
Also, Geany has many plugins: git/svn/mercurial support, split view of a document, bookmarks, markdown prewiew, in-built terminal, debugger support and much more.
Geany runs "ok" on RPi too ;)

Now, Geany *has* some issues on Windows. Namely, "grep" from GNUWin package still needs some "wrapper" in a form of a *.bat file to work properly, but that's easy google-able ;)




Don't get me wrong. I'm *not* trying to undermine anyone's work or anything.
It's just I'm not sure why should I (at least) *consider* to change my working IDE to ZeroBrane.

Rochambeau
Member
Posts: 119
Joined: Tue Sep 23, 2014 11:37

Re: Working & wonderfull Mintest IDE, based on ZeroBrane Stu

by Rochambeau » Post

@4aiman

Can you provide a tutorial (or link) how to integrate minetest into geany and debug mods with geany?

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: Working & wonderfull Mintest IDE, based on ZeroBrane Stu

by 4aiman » Post

@Rochambeau

That would be offtopic, so I'll use a spoiler tag.

But prior to reading that, be sure to check ZeroBrane and the bindings wintermute has got ready for everyone.
Wintermute's work should get all attention it deserves.
Spoiler
I've got no link for such a case :)
And while Geany can be configured, I'm not the one who really did that for Minetest.


To tell the truth, I don't know what do you mean by "debug mods" clause.

Let me explain why:

It makes sense to "debug" a stand-alone executable or a stand-alone script (But a script already need an interpreter! "Tiz iz good" Geany knows that lua should be run using lua interpreter ;) that can be run on its own - you'll get error output and can test behaviour of your code. If your code was "buggy" - it won't work or won't do the things you want it to do.

Say, your mod is "Ok" syntactically and logically.
How do you know you'll get the results you're hoping to get?
(Ex: monster amount, rarity of biomes).




But for a *mod* it's *impossible* to test it outside the game it was made for - "Minetest" in our case.

I can't see much difference between having to click a button or a keyboard short-cut and switching focus to the terminal and pressing UpArrow+Enter to run Minetest.

So, I run Minetest from the in-built terminal emulator. Minetest crashes -> I see error message from *both* Lua *and* C++. I even know about segfaults and other stuff like missing shared libraries, etc, etc.

But that's not all - one can launch mc "inside" the terminal emulator which, in turn, is inside Geany and easily browse the directories to perform some additional actions.

Rochambeau
Member
Posts: 119
Joined: Tue Sep 23, 2014 11:37

Re: Working & wonderfull Mintest IDE, based on ZeroBrane Stu

by Rochambeau » Post

What I mean by debugging is, that I want to trace my script step by step, see why it runs through ifs or elses, set breaking points, see variables and their values, and so on.

It seems like eclipse can do it:
http://dev.minetest.net/Intro#Integrate ... vironments
But I could not get it to work properly.

So is it possible with geany or ZeroBrane?

User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

Re: Working & wonderfull Mintest IDE, based on ZeroBrane Stu

by Evergreen » Post

@Rochambeau Afaik, that is impossible with to do, no matter what IDE or text editor you use. That would have to be something implemented within minetest, which IDE's could take advantage of.

Slightly off-topic:
I might think about making a minetest integration plugin for vim, I just don't know whether that would be useful for other people or not.
Back from the dead!

Rochambeau
Member
Posts: 119
Joined: Tue Sep 23, 2014 11:37

Re: Working & wonderfull Mintest IDE, based on ZeroBrane Stu

by Rochambeau » Post

If you want to debug your embedded scripts same way you would debug a native application, give it a try.
That one line is taken from the minetest dev link I provided. It sounds like some kind of deeper mod debugging is possible with eclipse. I really should give it another try...

Sorry for OT..

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: Working & wonderfull Mintest IDE, based on ZeroBrane Stu

by 4aiman » Post

Eclipse is too heavy if you ask me.
I'd choose ZeroBrane over Eclipse 100 times out of 10 ;)

As a side note, IDE integrated within Minetest itself would be a wonderful thing.
Actually, a WYSIWYG formspec editor would be even greater!
I even started writing one using some black magic, but ppl over there told me that was a wrong path.


Anyway, has anyone actually used ZeroBrane "in production"?

Rochambeau
Member
Posts: 119
Joined: Tue Sep 23, 2014 11:37

Re: Working & wonderfull Mintest IDE, based on ZeroBrane Stu

by Rochambeau » Post

Finally got debugging with eclipse to work (see screenshot)!

But I also tested ZeroBrane with wintermutes plugin and I like the autocompletion with the help texts. That is really helpful.
Attachments
debuggingeclipse.png
debuggingeclipse.png (164.55 KiB) Viewed 1920 times

wilkgr76
Member
Posts: 832
Joined: Wed Feb 18, 2015 02:44
GitHub: wilkgr76

Re: Working & wonderfull Mintest IDE, based on ZeroBrane Stu

by wilkgr76 » Post

Oooooh nice :)
N/A

olea
Member
Posts: 14
Joined: Thu Dec 25, 2014 12:46
GitHub: olea
Contact:

Re: Working & wonderfull Mintest IDE, based on ZeroBrane Stu

by olea » Post

[quote="wintermute"]Dear Minetest-Community,


It provides not only keyword highlighting of LUA words, but an excellent autocompletion
wintermute

Hi:

I'm not a developer at all so sorry if my question seems a little silly. Would let Zerobrane+Minetest extension any kind of any code autocompletion based not only lua syntax but to mods definitions?

I mean, when writing or modifying mod's lua code to be able to find the original definition of each item navigating through code, or autocompletion when using defined items.

Thanks in advance.
ljrObrQC5NXm4Quy37k0FxyRmYtel7qb

User avatar
poikilos
Member
Posts: 67
Joined: Thu Feb 18, 2016 13:45
GitHub: Poikilos
In-game: Poikilos

Re: Working & wonderfull Mintest IDE, based on ZeroBrane Stu

by poikilos » Post

:edit: off-topic part moved to pm

OK I just wrote a linux shell script installer, but due to the current situation the user must download the file from the forum to $HOME/Downloads then run the script (it detects it there; and detects whether zbstudio folder is installed in /usr/share or /opt):
https://github.com/expertmm/EnlivenMine ... nvironment
Last edited by poikilos on Mon Oct 15, 2018 21:23, edited 4 times in total.

salahzar
Member
Posts: 24
Joined: Sat Jul 22, 2017 23:10
GitHub: salahzar
IRC: salahzar

Re: Working & wonderfull Mintest IDE, based on ZeroBrane Stu

by salahzar » Post

I've found this post and also (with some difficulty) some other posts on internet where they say that it is possible to debug minetest via zbstudio.

Using Minetest 0.4.16 msvc win32 I've seen that putting the following code in my mod Is actually connecting to the zb debug server (after disabling security). If I enable server debugger it goes without error, otherwise it says that connection refused. But I was not able to single step o break to any breakpoints :(

Code: Select all

ie = minetest.request_insecure_environment()
ie.require('mobdebug').start()
minetest.debug("done")
but I couldn't enable the debugging button on zbstudio when specifying a configuration like the following.

Code: Select all

return {
  name = "minetest",
  description = "Start Minetest",
  author = "wintermute",
  version = 0.1,
  api = {"baselib","minetest"},
  onRegister = function(self)
    -- add interpreter with name "sample"
    ide:AddInterpreter("minetest", {
  name = "Minetest",
  description = "Start Minetest",
  api = {"baselib","minetest"},
  hasdebugger = true,
  fattachdebug = function(self) DebuggerAttachDefault() end,
})
  end,
  frun = function(self,wfilename,rundebug)
    CommandLineRun("D:\\apps\\minetest-0.4.16-win32-msvc\\bin\\minetest.exe","/",true,false)
  end,
  onUnRegister = function(self)
    -- remove interpreter with name "sample"
    ide:RemoveInterpreter("minetest")
  end,
} 
Trying to use zbstudio for didactical reason making people understand exactly what it is happening in minetest via debugging, I'd love to understand how I can debug code with zbstudio ....
I understand that some of you guys succeeded in doing it ..

wintermute
Member
Posts: 13
Joined: Wed Jun 24, 2015 18:44
IRC: freeemint_
In-game: aulin

Re: Working & wonderfull Mintest IDE, based on ZeroBrane Stu

by wintermute » Post

olea wrote:
wintermute wrote:Dear Minetest-Community,


It provides not only keyword highlighting of LUA words, but an excellent autocompletion
wintermute

Hi:

I'm not a developer at all so sorry if my question seems a little silly. Would let Zerobrane+Minetest extension any kind of any code autocompletion based not only lua syntax but to mods definitions?

I mean, when writing or modifying mod's lua code to be able to find the original definition of each item navigating through code, or autocompletion when using defined items.
It is possible to add such definitions from Mods but there are a few reasons why i did decide against it.

At the time there was no stanardised parsable packet documentation which contains auto complete relevant information. This means for every time
I was not aware how to open new files and jump to an offset based on an user click in zerobrane. This feature is not implemented in ZeroBrane (https://studio.zerobrane.com/doc-plugin#menu-api) as far as i can see. The second problem would me maintaining the list of positions to jump to.
The third reason is that i am not sure whether addons are parsed at install time or at each startup. If it would be at each startup it might be possible to add auto completion for a selected number of mods at run time. But this would require an standardized format of the mod functions which has be updated by the developer of each package. This solution scales poorly for obvious reasons. It would be need though.

User avatar
poikilos
Member
Posts: 67
Joined: Thu Feb 18, 2016 13:45
GitHub: Poikilos
In-game: Poikilos

Re: Working & wonderfull Mintest IDE, based on ZeroBrane Stu

by poikilos » Post

I've clarified the licensing and authorship of lua-users.org using info from the mini charter and JohnBelmonte respectively (see README for complete description of authorship and licensing). I've also added a fallback license to MinetestIDE (it is said to be "based on ZeroBrane Studio" so the only logical conclusion would be that the license is MIT License).

Now that the licensing is clear, I've put MinetestIDE (along with my install.sh script for GNU+Linux systems) on GitHub so the project can finally be continued and maintained:
Download MinetestIDE on GitHub

* please submit a pull request for any changes made after the 2015-07-27 version 1.0 release

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests