How to solve WML errors

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
User avatar
bigkahuna
Posts: 657
Joined: September 11th, 2010, 6:24 pm
Location: In your mind.

Re: How to easily debug WML

Post by bigkahuna »

So a colorful stderr.txt? So my method would still work. My method just shows the best way to solve individual errors, not how to find them. Now to find them, that 1.9 highlighting thing would help some.

EDIT: The in-game error log only shows one error at a time, while the stderr shows a bunch of them. Also, the in-game error log has a terrible habit of giving irrelevant errors. At least 1 out of 2 errors I get from there are irrelevant.
Check out my campaign Sweet Revenge!
Join the new R2D forum!
User avatar
Astoria
Inactive Developer
Posts: 1007
Joined: March 20th, 2008, 5:54 pm
Location: Netherlands

Re: How to easily debug WML

Post by Astoria »

bigkahuna wrote:So a colorful stderr.txt? So my method would still work. My method just shows the best way to solve individual errors, not how to find them. Now to find them, that 1.9 highlighting thing would help some.
Not exactly, it just shows the mistakes, no yellow highlighting. Just text pointing where the mistake is.
Formerly known as the creator of Era of Chaos and maintainer of The Aragwaithi and the Era of Myths.
User avatar
bigkahuna
Posts: 657
Joined: September 11th, 2010, 6:24 pm
Location: In your mind.

Re: How to easily debug WML

Post by bigkahuna »

Well that helps. Looks like they've cleaned up the error messages. I'll switch over to 1.9 once my favorite add-ons get ported :D
Check out my campaign Sweet Revenge!
Join the new R2D forum!
gavenkoa
Posts: 36
Joined: May 11th, 2009, 7:20 pm
Location: Dnepropetrovsk, Ukraine
Contact:

Re: How to solve WML errors

Post by gavenkoa »

Use wmllint tool (sudo apt-get install wesnoth-1.12-tools) to check code. It built into graphical wesnoth/data/tools/GUI.pyw tools that come with Wesnoth sources.
Jagr
Posts: 10
Joined: April 11th, 2025, 11:19 am

Re:

Post by Jagr »

Finisterrex wrote: June 7th, 2007, 11:56 am Yesterday it happens to me xD

i started reading all lines, but then i cut the WML as u said, and at the final i get the error... an "asdasdasd" typed by error lol.
total noob here
doin a lot with ai lately
(for some stuff its a mess)

but wouldn't it be easy today to first copy&paste your whole cfg to a ai and say: "Not working. Find mistake."

Afaik ai's hallucinate a lot of stuff but a erroneous "asdasadas" in a bunch of code it finds in seconds ...
=)
User avatar
Ravana
Forum Moderator
Posts: 3313
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: How to solve WML errors

Post by Ravana »

You should use schema validation, not hallucinations for that. https://wiki.wesnoth.org/SchemaWML
gnombat
Posts: 892
Joined: June 10th, 2010, 8:49 pm

Re: Re:

Post by gnombat »

Jagr wrote: April 17th, 2025, 9:00 pm but wouldn't it be easy today to first copy&paste your whole cfg to a ai and say: "Not working. Find mistake."
I would not expect an LLM-based chatbot to actually work very well with WML. The problem is that LLMs work best when they are trained on large amounts of training data - for example, with a popular programming language like C++, there are literally billions of lines of code that have been written in that language and can be used for training purposes. But with WML, there are only about a dozen mainline campaigns and a few hundred add-ons on the add-on server, and that's it; that's all the WML code that has ever been written. Even if all of it is used for training data, that's still not very much.

You might get better results when using Lua (because Lua is a popular, widely used programming language).
Jagr
Posts: 10
Joined: April 11th, 2025, 11:19 am

Re: Re:

Post by Jagr »

gnombat wrote: April 18th, 2025, 4:09 am I would not expect an LLM-based chatbot to actually work very well with WML. The problem is that LLMs work best when they are trained on large amounts of training data - for example, with a popular programming language like C++, there are literally billions of lines of code that have been written in that language and can be used for training purposes. But with WML, there are only about a dozen mainline campaigns and a few hundred add-ons on the add-on server, and that's it; that's all the WML code that has ever been written. Even if all of it is used for training data, that's still not very much.
i just tested grok (twitter ai)
gave it my scenario script and randomly put in some asdfasdasd

https://x.com/i/grok/share/v1pfJsBmqymUeXAGTP89NGWJA

found it instantly

it was at an ez place and not sayin untrained chatbots are much use in coding in general
but for simple stuff like this?
gnombat
Posts: 892
Joined: June 10th, 2010, 8:49 pm

Re: Re:

Post by gnombat »

That's actually pretty impressive work by Grok there - better than I expected.

But of course YMMV depending how complex your question is.
Jagr
Posts: 10
Joined: April 11th, 2025, 11:19 am

Re: How to solve WML errors

Post by Jagr »

totally YMMV

i used grok a lot to learn the Wesnoth map editor ("Where is..." "How do i...") and that worked great

for example: How do I make a map description that shows up in the multiplayer screen and not just on the addon server
and it told me in so many words "do that in the file dude doh! under description="

for coding so lala bc it tends to make stuff up or not understand
i was told there is another wml language out there so there is mix ups

but i fed it some basic wml pages from wesnoth.org and there are some results but more like a extended search machine
like "is there a tag that does XYZ? look here www... and on all linked pages"

but it totally depends on how you phrase the question and can go 100% wrong and lead you astray or just try sell you bs with the utmost conviction
Post Reply