Skip to content
cadon edited this page May 4, 2024 · 16 revisions

In the extractor, the "G"-button near the creature's name can be used to automatically create a name for that creature. The idea and first implementations are from @tsebring and @SkyDotNET, later @eaglexmw-gmail added some functions.

Usage

To use this feature, a naming-pattern has to be defined by right-clicking on the "G"-button near the creature-name input. E.g. a pattern like {species} {sex_short}-{hp} {dm} could create a name like "Argentavis F-38 40" for a female argentavis with 38 levels in HP and 40 levels in damage.

Any characters that don't match a key-word will not be changed. E.g. a pattern like {species} (Joe's) for an Argentavis will create Argentavis (Joe's).

Key-words

For a complete list of possible key-words see the pattern editor in the application. Listed here are some keywords as example.

  • {species}: species name

  • {spcsNm}: species name without vowels

  • {firstWordOfOldest}: the first word of the name of the first added creature of the species

  • {sex}: sex ("Male", "Female", "Unknown")

  • {sex_short}: "M", "F", "U"

  • {yy}: current year with 2 digits

  • {MM}: current month with 2 digits

  • {dd}: current day of the month with 2 digits

  • {hh}: current hours (24 h format)

  • {mm}: current minutes

  • {ss}: current seconds

  • {date}: current yy-MM-dd

  • {time}: current hh:mm:ss

  • {n}: if the name is not unique, the smallest possible number is appended (only creatues with a given sex are considered).

  • {highest1s}: the abbreviation of the name of the highest stat of that creature.

  • {highest2s}: the abbreviation of the name of the second highest stat of that creature. (works up to {highest4s})

  • {highest1l}: the level of the highest stat of that creature.

  • {highest2l}: the level of the second highest stat of that creature. (works up to {highest4l})

  • {n}: if the generated name already exists, the smallest number that makes the name unique is added. E.g. if you pattern is {species} {n}, and you have a creatures named Rex 1 and Rex 3, the next rex is named Rex 2 and then the next Rex 4, Rex 5 etc.

Breeding-levels

  • {hp}: Health
  • {st}: Stamina
  • {to}: Torpidity
  • {ox}: Oxygen
  • {fo}: Food
  • {wa}: Water
  • {te}: Temperature
  • {we}: Weight
  • {dm}: MeleeDamageMultiplier
  • {sp}: SpeedMultiplier
  • {fr}: TemperatureFortitude
  • {cr}: CraftingSpeedMultiplier

Breeding values

  • {hp_vb}: Breeding value of Health
  • {st_vb}: Breeding value of Stamina
  • {to_vb}: Breeding value of Torpidity
  • {ox_vb}: Breeding value of Oxygen
  • {fo_vb}: Breeding value of Food
  • {wa_vb}: Breeding value of Water
  • {te_vb}: Breeding value of Temperature
  • {we_vb}: Breeding value of Weight
  • {dm_vb}: Breeding value of MeleeDamageMultiplier
  • {sp_vb}: Breeding value of SpeedMultiplier
  • {fr_vb}: Breeding value of TemperatureFortitude
  • {cr_vb}: Breeding value of CraftingSpeedMultiplier

Other

  • {effImp}: Taming-effectiveness or Imprinting (depending if the creature was bred or tamed)
  • {gen}: Number of generations
  • {gena}: Number of generations in letters, e.g. generation 0 is 'A', generation 1 is 'B', generation 26 is 'AA' etc.
  • {muta}: Number of mutations
  • {rnd}: random number 100000 - 999999
  • {tn}: number of creatures of the current species in the library + 1

Functions

Functions can be used for more complex patterns. They are enclosed by double brackets and start with a hash. In general they look like {{#functionName: parameter1 | parameter2 | parameter3 }}. Functions can be nested, e.g. {{#casing: {{#substring: {species} | 0 | 4 }} | U }} will result in ANKY for an Ankylosaurus.

If

A conditional expression first checks for a condition and then creates text depending on if that condition is fulfilled. The only condition currently supported is a check if a stat is a top stat (i.e. the highest of all creatures of the same species in the library).

The syntax is {{#if: isTopXX | text if true | text if false }}. XX has to be replaced with the English 2-letter abbreviation of the according stat, e.g. Hp for Health, St for Stamina, etc. (see list above). The text if false can be omitted. For example {{#if: isTopHP | TopHP | noTopHP }} will result in TopHP if the creature has a top stat in health and in noTopHP else. You can also use other patterns in the conditional expression like {{#if: isTopHP | HP {hp} }}, which will result in HP 42 if the creature has 42 levels in HP and if this is a top stat.

Ifexpr

Tests if a given condition is true, e.g. {{#ifexpr: {species} == Ankylosaur | it's an Anky | it's not an Anky }} or {{#ifexpr: {hp} > 40 | good HP }}

Example for if-else-switch.

Expr

Simple calculation with two operands and one operator. Possible operators are +, -, *, /. {{#expr: expression }}, e.g. {{#expr: {hp} * 2 }}.

Len

Returns the length of the passed string. {{#len: string }}, e.g. {{#len: {isTophp}{isTopdm}{isTopwe} }} returns the number of top stats.

substring

{{#substring: text | start | length }}. Length can be ommited. If start is negative it takes the characters from the end. E.g. {{#substring: {species} | 0 | 4 }} will result in Anky for an Ankylosaurus.

replace

{{#replace: text | find | replaceBy }}, e.g. {{#replace: {species} | Abberant | Ab }} will result in Ab Rex for an Aberrant Rex. Spaces are removed and ignored from the find and replace string. If they should be considered, use &sp; for a space.

regexreplace

Regex replacing. Use { instead {, &vline; instead | and } instead of }. {{#regexreplace: text | pattern | replaceBy }}, e.g. {{#regexreplace: hp-st-we- | \\-$ | }}

customreplace

{{#customreplace: text }} will check if the text is listed in a specific json file and then replace it with the according value. The file could look like

{
  "Allosaurus": "Allo",
  "Snow Owl": "Owl"
}

For this file, {{#customreplace: {species} }} will transform Snow Owl to Owl for a snow owl and will do nothing for a rex. That way for all species (or other text) custom replacings can be specified. That file has to be named customReplacings.json and needs to be in the json-folder of ASB (i.e. in the ASB folder for the zip-version or the local-data folder for the installed version).

div

Divide by. {{#div: number | divisor }}, can be used to display stat-values in thousands, e.g. '{{#div: {hp_vb} | 1000 }}kHP' will result in 12kHP` if a creature has a stat value of 12540 for HP.

float_div

Divide by with possible float numers as result. {{#float_div: number | divisor | formatString }}, can be used to display stat-values in thousands with decimal digits, e.g. '{{#div: {hp_vb} | 1000 | F2 }}kHP' will result in 12.54kHP` if a creature has a stat value of 12540 for HP.

padleft

{{#padleft: number | length | padding character }}, e.g. {{#padleft: {hp_vb} | 8 | 0 }}

padright

{{#padright: number | length | padding character }}, e.g. {{#padright: {hp_vb} | 8 | _ }}

casing

{{#casing: text | casingtype (U, L , T) }}. U for UPPER, L for lower, T for Title. E.g. {{#casing: {species} | U }} will result in REX for a rex.

time

Displays the current date and / or time. {{#time: formatString }}, e.g. {{#time: yyyy-MM-dd_HH:mm }}.

format

{{#format: number | formatString }}, e.g. {{#format: {hp_vb} | 000000 }} For possible format-strings see Numeric format string.

format_int

Like #format, but supports x in the format for hexadecimal representations. {{#format_int: number | formatString }}, e.g. {{#format_int: {{#color: 0 }} | x2 }}.

color

Returns the colorId of the region. If the second parameter is not empty, the color name will be returned. Unused regions will only return a value if the third value is not empty. {{#color: regionId | return color name | return value even for unused regions }}, e.g. {{#color: 0 | true }} returns the name of the color in the region 0.

colorNew

Returns newInRegion if the region contains a color that is not yet available in that species. Returns newInSpecies if that color is not yet available in any region of that species. {{#colorNew: regionId }}, e.g. {{#colorNew: 0 }}.

indexOf

Returns the index of the second parameter in the first parameter. If the string is not contained, an empty string will be returned. {{#indexof: source string | string to find }}, e.g. {{#indexof: hello | ll }} returns 2.

md5

Returns the md5 hash of a given string. {{#md5: string }}, e.g. {{#md5: {hp}{st}{we} }}.

ListName

Reads a text file with names and returns the content of the given line (zero based, i.e. the first line is number 0). The text file has to be in the json folder (to open use the menu Settings - open json data folder…), the file's name has to be creatureNames[optionalSuffix].txt, where [optionalSuffix] can be stated in the function. {{#listName: line | fileSuffix }}. The files creatureNames.txt, creatureNamesF.txt and creatureNamesM.txt are given as example and will be overwritten with each update. To create your own files use a name like e.g. creatureNames_myNamesF.txt and the function like {{#listName: {n} | _myNamesF }}. If the line number is equal or larger than the available lines, the modulo is used, i.e. the counting starts at the first line.

rand

Returns a random integer, the parameter is either the max or the min and the max. {{#rand: 100 }} will return a random number in the range {0, 99}. {{#rand: 20 | 101 }} will return a random number in the range {20, 100}.

list

Formatting a list. Splits a string into elements, removes empty elements and joins them with a separator. {{#list: list string | initial separator | final separator }}. {{#list: 10,,48,24, | , | , }} will return 10,48,24. {{#list: 10,,48,24, | , | ,&sp; }} will return 10, 48, 24.

Special character escaping

The characters {, | and } are used in the function syntax, if you want to literally use these characters in the resulting name, use

  • { for {
  • &vline; for |
  • } for }.

Parameters are trimmed, i.e. space and newlines are removed at the start and end. You can use &sp; to keep a space.