_main.cfg

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

Moderators: Forum Moderators, Developers

Forum rules
Before reporting issues in this section, you must read the following topic:

_main.cfg

Postby Limabean » September 21st, 2008, 2:38 pm

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)?
When a scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong.
-Arthur C. Clarke-
User avatar
Limabean
 
Posts: 343
Joined: August 26th, 2008, 2:14 pm
Location: New Hampshire, USA

Re: _main.cfg

Postby zookeeper » September 21st, 2008, 3:25 pm

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
zookeeper
WML Wizard
 
Posts: 8510
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: _main.cfg

Postby Limabean » September 21st, 2008, 4:08 pm

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).
When a scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong.
-Arthur C. Clarke-
User avatar
Limabean
 
Posts: 343
Joined: August 26th, 2008, 2:14 pm
Location: New Hampshire, USA

Re: _main.cfg

Postby Limabean » September 24th, 2008, 7:23 pm

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. :)
When a scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong.
-Arthur C. Clarke-
User avatar
Limabean
 
Posts: 343
Joined: August 26th, 2008, 2:14 pm
Location: New Hampshire, USA

Re: _main.cfg

Postby zookeeper » September 24th, 2008, 7:32 pm

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
zookeeper
WML Wizard
 
Posts: 8510
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: _main.cfg

Postby Limabean » September 24th, 2008, 10:30 pm

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?
When a scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong.
-Arthur C. Clarke-
User avatar
Limabean
 
Posts: 343
Joined: August 26th, 2008, 2:14 pm
Location: New Hampshire, USA

Re: _main.cfg

Postby AI » September 25th, 2008, 9:27 pm

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
AI
UMC-Dev Cultist
 
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: _main.cfg

Postby Limabean » September 26th, 2008, 2:21 am

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.
When a scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong.
-Arthur C. Clarke-
User avatar
Limabean
 
Posts: 343
Joined: August 26th, 2008, 2:14 pm
Location: New Hampshire, USA

Re: _main.cfg

Postby Limabean » September 29th, 2008, 11:29 pm

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 :?:
When a scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong.
-Arthur C. Clarke-
User avatar
Limabean
 
Posts: 343
Joined: August 26th, 2008, 2:14 pm
Location: New Hampshire, USA

Re: _main.cfg

Postby AI » September 30th, 2008, 3:48 pm

Remove your passphrase, then zip up a folder that contains everything and upload it here.
AI
UMC-Dev Cultist
 
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: _main.cfg

Postby zookeeper » September 30th, 2008, 4:48 pm

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
zookeeper
WML Wizard
 
Posts: 8510
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: _main.cfg

Postby Limabean » September 30th, 2008, 11:23 pm

Sorry, I didn't think of that. Thanks for the help. :)
Here it is:
Attachments
myscenario.zip
(6.74 KiB) Downloaded 251 times
When a scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong.
-Arthur C. Clarke-
User avatar
Limabean
 
Posts: 343
Joined: August 26th, 2008, 2:14 pm
Location: New Hampshire, USA

Re: _main.cfg

Postby Quietus » September 30th, 2008, 11:31 pm

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 252 times
User avatar
Quietus
Art Contributor
 
Posts: 474
Joined: January 15th, 2008, 3:37 pm
Location: Worthing, UK

Re: _main.cfg

Postby Limabean » October 1st, 2008, 12:10 am

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.
When a scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong.
-Arthur C. Clarke-
User avatar
Limabean
 
Posts: 343
Joined: August 26th, 2008, 2:14 pm
Location: New Hampshire, USA

Re: _main.cfg

Postby ivanovic » October 1st, 2008, 7:24 am

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"
User avatar
ivanovic
Lord of Translations
 
Posts: 1146
Joined: September 28th, 2004, 10:10 pm
Location: Germany

Next

Return to Technical Support

Who is online

Users browsing this forum: No registered users and 0 guests