Race in 1.8

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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
Urs
Art Contributor
Posts: 437
Joined: August 11th, 2007, 5:33 pm

Race in 1.8

Post by Urs »

Recently I took to porting Imperial Era to 1.8, with limited success. Peter_the_Great ran wmllint on it, and it was playable. A problem was that apparently some/all of the units didn't have proper race id's. I noticed this when playing, and Gambit related the issue to me in a PM:
There are races in Imperial Era that have no race ID defined. This can cause typos and even out-of-sync errors in other add-ons.
That, of course, is a bad thing.

The issue appeared to be a simple one: all of the races used the name= tag for the race, rather than the id= tag... I compared this with EOM and wesnoth core. I fixed the issue with some pretty simple find/replace stuff. I also split the .cfg file that had all the race information on it into lots of little ones - EOM does this, although core does not. Now I have, for example, orcs-minuti.cfg, human-lavinians.cfg, and elves-wild.cfg instead of one big various.cfg. I moved all the movetypes into those folders.

However, this only fixed half the problem: now the units all have a race association, but it's the same one. Wild Elves, Frost Elves, etc... all of them are now "Lavinians" in the game.

What am I doing wrong? This is the race part of my elves-wild.cfg file, and the relevant part of a sidhe unit's cfg file:

Code: Select all

#textdomain wesnoth-Imperial_Era

#Sidhe
[race]
    id=sidhe
    num_traits=2
    markov_chain_size=2
    male_name= _ "race^Sidhe"
    female_name= _ "race+female^Sidhe"
    plural_name= _ "race^Sidhe"
    description= _ "When the Elves first arrived in Evrosia, they were united in one nation, led by the king Vanimaro. However, upon their encounter and subsequent battles with the Keltoi/Marauders, they fractured. The Issaelfr, who had taken up residence in Alfheim, wanted peace, but the Sidhe would accept no such thing. The matter was not helped when Vanimaro was slain in combat by the Marauders. Afterwards, the Sidhe dwelt in the eastern forests, their capital at Mt. Stormkeep. They were extremely xenophobic, and detested, above all, mankind, which they saw as a race of weaklings and traitors."
    {SIDHE_NAMES}
[/race]
...movetypes...

Code: Select all

[unit_type]
    id=Wild Elf Bladespinner
    name= _ "Bladespinner"
    race=sidhe
    image="units/elves-wild/bladespinner.png"
    {MAGENTA_IS_THE_TEAM_COLOR}
    hitpoints=50
    movement_type=wildwoodland
    {LESS_NIMBLE_ELF}
    movement=6
    experience=80
    level=2
    alignment=chaotic
    advances_to=Wild Elf Wardancer
    cost=32
    usage=fighter
    description= _ "The better warriors of the sidhe are known as bladespinners. They can, it is said, cut a man in three different places before he will lift his weapon."

...etc...

Alink
Inactive Developer
Posts: 181
Joined: March 5th, 2007, 6:45 am
Location: Belgium

Re: Race in 1.8

Post by Alink »

Urs wrote: However, this only fixed half the problem: now the units all have a race association, but it's the same one. Wild Elves, Frost Elves, etc... all of them are now "Lavinians" in the game.
It could be useful to know if you are referring to what show in the help race section, or in the main sidebar.
If the main sidebar is wrong too, that probably means that the race cfg files are misplaced or not used somehow.
If it's only the help, then indeed it's probably a id / name bug which confuses the help code when it generates the race sections. But I don't see error in what you posted.

User avatar
Urs
Art Contributor
Posts: 437
Joined: August 11th, 2007, 5:33 pm

Re: Race in 1.8

Post by Urs »

Both.

And at least one of the race cfg's is being read, since in the help section everyone is listed as "Lavinian" and the Lavinian description is present.

Alink
Inactive Developer
Posts: 181
Joined: March 5th, 2007, 6:45 am
Location: Belgium

Re: Race in 1.8

Post by Alink »

This kind of things is easy to debug when I can see the whole code. Can you post a zip of the current state of this addon somewhere? It looks like a bug (even if the fact that it works with mainline seems to show that it's possible to make it work), so I suggest to file a bug on Gna! (http://bugs.wesnoth.org) and attach the file there. Because without more info, I fear that it will be hard to diagnose the problem.

User avatar
Urs
Art Contributor
Posts: 437
Joined: August 11th, 2007, 5:33 pm

Re: Race in 1.8

Post by Urs »

Alright... I hope this works. Should I file a bug now, when it could still be a wml issue? Or should I wait until someone slightly more wml-literate than me has looked at the code?

Also, here we go: http://dl.dropbox.com/u/2436858/Imperial_Era.zip

Alink
Inactive Developer
Posts: 181
Joined: March 5th, 2007, 6:45 am
Location: Belgium

Re: Race in 1.8

Post by Alink »

All the WML code looks ok and when I test it, all race info seems correct. IIRC a bad addon can confuses enough the help to break other addons, because in multiplayer all WML unit data are mixed in the same pool. Have you tried after removing all other addons, and keep only the same data you posted?

There is still some other errors, though. The 'falcon' race seems missing. Also it reported the
"CAVERNEI_NAMES, etc.." as not defined. I believe it's because your {~add-ons/Imperial_Era/units/} don't control the inclusion order of the "units/" files. When including manually names.cfg first with{~add-ons/Imperial_Era/units/names.cfg}, it fixed that error. So maybe it's also a file order problem in your hand. I don't remember the file inclusion rules there but the fact that you split the races in different files etc.. may be important after all. I suggest to try as mainline core do and see if it fixes the problem.

Sorry, the fact that it works here make it harder to find the bug, and if it's a unrelated problem on your hand, your code may even be fine.

Post Reply