Problem with my addon's _main.cfg
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.
- Flameslash
- Posts: 633
- Joined: December 21st, 2008, 12:29 pm
Problem with my addon's _main.cfg
Okay, so I've been stumped by this for ages now. I've compared my campaign's _main.cfg to other campaigns, from mainline and addons, and I just can't work out what the problem is.
When I use this code:
I get an error about an unexpected endif.
However, if I don't include the #endif, I get an error about a missing endif. I simply can't work it out. I would be very grateful if someone could pount out to me where I'm going wrong.
When I use this code:
Code: Select all
#ifdef CAMPAIGN_TALE_OF_THE_DUNES
{~add-ons/Tale_of_the_Dunes/scenarios}
{~add-ons/Tale_of_the_Dunes/maps
[+units]
{~add-ons/Tale_of_the_Dunes/units}
[/units]
#endif
However, if I don't include the #endif, I get an error about a missing endif. I simply can't work it out. I would be very grateful if someone could pount out to me where I'm going wrong.
Last edited by Ravana on April 6th, 2018, 2:36 pm, edited 1 time in total.
Reason: Use [code] BBCode tags in your posts for embedding WML snippets.
Reason: Use [code] BBCode tags in your posts for embedding WML snippets.
Re: Problem with my addon's _main.cfg
You might have an unterminated preprocessor block (
Or even in your _main.cfg, really, since we can’t see the rest of the contents of it.
#ifdef
, #define
, most likely the latter) in one of the files in the paths you’re including there.Or even in your _main.cfg, really, since we can’t see the rest of the contents of it.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
Re: Problem with my addon's _main.cfg
The information about the problem file is good. Then you have to look for the first line number in the error code. There will be you mistake to fix. The rest is rubbish. You might get a new error code again. Continue this process until it works.
- Flameslash
- Posts: 633
- Joined: December 21st, 2008, 12:29 pm
Re: Problem with my addon's _main.cfg
Actually, it's a lot simpler than that. I forgot to close a bracket "{~add-ons/Tale_of_the_Dunes/maps" which is kind of embarrassing. Doing that fixed it.
But now the graphics of the "custom" units (I copied over the Nagas from UtBS, basically) won't show up, even though I've included them in the folder. I honestly can't figure out where the problem is, so if anyone wants to take a look, I've included a .zip fo the lot.
Basically, the images are in the folder Tale_of_the_Dunes/images/units/nagas/. The units' .cfgs have lines like "image="units/nagas/warden.png"". But the units just show up as invisible.
But now the graphics of the "custom" units (I copied over the Nagas from UtBS, basically) won't show up, even though I've included them in the folder. I honestly can't figure out where the problem is, so if anyone wants to take a look, I've included a .zip fo the lot.
Basically, the images are in the folder Tale_of_the_Dunes/images/units/nagas/. The units' .cfgs have lines like "image="units/nagas/warden.png"". But the units just show up as invisible.
- Attachments
-
- Tale_of_the_Dunes.zip
- (73.33 KiB) Downloaded 251 times
Re: Problem with my addon's _main.cfg
Look at the way every campaign with custom images uses a [binary_path]. That's what lets your custom images be found, nothing else.
- Flameslash
- Posts: 633
- Joined: December 21st, 2008, 12:29 pm
Re: Problem with my addon's _main.cfg
You're absolutely right about needing a [binary_path]. I had one at one point, but ended up getting rid of it when fiddling about trying to get rid of the earlier error. However, adding it back in doesn't seem to fix the error, unfortunately.
I've included how I've added the binary path, just in case I'm missing something obvious like I often do.
Note - I don't think "{~add-ons/Tale_of_the_Dunes/images/units/nagas}" needs to be there or does anything, but I included it just to try it.
I've included how I've added the binary path, just in case I'm missing something obvious like I often do.
Code: Select all
#ifdef CAMPAIGN_TALE_OF_THE_DUNES
[binary_path]
path=data/add-ons/Tale_of_the_Dunes/
[/binary_path]
{~add-ons/Tale_of_the_Dunes/scenarios}
{~add-ons/Tale_of_the_Dunes/maps}
{~add-ons/Tale_of_the_Dunes/images/units/nagas}
[+units]
{~add-ons/Tale_of_the_Dunes/units/nagas}
[/units]
#endif
Re: Problem with my addon's _main.cfg
If art does not show, it sometimes is not in the right folder or is wrongly spelled. Big and small letter matter here too.
For this there will be no error code.
Of course there might be an issue with your path. For this you have to copy the code of a working campaign faithfully.
For this there will be no error code.
Of course there might be an issue with your path. For this you have to copy the code of a working campaign faithfully.
- Pentarctagon
- Project Manager
- Posts: 5564
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: Problem with my addon's _main.cfg
With adding the [binary_path], the naga images do show up(spawned a couple from debug mode):
Code: Select all
#textdomain wesnoth-totd
[textdomain]
name="wesnoth-totd"
[/textdomain]
[campaign]
#textdomain wesnoth-totd
id=Tale of the Dunes
name= _ "Tale of the Dunes"
abbrev= _ "TotD"
define=CAMPAIGN_TALE_OF_THE_DUNES
id=Tale_of_the_Dunes
rank=230
name= _ "Tale of the Dunes"
icon=
image=
abbrev= _ "TotD"
first_scenario=01_Strangers_in_the_North
{CAMPAIGN_DIFFICULTY EASY "" ( _ "Fighter") ( _ "Easy")}
{CAMPAIGN_DIFFICULTY NORMAL "" ( _ "Commander") ( _ "Normal")} {DEFAULT_DIFFICULTY}
{CAMPAIGN_DIFFICULTY HARD "" ( _ "Lord") ( _ "Challenging")}
description= _ "Test"
[/campaign]
#ifdef CAMPAIGN_TALE_OF_THE_DUNES
[binary_path]
path=data/add-ons/Tale_of_the_Dunes/
[/binary_path]
{~add-ons/Tale_of_the_Dunes/scenarios}
{~add-ons/Tale_of_the_Dunes/maps}
[+units]
{~add-ons/Tale_of_the_Dunes/units/nagas}
[/units]
#endif
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
- Flameslash
- Posts: 633
- Joined: December 21st, 2008, 12:29 pm
Re: Problem with my addon's _main.cfg
Ah, it seems it was just the Warden which wasn't working with the binary path included - which just so happened to be the one I was spawning to check. Oops. Thank you.