Traits and names along side races.

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
Vilebeggar
Posts: 153
Joined: September 5th, 2018, 5:21 pm
Location: Albania

Traits and names along side races.

Post by Vilebeggar »

So i made a unit part of the monster race, it showed up in game without a name or trait (like intelligent or strong). So how do you makes the links within these. Also how do you make a brand new race?
Competitive Wesnoth. For the fans by the fans.
User avatar
josteph
Inactive Developer
Posts: 741
Joined: August 19th, 2017, 6:58 pm

Re: Traits and names along side races.

Post by josteph »

Vilebeggar wrote: April 1st, 2019, 1:02 pm So i made a unit part of the monster race, it showed up in game without a name or trait (like intelligent or strong). So how do you makes the links within these.
The monster race has num_traits=0, meaning monsters don't get random traits by default. If you want them to get traits you'll need to assign them explicitly.

https://github.com/wesnoth/wesnoth/blob ... #L293-L300
Vilebeggar wrote: April 1st, 2019, 1:02 pm Also how do you make a brand new race?
With the [race] tag: https://wiki.wesnoth.org/UnitsWML#.5Brace.5D
Shiki
Developer
Posts: 348
Joined: July 13th, 2015, 9:53 pm
Location: Germany

Re: Traits and names along side races.

Post by Shiki »

You can override num_traits=1 in the [unit_type] as well.
If you want to avoid one of the standard traits like quickm, set also ignore_race_traits=yes, and add a trait inside the unit_type, e.g. with the {TRAIT_FEARLESS} macro.
Try out the dark board theme.
Vilebeggar
Posts: 153
Joined: September 5th, 2018, 5:21 pm
Location: Albania

Re: Traits and names along side races.

Post by Vilebeggar »

Is there any good example in the base game about this subject i could look at?
Competitive Wesnoth. For the fans by the fans.
Post Reply