My Era not loading with no error message
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.
Re: My Era not loading with no error message
Was any of this code generated by an AI?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
It looks like it may be hallucinating WML tags that don't actually exist...
-
- Posts: 14
- Joined: May 29th, 2025, 6:39 pm
Re: My Era not loading with no error message
Actually I did get some AI help on a couple of the main files (can't trust those darn machines)gnombat wrote: ↑May 30th, 2025, 4:15 pmWas any of this code generated by an AI?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
It looks like it may be hallucinating WML tags that don't actually exist...
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
-
- Posts: 14
- Joined: May 29th, 2025, 6:39 pm
Re: My Era not loading with no error message
What I originally did was have this as my main file
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?
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 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?
Re: My Era not loading with no error message
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.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
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.
-
- Posts: 14
- Joined: May 29th, 2025, 6:39 pm
Re: My Era not loading with no error message
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: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.
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
- Pentarctagon
- Project Manager
- Posts: 5730
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: My Era not loading with no error message
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
take one down, patch it around
-2,147,483,648 little bugs in the code
Re: My Era not loading with no error message
OK, beware that the Era of Magic is a bit complicated, but we can still work with that...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.
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}
[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.-
- Posts: 14
- Joined: May 29th, 2025, 6:39 pm
Re: My Era not loading with no error message
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!gnombat wrote: ↑May 30th, 2025, 5:51 pmOK, beware that the Era of Magic is a bit complicated, but we can still work with that...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.
Line 37 of the_main.cfg
file for the Era of Magic looks like this:
That file looks like this. Basically it has several differentCode: Select all
{~add-ons/Era_of_Magic/EoMa_eras.cfg}
[era]
tags, because it defines several different eras. You will just need one[era]
tag for your era.
It is using aEOMA_SIDE
macro to include the various factions, but you don't need to use a macro for that. ThoseEOMA_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.

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.
Re: My Era not loading with no error message
Instead of writing this: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
Code: Select all
image="images/units/alliance/ft_footman.png"
Code: Select all
image="units/alliance/ft_footman.png"
There's probably a file getting included twice somehow... I noticed in the code you posted above you haveArchMessenger 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.
{~add-ons/Era_of_The_Frozen_Throne/units/scourge/}
written twice - is that still in your code?-
- Posts: 14
- Joined: May 29th, 2025, 6:39 pm
Re: My Era not loading with no error message
When I put the factions inside the [era] tag, I hadn't removed them from where they were before that.gnombat wrote: ↑May 30th, 2025, 6:43 pm
Instead of writing this:
Try writing this:Code: Select all
image="images/units/alliance/ft_footman.png"
(You can see examples of how this should look in the Era of Magic, like this.)Code: Select all
image="units/alliance/ft_footman.png"
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?
I also changed the image to not include the images/ file...
It works perfectly! No errors, exactly as I hoped it would!

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!

Re: My Era not loading with no error message
In the Units section you got the scourge twice and there is a sentinel missing.
Campaigns:Vendraxis Prophecy
Porting:Across the Ocean, Forgotten Legacy, Oath of Allegiance, Palms amid Blue Dunes, Carved in Stone, The Rod of Justice
Modification: Unit Color Changer, Unit Color Variation
Porting:Across the Ocean, Forgotten Legacy, Oath of Allegiance, Palms amid Blue Dunes, Carved in Stone, The Rod of Justice
Modification: Unit Color Changer, Unit Color Variation
-
- Posts: 14
- Joined: May 29th, 2025, 6:39 pm
Re: My Era not loading with no error message
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
Re: My Era not loading with no error message
I am really interested in your sprites if it is okay to share.ArchMessenger wrote: ↑May 31st, 2025, 2:08 pmYeah 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
Campaigns:Vendraxis Prophecy
Porting:Across the Ocean, Forgotten Legacy, Oath of Allegiance, Palms amid Blue Dunes, Carved in Stone, The Rod of Justice
Modification: Unit Color Changer, Unit Color Variation
Porting:Across the Ocean, Forgotten Legacy, Oath of Allegiance, Palms amid Blue Dunes, Carved in Stone, The Rod of Justice
Modification: Unit Color Changer, Unit Color Variation