Working %TOPIC_TITLE%amp; wonderfull Mintest IDE, based on ZeroBrane Studio

Working & wonderfull Mintest IDE, based on ZeroBrane Studio

Postby wintermute » Mon Jul 27, 2015 3:26 pm

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
wintermute
Member
 
Posts: 10
Joined: Wed Jun 24, 2015 6:44 pm
In-game: aulin

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

Postby est31 » Mon Jul 27, 2015 4:01 pm

Very nice!
est31
Developer
 
Posts: 173
Joined: Mon Dec 29, 2014 1:49 am

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

Postby 4aiman » Mon Jul 27, 2015 7:33 pm

Nice, indeed.
But... how it's different from Geany? (no offense intended)
4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 5:47 am

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

Postby ExeterDad » Mon Jul 27, 2015 11:30 pm

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
ExeterDad
Member
 
Posts: 1717
Joined: Sun Jun 01, 2014 8:00 pm
In-game: ExeterDad

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

Postby wintermute » Tue Jul 28, 2015 5:59 pm

@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
wintermute
Member
 
Posts: 10
Joined: Wed Jun 24, 2015 6:44 pm
In-game: aulin

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

Postby Calinou » Tue Jul 28, 2015 6:18 pm

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.
Calinou
Moderator
 
Posts: 3154
Joined: Mon Aug 01, 2011 2:26 pm
GitHub: Calinou
In-game: Calinou

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

Postby ExeterDad » Wed Jul 29, 2015 4:26 am

@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!
ExeterDad
Member
 
Posts: 1717
Joined: Sun Jun 01, 2014 8:00 pm
In-game: ExeterDad

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

Postby 4aiman » Wed Jul 29, 2015 9:15 am

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.
4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 5:47 am

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

Postby Rochambeau » Wed Jul 29, 2015 12:25 pm

@4aiman

Can you provide a tutorial (or link) how to integrate minetest into geany and debug mods with geany?
Rochambeau
Member
 
Posts: 112
Joined: Tue Sep 23, 2014 11:37 am

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

Postby 4aiman » Wed Jul 29, 2015 1:34 pm

@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.

+ Why do I use Geany
4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 5:47 am

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

Postby Rochambeau » Wed Jul 29, 2015 5:33 pm

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?
Rochambeau
Member
 
Posts: 112
Joined: Tue Sep 23, 2014 11:37 am

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

Postby Evergreen » Wed Jul 29, 2015 6:12 pm

@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.
Evergreen
Member
 
Posts: 2135
Joined: Sun Jan 06, 2013 1:22 am
GitHub: 4Evergreen4
In-game: Evergreen

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

Postby Rochambeau » Wed Jul 29, 2015 7:27 pm

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..
Rochambeau
Member
 
Posts: 112
Joined: Tue Sep 23, 2014 11:37 am

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

Postby 4aiman » Wed Jul 29, 2015 8:08 pm

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"?
4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 5:47 am

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

Postby Rochambeau » Thu Jul 30, 2015 7:26 pm

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.
Rochambeau
Member
 
Posts: 112
Joined: Tue Sep 23, 2014 11:37 am

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

Postby wilkgr76 » Fri May 06, 2016 1:19 am

Oooooh nice :)
wilkgr76
Member
 
Posts: 830
Joined: Wed Feb 18, 2015 2:44 am
GitHub: wilkgr76

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

Postby olea » Wed May 10, 2017 11:13 am

[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.
olea
New member
 
Posts: 9
Joined: Thu Dec 25, 2014 12:46 pm
GitHub: olea

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

Postby poikilos » Thu Feb 22, 2018 10:35 pm

: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/EnlivenMinetest/blob/master/etc/install-zerobrane-minetest-environment
poikilos
Member
 
Posts: 49
Joined: Thu Feb 18, 2016 1:45 pm
GitHub: poikilos
In-game: Abiyahh

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

Postby salahzar » Sun Mar 11, 2018 11:21 pm

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 ..
salahzar
Member
 
Posts: 22
Joined: Sat Jul 22, 2017 11:10 pm

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

Postby wintermute » Tue Apr 03, 2018 3:10 pm

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.
wintermute
Member
 
Posts: 10
Joined: Wed Jun 24, 2015 6:44 pm
In-game: aulin

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

Postby poikilos » Wed Feb 06, 2019 5:42 pm

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
poikilos
Member
 
Posts: 49
Joined: Thu Feb 18, 2016 1:45 pm
GitHub: poikilos
In-game: Abiyahh

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

Postby Eightball » Sun Mar 24, 2019 12:10 pm

Hi there,

I'm new to Minetest and was wondering that the dev wiki is full of information but there is nothing about an editor or IDE where Lua code can be developed. This was the best I can find and it works wonderfull without big effort.

Wouldn't this be a good hint in the wiki to give new developers a starting point? Also there are threads about debugging, that it is working and how (currently with modification of Minetest itself). I guess everything needed is available but nobody put all together. Can I help writing all together to the wiki, is there any interrest about i?

How are more experienced devolopers develope and bugfix their code/mods?
Eightball
New member
 
Posts: 7
Joined: Sun Mar 24, 2019 11:12 am

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

Postby texmex » Sun Mar 24, 2019 3:16 pm

The choice of editor is simply a matter of taste. Any editor will do. Personally I use Atom with a Lua language validator.
texmex
Member
 
Posts: 1299
Joined: Mon Jul 11, 2016 9:08 pm
GitHub: tacotexmex
In-game: texmex

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

Postby ThorfinnS » Mon Mar 25, 2019 5:22 pm

Be sure to read 4aiman's answer Why I use Geany. Like him, unless you are doing some really heavy-duty coding, I don't see much value in using an IDE for a minetest mod. An appropriate log entry should be enough to debug most scripts. If you are new to LUA, heck, yes, use one. If you are having trouble debugging a particular block of code, sure. But IMO, mostly its value here just to learn the language.

I hate autocomplete. Syntax highlighting is great. Personally I don't see much point in a linter for this kind of coding. I haven't found a linter that gives the right answer for scads of interpreter optimizations anyway. Function lookup is nice, but mostly I have to go to the dev docs anyway. Clipboard history, side-by-side file compare, and personal snippets are essential. Auto-checking for changes to file on disk a massive plus. Probably you can guess what I use and teach to my students.

I do have atom installed, and use it on occasion. I even have it open at the moment. But it is so heavy I need a good reason to use it, which isn't the case most of the time.
ThorfinnS
Member
 
Posts: 75
Joined: Mon Feb 25, 2019 10:05 pm

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

Postby Eightball » Mon Mar 25, 2019 6:37 pm

Of course it's all a matter of taste and nobody should be forced to use any. But giving some hints for new users makes developing the first mod a bit easier.
Also when you say it's not worth to search for an IDE because there is not much value about it, that also a good point to mention in the wiki. ;-)
Eightball
New member
 
Posts: 7
Joined: Sun Mar 24, 2019 11:12 am



Return to Minetest-related projects



Who is online

Users browsing this forum: Yandex Bot [Bot] and 0 guests