Ingame Text Editor

Brainstorm ideas of possible additions to the game. Read this before posting!

Moderator: Forum Moderators

Forum rules
Before posting a new idea, you must read the following:
Post Reply
User avatar
Bilbo_Sacket
Posts: 35
Joined: February 28th, 2021, 4:27 am

Ingame Text Editor

Post by Bilbo_Sacket »

As far as I know there are no text editors for wesnoth, But I think that it would be very useful to make one for programmers, particularly an ingame one which can be accessed through map editor. It would make many things easier, such as correct spelling, the use of Macros that have been made by others which you might not know about, and to make coordinates easier to manipulate. It would also help those who do not have c++ editors, or Lua. Further giving access to work made by others and included in core content and .dll libraries. Overall making it easier to understand the language and further manipulate it. (I forgot to include the advantages of understanding the games deeper functions).
User avatar
Pentarctagon
Project Manager
Posts: 5527
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Ingame Text Editor

Post by Pentarctagon »

There are these. Writing a separate text editor seems kind of duplicative though.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
shevegen
Posts: 497
Joined: June 3rd, 2004, 4:35 pm

Re: Ingame Text Editor

Post by shevegen »

> Writing a separate text editor seems kind of duplicative though.

I think it depends. To explain that, I have two ruby gems that aid me in installing packages and source code.
For instance on the commandline I do "ry wesnoth" and wesnoth will be compiled from source.

One of these gems is very large, about 3MB as .gem; the other is much smaller. The smaller one I use
when I manage to break the larger gem, and it is faster and easier to run.

Different editors could cater to different use cases too. I had that idea to create wesnoth scenarios
automatically (at the least as a skeleton) and use ruby-gtk3 locally. Right now I change a lot of code
to support both ruby-gtk3 and libui (which works on windows). From that it is a possibility to then
use the www with the same code base (and javascript ... but I hate supporting javascript sooo much,
it is such an annoying programming language...)

I can give it a try perhaps to see how far I get in ruby-gtk3. I am unfortunately excessively lazy,
but doing simple GUIs is not that much work. A few months ago I added a prototype for oldschool
text books. It doesn't look great but it does not look epic ugly either IMO:

For instance:

https://i.imgur.com/ZuryfYc.png

I think doing something like that, a bit more sophisticated, different colours/CSS, should not be
so hard for wesnoth, at the least as a prototype with some features to show that this is doable
(and then, knowing me, I jump to another project so... endurance is a weak point :P)

Of course from gobject-introspection to C++ and boost is a far stretch, but one other idea I had
was to write the logic in a DSL and then use ruby to autogenerate C/C++ code. But ... I may
keep this all small-ish and look about prototypes for an editor.

Is there a page where we can look which features should be supported? Perhaps it could be
a contest like ... create the best editor in any programming language. :D

And then... the last step is to rewrite it in C++. :P
User avatar
beetlenaut
Developer
Posts: 2814
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Ingame Text Editor

Post by beetlenaut »

What would be better than a new editor--especially one embedded in the game--would be a plugin for an established one that does code completion. That would help the OP, and make everyone's editing less tedious. I know that at least Notepad++, gedit, and Kate support plugins. I'm sure others do as well.

There has actually been at least one dedicated WML editor before, written in java IIRC. That was years ago though, and I assume it's not being maintained anymore. That's the usual fate of any single-person project like this, which is another reason why a plugin would be better.
shevegen wrote: September 24th, 2021, 11:25 pm To explain that, I have two ruby gems...
I don't see how a use case like this applies to WML though.
shevegen wrote: September 24th, 2021, 11:25 pm I had that idea to create wesnoth scenarios automatically
A lot of people have tried this, but I think it turns out to be a much harder problem than they thought. Also, I don't think that lowering the barrier of entry for creating UMC is necessarily a good thing. (Another strike against an in-game editor.) We could easily end up with an add-on server that's 90% unfinished, broken stubs. I think the main thing preventing that right now is that you need to have a certain level of determination to get started.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
User avatar
egallager
Posts: 576
Joined: November 19th, 2020, 7:27 pm
Location: Concord, New Hampshire
Contact:

Re: Ingame Text Editor

Post by egallager »

beetlenaut wrote: September 25th, 2021, 4:37 pm What would be better than a new editor--especially one embedded in the game--would be a plugin for an established one that does code completion. That would help the OP, and make everyone's editing less tedious. I know that at least Notepad++, gedit, and Kate support plugins. I'm sure others do as well.
Yeah, that's what Pentarctagon linked to:
Pentarctagon wrote: August 8th, 2021, 6:27 pm There are these. Writing a separate text editor seems kind of duplicative though.
(they do syntax highlighting at least; not sure if any do code completion, though... be sure to expand the "older" spoiler section in the linked thread, btw, as most of them are actually in there)
User avatar
beetlenaut
Developer
Posts: 2814
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Ingame Text Editor

Post by beetlenaut »

I'm aware of that thread, and I already have syntax highlighting. I was specifically talking about code completion though. I would like to type a start tag and have the end tag appear automatically for example. I've tried several of those editors and none of them did code completion--at least not for WML. If one of them does do it now, I would like to know about it.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
User avatar
Celtic_Minstrel
Developer
Posts: 2166
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: Ingame Text Editor

Post by Celtic_Minstrel »

I think Visual Studio code can do auto-closing tags. I'm not sure if the WML plugin leverages that capability though.

Another thing that would be nice with respect to code completion is something that uses the WML schema to suggest a tag or attribute name. It would be a lot of work (because of the WML preprocessor) but it would be very useful if someone could pull it off.
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
Post Reply