[CSM] CSM Designing and Testing Environment [csm_dte]

[CSM] CSM Designing and Testing Environment [csm_dte]

Postby FiftySix » Mon May 21, 2018 11:24 pm

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.
FiftySix
Member
 
Posts: 15
Joined: Sun Jan 14, 2018 10:58 am
GitHub: BenjieFiftysix
In-game: fiftysix or benjie

Re: [CSM] lua IDE [lua_ide]

Postby Lejo » Tue May 22, 2018 7:56 am

Nice!!!
Lejo
Member
 
Posts: 496
Joined: Mon Oct 19, 2015 4:32 pm
GitHub: Lejo1
In-game: Lejo

Re: [CSM] lua IDE [lua_ide]

Postby octacian » Tue May 22, 2018 1:32 pm

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.
octacian
Member
 
Posts: 593
Joined: Mon Dec 21, 2015 10:18 pm
GitHub: octacian
In-game: octacian

Re: [CSM] lua IDE [lua_ide]

Postby FiftySix » Tue May 22, 2018 3:33 pm

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.
FiftySix
Member
 
Posts: 15
Joined: Sun Jan 14, 2018 10:58 am
GitHub: BenjieFiftysix
In-game: fiftysix or benjie

Re: [CSM] lua IDE [lua_ide]

Postby Linuxdirk » Tue May 22, 2018 3:45 pm

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!
Linuxdirk
Member
 
Posts: 1928
Joined: Wed Sep 17, 2014 11:21 am
In-game: Linuxdirk

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

Postby Lone_Wolf » Tue May 22, 2018 8:06 pm

This looks slightly cooler than the basic_robot csm. Love it!
Lone_Wolf
Member
 
Posts: 2151
Joined: Sun Apr 09, 2017 5:50 am
GitHub: LoneWolfHT
In-game: Lone_Wolf

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

Postby Lejo » Mon Jun 11, 2018 1:35 pm

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.
Lejo
Member
 
Posts: 496
Joined: Mon Oct 19, 2015 4:32 pm
GitHub: Lejo1
In-game: Lejo

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

Postby FiftySix » Mon Jun 11, 2018 4:01 pm

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.
FiftySix
Member
 
Posts: 15
Joined: Sun Jan 14, 2018 10:58 am
GitHub: BenjieFiftysix
In-game: fiftysix or benjie

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

Postby Sokomine » Mon Jun 25, 2018 4:27 pm

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.
Sokomine
Member
 
Posts: 3751
Joined: Sun Sep 09, 2012 5:31 pm
GitHub: Sokomine

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

Postby FiftySix » Mon Jun 25, 2018 4:39 pm

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).
FiftySix
Member
 
Posts: 15
Joined: Sun Jan 14, 2018 10:58 am
GitHub: BenjieFiftysix
In-game: fiftysix or benjie

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

Postby Lone_Wolf » Thu Jun 28, 2018 2:17 am

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
Lone_Wolf
Member
 
Posts: 2151
Joined: Sun Apr 09, 2017 5:50 am
GitHub: LoneWolfHT
In-game: Lone_Wolf

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

Postby Lone_Wolf » Thu Jun 28, 2018 4:12 pm

It would be nice if users were able to import formspecs too. I've already met with a time where that would be useful
Lone_Wolf
Member
 
Posts: 2151
Joined: Sun Apr 09, 2017 5:50 am
GitHub: LoneWolfHT
In-game: Lone_Wolf

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

Postby FiftySix » Sat Jun 30, 2018 5:38 pm

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
FiftySix
Member
 
Posts: 15
Joined: Sun Jan 14, 2018 10:58 am
GitHub: BenjieFiftysix
In-game: fiftysix or benjie

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

Postby Lone_Wolf » Sat Jun 30, 2018 6:05 pm

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
Lone_Wolf
Member
 
Posts: 2151
Joined: Sun Apr 09, 2017 5:50 am
GitHub: LoneWolfHT
In-game: Lone_Wolf

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

Postby FiftySix » Mon Jul 02, 2018 11:54 am

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!
FiftySix
Member
 
Posts: 15
Joined: Sun Jan 14, 2018 10:58 am
GitHub: BenjieFiftysix
In-game: fiftysix or benjie

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

Postby Lone_Wolf » Wed Jul 04, 2018 7:29 pm

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/
Lone_Wolf
Member
 
Posts: 2151
Joined: Sun Apr 09, 2017 5:50 am
GitHub: LoneWolfHT
In-game: Lone_Wolf

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

Postby aristotle » Wed Aug 15, 2018 4:01 pm

@FiftySix
+1!
Thank you. :)
aristotle
Member
 
Posts: 74
Joined: Wed Mar 14, 2018 11:40 pm
GitHub: askotos
In-game: aristotle

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

Postby ChimneySwift » Wed Sep 05, 2018 7:04 am

Wow, much better than I at first thought.

This is going to become my go-to for whenever something wants a formspec.
ChimneySwift
Member
 
Posts: 320
Joined: Fri Sep 22, 2017 6:46 am
GitHub: ChimneySwift
In-game: ChimneySwift

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

Postby Lone_Wolf » Tue Apr 16, 2019 2:24 am

This still being worked on? IIRC minetest.localplayer isn't buggy anymore. And there are a few new API features.
Lone_Wolf
Member
 
Posts: 2151
Joined: Sun Apr 09, 2017 5:50 am
GitHub: LoneWolfHT
In-game: Lone_Wolf

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

Postby FiftySix » Wed Apr 17, 2019 11:35 am

I'm currently busy, and don't have time to work on this, but I will have lots of time after the 22 may to continue working on this. I'm hoping to re-arrange the UI a bit to make space for new features/easier to use, and start working on the lua editor. I'm glad to see people are still interested in this!
FiftySix
Member
 
Posts: 15
Joined: Sun Jan 14, 2018 10:58 am
GitHub: BenjieFiftysix
In-game: fiftysix or benjie



Return to Client-side modding



Who is online

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