What traits do levelled up units automatically inherit?

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
Argothair
Posts: 19
Joined: May 10th, 2014, 12:01 am

What traits do levelled up units automatically inherit?

Post by Argothair »

When I'm writing custom unit files, what traits can I rely on them to automatically inherit from lower-level units?

E.g. suppose I have a Level 1 "Frog" that advances to a Level 2 "Battletoad." I add WML to the Frog unit file to make it lawful, give it the skirmisher ability, give it weakness to cold, give it resistance to impact, give it fast movement on water, and give it a high chance of being hit on mountain terrain. Do I also need to add that same WML to the Battletoad file, or is it enough to just say that the Frog advances_to Battletoad and then trust the system to copy over all of those traits?

For extra credit, is it safe to partially edit a set of traits? Suppose I want the Battletoad to lose its weakness to cold but keep its resistance to impact. Can I safely type in just:

Code: Select all

[resistance]
     cold=100
[/resistance]
and trust that the cold resistance will be updated and the impact resistance will be left unchanged from the Frog?

Thanks for help with this simple question -- I couldn't find it an answer in the Wiki, but maybe I'm just not looking in the right spots.

User avatar
Pentarctagon
Project Manager
Posts: 4427
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: What traits do levelled up units automatically inherit?

Post by Pentarctagon »

Those values are taken from the unit's movetype only - none are inherited. Putting a [resistance], for example, into the [unit_type] will override those resistances for that unit only (and yes, doing that is completely safe).
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code

Argothair
Posts: 19
Joined: May 10th, 2014, 12:01 am

Re: What traits do levelled up units automatically inherit?

Post by Argothair »

Thanks!

Post Reply