[Mod] In-Game Formspec Creator [debugger]

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

[Mod] In-Game Formspec Creator [debugger]

by octacian » Post

Debug Tools for Mod Developers [debugger] This is meant to be a simple tool for developers to use while attempting to debug issues in mods. As of writing, only the formspec creator has been implemented. Click on the spoiler below to see how it works or see below for planned features.

Tools are hidden from the creative inventory by default. To allow access in creative rather than just via /giveme, set not_in_creative to 0 in the config.txt.
Spoiler
Image

Formspec Editor

The formspec editor is a very simple tool for the purpose of making formspec creation easier. Traditionally, you would have to reload Minetest every time you made the smallest change. However, with this formspec editor, simply put your formspec in the textarea, click refresh, and the formspec will be displayed on the right.

The formspec editor can be accessed in two ways. You can get the "Formspec Editor" item in the creative inventory or with /giveme debugger:form_editor, then left-click to edit or right-click to preview the form without the editor interface. You can also use the chatcommand /form_editor to access the editor. This command requires that you have the debug privilege. Providing no parameters or edit will show the editor, while preview will show the form without the editor interface.
Spoiler
Image

Metadata Editor

The metadata editor is a slightly more complex tool that allows viewing and modifying the metadata of any node.

The metadata editor can only be accessed with the "Meta Editor" item in the creative inventory or with /giveme debugger:meta_editor. The interface can then be shown by punching any valid node.

In initial state, the editor displays a list of meta keys and their corresponding values. Double-clicking on any of the values allows you to assign a new value or delete the key-value pair entirely. You can also add new metadata fields with the "Add Key" bottom in the bottom-left corner of the initial state. Note: Trying to add an existing key will result in an error message being printed to the chat.
Planned Features
  • Inventory Editor
  • Run Lua Code Under Environment (server won't crash)
  • In-Game HUD Editor (?)
..and possibly more
Last edited by octacian on Tue Apr 04, 2017 21:29, edited 1 time in total.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
I'm currently inactive in the Minetest community! So if I don't respond, that's why.

User avatar
cx384
Member
Posts: 654
Joined: Wed Apr 23, 2014 09:38
GitHub: cx384
IRC: cx384

Re: [Mod] In-Game Formspec Creator [debugger]

by cx384 » Post

What is the significant difference between your mod and this?
Can your read this?

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

Re: [Mod] In-Game Formspec Creator [debugger]

by octacian » Post

cx384 wrote:What is the significant difference between your mod and this?
Not much at all, except for the fact that it's a mod, not a subgame, meaning it is easier to use. Not only that, but it is far more stable than the other (e.g. you can exit without crashing the game, formspecs are saved per-player when the game is shut down, and all formspec elements function properly).

Actually, that link is where I got the basic idea as I didn't think that editor was very refined.

Aside from the above, this mod will in the future include several other tools as described in the "Planned Features" section.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
I'm currently inactive in the Minetest community! So if I don't respond, that's why.

User avatar
addi
Member
Posts: 666
Joined: Thu Sep 20, 2012 03:16
GitHub: adrido
Location: Black-Forest, Germany

Re: [Mod] In-Game Formspec Creator [debugger]

by addi » Post

octacian wrote:Not much at all, except for the fact that it's a mod, not a subgame, meaning it is easier to use. Not only that, but it is far more stable than the other (e.g. you can exit without crashing the game, formspecs are saved per-player when the game is shut down, and all formspec elements function properly).
hey dont make my work bad ;-P
Is a mod with chat command+additional priv easier to uses then a subgame? not really imo.
the crash on exit was fixed a long time ago, and all the formspec elements works as expected. (well they are work at least as all minetest formspec works XD )
It only had no time to implement a save/restore functionality, thats a + for your project ;)
But its nice to see someone continues with the idea :)

User avatar
Desour
Member
Posts: 1473
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: Desour
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: [Mod] In-Game Formspec Creator [debugger]

by Desour » Post

Useful, but we already have eg. worldedit's formspec tester.
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

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

Re: [Mod] In-Game Formspec Creator [debugger]

by octacian » Post

addi wrote:hey dont make my work bad ;-P
Is a mod with chat command+additional priv easier to uses then a subgame? not really imo.
the crash on exit was fixed a long time ago, and all the formspec elements works as expected. (well they are work at least as all minetest formspec works XD )
It only had no time to implement a save/restore functionality, thats a + for your project ;)
But its nice to see someone continues with the idea :)
Sorry, it didn't appear to me that you had updated the thread or anything, so I had no way of knowing and didn't think to look through the commit history. Maybe I just missed it, but.
DS-minetest wrote: Useful, but we already have eg. worldedit's formspec tester.
Yes, IK about WorldEdit's formspec tester. However, once again, I find this one to be far more intuitive. Specifically how you can have code and formspec side-by-side, whereas you cannot in WorldEdit.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
I'm currently inactive in the Minetest community! So if I don't respond, that's why.

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

Re: [Mod] In-Game Formspec Creator [debugger]

by octacian » Post

The latest commit includes a metadata editor. This allows you to edit the metadata of any block. (See OP.)

Next up is a code editor, HUD editor, and inventory editor.

Development on this mod will probably, however, be once again delayed as I have many other projects which are of greater importance to progress on.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
I'm currently inactive in the Minetest community! So if I don't respond, that's why.

mr_dean
Member
Posts: 30
Joined: Fri Jan 06, 2017 00:38
In-game: mr_dean
Location: Modding...

Re: [Mod] In-Game Formspec Creator [debugger]

by mr_dean » Post

OMG thank you!

Finally I am not constantly reloading a world every five seconds while I am writing a mod! This even works good, and, doesn't cause a ton of lag like I thought that it would. Anyway, keep up the good mods Octacian
I know you believe you understand what you think I said, but, I am not sure that what you heard is not what I meant. - Author Unknown

Arcelmi
Member
Posts: 68
Joined: Mon Dec 28, 2015 16:24
GitHub: Arcelmi
IRC: Arcelmi
In-game: Arcelmi
Location: Germany

Re: [Mod] In-Game Formspec Creator [debugger]

by Arcelmi » Post

I like this mod, but can you change in file meta_editor.lua line 15

Code: Select all

values = values..value..","
to

Code: Select all

values = values..minetest.formspec_escape(value)..","
so there can be meta strings with ","
I don't speak very good English... | My mods

I've got a signature!

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [Mod] In-Game Formspec Creator [debugger]

by azekill_DIABLO » Post

looks super nice!
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

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

Re: [Mod] In-Game Formspec Creator [debugger]

by octacian » Post

Arcelmi wrote:I like this mod, but can you change in file meta_editor.lua line 15

Code: Select all

values = values..value..","
to

Code: Select all

values = values..minetest.formspec_escape(value)..","
so there can be meta strings with ","
Yes, I noticed that issue. I'll be working on this mod a bit more in the near future and will see what I can do then. Thanks for pointing this out anyways!
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
I'm currently inactive in the Minetest community! So if I don't respond, that's why.

Post Reply

Who is online

Users browsing this forum: No registered users and 25 guests