Making a custom race

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
Bilbo_Sacket
Posts: 37
Joined: February 28th, 2021, 4:27 am

Making a custom race

Post by Bilbo_Sacket »

I am trying to create a custom race for an era that I am making. The main purpose is to have a names list separate from wesnoth core, that might be found in another nation. However, units that I assign this race to always show up in miscellaneous.
User avatar
Lord-Knightmare
Discord Moderator
Posts: 2360
Joined: May 24th, 2010, 5:26 pm
Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
Contact:

Re: Making a custom race

Post by Lord-Knightmare »

Bilbo_Sacket wrote: April 9th, 2022, 12:10 am I am trying to create a custom race for an era that I am making. The main purpose is to have a names list separate from wesnoth core, that might be found in another nation. However, units that I assign this race to always show up in miscellaneous.
well, you have to define the [race][/race] first with an id and name
and the value of that id in [race][/race] is what the value the race= is in your unit type file.

Sample

Code: Select all

[race]
    id=slime
    name= _ "Slime"
[/race]

[unit_type]
    id="Ooze Slime"
    name= _ "Ooze Slime"
    race=slime
[/unit_type]
Lastly, refer to the wiki for anything you find confusing. It's mostly all there. Or, check examples where custom races are defined.
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
User avatar
Bilbo_Sacket
Posts: 37
Joined: February 28th, 2021, 4:27 am

Re: Making a custom race

Post by Bilbo_Sacket »

Sorry I probably should have included a snippet of code so that it would be easier for you to help, thankyou though, I will check my work and see if your suggestions help.
User avatar
Bilbo_Sacket
Posts: 37
Joined: February 28th, 2021, 4:27 am

Re: Making a custom race

Post by Bilbo_Sacket »

It appears I did not include the name value, it remains yet to be seen if that will make a difference however until I test it.
User avatar
Bilbo_Sacket
Posts: 37
Joined: February 28th, 2021, 4:27 am

Re: Making a custom race

Post by Bilbo_Sacket »

It did not work I will post a snippet with details pertaining to the mod removed I am not yet prepared to unveil my work of the last few months to the world.

Code: Select all

#textdomain wesnoth-##########

[race]
    id=race
	name=_ "race"
    male_name= _ "race^race"
    female_name= _ "race+female^race"
    plural_name= _ "race^race"
    num_traits=2
    markov_chain_size=3
    male_names="J" 
    description= _ ""#describe the society of the day.#
[/race]
I appreciate any suggestions.
User avatar
Celtic_Minstrel
Developer
Posts: 2207
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: Making a custom race

Post by Celtic_Minstrel »

That code is correct, so if it doesn't work, the problem is most likely that you've placed it in the wrong place. Unfortunately, without more context, it's impossible for us to point out the exact nature of your error, although I can say that both [race] and [unit_type] must be placed inside a [units] tag.
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
User avatar
Bilbo_Sacket
Posts: 37
Joined: February 28th, 2021, 4:27 am

Re: Making a custom race

Post by Bilbo_Sacket »

huh. Your advice was very useful, you addressed my problem exactly, I have tried to create a unique race several times, all ending in disaster because I did not catch that key element of where to call it. Thank you.
Post Reply