My Era not loading with no error message

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.
gnombat
Posts: 892
Joined: June 10th, 2010, 8:49 pm

Re: My Era not loading with no error message

Post by gnombat »

ArchMessenger wrote: May 30th, 2025, 4:09 pm I'll be honest I'm not a seasoned coder, most of my stuff is copy-pasted with some renaming, so I don't remember where I took that from
Was any of this code generated by an AI? 🤖

It looks like it may be hallucinating WML tags that don't actually exist...
ArchMessenger
Posts: 14
Joined: May 29th, 2025, 6:39 pm

Re: My Era not loading with no error message

Post by ArchMessenger »

gnombat wrote: May 30th, 2025, 4:15 pm
ArchMessenger wrote: May 30th, 2025, 4:09 pm I'll be honest I'm not a seasoned coder, most of my stuff is copy-pasted with some renaming, so I don't remember where I took that from
Was any of this code generated by an AI? 🤖

It looks like it may be hallucinating WML tags that don't actually exist...
Actually I did get some AI help on a couple of the main files (can't trust those darn machines)
What specifically am I attempting to do here? Is there a guide I could follow? Thanks for bearing with me, I know I must seem like a total buffoon (sort of am)

I'll retry so code I handwrote from the "addon structure" guide in the wiki, but it didn't seem to be working originally so I turned to ai
ArchMessenger
Posts: 14
Joined: May 29th, 2025, 6:39 pm

Re: My Era not loading with no error message

Post by ArchMessenger »

What I originally did was have this as my main file

Code: Select all

#textdomain wesnoth-Era_of_The_Frozen_Throne

[textdomain]
    name="wesnoth-Era_of_The_Frozen_Throne"
    path="data/add-ons/Era_of_The_Frozen_Throne"
[/textdomain]

#ifdef MULTIPLAYER
[binary_path]
    path=data/add-ons/Era_of_The_Frozen_Throne/
[/binary_path]



{~add-ons/Era_of_The_Frozen_Throne/factions/alliance.cfg}
{~add-ons/Era_of_The_Frozen_Throne/factions/horde.cfg}
{~add-ons/Era_of_The_Frozen_Throne/factions/scourge.cfg}
{~add-ons/Era_of_The_Frozen_Throne/factions/sentinels.cfg}

[+units]
    {~add-ons/Era_of_The_Frozen_Throne/units/alliance/}
    {~add-ons/Era_of_The_Frozen_Throne/units/horde/}
    {~add-ons/Era_of_The_Frozen_Throne/units/scourge/}
    {~add-ons/Era_of_The_Frozen_Throne/units/scourge/}
[/units]

#endif
But I got an error on line 15, I figured I needed to but those four lines inside a (would that be a function? The thing with the brackets like [binary path]?)
but I wasn't sure how, so I had some Ai do a once over and it told me to replace the whole file with what you now have, and make that new frozen_throne script in the eras file. Is there a simple solution I'm missing?
User avatar
Ravana
Forum Moderator
Posts: 3313
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: My Era not loading with no error message

Post by Ravana »

gnombat
Posts: 892
Joined: June 10th, 2010, 8:49 pm

Re: My Era not loading with no error message

Post by gnombat »

ArchMessenger wrote: May 30th, 2025, 4:27 pm Actually I did get some AI help on a couple of the main files (can't trust those darn machines)
What specifically am I attempting to do here? Is there a guide I could follow? Thanks for bearing with me, I know I must seem like a total buffoon (sort of am)

I'll retry so code I handwrote from the "addon structure" guide in the wiki, but it didn't seem to be working originally so I turned to ai
If you've used AI for development with other programming languages, you may be somewhat disappointed when trying to use it to write WML code.

As I've written before - LLM-based AI chatbots tend to work best when they are trained on enormous amounts of training data, and there probably isn't enough WML code in the entire world to provide sufficient training data for an LLM's needs. Some people have had some degree of success with using AI for WML development, but it looks like it may be prone to hallucinating WML tags which don't exist.

Rather than using AI for development, I would recommend taking a look at the source code of your favorite era on the add-ons server and just try to mostly copy from that. If you don't have a favorite era you could look at the Era of Legends - it is fairly simple and straightforward.
ArchMessenger
Posts: 14
Joined: May 29th, 2025, 6:39 pm

Re: My Era not loading with no error message

Post by ArchMessenger »

gnombat wrote: May 30th, 2025, 5:04 pm
If you've used AI for development with other programming languages, you may be somewhat disappointed when trying to use it to write WML code.

As I've written before - LLM-based AI chatbots tend to work best when they are trained on enormous amounts of training data, and there probably isn't enough WML code in the entire world to provide sufficient training data for an LLM's needs. Some people have had some degree of success with using AI for WML development, but it looks like it may be prone to hallucinating WML tags which don't exist.

Rather than using AI for development, I would recommend taking a look at the source code of your favorite era on the add-ons server and just try to mostly copy from that. If you don't have a favorite era you could look at the Era of Legends - it is fairly simple and straightforward.
Originally that was what I tried to do, I looked at the _main.cfg file for Era of Magic, and did my best to replicate the parts I thought were applicable to me. (Unlike EoMa I don't have a campaign or resources addon) I tried to just copy the parts that seemed essential for function, or that referred to factions or units. The result of that was this main file:

Code: Select all

#textdomain wesnoth-Era_of_The_Frozen_Throne

[textdomain]
    name="wesnoth-Era_of_The_Frozen_Throne"
    path="data/add-ons/Era_of_The_Frozen_Throne"
[/textdomain]

#ifdef MULTIPLAYER
[binary_path]
    path=data/add-ons/Era_of_The_Frozen_Throne/
[/binary_path]



{~add-ons/Era_of_The_Frozen_Throne/factions/alliance.cfg}
{~add-ons/Era_of_The_Frozen_Throne/factions/horde.cfg}
{~add-ons/Era_of_The_Frozen_Throne/factions/scourge.cfg}
{~add-ons/Era_of_The_Frozen_Throne/factions/sentinels.cfg}

[+units]
    {~add-ons/Era_of_The_Frozen_Throne/units/alliance/}
    {~add-ons/Era_of_The_Frozen_Throne/units/horde/}
    {~add-ons/Era_of_The_Frozen_Throne/units/scourge/}
    {~add-ons/Era_of_The_Frozen_Throne/units/scourge/}
[/units]

#endif
but that didn't work. I'm a total novice to coding in general, I have almost no idea what I'm doing, so I don't know what I did wrong. I see what you mean about AI being unreliable for WML now, so could you help me understand what I did wrong here?
User avatar
Pentarctagon
Project Manager
Posts: 5730
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: My Era not loading with no error message

Post by Pentarctagon »

For this sort of thing you could also take a look at mainline itself. The wiki also generally has good documentation: https://wiki.wesnoth.org/EraWML
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
gnombat
Posts: 892
Joined: June 10th, 2010, 8:49 pm

Re: My Era not loading with no error message

Post by gnombat »

ArchMessenger wrote: May 30th, 2025, 5:22 pm Originally that was what I tried to do, I looked at the _main.cfg file for Era of Magic, and did my best to replicate the parts I thought were applicable to me.
OK, beware that the Era of Magic is a bit complicated, but we can still work with that...

Line 37 of the _main.cfg file for the Era of Magic looks like this:

Code: Select all

{~add-ons/Era_of_Magic/EoMa_eras.cfg}
That file looks like this. Basically it has several different [era] tags, because it defines several different eras. You will just need one [era] tag for your era.

It is using a EOMA_SIDE macro to include the various factions, but you don't need to use a macro for that. Those EOMA_SIDE lines are basically equivalent to your {~add-ons/Era_of_The_Frozen_Throne/factions/...} lines. So basically you want create an [era] tag, and put those faction lines inside that [era] tag.
ArchMessenger
Posts: 14
Joined: May 29th, 2025, 6:39 pm

Re: My Era not loading with no error message

Post by ArchMessenger »

gnombat wrote: May 30th, 2025, 5:51 pm
ArchMessenger wrote: May 30th, 2025, 5:22 pm Originally that was what I tried to do, I looked at the _main.cfg file for Era of Magic, and did my best to replicate the parts I thought were applicable to me.
OK, beware that the Era of Magic is a bit complicated, but we can still work with that...

Line 37 of the _main.cfg file for the Era of Magic looks like this:

Code: Select all

{~add-ons/Era_of_Magic/EoMa_eras.cfg}
That file looks like this. Basically it has several different [era] tags, because it defines several different eras. You will just need one [era] tag for your era.

It is using a EOMA_SIDE macro to include the various factions, but you don't need to use a macro for that. Those EOMA_SIDE lines are basically equivalent to your {~add-ons/Era_of_The_Frozen_Throne/factions/...} lines. So basically you want create an [era] tag, and put those faction lines inside that [era] tag.
Ah ha! Okay I tried adding an [era] tag to but my faction lines inside of... and it works! Thank you so much for the help! :mrgreen:
The faction loads, the only problem now is that none of my units' sprites load, all recruitable units and their advancements are completely invisible. Log says "error image: could not open image 'images/units/alliance/ft_footman.png'" for all units. I checked to make sure that their unit files have the right name for the image, so that's not it
The log also is warning me that apparently all of my unit IDs appear more than once, although that doesn't seem to be affecting how it plays. Just figured I'd mention it.
gnombat
Posts: 892
Joined: June 10th, 2010, 8:49 pm

Re: My Era not loading with no error message

Post by gnombat »

ArchMessenger wrote: May 30th, 2025, 6:20 pm The faction loads, the only problem now is that none of my units' sprites load, all recruitable units and their advancements are completely invisible. Log says "error image: could not open image 'images/units/alliance/ft_footman.png'" for all units. I checked to make sure that their unit files have the right name for the image, so that's not it
Instead of writing this:

Code: Select all

image="images/units/alliance/ft_footman.png"
Try writing this:

Code: Select all

image="units/alliance/ft_footman.png"
(You can see examples of how this should look in the Era of Magic, like this.)
ArchMessenger wrote: May 30th, 2025, 6:20 pm The log also is warning me that apparently all of my unit IDs appear more than once, although that doesn't seem to be affecting how it plays. Just figured I'd mention it.
There's probably a file getting included twice somehow... I noticed in the code you posted above you have {~add-ons/Era_of_The_Frozen_Throne/units/scourge/} written twice - is that still in your code?
ArchMessenger
Posts: 14
Joined: May 29th, 2025, 6:39 pm

Re: My Era not loading with no error message

Post by ArchMessenger »

gnombat wrote: May 30th, 2025, 6:43 pm
Instead of writing this:

Code: Select all

image="images/units/alliance/ft_footman.png"
Try writing this:

Code: Select all

image="units/alliance/ft_footman.png"
(You can see examples of how this should look in the Era of Magic, like this.)

There's probably a file getting included twice somehow... I noticed in the code you posted above you have {~add-ons/Era_of_The_Frozen_Throne/units/scourge/} written twice - is that still in your code?
When I put the factions inside the [era] tag, I hadn't removed them from where they were before that.
I also changed the image to not include the images/ file...

It works perfectly! No errors, exactly as I hoped it would! :mrgreen:

Seriously, thank you and all the helpful people here in this forum, I hope I wasn't too much of a bother
Everything seems to be running well as of right now. Thanks so much! ^_^
User avatar
Refumee
Posts: 286
Joined: February 12th, 2023, 10:17 am
Location: Vendraxis' Lair

Re: My Era not loading with no error message

Post by Refumee »

In the Units section you got the scourge twice and there is a sentinel missing.
ArchMessenger
Posts: 14
Joined: May 29th, 2025, 6:39 pm

Re: My Era not loading with no error message

Post by ArchMessenger »

Refumee wrote: May 31st, 2025, 1:48 pm In the Units section you got the scourge twice and there is a sentinel missing.
Yeah I saw this one. There are a few other mistakes in the file I sent over, but I've been able to spot and fix them on my own. I think I misspelled 'pathfidner' and 'eilvish' as well as listing Scourge twice haha
User avatar
Refumee
Posts: 286
Joined: February 12th, 2023, 10:17 am
Location: Vendraxis' Lair

Re: My Era not loading with no error message

Post by Refumee »

ArchMessenger wrote: May 31st, 2025, 2:08 pm
Refumee wrote: May 31st, 2025, 1:48 pm In the Units section you got the scourge twice and there is a sentinel missing.
Yeah I saw this one. There are a few other mistakes in the file I sent over, but I've been able to spot and fix them on my own. I think I misspelled 'pathfidner' and 'eilvish' as well as listing Scourge twice haha
I am really interested in your sprites if it is okay to share.
Post Reply