I. Traits
Traits all have:
- attribute requirements (in Trait Editor: as many as you like for STR, DEX, CON, INT, WIS and CHA)
- a required prerequisite trait (in Trait Editor: prerequisiteTrait)
- a trait which is replaced by the chosen trait (in Trait Editor: traitToReplaceByTag)
- a setting whether the class can get the trait at all (in Player Class Editor: allowed)
- a setting whether the trait is gainable during normal level up process vs. has to be specifically given by script (in Player Class Editor: needs specific training to learn)
- the required minimum level before a trait appears as choosable in the level up process (in Player Class Editor: at what level is available)
- a setting whether the trait is automatically given on level up (when reaching required level) or whether trait points have to be spend to buy it (in Player Class Editor: automatically learned); the number of trait points per level up can also be set in the Player Class Editor
Note: the trait replacement (1) removes the replaced trait should the player character already have it and (2) also prevents the player character from ever gaining the replaced trait or any traits that are connected to it by chain of trait requirements (eg if the trait strength +2 is replaced by dexterity +2 (imagine two different paths for character development, dex or strength focused), then the traits strength +4 (req. strenght +2) and strength + 6 (req. strentgh +4) will never appear as (later) available in info or level up screen). A replaced trait that was at the same time requirement of the trait replacing it does not do the described check for chain of trait requirements (otherwise it would remove the trait that should repalce it, too).
You can use the replace mechansim e.g. to have a vertical succession of traits that replace each other (including all effects that the prior versions might have added). This saves space in the traits list of a character as only the most developed version of a trait is shown.
Furthermore, you can make a player have to decide between two alternative traits, adding more player agenda and consequences to character development. Simply set two traits to replace each other and which ever is taken first blocks the other one forever.
Finally, you can grant traits Might & Magic style via scripts (eg. by trainers or as quest rewards). The script osAddTraitToPlayer.cs allows adding a trait (the replacment is done automatically then). Please note that no requirements at all are checked when adding a trait via script. If you want requirements in place, best build them into gc... checks in your conversation that finally leads to granting the trait. Useful scripts here are eg: gcCheckHasTrait.cs (for checking prerequisite trait or actually even traits (plural) here), gcCheckAttribute.cs or gcCheckIsClassLevel.cs.
II. Spells
Spells work basically the same (especially using in Trait Editor: spellToReplaceByTag), but are much simpler as they do not know requirements (no prerequsiste spells nor attribute requirements). There are also the corresponding scripts: osAddSpellToPlayer.cs and gcCheckHasSpell.cs.