race-file does not work

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
User avatar
Halbling
Posts: 16
Joined: February 19th, 2017, 5:12 pm
Location: Germany

race-file does not work

Post by Halbling »

Hi together!

I''m new in here and I didn't find my topic yet. If there is allready an topic for my problem, I'm sorry for opening an new one and would be happy, if someone could give me the link. Thanks!

I'm writting a little campaign just for fun and myself (maybe, if it works proper, you may have a look!) with a new race. Most things I got to run on myself, this websit and other campaign were great help, but I am stuck with the "race"-file. It's in an "utils"-folder, which is opened by my _main-file. My "specials"-file in this "utils"-folder is working, so I don't belive to find the mistake there.
I created this "race"-file by chanching an other working race-file of an other campaign. I thought, this would be the best way to do it. But, as said befor, it doesn't work.

If anyone has an idea, what I could have mad wrong, it would be very great, if you could help me! I attached the not-working file, if you want to search my mistake there.

Thanks for every help!!
Attachments
race.cfg
my not-working file
(6.32 KiB) Downloaded 185 times
User avatar
James_The_Invisible
Posts: 534
Joined: October 28th, 2012, 1:58 pm
Location: Somewhere in the Northlands, fighting dark forces
Contact:

Re: race-file does not work

Post by James_The_Invisible »

Welcome to the forums.
Well, it is indeed read by game in that place but [race] (and also [movetype]) is a sub-tag of [units] so you should place it somewhere under it. The campaign's _main.cfg file is fine but units folder might be a better place for it. Maybe you will need to make sure that the game reads it before any unit uses it (I am not sure about this because I never needed to create a new race/move type).
User avatar
Halbling
Posts: 16
Joined: February 19th, 2017, 5:12 pm
Location: Germany

Re: race-file does not work

Post by Halbling »

Thanks James!
I try something and hope it works ;)
I did try a lot, but you gave me a new idea!
User avatar
Halbling
Posts: 16
Joined: February 19th, 2017, 5:12 pm
Location: Germany

Re: race-file does not work

Post by Halbling »

It works!!!! :mrgreen:

Finally!
I spent hours on it and now it was so easy! Thanks again!
It was not my first idea, but it was the right direction to think about it!

Now I've got to play with my race a bit!
User avatar
Halbling
Posts: 16
Joined: February 19th, 2017, 5:12 pm
Location: Germany

how race-file does work

Post by Halbling »

Sorry for posting again. Three times without any other comment.

But for those who got the same or a similar problem as I had, I'd like to post my solution.

Here we go:
in my _main.cfg I got these lines:
#ifdef CAMPAIGN_HALBLINGTEST
[binary_path]
path=data/add-ons/HalblingTest
[/binary_path]

{~add-ons/HalblingTest/images}
{~add-ons/HalblingTest/images/...}
{~add-ons/HalblingTest/images/units/...}
{~add-ons/HalblingTest/...}
...
{~add-ons/HalblingTest/scenarios}
{~add-ons/HalblingTest/utils}
{~add-ons/HalblingTest/units}

[+units]
{~add-ons/HalblingTest/units}
[/units]


#endif
and in my race.cfg, which now is placed in the units-folder, these:
{~add-ons/HalblingTest/units/elves}
{~add-ons/HalblingTest/units/humans}
{~add-ons/HalblingTest/units/new_race}
just below [race] and [movetype].

Maybe not every line of these is necessary and maybe there is a smarter solution, but it works and I'm so happy about it!
Shiki
Developer
Posts: 348
Joined: July 13th, 2015, 9:53 pm
Location: Germany

Re: race-file does not work

Post by Shiki »

I think you don't need the {~add-ons/HalblingTest/units} before the [units] tag. And use [units] instead of [+units], that + is not needed anymore.
Try out the dark board theme.
User avatar
James_The_Invisible
Posts: 534
Joined: October 28th, 2012, 1:58 pm
Location: Somewhere in the Northlands, fighting dark forces
Contact:

Re: race-file does not work

Post by James_The_Invisible »

Code: Select all

{~add-ons/HalblingTest/images}
{~add-ons/HalblingTest/images/...}
{~add-ons/HalblingTest/images/units/...}
Also this does nothing unless you have any .cfg files there. And you should probably switch these lines:

Code: Select all

{~add-ons/HalblingTest/scenarios}
{~add-ons/HalblingTest/utils}
because macros have to be defined before they can be used as far as I know.
User avatar
Halbling
Posts: 16
Joined: February 19th, 2017, 5:12 pm
Location: Germany

Re: race-file does not work

Post by Halbling »

So I only need these lines, when there are .cfg fils in it. Great, thanks!

Now it looks like that:

Code: Select all

{~add-ons/HalblingTest/utils} 
{~add-ons/HalblingTest/units} 
{~add-ons/HalblingTest/scenarios}   

[units]
      {~add-ons/HalblingTest/units}
[/units]      
I need the units, becaus in the units-folder there is my race.cfg file. Every thing is still working fine, so I am happy :D
Post Reply