Traits Namer


Version: 1.01

Author: Kread-EX


Introduction
This is a core script. By itself, it doesn't do anything but it is used by one of my scripts and will soon be used by at least a second one. The purpose of this script is to provide an automated way to name traits: the script retrieve the traits data and generates a name based on a customizable template.

As for version 1.0, you can now generate names for usable items effects, as well as generate help descriptions.

Instructions
Traits Namer provides you with a template to name traits. Most of it is rather self-explanatory, but pay attention to the CODENAMES hash:

CODE
CODENAMES = {
    
    11 => '%s resist: %d%'        , # Element rate
    12 => '%s debuff rate: %d%'   , # Debuff rate
    13 => '%s resist: %d%'        , # State rate
    14 => 'Immunity: %s'          , # State immunity
    21 => '%s: %d%'               , # Parameter rate
    22 => '%s: %d%'               , # Additional parameter rate
    23 => '%s: %d%'               , # Special parameter rate
    31 => 'Attack %s'             , # Physical attack attribute
    32 => 'Attack %s %d%'         , # Physical attack state
    33 => 'Attack speed %d'       , # Attack speed correction
    34 => 'Attack x%d'            , # Additional attacks
    41 => 'Command: %s'           , # Add skill type
    42 => 'Seal: %s'              , # Seal skill type
    43 => 'Skill: %s'             , # Add skill
    44 => 'Skill Seal: %s'        , # Seal skill
    51 => 'Can equip: %s'         , # Add equip type (weapon)
    52 => 'Can equip: %s'         , # Add equip type (armor)
    53 => 'Fix equip: %s'         , # Fix equip slot
    54 => 'Seal equip: %s'        , # Seal equip slot
    55 => 'Dual Wielding'         , # Dual Wield
    61 => 'Bonus Actions: +%d%'   , # Bonus actions
    62 => '%s'                    , # Special flag
    63 => 'Collapse type'         , # Collapse type (will never be used, I think)
    64 => '%s'                    , # Party ability
    
    }

The “%s” and “%d” are substitution fields. For instance, “%s resist: %d%” for the element rate will be displayed as “Element name” + “resist” + “value” + “%”.

The “%s” and “%d” are substitution fields. For instance, “%s resist: %d%” for the element rate will be displayed as “Element name” + “resist” + “value” + “%”.

The same applies to the help window description (CODEHELP), the usable items effects names (EFFECTS_CODENAME) and their description (EFFECTS_CODEHELP).

New feature: custom names. They’re here to allow you to chose completely different names (or descriptions) based on completely arbitrary values: for instance naming the trait. For instance, check the following examples:
CODE
1    CUSTOM_TRAITS = {
2    
3    [0, 32, 2, 50] => ['Poisonous', nil],
4    [0, 32, 2, 100] => ['Venomous', nil],
5    
6    }

Here, the trait giving 50% chance to add Poison to a normal attack will be called ‘Poisonous’ and the one with 100% chance ‘Venomous’. The nil value is where you put the custom description if you want one.

Script
Download

Compatibility
Not compatible with blue jelly things sucking on a pacifier.

Terms and Conditions
You are free to adapt this work to suit your needs.
You can use this work for commercial purposes if you like it.
Credit is appreciated.