MinetestIDE - Minetest Lua API Code Completion in ZeroBrane

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

MinetestIDE - Minetest Lua API Code Completion in ZeroBrane

by poikilos » Tue Mar 12, 2019 18:28

I have done a minor fork of "MinetestIDE," which is wintermute's mod of ZeroBrane Studio, a Lua editor with code completion (with Minetest code completion added thanks to wintermute). Below is all I've done so far:
  • extracted it from the forum zip and uploaded it to GitHub
  • clarified license & authorship
  • made an installer script for Linux (on Windows, MinetestIDE can still be installed the old way after installing ZeroBrane, by copying a folder, then setting the Lua interpreter to "minetest" in ZeroBrane, as instructed in the included documentation)

Download Source: ZIP
Browse Source: https://github.com/poikilos/MinetestIDE
Clone with git: git clone https://github.com/poikilos/MinetestIDE.git

History:
Wintermute's release post didn't promote MinetestIDE but understated its value at least in the lead-in. The title didn't have effective keywords (such as "code completion") and spelled Minetest incorrectly. Lack of clear licensing and authorship was a major hitch hindering the uptake of MinetestIDE. Another major hitch was that there was no installer. I didn't memorize much of the Minetest Lua API, and not many people had, so code completion was desirable. Therefore, I searched far and wide and finally found Wintermute's release post. After pursuing several dead leads regarding authorship on and off for months, I resolved the licensing issues (see "Authors" section of included README.md). I immediately began work on making the release available. I added an installer script, at least for Linux systems.


Planned Features:
  • annotate parts of the API that were changed (such as
    Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
    Code: Select all
    minetest.check_for_falling({x = 0, y = 0, z = 0})
    vs the original
    Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
    Code: Select all
    nodeupdate
    which remains in the mintest.org releases for backward compatibility)
  • installer script for Windows

Additional Ideas:
(I am not likely to implement these, but you could then let me know using a GitHub pull request):
  • minimal asset management: Add warnings for requirements, such as models in models directory and textures in textures directory, and conventions, such as modname_nodename.png for a texture and modname_nodename.* for a corresponding model.
  • warning model file specifies a texture (causes log spamming on Minetest server due to Irrlicht not finding the texture itself, even though Minetest adds textures manually)--this may require some exotic CLI, possibly for b3view, that uses Irrlicht headlessly to output a texture name or else output nothing.
  • warning on missing mod.conf or modpack.txt
  • warning if no LICENSE* file (possibly recommend MIT license since used for Minetest, and have a button that automatically inserts a license of your choice)
  • warning if no README* file
  • possibly show a tutorial file pop up describing how to do of all of the above manually, and redirect them to the modding book, even if the automation of these steps isn't implemented or reasonably doable.
 

OldCoder
Administrator
 
Posts: 345
Joined: Mon Oct 01, 2012 14:59

Re: MinetestIDE - Minetest Lua API Code Completion in ZeroBr

by OldCoder » Tue Mar 12, 2019 20:44

MinetestIDE is an IDE for Minetest, written in Lua, that is derived from a program named ZBStudio.

This post explains how I got Poikilos's version of MinetestIDE to work in my distro. Read Poikilos's post above this one first.

1. Dependencies and/or recommended packages include shared libraries for bzip2, glib2, freetype2, harfbuzz, wxwidgets 3.0, xorg, and zlib. Recent releases are recommended, though bleeding edge might not work.

Note that wxwidgets should be in the 3.0 series as opposed to older series or recent git branches.

2. To install Poikilos's copy of MinetestIDE, one executes "./install.sh" in the top level git-clone directory. Internet access is required because external code is downloaded.

3. Under some distros, to run the program, users may need to set, and export, either or both of the following environment variables:

LD_PRELOAD
LD_LIBRARY_PATHS

In my case, I needed to set LD_PRELOAD to an absolute path for the following GTK library file:

libgtk-x11-2.0.so.0

Additionally, I needed to set LD_LIBRARY_PATHS to an absolute path for "gcc's" "lib" subdirectory.

I then needed to execute the following command at the "bash" level:

export LD_PRELOAD LD_LIBRARY_PATHS

Subsequent to installation of the program, and these extra steps, I was able to run the program as follows:

cd /opt/zbstudio && ./zbstudio.sh

4. On my system, the fonts were too small to be readable. I was able to partly correct this as follows:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
cd /opt/zbstudio
sed -e 's/defaultsize = 1[0-9]/defaultsize = 18/' \
    -e 's/font_size = 1[0-9]/font_size = 18/' \
    -e 's/fontsize = nil/fontsize = 18/' \
    -e '/ide.font.tree = font/ifont:SetPointSize (18);' \
    -i `find . -type f -name \*.lua`

This fixed most of the fonts, though the menu-bar font was still a bit small. The screenshot below shows the program running after this step.

Some users will consider the output produced by 18 here to be too large. They may wish to substitute a number in the range of 14 to 17 for 18. However, the defaults are definitely too low


Image
 


Return to Minetest Tools

Who is online

Users browsing this forum: No registered users and 1 guest

cron