[CSM] CSM Designing and Testing Environment [csm_dte]

User avatar
FiftySix
Member
 
Posts: 10
Joined: Sun Jan 14, 2018 10:58
Location: Scotland
GitHub: BenjieFiftysix
In-game: fiftysix or benjie

[CSM] CSM Designing and Testing Environment [csm_dte]

by FiftySix » Mon May 21, 2018 23:24

CSM DTE
Client Side Mod Designing & Testing Environment

An advanced, ingame lua and formspec editor.

This can be used for creating, testing and using CSMs without reloading the game, and without the game crashing. This is also the easiest way to create advanced formspecs. It was tested with multiple CSMs, and they all worked. (actually in the current version, a few things might not work, but they will be fixed in the future)

CSMs can be created, or pasted in, and they should work the same as they would normally, except errors won't crash the game!

functions that are registered with minetest can be put in a function safe(func) to output errors to the UI when minetest calls them

scripts can be put in startup to run them automatically when the game loads. errors are also put in the UI

Features:
lua editor:

- print function
- coloured error output
- multiple files
- file creation and deletion
- safe function execution
- automatically run files at startup

formspec editor:

- every widget is available
- widgets are easy to edit
- formspec preview, shows what it will look like
- export as a function with parameters
- export as a string
- and a whole bunch of fancy stuff

Download
Github
Download


Screenshots:
Lua editor:
Image
Formspec editor
Image

To Use:

- use the command .dte to open the editor
- select the lua editor tab to run and edit CSMs
- select the formspec editor tab to create a formspec
- select the files tab to open, create, and delete files
- select the startup tab to select lua files to run when the game loads

How to install

- make sure you have client modding enabled (search for client modding in advanced settings, and set it to true)
- download and extract the zip file into clientmods\csm_dte or paste the init.lua file into it.
- add load_mod_csm_dte = true to the clientmods\mods.conf file
- join a game or server, and it should work!


Please tell me of any differences when running a CSM in this and the usual way. Thanks
I also need a list of API functions for registering functions with minetest, and a list of functions which only work before the game has loaded.
Last edited by FiftySix on Mon Jul 02, 2018 11:48, edited 6 times in total.
Frustrated with formspec strings? Check my formspec editor!
 

User avatar
Lejo
Member
 
Posts: 405
Joined: Mon Oct 19, 2015 16:32
GitHub: Lejo1
In-game: Lejo
 

User avatar
octacian
Member
 
Posts: 592
Joined: Mon Dec 21, 2015 22:18
Location: BC, Canada
GitHub: octacian
IRC: octacian
In-game: octacian

Re: [CSM] lua IDE [lua_ide]

by octacian » Tue May 22, 2018 13:32

This is a very interesting concept, and I quite like it - in fact, I once considered making something similar. There is one very basic problem, however, that for me anyway voids the usefulness of the entire concept. That reason is that Minetest's textarea is very limited. For me to be happy with writing more than a few short lines of code in an editor, it must at least have automatic indentation and syntax highlighting, two things which are completely impossible to implement within Minetest. Besides that, I'd prefer if it had the ability to do things such as select multiple parts of the code at once (multiple cursors). Not only that, but I usually have trouble copy-pasting stuff in and out of Minetest due to a weird bug in Irrlicht related to Linux, so I wouldn't be able to use it efficiently no matter what, but this is in no way your fault as it doesn't even have anything to do with Minetest.

Anyways, TL;DR: this is an amazing idea and a good implementation, but it lacks features that are impossible in Minetest, features that I consider a requirement for a good code editor.

May I also suggest that maybe you rename this to "lua_editor", and title it "In-Game Lua Code Editor"? Why? Well, the term IDE (Integrated Development Environment) refers to an environment usually specialized for a specific language, having debugging and testing tools, and usually having many if not all of the features I mentioned above.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
 

User avatar
FiftySix
Member
 
Posts: 10
Joined: Sun Jan 14, 2018 10:58
Location: Scotland
GitHub: BenjieFiftysix
In-game: fiftysix or benjie

Re: [CSM] lua IDE [lua_ide]

by FiftySix » Tue May 22, 2018 15:33

octacian wrote:This is a very interesting concept, and I quite like it

Thank You!

The textarea is not great for writing in, but things can easily be pasted into it. My idea of how I would use it, was to write the code in a normal text editor, then copy it into the textarea (I'm on windows), so I wouldn't have to reload the game, and it wouldn't crash.
My post was poorly written and rushed, so I will probably make it more usefull in the future.

I will rename it to something else, probably not "Lua Editor", because I plan on adding some features for UI design and testing. Maybe "CSM Designing and Testing Envirnonment", or "CSM DTE" for short.
Frustrated with formspec strings? Check my formspec editor!
 

User avatar
Linuxdirk
Member
 
Posts: 1551
Joined: Wed Sep 17, 2014 11:21
Location: Germany
In-game: Linuxdirk

Re: [CSM] lua IDE [lua_ide]

by Linuxdirk » Tue May 22, 2018 15:45

FiftySix wrote:CSMs can be pasted in and used permanently using the startup option. You don't even have to reload the game!

Great, no more script-based automatic CSM updates using Git!
 

User avatar
Lone_Wolf
Member
 
Posts: 1867
Joined: Sun Apr 09, 2017 05:50
Location: You wouldn't believe me
GitHub: LoneWolfHT
IRC: Lone_Wolf
In-game: Lone_Wolf or Somebody

Re: [CSM] CSM Designing and Testing Environment [csm_dte]

by Lone_Wolf » Tue May 22, 2018 20:06

This looks slightly cooler than the basic_robot csm. Love it!
I've noticed the number of mods I can contribute to has decreased. I'm sticking with Github. Even though I don't like MS
 

User avatar
Lejo
Member
 
Posts: 405
Joined: Mon Oct 19, 2015 16:32
GitHub: Lejo1
In-game: Lejo

Re: [CSM] CSM Designing and Testing Environment [csm_dte]

by Lejo » Mon Jun 11, 2018 13:35

If you run a not Startup CSM with minetest.register_on_joinplayer(function(player)
The minetest.register_on_joinplayer(function(player) will never be done.
 

User avatar
FiftySix
Member
 
Posts: 10
Joined: Sun Jan 14, 2018 10:58
Location: Scotland
GitHub: BenjieFiftysix
In-game: fiftysix or benjie

Re: [CSM] CSM Designing and Testing Environment [csm_dte]

by FiftySix » Mon Jun 11, 2018 16:01

All(most?) options for registering functions with minetest will be overwritten in a future version, meaning they will work after startup. So far the only function which I have done this for is minetest(/core).get_mod_storage(). They will also automatically be run in a safe environment (error catching) without using the safe() function, and can hopefully be unregistered from the GUI.

A list of API functions for registering things or commands would be usefull, since I am new to modding. but most importantly all functions which don't work after startup.
Frustrated with formspec strings? Check my formspec editor!
 

Sokomine
Member
 
Posts: 3616
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: [CSM] CSM Designing and Testing Environment [csm_dte]

by Sokomine » Mon Jun 25, 2018 16:27

The idea of a preview of a formspec is very good. I wonder if it might be possible to just write the code with a normal editor and let the test mod read and interpret that text file whenever the developper requests an update. Would be horribly insecure in general gameplay; but developping your own mods is another matter.
A list of my mods can be found here.
 

User avatar
FiftySix
Member
 
Posts: 10
Joined: Sun Jan 14, 2018 10:58
Location: Scotland
GitHub: BenjieFiftysix
In-game: fiftysix or benjie

Re: [CSM] CSM Designing and Testing Environment [csm_dte]

by FiftySix » Mon Jun 25, 2018 16:39

I'm pretty sure you have misunderstood (or is it me?). I am talking about a preview of part of the project I am working on. The file (which I called the preview file) is a formspec creator, which generates the code for a formspec. And your idea for reading a file which was edited with a normal editor is currently not possible, because CSMs don't have file access (my few tests show at least).
Frustrated with formspec strings? Check my formspec editor!
 

User avatar
Lone_Wolf
Member
 
Posts: 1867
Joined: Sun Apr 09, 2017 05:50
Location: You wouldn't believe me
GitHub: LoneWolfHT
IRC: Lone_Wolf
In-game: Lone_Wolf or Somebody

Re: [CSM] CSM Designing and Testing Environment [csm_dte]

by Lone_Wolf » Thu Jun 28, 2018 02:17

I love the formspec editor. Just one request. Allow users to reset the editor if this happens?
Image
(I just unchecked the item tickbox to remove but it the img was bigger...)

Also: maybe add the ability to set the background? (I didn't see it)
EDIT: The ability to duplicate elements would be nice
EDIT2: The ability to move elements around with some buttons in this form on the side somewhere
Code: Select all
  ^
<   >
  v

would be nice
I've noticed the number of mods I can contribute to has decreased. I'm sticking with Github. Even though I don't like MS
 

User avatar
Lone_Wolf
Member
 
Posts: 1867
Joined: Sun Apr 09, 2017 05:50
Location: You wouldn't believe me
GitHub: LoneWolfHT
IRC: Lone_Wolf
In-game: Lone_Wolf or Somebody

Re: [CSM] CSM Designing and Testing Environment [csm_dte]

by Lone_Wolf » Thu Jun 28, 2018 16:12

It would be nice if users were able to import formspecs too. I've already met with a time where that would be useful
I've noticed the number of mods I can contribute to has decreased. I'm sticking with Github. Even though I don't like MS
 

User avatar
FiftySix
Member
 
Posts: 10
Joined: Sun Jan 14, 2018 10:58
Location: Scotland
GitHub: BenjieFiftysix
In-game: fiftysix or benjie

Re: [CSM] CSM Designing and Testing Environment [csm_dte]

by FiftySix » Sat Jun 30, 2018 17:38

There is now a new version.
- Widgets can't overlap the editor. A red box is displayed to show the area it would be
- The colour of the background can be set
- Images can be made background images
- Widgets can be duplicated
- The new widget menu can be accessed without having to leave the selected widget
- the delete button has moved
- 2 new widgets have been added: tooltip and tabs
- The colour of InvLists can now be changed (from the Display tab because you can't change individual list colours)
- The Size menu has been renamed to Display because it has more stuff
- The size of the window is now displayed with an outline (shows actual size, and 0, 0 to width, height)

Edit:
I will not add the movement control buttons, but I will try and make keyboard controls move widgets (edit 2: not possible as far as I can see).
If I do add an option to import formspec strings, it won't be any time soon
Last edited by FiftySix on Sun Jul 01, 2018 12:37, edited 2 times in total.
Frustrated with formspec strings? Check my formspec editor!
 

User avatar
Lone_Wolf
Member
 
Posts: 1867
Joined: Sun Apr 09, 2017 05:50
Location: You wouldn't believe me
GitHub: LoneWolfHT
IRC: Lone_Wolf
In-game: Lone_Wolf or Somebody

Re: [CSM] CSM Designing and Testing Environment [csm_dte]

by Lone_Wolf » Sat Jun 30, 2018 18:05

FiftySix wrote:There is now a new version.
- Widgets can't overlap the editor. A red box is displayed to show the area it would be
- The colour of the background can be set
- Images can be made background images
- Widgets can be duplicated
- The new widget menu can be accessed without having to leave the selected widget
- the delete button has moved
- 2 new widgets have been added: tooltip and tabs
- The colour of InvLists can now be changed (from the Display tab because you can't change individual list colours)
- The Size menu has been renamed to Display because it has more stuff
- The size of the window is now displayed with an outline (shows actual size, and 0, 0 to width, height)

Awesome! I'm loving this CSM
I've noticed the number of mods I can contribute to has decreased. I'm sticking with Github. Even though I don't like MS
 

User avatar
FiftySix
Member
 
Posts: 10
Joined: Sun Jan 14, 2018 10:58
Location: Scotland
GitHub: BenjieFiftysix
In-game: fiftysix or benjie

Re: [CSM] CSM Designing and Testing Environment [csm_dte]

by FiftySix » Mon Jul 02, 2018 11:54

I have finally put the formspec editor into the main file!
So the formspec editor is part of the same mod, and can be accessed from the same UI, using tabs.
Now it is is much easier to access the formspec editor, because it doesn't have to be installed separately, and I hope more people will get to use it!
Frustrated with formspec strings? Check my formspec editor!
 

User avatar
Lone_Wolf
Member
 
Posts: 1867
Joined: Sun Apr 09, 2017 05:50
Location: You wouldn't believe me
GitHub: LoneWolfHT
IRC: Lone_Wolf
In-game: Lone_Wolf or Somebody

Re: [CSM] CSM Designing and Testing Environment [csm_dte]

by Lone_Wolf » Wed Jul 04, 2018 19:29

This clientmod will crash if you don't delete modstorage before using the latest update (For me anyway).
The modstorage is in /minetest/client/modstorage/
I've noticed the number of mods I can contribute to has decreased. I'm sticking with Github. Even though I don't like MS
 

aristotle
Member
 
Posts: 27
Joined: Wed Mar 14, 2018 23:40
GitHub: askotos
IRC: aristotle_
In-game: aristotle
 


Return to Client-side modding



Who is online

Users browsing this forum: No registered users and 2 guests