Skip to content

API Hero abort_pregnancy

SolWayward edited this page Mar 2, 2026 · 1 revision

gm.hero.abort_pregnancy

Endpoint: gm.hero.abort_pregnancy

Syntax

gm.hero.abort_pregnancy <hero>

Parameters

Parameter Type Required Position Description
hero string Yes 0 The pregnant hero (name, StringId, or player)

Description

Terminates a hero's pregnancy without delivering a child. The pregnancy record is removed and the pregnancy flag is cleared. No child is born and no birth events are fired.

The command validates that the specified hero is currently pregnant. If the hero is not pregnant, an error is returned.

This command delegates to HeroManager.AbortBirth() for the actual abortion logic.

Examples

Abort by Name

gm.hero.abort_pregnancy Ira

Output:

Pregnancy terminated for Ira.

Abort by StringId

gm.hero.abort_pregnancy lord_1_3

Output:

Pregnancy terminated for Ira.

Using Named Argument

gm.hero.abort_pregnancy hero:Ira

Output:

Pregnancy terminated for Ira.

Multi-Word Name with Single Quotes

gm.hero.abort_pregnancy 'Liena the Fierce'

Output:

Pregnancy terminated for Liena the Fierce.

Abort Player Pregnancy

gm.hero.abort_pregnancy player

Output:

Pregnancy terminated for {Player Name}.

Usage Tips

Check Pregnancy Status: Use query commands to check if a hero is pregnant:

# Check hero details including pregnancy status
gm.query.hero_info Ira
gm.query.hero_info lord_1_3

# Then abort if needed
gm.hero.abort_pregnancy Ira

Re-Impregnate After Abortion: After aborting a pregnancy, the hero can be impregnated again immediately:

gm.hero.abort_pregnancy Ira
gm.hero.impregnate Ira Derthert

Undo Accidental Impregnation: If you accidentally impregnated the wrong hero or with the wrong father:

# Abort the unwanted pregnancy
gm.hero.abort_pregnancy Ira

# Re-impregnate with the correct father
gm.hero.impregnate Ira Derthert

Error Handling

Hero Not Found: If the hero 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.

Not Pregnant: If the specified hero is not pregnant:

Error: {name} is not pregnant.

Solution: Verify the hero's pregnancy status with gm.query.hero_info first.

Related Commands

Notes

Clean Removal: The command removes both the pregnancy flag and the underlying pregnancy record, ensuring a clean state. The hero can be impregnated again immediately.

No Birth Events: Unlike gm.hero.give_birth, this command does not fire any native birth events. No child is created and no game systems are notified of a birth.

No Side Effects: Aborting a pregnancy has no effect on the hero's health, relationships, or clan status.

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 (hero: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