_main.cfg

Having trouble with the game? Report issues and get help here. Read this first!

Moderator: Forum Moderators

Forum rules
Before reporting issues in this section, you must read the following topic:
User avatar
Limabean
Posts: 369
Joined: August 26th, 2008, 2:14 pm
Location: New Hampshire, USA

_main.cfg

Post by Limabean »

basically, what is it? what do you put in it? where does it go (in relation to a mp scenario)? what does it do? Where can I find all this info (on the wiki)?
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: _main.cfg

Post by zookeeper »

If you {include} a directory with a _main.cfg in it, only the _main.cfg will be included. If you include a directory without a _main.cfg in it, all the .cfg files in that directory are included. That's pretty much it.

There is nothing you cannot do without using a _main.cfg.
User avatar
Limabean
Posts: 369
Joined: August 26th, 2008, 2:14 pm
Location: New Hampshire, USA

Re: _main.cfg

Post by Limabean »

but what is it? how do I make the _main.cfg for my own scenario? I can't find any mention of it on the wiki so i'm asking here.
for example, here is the _main.cfg from HttT:

Code: Select all

#textdomain wesnoth-httt
[textdomain]
    name="wesnoth-httt"
[/textdomain]

# wmlscope: set export=no
[campaign]
    id=heir_throne
    rank=30
    icon=../data/campaigns/Heir_To_The_Throne/images/units/konrad-lord-leading.png
    name= _ "Heir to the Throne"
    abbrev= _ "HttT"
    define=CAMPAIGN_HEIR_TO_THE_THRONE
    first_scenario=01_The_Elves_Besieged
    difficulties=EASY,NORMAL,HARD
    difficulty_descriptions={MENU_IMG_TXT2 "units/elves-wood/fighter.png~RC(magenta>red)" _"Fighter" _"(Beginner)"} +
    ";*" + {MENU_IMG_TXT2 "units/elves-wood/hero.png~RC(magenta>red)" _"Hero" _"(Normal)"} + ";" +
    {MENU_IMG_TXT2 "units/elves-wood/champion.png~RC(magenta>red)" _"Champion" _"(Challenging)"}
    description= _ "Fight to regain the throne of Wesnoth, of which you are the legitimate heir.

(Novice level, 25 scenarios.)"
    image=../data/campaigns/Heir_To_The_Throne/images/campaign_image.png

    [about]
        images = maps/wesnoth.png,story/httt_story1.jpg,story/httt_story2.jpg,story/httt_story3.jpg,story/httt_story4.jpg,story/httt_story5.jpg,story/httt_story6.jpg,story/httt_story7.jpg,story/httt_story8.jpg
    [/about]

    [about]
        title = _ "Campaign Design"
        [entry]
            name = "David White (Sirp)"
        [/entry]
    [/about]
    [about]
        title = _ "Campaign Maintenance"
        [entry]
            name = "Dimitar Ilccov (Mythological)"
            comment = "current maintainer"
        [/entry]
        [entry]
            name = "Scott Klempner"
        [/entry]
    [/about]
    [about]
        title = _ "Artwork and Graphics Design"
        [entry]
            name = "Francisco Muñoz (fmunoz)"
        [/entry]
        [entry]
            name = "Richard Kettering (Jetryl)"
        [/entry]
        [entry]
            name = "Neoriceisgood"
        [/entry]
    [/about]
    [about]
        title = _ "Miscellaneous"
        [entry]
            name = "Patrick Parker (Sapient)"
            comment = "WML assistance"
        [/entry]
    [/about]
[/campaign]

#ifdef CAMPAIGN_HEIR_TO_THE_THRONE
[binary_path]
    path=data/campaigns/Heir_To_The_Throne
[/binary_path]
[+units]
    {campaigns/Heir_To_The_Throne/units}
[/units]
{campaigns/Heir_To_The_Throne/utils}
{campaigns/Heir_To_The_Throne/scenarios}
#endif
all the examples of a _main.cfg that I can find are different.

The reason I ask is that i'm trying to upload my own scenario onto the add on list. According to the wiki I need my own _main.cfg
The Wiki wrote:Uploading a campaign to the in-game campaign server is a bit more complicated than uploading it to the fora.

Start by putting the campaign WML directory in your user campaigns directory (on Unix systems this will be ~/.wesnoth/data/campaigns).

If you are using a version of Wesnoth prior to 1.3.10, you will need to put the top-level .cfg file for the campaign alongside the WML directory in your user campaigns directory as well. At version 1.3.10 or later you don't need to do this, provided you have a _main.cfg in your WML directory.

You must put a valid .pbl file in your user campaigns directory as well. The syntax for this is described in PblWML.

So, if your campaign is named Fight_For_Foobar, your user campaigns directory must contain at least the subdirectory Fight_For_Foobar/ and the metadata file Fight_For_Foobar.pbl. If you are using the old style of top-level .cfg file, it should also contain Fight_For_Foobar.cfg (but it's better to use the new-style organization with a _main.cfg in your WML directory).
User avatar
Limabean
Posts: 369
Joined: August 26th, 2008, 2:14 pm
Location: New Hampshire, USA

Re: _main.cfg

Post by Limabean »

okay, i'll change my line of questioning: How about this?
How can I upload a scenario to the add-on list for others to download? The above wiki quote isn't too helpful so I just need some clarification. Obviously one of the things I don't get is "_main.cfg" so any info in that direction will be helpful. If I can make the _main.cfg for my scenario, I should be able to figure everything else out from there. Of course, if you don't want to explain that, i'd welcome a complete step-by-step process for uploading a mp scenario. :)
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: _main.cfg

Post by zookeeper »

If you want to upload an add-on, you need either myaddon/_server.pbl or myaddon.pbl and either myaddon/_main.cfg or myaddon.cfg. There's nothing more to _main.cfg than that and what I already explained. The WML language doesn't in any other way care about files, using multiple .cfg files (as opposed to, like, just one really big one) are just a way to organize your WML code. You could put all the code of a whole campaign in mycampaign/_main.cfg if you wanted to.
User avatar
Limabean
Posts: 369
Joined: August 26th, 2008, 2:14 pm
Location: New Hampshire, USA

Re: _main.cfg

Post by Limabean »

ok, I guess I was just confused about _main.cfg. I still can't seem to upload it and I think it's because of the locations of the files.
I have a folder un userdata/data/campaigns with the same title as my add-on. In that folder is the _main.cfg file with all the WML from my scenario inside it. I also have the .pbl file titled "Arena_Endurance.pbl" in that same folder. I might have done the .pbl file wrong so i'll post it here just in case:

Code: Select all

title="Arena Endurance"
type="scenario_mp"
icon="scenery/tent-fancy-red.png"
version="0.0.1"
author="Limabean"
passphrase="..."
description="Survive hordes of enemy spawns."
email="..."
btw, I was following the .pbl model from the wiki, here:
http://www.wesnoth.org/wiki/PblWML
So: What is wrong with this setup?
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: _main.cfg

Post by AI »

If you use the filename "Arena_Endurance.pbl", it should be in ~campaigns, if you put it in ~campaigns/Arena_Endurance, it should be named _server.pbl
User avatar
Limabean
Posts: 369
Joined: August 26th, 2008, 2:14 pm
Location: New Hampshire, USA

Re: _main.cfg

Post by Limabean »

hmm, I've tried moving the "Arena_Endurance.pbl" to ~campaigns as well as rebaming it _server.pbl and leaving it in my scenario folder. Neither seems to have worked. Anything else I might have done wrong?

btw, I'm assuming the wiki is up-to-date when it says this:
the wiki wrote:Open Wesnoth
Select "Get Add-ons" from the main menu
Accept the default server name campaigns.wesnoth.org and hit 'OK'
Scroll to the bottom of the list of available campaigns
Select "Publish Campaign: Your Campaign Name" (the last entry in the list of campaigns)
If the "publish campaign" option does not appear, then there is a problem with how the campaign is set up or with the .pbl file. Ask for help or review the earlier sections of this tutorial.
User avatar
Limabean
Posts: 369
Joined: August 26th, 2008, 2:14 pm
Location: New Hampshire, USA

Re: _main.cfg

Post by Limabean »

I've said everything i've done and followed peoples suggestions but it still isn't working. This problem seems pretty simple but it just isn't working for me. Is there any other information I can give that might be useful? Are there any other things I might have done wrong :?:
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: _main.cfg

Post by AI »

Remove your passphrase, then zip up a folder that contains everything and upload it here.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: _main.cfg

Post by zookeeper »

AI wrote:Remove your passphrase, then zip up a folder that contains everything and upload it here.
Exactly.

Before you ask if someone could help you, ask yourself whether it might be a good idea to actually make it easy for them to help you, instead of forcing them to write a novel if they want to help.
User avatar
Limabean
Posts: 369
Joined: August 26th, 2008, 2:14 pm
Location: New Hampshire, USA

Re: _main.cfg

Post by Limabean »

Sorry, I didn't think of that. Thanks for the help. :)
Here it is:
Attachments
myscenario.zip
(6.74 KiB) Downloaded 348 times
User avatar
Quietus
Art Contributor
Posts: 474
Joined: January 15th, 2008, 3:37 pm
Location: Worthing, UK

Re: _main.cfg

Post by Quietus »

Your PBL file is still a text document and thus will not work. You need an editor that can save in PBL format (preferably Notepad++, which is what i use). This is probably why it isnt working.

Also AFAIK the PBL file MUST be the same file name as the main.cfg (though not entirely sure on this one.

here is you PBL file as a PBL file and not a .TXT file

EDIT: tested, simply put the folder into your userdata and your ready to publish
Attachments
Arena_endurance.zip
(6.74 KiB) Downloaded 360 times
User avatar
Limabean
Posts: 369
Joined: August 26th, 2008, 2:14 pm
Location: New Hampshire, USA

Re: _main.cfg

Post by Limabean »

ahh :hmm: , now it makes sense. Thanks Quietus, zookeeper, and AI! :D

I just used notepad and couldn't save it as a PBL file, I don't have notepad++. thanks again for clearing that up.
Last edited by Limabean on October 2nd, 2008, 1:33 am, edited 1 time in total.
User avatar
ivanovic
Lord of Translations
Posts: 1149
Joined: September 28th, 2004, 10:10 pm
Location: Germany

Re: _main.cfg

Post by ivanovic »

You can save as something.pbl even with notepad. In the save box, just have " " around the name. That is, to save as something.pbl instead of automatically getting something.pbl.txt, enter this in the save dialog:

Code: Select all

"something.pbl"
Post Reply