Main.cfg what goes in it?

The place to post your WML questions and answers.

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.
blueknight1758
Posts: 252
Joined: March 30th, 2011, 8:38 pm
Location: The UK

Re: Main.cfg what goes in it?

Post by blueknight1758 »

is this what you meant?
Because this doesn't gets an error message saying the game can't load the add-on.
Attachments
_main.cfg
(516 Bytes) Downloaded 148 times
Last edited by blueknight1758 on June 25th, 2011, 7:26 pm, edited 1 time in total.
Ceres
Forum Regular
Posts: 620
Joined: September 18th, 2010, 7:56 pm
Location: Germany

Re: Main.cfg what goes in it?

Post by Ceres »

The engine probably reads it as a very long textdomain, which is syntactically correct, so no error message.
And yes, you should really put every key/tag on a new line.
User avatar
Crendgrim
Moderator Emeritus
Posts: 1328
Joined: October 15th, 2010, 10:39 am
Location: Germany

Re: Main.cfg what goes in it?

Post by Crendgrim »

blueknight: No.
This time, you've got 3 lines:

Code: Select all

#textdomain wesnoth-Apocylyptic_Era[binary_path]    path=data/add-ons/Apocylyptic_Era/ 
[/binary_path][textdomain] name="wesnoth-Apocylyptic_Era" path="data/add-ons/Apocylyptic_Era/translations"
[/textdomain] #ifdef MULTIPLAYER #define APOCYLYPTIC_ERA #enddef #endif #ifdef APOCYLYPTIC_ERA#Macros{~add-ons/Apocylyptic_Era/macros/}{~add-ons/Apocylyptic_Era/macros/abilities.cfg}{~add-ons/Apocylyptic_Era/era.cfg}[+units]{~add-ons/Apocylyptic_Era/units/}{~add-ons/Apocylyptic_Era/images/units/tribals}[/units]#enddef
Either you didn't understand me or you're using a bad text editor (in which case I would second the suggestion from above to use Notepad++).
It should look like this:

Code: Select all

#textdomain wesnoth-Apocylyptic_Era
[binary_path]
    path=data/add-ons/Apocylyptic_Era/ 
[/binary_path]
[textdomain]
    name="wesnoth-Apocylyptic_Era"
    path="data/add-ons/Apocylyptic_Era/translations"
[/textdomain]
#ifdef MULTIPLAYER
#define APOCYLYPTIC_ERA
#enddef
#endif

#ifdef APOCYLYPTIC_ERA
# Macros
{~add-ons/Apocylyptic_Era/macros/}
{~add-ons/Apocylyptic_Era/macros/abilities.cfg}
{~add-ons/Apocylyptic_Era/era.cfg}
[+units]
    {~add-ons/Apocylyptic_Era/units/}
    {~add-ons/Apocylyptic_Era/images/units/tribals}
[/units]
#enddef
However, I don't think that including "~add-ons/Apocylyptic_Era/images/units/tribals" is useful, because I don't suppose there are any .cfgs. You only need to include all directories which contain these files (you may have meant to include ~add-ons/Apocylyptic_era/units/tribals instead).


Crend
UMC Story Images — Story images for your campaign!
User avatar
Pentarctagon
Project Manager
Posts: 5730
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Main.cfg what goes in it?

Post by Pentarctagon »

Moved to the WML Workshop.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
blueknight1758
Posts: 252
Joined: March 30th, 2011, 8:38 pm
Location: The UK

Re: Main.cfg what goes in it?

Post by blueknight1758 »

With the first one i get an unexpected #enddef#ifdef
but the second i getor #ifndef not terminated error
can someone tell me where this #enddef should go?
Attachments
__main.cfg
unexpected #enddef
(514 Bytes) Downloaded 128 times
_main.cfg
#ifdef or #ifndef not terminated
(505 Bytes) Downloaded 145 times
Ceres
Forum Regular
Posts: 620
Joined: September 18th, 2010, 7:56 pm
Location: Germany

Re: Main.cfg what goes in it?

Post by Ceres »

#ifdef is terminated with #endif.
#define is terminated with #enddef.
You mixed up those on the first one.

The problem with the second one is exactly what it says. You didn't terminate #ifdef (both of 'em).
blueknight1758
Posts: 252
Joined: March 30th, 2011, 8:38 pm
Location: The UK

Re: Main.cfg what goes in it?

Post by blueknight1758 »

Ah thanks that should help.
blueknight1758
Posts: 252
Joined: March 30th, 2011, 8:38 pm
Location: The UK

Re: Main.cfg what goes in it?

Post by blueknight1758 »

With this version the game boots up normally but i don't get the option to choose the era in the multiplayer screen.
Is there anything wrong with my main file or is something wrong with my era file?
Attachments
_main.cfg
(521 Bytes) Downloaded 133 times
era.cfg
(179 Bytes) Downloaded 136 times
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Main.cfg what goes in it?

Post by zookeeper »

You have an #ifdef APOCYLYPTIC_ERA but APOCYLYPTIC_ERA is never defined anywhere.

Also, the word is "apocalyptic".
blueknight1758
Posts: 252
Joined: March 30th, 2011, 8:38 pm
Location: The UK

Re: Main.cfg what goes in it?

Post by blueknight1758 »

So to fix it i would define APOCYLYPTIC_ERA? How do i do this if it is what i should be doing?

:EDIT I deleted #ifdef APOCYLYPTIC_ERA and one #endif and it works now thanks guys.
blueknight1758
Posts: 252
Joined: March 30th, 2011, 8:38 pm
Location: The UK

Re: Main.cfg what goes in it?

Post by blueknight1758 »

when i try and upload my add-on with this _server.pbl i get an #error you didn't specify a type when i have specified "era" can anyone see a problem?
Attachments
_server.pbl
(349 Bytes) Downloaded 141 times
User avatar
Crendgrim
Moderator Emeritus
Posts: 1328
Joined: October 15th, 2010, 10:39 am
Location: Germany

Re: Main.cfg what goes in it?

Post by Crendgrim »

blueknight1758 wrote:So to fix it i would define APOCYLYPTIC_ERA? How do i do this if it is what i should be doing?

:EDIT I deleted #ifdef APOCYLYPTIC_ERA and one #endif and it works now thanks guys.
Don't do this. Then your units will be loaded always, no matter which era is selected (IIRC).
Better use the define= key of the [campaign] tag: CampaignWML

And regarding the .pbl file, it says exactly what is wrong: You didn't specify a type= argument: PblWML#type


Crend
UMC Story Images — Story images for your campaign!
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Main.cfg what goes in it?

Post by zookeeper »

Crendgrim wrote:
blueknight1758 wrote:So to fix it i would define APOCYLYPTIC_ERA? How do i do this if it is what i should be doing?

:EDIT I deleted #ifdef APOCYLYPTIC_ERA and one #endif and it works now thanks guys.
Don't do this. Then your units will be loaded always, no matter which era is selected (IIRC).
Wrong; that's the only way to do it and how every era does it.
blueknight1758
Posts: 252
Joined: March 30th, 2011, 8:38 pm
Location: The UK

Re: Main.cfg what goes in it?

Post by blueknight1758 »

I've sorted the .pbl and it's now on the 1.9 add-on server as apocylyptic era
And in the next version Ill of fixed the spelling error in apocalyptic thanks zookeeper.
User avatar
Crendgrim
Moderator Emeritus
Posts: 1328
Joined: October 15th, 2010, 10:39 am
Location: Germany

Re: Main.cfg what goes in it?

Post by Crendgrim »

zookeeper wrote: Wrong; that's the only way to do it and how every era does it.
Ah, right, sorry. I mixed up campaign and era WML. My fault. :(
Then please disregard my post.


Crend
UMC Story Images — Story images for your campaign!
Post Reply