Global

Methods

(static) createAppearance(character) → {String}

Description:
  • Describe a character's appearance and behavior. This description will be different each time the character is passed to this function.

Source:
Example
createAppearance({ character })
=> "Long brown hair, short stature"
Parameters:
Name Type Description
character Character

The character to describe.

Returns:

A description of the appearance and behavior of the character

Type
String

createBag(paramsopt) → {Bag}

Description:
  • Creates a collection of objects, held in a collection type known as a Bag.

Source:
Example
createBag({ count: 3, tags: "house"}).toString()
=> "A television (5/20), a winter jacket (worn; 0.5/10), and a ceramic bowl (3/1)."
Parameters:
Name Type Attributes Description
params Object <optional>
Properties
Name Type Attributes Default Description
value Number | String <optional>
10

the total value of items to add to the bag. The method will get as close to this value as possible, but may go over. If the value is a string, it is treated as dice notation.

repeat Number <optional>
20

This is the percentage chance that the last item selected will be added again. Can range from 0% (no repeated items) to 100% (only one item, as many as are needed to reach the other specified limits).

count Number <optional>
Number.MAX_VALUE

affects how many items will be added to the bag. The bag will not exceed this number of items.

enc Number <optional>
Number.MAX_VALUE

the maximum encumbrance of the bag. The method will get as close to this value as possible, but may go over.

uncountable Boolean <optional>
false

if true, items in the bag are treated as uncountable.

minValue Number <optional>
0

the minimum value of any items added to the bag (for some applications, like store stock, it is desirable to set this number above 0).

tags String <optional>
"*"

tags that will be used to search for items to add to the bag.

name String <optional>

a name for the bag.

description String <optional>

a description for the bag.

Returns:

a bag containing items that meet the specified criteria

Type
Bag

createBookTitle(optionsopt) → {string}

Description:
  • Generates a random fictional book title, optionally filtered by genre.

Source:
Parameters:
Name Type Attributes Default Description
options Object <optional>
{}

Book title creation options

Properties
Name Type Attributes Description
genre string <optional>

Genre of book to generate, selected from the values returned by getBookGenres(). If not provided, a genre is randomly selected.

Returns:

A generated book title

Type
string

createCharacter(options) → {Character}

Description:
  • Creates a new character with customizable attributes and generated characteristics.

Source:
Parameters:
Name Type Description
options Object

Character creation options

Properties
Name Type Attributes Default Description
possessions string <optional>
"None"

Starting possessions or equipment (can be "None", "Walk-About", or "Traveling")

age number <optional>
roll("14+3d12")

Character age in years

traits Object <optional>
{}

Initial trait values (e.g., { Cunning: 2, Strong: 2 })

gender string <optional>

Character gender ("male" or "female"). If not provided, randomly selected.

heritage string <optional>

Character heritage ("latino" or "anglo" lead to specific names, but any heritage can be provided). If not provided, randomly selected.

name string <optional>

Character name. If not provided, a name is generated.

preProfession string | Object <optional>

Character pre-collapse profession/career. Can be a profession name string or profession object, selected from the values returned by the getPreProfessions function. The option ”soldier” will select a military branch as a pre-collapse profession.

postProfession string | Object <optional>

Character post-collapse profession/career. Can be a profession name string or profession object, selected from the values returned by the getPostProfessions function. The option ”soldier” will select a military branch as a post-collapse profession. If “soldier” is selected pre-and post-collapse, the same branch will be used for both.

isChild boolean <optional>
false

Whether to create a child character (affects age and training)

Returns:

A new Character instance with generated or specified attributes

Type
Character

createCharacterName(params) → {CharacterName}

Description:
  • Generate a random name for a mid-century American, of the kind that would be wandering around an atomic era apocalypse. Does not add a nickname.

Source:
Example
createCharacterName({gender: 'female', heritage: 'latino'})
=> {"given": "Elena", "family": "Silva", "gender": "female", "heritage": "latino"}
let girl = createCharacterName({gender: 'female'})
girl.toString()
=> "Ada King"
Parameters:
Name Type Description
params Object
Properties
Name Type Description
gender String

'male' or 'female' name. Optional. If not specified, gender is 50/50.

heritage String

'anglo' or 'latino' (Optional. If not specified, 20% of names are Latino).

given String

set the given name to this name

family String

set the family name to this name

Returns:
Type
CharacterName

createContainer(optionsopt) → {Bag}

Description:
  • Creates a container (e.g., a first aid kit, cabinet, or ammunition box) of a given type, potentially pre-filled with items. Containers may be empty or show signs of prior use.

Source:
Parameters:
Name Type Attributes Default Description
options Object <optional>
{}

Container creation options

Properties
Name Type Attributes Description
type string <optional>

Type of container to create, selected from the values returned by getContainerTypes(). If not provided, a type is randomly selected.

Returns:

A new Bag instance (extends Bag) with a name, optional description, and items

Type
Bag

createEventLayer(options) → {void}

Description:
  • Enriches a location map with event-driven narrative content. Currently populates farm locations with family occupants, adding a family tree and roster to each farm's description.

Source:
Parameters:
Name Type Description
options Object

Event layer options

Properties
Name Type Description
map Map

A location map keyed by location type (e.g. "Farm"). Modified in place.

Returns:
Type
void

createFamily(optionsopt) → {Family}

Description:
  • Creates a multi-generational family with characters, relationships, and a shared family name. The family tree simulates births, deaths, and partnerships over time. A generation is counted when a child is born into the tree.

Source:
Parameters:
Name Type Attributes Default Description
options Object <optional>
{}

Family creation options

Properties
Name Type Attributes Default Description
generations number <optional>
1

Number of generations to simulate. Higher values produce larger families with grandchildren and great-grandchildren.

Returns:

A Family instance rooted at the founding mother, containing the full family tree

Type
Family

createGang(optionsopt) → {Gang}

Description:
  • Creates a gang of characters with a shared type, name, and profession-appropriate traits. Each member is a generated Character. Members may be assigned nicknames depending on gang type.

Source:
Parameters:
Name Type Attributes Default Description
options Object <optional>
{}

Gang creation options

Properties
Name Type Attributes Default Description
type string <optional>

Type of gang to create, selected from the values returned by getGangTypes() (e.g. "Biker Gang", "Street Gang", "Raiding Gang", "Cowboy Posse"). If not provided, randomly selected.

count number <optional>
null

Number of gang members to generate. If not provided, a count is rolled based on the gang type's configuration.

Returns:

A new Gang instance containing the generated member characters

Type
Gang

createHistoricalLayer(options) → {void}

Description:
  • Enriches a location map with pre-collapse historical narrative content. Selects locations and modifies them according to history rules: adding descriptions, renaming locations, placing items or containers, and optionally clearing their existing contents.

Source:
Parameters:
Name Type Description
options Object

Historical layer options

Properties
Name Type Description
map Map

A location map keyed by location type. Modified in place.

Returns:
Type
void

createHorseDescription(optionsopt) → {string}

Description:
  • Generates a descriptive string for a horse, including its type, optional behavior, coat pattern, and name.

Source:
Parameters:
Name Type Attributes Default Description
options Object <optional>
{}

Horse description options

Properties
Name Type Attributes Description
gender string <optional>

Gender of the horse ("male" or "female"). Male horses may be stallions, geldings, or colts; female horses may be mares or fillies. If not provided, randomly selected.

Returns:

A descriptive phrase for the horse (e.g. "a nervous spotted mare named Clover")

Type
string

createItem(optionsopt) → {Item}

Description:
  • Creates a random item from the item database, optionally filtered by name, tags, value range, or encumbrance range. Automatically generates titles for books, magazines, and horses.

Source:
Parameters:
Name Type Attributes Default Description
options Object <optional>
{}

Item creation options

Properties
Name Type Attributes Default Description
name string <optional>

Specific item name to look up. If not provided, an item is selected by tags.

tags string <optional>
"*"

Tag expression to filter items (e.g. "firearm", "ammo:22", "food -luxury"). Supports the full tag expression syntax including |, space (AND), and parentheses.

minValue number <optional>
0

Minimum item value (in caps).

maxValue number <optional>
Number.MAX_VALUE

Maximum item value (in caps).

minEnc number <optional>
0

Minimum item encumbrance.

maxEnc number <optional>
Number.MAX_VALUE

Maximum item encumbrance.

condition string <optional>

Item condition: "poor", "fair", "good", "excellent", or "mint". Affects value for items that can break. If not provided, randomly selected by rarity.

Returns:

An Item instance matching the given criteria, or null if no match is found

Type
Item

createKit(params) → {Object}

Description:
  • Generate the possessions that would be on the person of an active NPC (e.g. out on patrol, out for a night on the town, out on a raid or in the middle of criminal activity).

Source:
Parameters:
Name Type Description
params Object
Properties
Name Type Attributes Description
profession String | Profession <optional>

profession name or instance

preProfession String | Profession <optional>

profession name or instance

gender String <optional>

gender of character (male or female)

traveling Boolean <optional>

should this bag include extended equipment for exploring, and not just walk-abouts?

Returns:

An object of two bags, one under the property "clothing" and another under the bag of "possessions".

Type
Object

createLocation()

Description:
  • Create a location. You must supply the type of a location template and an instance tree will be created from that point in the template hierarchy, working downward throw all child nodes templates, returning the resulting instance tree. Tags are not currently used in selection of templates, but may be in the future.

Source:

createLocationName(optionsopt) → {string}

Description:
  • Generates a name for a location node based on its type and its position in the location hierarchy. Supports sequence-based naming (e.g. "Room 1", "Room 2") and type-specific name generation (e.g. street names, building names, geographic features).

Source:
Parameters:
Name Type Attributes Default Description
options Object <optional>
{}

Location name options

Properties
Name Type Description
child Object

The location node to name, with type (string) and parent (Object) properties representing its place in the location hierarchy.

Returns:

A generated name for the location node

Type
string

createMagazineTitle() → {String}

Description:
  • Magazines will be produced as generic items in bags, loot, etc. This method returns a magazine with an auto-generated title, usually pretty silly. The titles are random so these magazines are not considered collectible.

Source:
Returns:

magazine with a title

Type
String

createMemorabilia(optionsopt) → {Item}

Description:
  • Creates a random piece of pre-collapse memorabilia, such as a comic book, trading card, magazine, or movie poster.

Source:
Parameters:
Name Type Attributes Default Description
options Object <optional>
{}

Memorabilia creation options

Properties
Name Type Attributes Default Description
type string <optional>
"random"

Category of memorabilia to create. One of: "random", "encyclopedia", "baseball-card", "comic-book", "news-magazine", "movie-poster", or "propaganda-poster". Use getMemorabiliaTypes() to get the full list of valid types.

Returns:

An Item instance representing a piece of memorabilia

Type
Item

createProfession(optionsopt) → {Profession}

Description:
  • Looks up a profession from the profession database by name or tags.

Source:
Parameters:
Name Type Attributes Default Description
options Object <optional>
{}

Profession lookup options

Properties
Name Type Attributes Description
name string <optional>

Profession name to look up (e.g. "Scavenger", "Rancher"). The special value "soldier" randomly selects a military branch (Army, Navy, Marine, Air Force).

tags string <optional>

Tag expression to filter professions.

Returns:

A Profession instance matching the given criteria, or null if not found

Type
Profession

createRelationship(optionsopt) → {Relationship}

Description:
  • Creates a pair of related characters (e.g. mother and son, aunt and nephew) with appropriate age differences, shared or independent heritage, and related professions.

Source:
Parameters:
Name Type Attributes Default Description
options Object <optional>
{}

Relationship creation options

Properties
Name Type Attributes Default Description
equip boolean <optional>
true

Whether to equip both characters with traveling possessions.

relation string <optional>

The relationship type for the older character, selected from the values returned by getRelationships() (e.g. "Mother", "Father", "Brother"). If not provided, randomly selected by rarity.

familyName string <optional>
null

An optional family name to assign to the older character. The younger character may inherit it based on the relationship type.

Returns:

A Relationship instance containing both characters and their relationship label

Type
Relationship

createTimeSeries(options) → {Array.<string>}

Description:
  • Generates a series of publication dates for a periodical, within a historical date range. Useful for assigning realistic issue dates to magazines and newspapers.

Source:
Parameters:
Name Type Description
options Object

Time series options

Properties
Name Type Attributes Default Description
period string <optional>
"weekly"

Publication frequency: "weekly", "biweekly", "monthly", or "bimonthly".

dayOfWeek string <optional>

Advance each date to the next occurrence of this day (e.g. "Monday"). If not provided, dates are not adjusted to a specific weekday.

format string <optional>
"full"

Date format: "full" produces "Monday 2 Jan 1956"; any other value produces "Jan 1956".

startDate string | Date <optional>
"1956-01-01"

Start of the date range, as a "YYYY-MM-DD" string or Date object.

endDate string | Date <optional>
"1958-07-14"

End of the date range (exclusive), as a "YYYY-MM-DD" string or Date object.

Returns:

An array of formatted date strings within the given range

Type
Array.<string>

createWeather(optionsopt) → {Weather}

Description:
  • Creates a weather report for a given date and location, including temperature, wind, precipitation, sun/moon times, and game-relevant effects (cold/heat warnings, travel impacts).

Source:
Parameters:
Name Type Attributes Default Description
options Object <optional>
{}

Weather creation options

Properties
Name Type Attributes Default Description
date string <optional>

ISO 8601 date string (e.g. "2026-03-10"). If not provided, defaults to today's date.

lat number <optional>
38.24475

Latitude for sun/moon calculations.

long number <optional>
-98.657227

Longitude for sun/moon calculations.

Returns:

A Weather instance with temperature, wind, precipitation, sky conditions, sun times, moon phase, and gameplay effect warnings.

Type
Weather