Skip to content

API Hero give_birth

SolWayward edited this page Mar 2, 2026 · 1 revision

gm.hero.give_birth

Endpoint: gm.hero.give_birth

Syntax

gm.hero.give_birth <mother> [father] [gender]

Parameters

Parameter Type Required Position Description
mother / hero string Yes 0 The pregnant female hero (name, StringId, or player)
father string No 1 The father hero (name, StringId, or player). If not specified, resolved from pregnancy record or spouse
gender string No 1 or 2 Gender of the child: male or female. Default: random

Description

Forces an immediate birth for a pregnant hero, bypassing the normal pregnancy duration. The command delivers the offspring, fires native birth events, clears the pregnancy state, and removes the pregnancy record.

If no father is specified, the command attempts to resolve the father from the existing pregnancy record. If no pregnancy record father is found, it falls back to the mother's spouse or a random nearby male hero.

The child gender can be specified as male or female. If not specified, the gender is chosen randomly.

This command delegates to HeroManager.GiveBirth() for the actual birth logic.

Examples

Basic Usage - Immediate Birth

gm.hero.give_birth Ira

Output:

Ira gave birth to {child name} (father: {father name})

Specify Child Gender

gm.hero.give_birth Ira female

Output:

Ira gave birth to {daughter name} (father: {father name})

Specify Father and Gender

gm.hero.give_birth Ira Derthert male

Output:

Ira gave birth to {son name} (father: Derthert)

Using Named Arguments

gm.hero.give_birth mother:Ira father:Derthert gender:female

Output:

Ira gave birth to {daughter name} (father: Derthert)

Multi-Word Name with Single Quotes

gm.hero.give_birth 'Liena the Fierce' Derthert male

Output:

Liena the Fierce gave birth to {son name} (father: Derthert)

Using StringId

gm.hero.give_birth lord_1_3

Output:

Ira gave birth to {child name} (father: {father name})

Hero Alias with Gender Only

gm.hero.give_birth hero:Ira gender:male

Output:

Ira gave birth to {son name} (father: {auto-resolved father})

Usage Tips

Impregnate First: The mother must already be pregnant. Use gm.hero.impregnate to make a hero pregnant before using this command:

# Make hero pregnant, then immediately deliver
gm.hero.impregnate Ira Derthert
gm.hero.give_birth Ira

Father Resolution: When no father is specified, the system resolves the father in this order:

  1. From the existing pregnancy record (set during impregnation)
  2. From the mother's spouse
  3. From a random nearby male hero

Child Gender: If you want a specific gender for the child, specify it explicitly:

gm.hero.give_birth Ira female   # Daughter
gm.hero.give_birth Ira male     # Son

Using Player as Mother:

# If player is female and pregnant
gm.hero.give_birth player
gm.hero.give_birth player female

Error Handling

Hero Not Found: If the mother or father query matches no heroes:

Error: No hero found matching '{query}'.

Solution: Verify the hero exists using gm.query.hero first.

Multiple Matches: If the query matches multiple heroes:

Error: Multiple heroes found matching '{query}'. Please be more specific.

Solution: Use the exact hero StringId or a more specific name.

Mother is Male: If the specified mother is a male hero:

Error: Mother must be female. {name} is male.

Solution: Ensure you are targeting a female hero as the mother.

Not Pregnant: If the mother is not currently pregnant:

Error: {name} is not pregnant.

Solution: Use gm.hero.impregnate to make the hero pregnant first.

Mother Not Alive: If the mother is dead:

Error: {name} is not alive.

Solution: The mother must be alive for birth to occur.

Father is Female: If the specified father is a female hero:

Error: Father must be male. {name} is female.

Solution: Ensure the father parameter references a male hero.

Invalid Gender: If the gender argument is not recognized:

Error: Invalid gender: '{value}'. Use 'male' or 'female'.

Solution: Use male, female, m, or f.

Related Commands

Notes

Child Inheritance: The child born from the birth will inherit traits and culture based on the game's native child generation system, which considers both parents.

Native Events: The command fires the native OnGivenBirth campaign event, ensuring all game systems (including other mods) are properly notified of the birth.

Pregnancy Cleanup: After delivery, the pregnancy flag is cleared and the pregnancy record is removed. The mother can be impregnated again immediately if desired.

Immediate Delivery: Unlike natural pregnancies which take in-game time, this command delivers the child instantly regardless of when the pregnancy started.

Single Quotes Required: The TaleWorlds console system requires SINGLE QUOTES (not double quotes) for multi-word arguments. Double quotes will not work.

Named and Positional Arguments: Both named (mother:value) and positional arguments are supported. Named arguments use the format argName:value with no spaces around the colon.

Last Updated: 3/1/2026

Quick Links

🏠 Home | Quick Reference | Syntax Guide


Hero Commands
Clan Commands
Kingdom Commands
Settlement Commands
Item Commands
Troop Commands
Caravan Commands
Bandit Commands
Query Commands

Clone this wiki locally