Where to place newly defined units? _main.cfg or units dir?

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.
Post Reply
Hannibal Barca
Posts: 11
Joined: December 31st, 2008, 6:31 pm

Where to place newly defined units? _main.cfg or units dir?

Post by Hannibal Barca »

Hello all,

I have taken on the abandoned campaign of Elves and Wose.

One of the things that have been done is that a new race was defined and the units abilities, etc. where set in units field of _main.cfg.

Looking through the other games, it seems it's better to make a cfg file in the units folder now?

Thanks for reading this noobs question!
User avatar
TrashMan
Posts: 601
Joined: April 30th, 2008, 8:04 pm
Contact:

Re: Where to place newly defined units? _main.cfg or units dir?

Post by TrashMan »

Erm? What?

You mean the unit files themselves?
They usually go into userdata/data/campaign/YourCampaignFolder/units altough you cna place them elsewhere, as long as you specify the path of that folder in the _main.cfg, so Wesnoth knows where to look for your units.
Light travels much faster than sound, that's why some people seem bright until you hear them speak.

>>> MY LITTLE LAB! <<<
Hannibal Barca
Posts: 11
Joined: December 31st, 2008, 6:31 pm

Re: Where to place newly defined units? _main.cfg or units dir?

Post by Hannibal Barca »

I could have been a little more detailed.

This campaign dates from the 1.0 days as I saw a post from the auther about updating to 1.2.

he defined a new race with units and their config info is in _main.cfg. Might have been a 1.0 thing?

I am just asking as I noticed not many others did that.

If config defs belong in the units directory then I will convert it.

Thanks!
User avatar
TrashMan
Posts: 601
Joined: April 30th, 2008, 8:04 pm
Contact:

Re: Where to place newly defined units? _main.cfg or units dir?

Post by TrashMan »

Oh, that.

you can also place the race definition in the units folder.
Just name the file something different.
I named mine races_extra.cfg

Put some names and races in there and you're good to go.
Light travels much faster than sound, that's why some people seem bright until you hear them speak.

>>> MY LITTLE LAB! <<<
Hannibal Barca
Posts: 11
Joined: December 31st, 2008, 6:31 pm

Re: Where to place newly defined units? _main.cfg or units dir?

Post by Hannibal Barca »

That's what I figured and anyway it would clean up main.cfg.

Thanks!
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Where to place newly defined units? _main.cfg or units dir?

Post by zookeeper »

You can organize your .cfg files in whatever way you like, meaning that if you wanted to, you could just put all your WML in your _main.cfg. ;) But of course it's good practise to put units in their own .cfg's in the units/ dir and so on.
Post Reply