can't get my campaign to load to the wesnoth "campaign" list
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.
can't get my campaign to load to the wesnoth "campaign" list
I am a beginner at this whole add-ons thing, and can't get my campaign to show up in the list of campaigns. (not the "add-ons" list)
That's my code.
Code: Select all
[textdomain]
name="wesnoth-Second_Front"
path="data/add-ons/Second_Front/translations"
[/textdomain]
[campaign]
#textdomain wesnoth-Second_Front
id=SECOND_FRONT
name= _ "Second Front"
abbrev= _ "SF"
define=CAMPAIGN_SECOND_FRONT
icon=peasant.png
image= second_front_logo.png
description= _ "Some text about my campaign!"
difficulties=EASY,NORMAL,HARD
difficulty_descriptions={MENU_IMG_TXT2 *&units/human-loyalists/peasant.png~TC(1,magenta) _"Civilian" _"(trivial)"} +
";" + {MENU_IMG_TXT2 units/human-loyalists/spearman.png~TC(1,magenta) _"Soldier" _"(simple)"} +
";" + {MENU_IMG_TXT2 units/human-loyalists/pikeman.png~TC(1,magenta) _"Veteran" _"(easy)"}
first_scenario=raiders
[/campaign]
#ifdef CAMPAIGN_SIMPLE_CAMPAIGN
{~add-ons/Second_Front/scenarios}
{~add-ons/Second_Front/maps}
[+units]
{~add-ons/Second_Front/units}
[/units]
#endif
Last edited by Pentarctagon on October 11th, 2018, 5:47 am, edited 1 time in total.
Reason: Please edit your previous post instead of multiposting.
Reason: Please edit your previous post instead of multiposting.
- beetlenaut
- Developer
- Posts: 2815
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: can't get my campaign to load to the wesnoth "campaign" list
There should be an error message directing you to a problem with the {MENU_IMG_TXT2} macro. Did you see that? Anyway, parentheses have a special meaning inside of macros calls, and the parentheses in your image paths are causing this error. If you put the complete image path in quotes in the macro call, that would fix it. (Get rid of the extra *& while you're at it.)
After that, you will also have a problem with mismatched defines, and an incomplete campaign image path, but you can worry about those after it shows up.
Also, are you working with BfW 1.12? That's old and not supported any more, so it's not a good idea. We are on 1.14.5 at the moment.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: can't get my campaign to load to the wesnoth "campaign" list
last night I just made my first campaign load without errors for the first time. so I know your struggle. I guess we all do.
However. I used a much simpler definition for the difficulties. This is taken out of the main.cfg from mainline campaign "Liberty". I just changed the names for the files and difficulies.
However. I used a much simpler definition for the difficulties. This is taken out of the main.cfg from mainline campaign "Liberty". I just changed the names for the files and difficulies.
Code: Select all
{CAMPAIGN_DIFFICULTY EASY "units/human-peasants/peasant.png~RC(magenta>red)" ( _ "Peasant") ( _ "Easy")} {DEFAULT_DIFFICULTY}
{CAMPAIGN_DIFFICULTY NORMAL "units/human-outlaws/outlaw.png~RC(magenta>red)" ( _ "Outlaw") ( _ "Normal")}
{CAMPAIGN_DIFFICULTY HARD "units/human-outlaws/fugitive.png~RC(magenta>red)" ( _ "Fugitive") ( _ "Difficult")}
stuff I worked on: Dunefolk Rework - ghype's Daily Art
- beetlenaut
- Developer
- Posts: 2815
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: can't get my campaign to load to the wesnoth "campaign" list
That's one of the reasons I asked about the version. CAMPAIGN_DIFFICULTY is an easier macro, but it doesn't work in 1.12. (MENU_IMG_TXT2 works in both versions, but will be removed at some point.)
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: can't get my campaign to load to the wesnoth "campaign" list
I have version 1.14.5
Re: can't get my campaign to load to the wesnoth "campaign" list
Thanks for your help. I did what ghype said, and the campaign still didn't show up in the list. BTW, where is the gamedata directory?
- beetlenaut
- Developer
- Posts: 2815
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: can't get my campaign to load to the wesnoth "campaign" list
I saved your code as _main.cfg, and put it in my add-ons folder inside a folder called Second_Front. It showed up in my campaign list as soon as I put quotes around the image path. I'm using 1.14.5 too, so it should work for you. What does your code look like now? Also tell us what files and folders you have because that might be the problem.
It depends on your operating system:
http://wiki.wesnoth.org/EditingWesnoth# ... _directory
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: can't get my campaign to load to the wesnoth "campaign" list
This is my current code.
Beetlenaut, maybe you can post your code so I can use it?
Code: Select all
[textdomain]
name="wesnoth-Second_Front"
path="data/add-ons/Second_Front/translations"
[/textdomain]
[campaign]
#textdomain wesnoth-Second_Front
id=SECOND_FRONT
name= _ "Second Front"
abbrev= _ "SF"
define=CAMPAIGN_SECOND_FRONT
icon=peasant.png
image= second_front_logo.png
description= _ "Some text about my campaign!"
difficulties=EASY,NORMAL,HARD
difficulty_descriptions=
{CAMPAIGN_DIFFICULTY EASY "units/human-peasants/peasant.png~RC(magenta>red)" ( _ "Peasant") ( _ "Easy")} {DEFAULT_DIFFICULTY}
{CAMPAIGN_DIFFICULTY NORMAL "units/human-loyalists/spearman.png~RC(magenta>red)" ( _ "Soldier") ( _ "Normal")}
{CAMPAIGN_DIFFICULTY HARD "units/human-loyalists/pikeman.png~RC(magenta>red)" ( _ "Orc hunter") ( _ "Difficult")}
first_scenario=raiders
[/campaign]
#ifdef CAMPAIGN_SIMPLE_CAMPAIGN
{~add-ons/Second_Front/scenarios}
{~add-ons/Second_Front/maps}
[+units]
{~add-ons/Second_Front/units}
[/units]
#endif
- beetlenaut
- Developer
- Posts: 2815
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: can't get my campaign to load to the wesnoth "campaign" list
But...my code was your code! (Just with quotation marks.) The code you just posted also works for me--exactly as it is this time. I asked about your directory structure because it seems like that must be the problem.
I made the folder userdata/data/add-ons/Second_Front. (Check the blue "i" icon at the bottom left of the BfW main screen to make sure you are using the correct userdata folder.) I made a file called _main.cfg in that folder, and copied the exact code from your last post into that file. Second Front showed up in my campaign list:
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: can't get my campaign to load to the wesnoth "campaign" list
here is my path: Documents\My Games\Wesnoth1.14\data\add-ons\Second_Front This is exactly what the "i" button tells me to do.
- beetlenaut
- Developer
- Posts: 2815
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: can't get my campaign to load to the wesnoth "campaign" list
Okay, and what exactly is in that folder?
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: can't get my campaign to load to the wesnoth "campaign" list
images, maps, scenarios, translations, units, and _main.cfg.
- beetlenaut
- Developer
- Posts: 2815
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: can't get my campaign to load to the wesnoth "campaign" list
Okay, but I meant everything, and what's inside of each and the code. Could you do this? Zip up the whole Second_Front folder into a zip file and post it. Then I know we will have enough information to fix your problem.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide