Lua API reference
Note
This page is auto-generated from
data/raw/generate_docs.luaand should not be edited directly.
Warning
In Lua, functions can be called with a
:and pass the object itself as the first argument, eg:Members where this behaviour is intended to be used are marked as π² Methods
Their signature documentation hides the first argument to reflect that
- Call π« Function members with a
.- Call π² Method members with a
:Alternatively, you can still call π² Methods with a
., from the class type or the variable itself but a value of the given type must be passed as the first parameter (that is hidden)All of these do the same thing:
print(Angle.from_radians(3):to_degrees())print(Angle.to_degrees(Angle.from_radians(3)))local a = Angle.from_radians(3) print(a:to_degrees())local a = Angle.from_radians(3) print(a.to_degrees(a))local a = Angle.from_radians(3) print(Angle.to_degrees(a))
ActivityTypeId
Bases
No base classes.
Constructors
- ActivityTypeId.new( )
- ActivityTypeId.new( ActivityTypeId )
- ActivityTypeId.new( string )
Members
NULL_ID
π« Function β> ( ) -> ActivityTypeId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> ActivityTypeRaw
str
π² Method β> ( ) -> string
AmmunitionEffectId
Bases
No base classes.
Constructors
- AmmunitionEffectId.new( )
- AmmunitionEffectId.new( AmmunitionEffectId )
- AmmunitionEffectId.new( AmmunitionEffectIntId )
- AmmunitionEffectId.new( string )
Members
NULL_ID
π« Function β> ( ) -> AmmunitionEffectId
implements_int_id
π« Function β> ( ) -> boolean
int_id
π² Method β> ( ) -> AmmunitionEffectIntId
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> AmmunitionEffectRaw
str
π² Method β> ( ) -> string
AmmunitionEffectIntId
Bases
No base classes.
Constructors
- AmmunitionEffectIntId.new( )
- AmmunitionEffectIntId.new( AmmunitionEffectIntId )
- AmmunitionEffectIntId.new( AmmunitionEffectId )
Members
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> AmmunitionEffectRaw
str_id
π² Method β> ( ) -> AmmunitionEffectId
AmmunitionTypeId
Bases
No base classes.
Constructors
- AmmunitionTypeId.new( )
- AmmunitionTypeId.new( AmmunitionTypeId )
- AmmunitionTypeId.new( string )
Members
NULL_ID
π« Function β> ( ) -> AmmunitionTypeId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> AmmunitionTypeRaw
str
π² Method β> ( ) -> string
Angle
Bases
No base classes.
Constructors
No constructors.
Members
from_arcmin
π« Function β> ( number ) -> Angle
from_degrees
π« Function β> ( number ) -> Angle
from_radians
π« Function β> ( number ) -> Angle
to_arcmin
π² Method β> ( ) -> number
to_degrees
π² Method β> ( ) -> number
to_radians
π² Method β> ( ) -> number
ArmorPortionData
Bases
No base classes.
Constructors
No constructors.
Members
coverage
π» Variable β> integer
encumber
π» Variable β> integer
max_encumber
π» Variable β> integer
get_covered_parts
π² Method β> ( ) -> BodyPartTypeIntId[]
Avatar
Bases
PlayerCharacterCreature
Constructors
No constructors.
Members
get_active_missions
π² Method β> ( ) -> Mission[]
get_completed_missions
π² Method β> ( ) -> Mission[]
get_failed_missions
π² Method β> ( ) -> Mission[]
Bionic
Bases
No base classes.
Constructors
No constructors.
Members
ammo_count
π» Variable β> integer
charge_timer
π» Variable β> integer
energy_stored
π» Variable β> Energy
incapacitated_time
π» Variable β> TimeDuration
invlet
π» Variable β> integer
powered
π» Variable β> boolean
show_sprite
π» Variable β> boolean
activate
π² Method β> ( Character, boolean? ) -> boolean
Activates this bionic on the given character. Optional block_message (default true) suppresses messages.
ammo_loaded
π² Method β> ( ) -> string
deactivate
π² Method β> ( Character, boolean? ) -> boolean
Deactivates this bionic on the given character. Optional block_message (default true) suppresses messages.
get_auto_start_thresh
π² Method β> ( ) -> number
get_quality
π² Method β> ( string ) -> integer
has_flag
π² Method β> ( string ) -> boolean
id
π² Method β> ( ) -> BionicDataId
info
π² Method β> ( ) -> BionicDataRaw
Returns the BionicData definition for this bionic.
is_auto_start_keep_full
π² Method β> ( ) -> boolean
is_auto_start_on
π² Method β> ( ) -> boolean
is_fueled_by
π² Method β> ( string ) -> boolean
remove_flag
π² Method β> ( string )
set_auto_start_thresh
π² Method β> ( number )
set_flag
π² Method β> ( string )
toggle_auto_start_mod
π² Method β> ( )
toggle_safe_fuel_mod
π² Method β> ( )
BionicDataId
Bases
No base classes.
Constructors
- BionicDataId.new( )
- BionicDataId.new( BionicDataId )
- BionicDataId.new( string )
Members
NULL_ID
π« Function β> ( ) -> BionicDataId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> BionicDataRaw
str
π² Method β> ( ) -> string
BionicDataRaw
Bases
No base classes.
Constructors
No constructors.
Members
activated
π» Variable β> boolean
can_uninstall
π» Variable β> boolean
capacity
π» Variable β> Energy
charge_time
π» Variable β> integer
exothermic_power_gen
π» Variable β> boolean
fuel_capacity
π» Variable β> integer
fuel_efficiency
π» Variable β> number
fuel_multiplier
π» Variable β> integer
included
π» Variable β> boolean
is_remote_fueled
π» Variable β> boolean
kcal_trigger
π» Variable β> integer
no_uninstall_reason
π» Variable β> string
passive_fuel_efficiency
π» Variable β> number
points
π» Variable β> integer
power_activate
π» Variable β> Energy
power_deactivate
π» Variable β> Energy
power_over_time
π» Variable β> Energy
power_trigger
π» Variable β> Energy
remote_fuel_draw
π» Variable β> Energy
starting_bionic
π» Variable β> boolean
weight_capacity_bonus
π» Variable β> Mass
weight_capacity_modifier
π» Variable β> number
available_upgrades
π² Method β> ( ) -> string[]
Available upgrade paths for this bionic.
bash_protec
π² Method β> ( ) -> table<string, integer>
Bash protection by body part.
bullet_protec
π² Method β> ( ) -> table<string, integer>
Bullet protection by body part.
canceled_mutations
π² Method β> ( ) -> string[]
Mutations/traits removed when this bionic is installed.
coverage_power_gen_penalty
π² Method β> ( ) -> number?
Returns the coverage power gen penalty, or nil if not set.
cut_protec
π² Method β> ( ) -> table<string, integer>
Cut protection by body part.
description
π² Method β> ( ) -> string
Returns the translated description of this bionic.
enchantments
π² Method β> ( ) -> string[]
Returns enchantment IDs as string values.
encumbrance
π² Method β> ( ) -> table<string, integer>
Encumbrance caused by this bionic on each body part.
env_protec
π² Method β> ( ) -> table<string, integer>
Environmental protection by body part.
fake_item
π² Method β> ( ) -> string
flags
π² Method β> ( ) -> string[]
Returns the set of flag IDs on this bionic definition.
fuel_opts
π² Method β> ( ) -> string[]
Returns fuel type IDs that can power this bionic.
get_all
π« Function β> ( ) -> BionicDataRaw[]
Returns a list of every bionic definition in the game.
has_flag
π² Method β> ( string ) -> boolean
Checks whether this bionic has a specific flag.
id
π² Method β> ( ) -> BionicDataId
included_bionics
π² Method β> ( ) -> string[]
Bionics automatically installed alongside this one.
learned_spells
π² Method β> ( ) -> table<string, integer>
Spells learned when this bionic is installed, mapped to level.
name
π² Method β> ( ) -> string
Returns the translated name of this bionic.
occupied_bodyparts
π² Method β> ( ) -> table<string, integer>
Body parts occupied by this bionic and slot space required.
power_gen_emission
π² Method β> ( ) -> string
required_bionics
π² Method β> ( ) -> string[]
Other bionics required for this one to be installed.
stat_bonus
π² Method β> ( ) -> table<string, integer>
Returns stat bonuses as a table mapping stat name to bonus value. Stat names are the translated abbreviations (
STR,DEX,INT,PERin English).
upgraded_bionic
π² Method β> ( ) -> string
BodyPartTypeId
Bases
No base classes.
Constructors
- BodyPartTypeId.new( )
- BodyPartTypeId.new( BodyPartTypeId )
- BodyPartTypeId.new( BodyPartTypeIntId )
- BodyPartTypeId.new( string )
Members
NULL_ID
π« Function β> ( ) -> BodyPartTypeId
implements_int_id
π« Function β> ( ) -> boolean
int_id
π² Method β> ( ) -> BodyPartTypeIntId
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> BodyPartTypeRaw
str
π² Method β> ( ) -> string
BodyPartTypeIntId
Bases
No base classes.
Constructors
- BodyPartTypeIntId.new( )
- BodyPartTypeIntId.new( BodyPartTypeIntId )
- BodyPartTypeIntId.new( BodyPartTypeId )
Members
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> BodyPartTypeRaw
str_id
π² Method β> ( ) -> BodyPartTypeId
BookRecipe
Bases
No base classes.
Constructors
No constructors.
Members
hidden
π» Variable β> boolean
name
π» Variable β> CppVal<translation>
recipe
π» Variable β> RecipeRaw
skill_level
π» Variable β> integer
Character
Bases
Creature
Constructors
No constructors.
Members
cash
π» Variable β> integer
focus_pool
π» Variable β> integer
follower_ids
π» Variable β> CharacterId[]
male
π» Variable β> boolean
mutation_category_level
π» Variable β> table<MutationCategoryTraitId, integer>
Strength of each mutation category, computed from the characterβs mutations and their prerequisites. Categories without mutations are absent.
name
π» Variable β> string
activate_bionic
π² Method β> ( BionicDataId, boolean? ) -> boolean
activate_mutation
π² Method β> ( MutationBranchId )
activate_mutation_id
π² Method β> ( MutationBranchId )
add_addiction
π² Method β> ( AddictionType, integer )
add_bionic
π² Method β> ( BionicDataId )
add_item
π² Method β> ( Detached<Item> )
Adds a detached item to the player inventory
add_known_trap
π² Method β> ( TripointBubMs, TrapIntId )
Characterlearns that the given trap is on the given tripoint. If the trap is null, the character learns that there is no trap there.
add_morale
π² Method β> ( MoraleTypeDataId, integer, integer, TimeDuration, TimeDuration, boolean, ItypeRaw? )
add_perk
π² Method β> ( PerkId )
addiction_level
π² Method β> ( AddictionType ) -> integer
age
π² Method β> ( ) -> integer
all_items
π² Method β> ( boolean ) -> Item[]
Gets all items
all_items_with_flag
π² Method β> ( JsonFlagId, boolean ) -> Item[]
Gets all items with the given flag
assign_activity
π² Method β> ( ActivityTypeId, integer, integer, integer, string )
assign_lua_activity
π² Method β> ( table )
Assigns a Lua-backed activity.
The callbacks receive a table with keysuser(Character),activity(PlayerActivity),name,dataandpos.
Takes a table with keys:
type(ActivityTypeId): Activity type.duration(TimeDuration): How long the activity takes.on_finish(string, optional): Key ingame.activity_functionscalled when the activity finishes.on_turn(string, optional): Key ingame.activity_functionscalled every turn of the activity.data(table, optional): Serializable Lua state passed back to the callbacks asparams.data.pos(TripointBubMs, optional): Activity position. Callbacks receive it asparams.posin absolute coordinates.name(string, optional): Activity name, passed to the callbacks asparams.name.interruptable(boolean, optional): Whether a key press can interrupt the activity. Defaults to true.
base_age
π² Method β> ( ) -> integer
base_height
π² Method β> ( ) -> integer
bionic_armor_bonus
π² Method β> ( BodyPartTypeIntId, DamageType ) -> number
bionics_weight
π² Method β> ( ) -> Mass
blood_loss
π² Method β> ( BodyPartTypeIntId ) -> integer
blossoms
π² Method β> ( )
bodypart_exposure
π² Method β> ( ) -> table<BodyPartTypeIntId, number>
Returns how exposed each body part is through worn items, from 0.0 (fully covered) to 1.0 (bare).
bodyweight
π² Method β> ( ) -> Mass
bonus_from_enchantments
π² Method β> ( number, EnchantmentValueId, boolean? ) -> number
Gets the bonus from the enchantment value. Doesnβt handle max logic itself.
can_hear
π² Method β> ( TripointBubMs, integer ) -> boolean
can_mount
π² Method β> ( Monster ) -> boolean
can_pick_volume
π² Method β> ( Volume ) -> boolean
can_pick_weight
π² Method β> ( Mass, boolean ) -> boolean
can_run
π² Method β> ( ) -> boolean
can_takeoff
π² Method β> ( Item ) -> boolean
Checks if a given
<code>[Item](#sol::Item)</code>can be taken off.
can_unwield
π² Method β> ( Item ) -> boolean
can_wear
π² Method β> ( Item, boolean ) -> boolean
Checks if creature can wear a given item. If boolean parameter is true, ignores already worn items
can_wield
π² Method β> ( Item ) -> boolean
cancel_activity
π² Method β> ( )
check_mount_is_spooked
π² Method β> ( ) -> boolean
check_mount_will_move
π² Method β> ( TripointBubMs ) -> boolean
clear_bionics
π² Method β> ( )
clear_morale
π² Method β> ( )
clear_mutations
π² Method β> ( )
clear_skills
π² Method β> ( )
consume_items
π² Method β> ( CppVal<item_comp>[] )
Consumes items from inventory based on item component list
consume_requirement
π² Method β> ( RequirementData, table ) -> boolean
Consumes a requirementβs item components from the inventory and nearby map. Tools and qualities are not used. Returns false if the player cancels a component choice.
Takes a table with keys:
range(integer, optional): Radius for nearby map items. Defaults to the pickup range.count(integer, optional): Number of times to consume the requirement. Defaults to 1.
consume_tools
π² Method β> ( CppVal<tool_comp>[] )
Consumes tool charges from inventory based on tool component list
cough
π² Method β> ( boolean, integer )
crafting_inventory
π² Method β> ( ) -> Inventory
Returns the crafting inventory for this character (includes nearby items)
create_item
π² Method β> ( ItypeId, integer ) -> Item
Creates an item with the given id and adds it to the player inventory.
countsets the itemβs charges, not the number of items: exactly one item is created. For stackable (count-by-charges) items such as ammo,countis the stack size. For non-stackable items, pass a negative value (e.g. -1), since a positive one is still applied as charges. Tools spawned with a negative value get their default charges.
crossed_threshold
π² Method β> ( ) -> boolean
deactivate_bionic
π² Method β> ( BionicDataId, boolean? ) -> boolean
deactivate_mutation
π² Method β> ( MutationBranchId )
deactivate_mutation_id
π² Method β> ( MutationBranchId )
dismount
π² Method β> ( )
drench
π² Method β> ( integer, BodyPartTypeIntId[], boolean )
drop_all_items
π² Method β> ( )
Drops all items (inventory, worn, wielded) at the characterβs current position.
drop_inv
π² Method β> ( integer )
enough_power_for
π² Method β> ( BionicDataId ) -> boolean
expose_to_disease
π² Method β> ( DiseaseTypeId )
fall_asleep
π² Method β> ( )
π² Method β> ( TimeDuration )
forced_dismount
π² Method β> ( )
getID
π² Method β> ( ) -> CharacterId
get_activity
π² Method β> ( ) -> PlayerActivity
get_all_skills
π² Method β> ( ) -> SkillLevelMap
get_armor_acid
π² Method β> ( BodyPartTypeIntId ) -> integer
get_auto_start_thresh
π² Method β> ( BionicDataId ) -> number
get_base_traits
π² Method β> ( ) -> MutationBranchId[]
get_bionic
π² Method β> ( BionicDataId ) -> Bionic
get_bionics
π² Method β> ( ) -> BionicDataId[]
get_dependant_worn_items
π² Method β> ( Item ) -> Item[]
get_dex
π² Method β> ( ) -> integer
get_dex_base
π² Method β> ( ) -> integer
get_dex_bonus
π² Method β> ( ) -> integer
get_faction_id
π² Method β> ( ) -> FactionId
get_fatigue
π² Method β> ( ) -> integer
get_free_bionics_slots
π² Method β> ( BodyPartTypeIntId ) -> integer
get_healthy
π² Method β> ( ) -> number
get_healthy_mod
π² Method β> ( ) -> number
get_highest_category
π² Method β> ( ) -> MutationCategoryTraitId
get_hostile_creatures
π² Method β> ( integer ) -> Creature[]
get_int
π² Method β> ( ) -> integer
get_int_base
π² Method β> ( ) -> integer
get_int_bonus
π² Method β> ( ) -> integer
get_item_with_id
π² Method β> ( ItypeId, boolean ) -> Item
Gets the first occurrence of an item with the given id
get_items_if
π² Method β> ( table ) -> Item[]
Returns items from the inventory, wielded and worn, matching every given filter as an array of
Item.
Takes a table where each key is a filter; unknown keys show a debug message and are ignored. Available filters:
category(string or string[]):Itemcategory id is one of these, e.g. βfoodβ.type(ItemTypeId or ItemTypeId[]):Itemtype is one of these.is_food(boolean): Whether the item is food.flags(FlagId or FlagId[]):Itemhas at least one of these flags.need_charges(boolean): Tool items must have charges left.has_charges(table): { id = ItemTypeId, amount = integer }: item type isidand has at leastamountcharges.addiction_type(AddictionType, string, or array of those): Comestibleβs addiction type is one of these, e.g.<code>[AddictionType](#sol::AddictionType)</code>.ALCOHOLor"alcohol".material(MaterialTypeId, string, or array of those):Itemis made of at least one of these materials, e.g."stone".worn(boolean): Whether the item is worn.wielded(boolean): Whether the item is wielded.
get_kcal_percent
π² Method β> ( ) -> number
get_lowest_hp
π² Method β> ( ) -> integer
get_magic
π² Method β> ( ) -> KnownMagic
Access the characterβs spellbook and mana pool.
get_max_power_level
π² Method β> ( ) -> Energy
get_melee_stamina_cost
π² Method β> ( Item ) -> integer
get_morale
π² Method β> ( MoraleTypeDataId ) -> integer
get_morale_level
π² Method β> ( ) -> integer
get_movement_mode
π² Method β> ( ) -> CharacterMoveMode
get_mutations
π² Method β> ( boolean ) -> MutationBranchId[]
get_painkiller
π² Method β> ( ) -> integer
get_part_encumbrance
π² Method β> ( BodyPartTypeId ) -> integer
get_part_temp_btu
π² Method β> ( BodyPartTypeIntId ) -> integer
Deprecated: use get_part_temp_celsius instead. Gets the current temperature of a specific body part in legacy Body
TemperatureUnits.
get_part_temp_celsius
π² Method β> ( BodyPartTypeIntId ) -> Temperature
Gets the current temperature of a specific body part in Celsius.
get_per
π² Method β> ( ) -> integer
get_per_base
π² Method β> ( ) -> integer
get_per_bonus
π² Method β> ( ) -> integer
get_power_level
π² Method β> ( ) -> Energy
get_rad
π² Method β> ( ) -> integer
get_shout_volume
π² Method β> ( ) -> integer
get_skill_level
π² Method β> ( SkillId ) -> integer
get_skill_level_object
π² Method β> ( SkillId ) -> SkillLevel
get_sleep_deprivation
π² Method β> ( ) -> integer
get_stamina
π² Method β> ( ) -> integer
get_stamina_max
π² Method β> ( ) -> integer
get_stim
π² Method β> ( ) -> integer
get_stored_kcal
π² Method β> ( ) -> integer
get_str
π² Method β> ( ) -> integer
get_str_base
π² Method β> ( ) -> integer
get_str_bonus
π² Method β> ( ) -> integer
get_temp_btu
π² Method β> ( ) -> table<BodyPartTypeIntId, integer>
Deprecated: use get_temp_celsius instead. Gets all bodyparts and their associated temperatures in legacy Body
TemperatureUnits.
get_temp_celsius
π² Method β> ( ) -> table<BodyPartTypeIntId, Temperature>
Gets all bodyparts and their associated temperatures in Celsius.
get_thirst
π² Method β> ( ) -> integer
get_time_died
π² Method β> ( ) -> TimePoint
get_total_bionics_slots
π² Method β> ( BodyPartTypeIntId ) -> integer
get_used_bionics_slots
π² Method β> ( BodyPartTypeIntId ) -> integer
get_visible_creatures
π² Method β> ( integer ) -> Creature[]
get_working_arm_count
π² Method β> ( ) -> integer
get_working_leg_count
π² Method β> ( ) -> integer
get_worn_items
π² Method β> ( ) -> Item[]
global_sm_location
π² Method β> ( ) -> TripointAbsSm
global_square_location
π² Method β> ( ) -> TripointAbsMs
has_active_bionic
π² Method β> ( BionicDataId ) -> boolean
has_active_mutation
π² Method β> ( MutationBranchId ) -> boolean
has_activity
π² Method β> ( ActivityTypeId ) -> boolean
has_addiction
π² Method β> ( AddictionType ) -> boolean
has_alarm_clock
π² Method β> ( ) -> boolean
has_any_bionic
π² Method β> ( ) -> boolean
has_base_trait
π² Method β> ( MutationBranchId ) -> boolean
has_bionic
π² Method β> ( BionicDataId ) -> boolean
has_bionics
π² Method β> ( ) -> boolean
has_child_flag
π² Method β> ( MutationBranchId ) -> boolean
has_enchantment_flag
π² Method β> ( EnchantmentFlagId ) -> boolean
has_item_with_flag
π² Method β> ( JsonFlagId, boolean ) -> boolean
Checks for an item with the given flag
has_item_with_id
π² Method β> ( ItypeId, boolean ) -> boolean
Checks for an item with the given id
has_mabuff
π² Method β> ( MartialArtsBuffId ) -> boolean
has_max_power
π² Method β> ( ) -> boolean
has_morale
π² Method β> ( MoraleTypeDataId ) -> boolean
has_morale_to_craft
π² Method β> ( ) -> boolean
has_morale_to_read
π² Method β> ( ) -> boolean
has_opposite_trait
π² Method β> ( MutationBranchId ) -> boolean
has_perk
π² Method β> ( PerkId ) -> boolean
has_power
π² Method β> ( ) -> boolean
has_trait_flag
π² Method β> ( JsonTraitFlagId ) -> boolean
has_trait_type
π² Method β> ( string ) -> boolean
has_two_arms
π² Method β> ( ) -> boolean
has_watch
π² Method β> ( ) -> boolean
heal
π² Method β> ( BodyPartTypeIntId, integer )
healall
π² Method β> ( integer )
healing_rate
π² Method β> ( number ) -> number
healing_rate_medicine
π² Method β> ( number, BodyPartTypeIntId ) -> number
hearing_ability
π² Method β> ( ) -> number
height
π² Method β> ( ) -> integer
hitall
π² Method β> ( integer, integer, Creature ) -> integer
hurtall
π² Method β> ( integer, Creature, boolean )
in_climate_control
π² Method β> ( ) -> boolean
invalidate_crafting_inventory
π² Method β> ( )
Invalidates the cached crafting inventory
irradiate
π² Method β> ( number, boolean ) -> boolean
is_armed
π² Method β> ( ) -> boolean
is_auto_start_keep_full
π² Method β> ( BionicDataId ) -> boolean
is_auto_start_on
π² Method β> ( BionicDataId ) -> boolean
is_blind
π² Method β> ( ) -> boolean
is_deaf
π² Method β> ( ) -> boolean
is_hauling
π² Method β> ( ) -> boolean
is_invisible
π² Method β> ( ) -> boolean
is_limb_broken
π² Method β> ( BodyPartTypeIntId ) -> boolean
is_limb_disabled
π² Method β> ( BodyPartTypeIntId ) -> boolean
is_max_power
π² Method β> ( ) -> boolean
is_mounted
π² Method β> ( ) -> boolean
is_quiet
π² Method β> ( ) -> boolean
is_rad_immune
π² Method β> ( ) -> boolean
is_stealthy
π² Method β> ( ) -> boolean
is_throw_immune
π² Method β> ( ) -> boolean
is_weak_to_water
π² Method β> ( ) -> boolean
is_wearing
π² Method β> ( Item ) -> boolean
is_wearing_active_optcloak
π² Method β> ( ) -> boolean
is_wearing_active_power_armor
π² Method β> ( ) -> boolean
is_wearing_helmet
π² Method β> ( ) -> boolean
is_wearing_on_bp
π² Method β> ( ItypeId, BodyPartTypeIntId ) -> boolean
is_wearing_power_armor
π² Method β> ( boolean ) -> boolean
is_wielding
π² Method β> ( Item ) -> boolean
is_worn
π² Method β> ( Item ) -> boolean
item_worn_with_flag
π² Method β> ( JsonFlagId, BodyPartTypeIntId ) -> Item
item_worn_with_id
π² Method β> ( ItypeId, BodyPartTypeIntId ) -> Item
items_with
π² Method β> ( bool ) -> Item[]
Filters items
knows_martial_art
π² Method β> ( MartialArtsId ) -> boolean
knows_recipe
π² Method β> ( RecipeId ) -> boolean
knows_trap
π² Method β> ( TripointBubMs ) -> boolean
Whether the character knows about the trap at the given tripoint.
learn_martial_art
π² Method β> ( MartialArtsId )
learn_recipe
π² Method β> ( RecipeId )
mabuff_armor_bonus
π² Method β> ( DamageType ) -> integer
mabuff_arpen_bonus
π² Method β> ( DamageType ) -> integer
mabuff_attack_cost_mult
π² Method β> ( ) -> number
mabuff_attack_cost_penalty
π² Method β> ( ) -> integer
mabuff_block_bonus
π² Method β> ( ) -> integer
mabuff_damage_bonus
π² Method β> ( DamageType ) -> integer
mabuff_damage_mult
π² Method β> ( DamageType ) -> number
mabuff_dodge_bonus
π² Method β> ( ) -> number
mabuff_speed_bonus
π² Method β> ( ) -> integer
mabuff_tohit_bonus
π² Method β> ( ) -> number
max_stored_kcal
π² Method β> ( ) -> integer
metabolic_rate
π² Method β> ( ) -> number
mod_base_age
π² Method β> ( integer )
mod_base_height
π² Method β> ( integer )
mod_dex_bonus
π² Method β> ( integer )
mod_fatigue
π² Method β> ( integer )
mod_healthy
π² Method β> ( number )
mod_healthy_mod
π² Method β> ( number, number )
mod_int_bonus
π² Method β> ( integer )
mod_max_power_level
π² Method β> ( Energy )
mod_painkiller
π² Method β> ( integer )
mod_per_bonus
π² Method β> ( integer )
mod_power_level
π² Method β> ( Energy )
mod_rad
π² Method β> ( integer )
mod_skill_level
π² Method β> ( SkillId, integer )
mod_sleep_deprivation
π² Method β> ( integer )
mod_speed_bonus
π² Method β> ( integer )
mod_stamina
π² Method β> ( integer )
mod_stim
π² Method β> ( integer )
mod_stored_kcal
π² Method β> ( integer )
mod_str_bonus
π² Method β> ( integer )
mod_thirst
π² Method β> ( integer )
mount_creature
π² Method β> ( Monster )
mutate
π² Method β> ( )
mutate_category
π² Method β> ( MutationCategoryTraitId )
π² Method β> ( MutationCategoryTraitId, boolean )
mutate_towards
π² Method β> ( MutationBranchId[], integer ) -> boolean
π² Method β> ( MutationBranchId ) -> boolean
mutation_armor
π² Method β> ( BodyPartTypeIntId, DamageType ) -> number
mutation_effect
π² Method β> ( MutationBranchId )
mutation_loss_effect
π² Method β> ( MutationBranchId )
mutation_ok
π² Method β> ( MutationBranchId, boolean, boolean ) -> boolean
mutation_value
π² Method β> ( string ) -> number
practice
π² Method β> ( SkillId, integer, integer, boolean )
read_speed
π² Method β> ( boolean ) -> integer
rem_addiction
π² Method β> ( AddictionType )
rem_morale
π² Method β> ( MoraleTypeDataId )
remove_bionic
π² Method β> ( BionicDataId )
remove_child_flag
π² Method β> ( MutationBranchId )
remove_item
π² Method β> ( Item ) -> Detached<Item>
Removes given
<code>[Item](#sol::Item)</code>from characterβs inventory. The<code>[Item](#sol::Item)</code>must be in the inventory, neither wielded nor worn.
remove_items_if
π² Method β> ( table ) -> Detached<Item>[]
Removes and returns items from the inventory, wielded and worn, matching every given filter as an array of
Item.
Accepts the same filter table asget_items_if.
remove_mutation
π² Method β> ( MutationBranchId, boolean )
remove_perk
π² Method β> ( PerkId )
remove_worn
π² Method β> ( Item ) -> Detached<Item>?
Attempts to remove the worn
<code>[Item](#sol::Item)</code>from character.
reset
π² Method β> ( )
reset_encumbrance
π² Method β> ( )
rest_quality
π² Method β> ( ) -> number
restore_scent
π² Method β> ( )
rooted
π² Method β> ( )
rust_rate
π² Method β> ( ) -> integer
setID
π² Method β> ( CharacterId, boolean )
set_auto_start_thresh
π² Method β> ( BionicDataId, number )
set_base_age
π² Method β> ( integer )
set_base_height
π² Method β> ( integer )
set_dex_bonus
π² Method β> ( integer )
set_faction_id
π² Method β> ( FactionId )
set_fatigue
π² Method β> ( integer )
set_healthy
π² Method β> ( number )
set_healthy_mod
π² Method β> ( number )
set_int_bonus
π² Method β> ( integer )
set_max_power_level
π² Method β> ( Energy )
set_movement_mode
π² Method β> ( CharacterMoveMode )
set_mutation
π² Method β> ( MutationBranchId )
set_painkiller
π² Method β> ( integer )
set_part_temp_btu
π² Method β> ( BodyPartTypeIntId, integer )
Deprecated: use set_part_temp_celsius instead. Sets a specific body part to a given legacy Body
TemperatureUnits value.
set_part_temp_celsius
π² Method β> ( BodyPartTypeIntId, Temperature )
Sets a specific body part to a temperature in Celsius.
set_per_bonus
π² Method β> ( integer )
set_power_level
π² Method β> ( Energy )
set_rad
π² Method β> ( integer )
set_skill_level
π² Method β> ( SkillId, integer )
set_sleep_deprivation
π² Method β> ( integer )
set_speed_bonus
π² Method β> ( integer )
set_stamina
π² Method β> ( integer )
set_stim
π² Method β> ( integer )
set_stored_kcal
π² Method β> ( integer )
set_str_bonus
π² Method β> ( integer )
set_temp_btu
π² Method β> ( integer )
Deprecated: use set_temp_celsius instead. Sets ALL body parts on a creature to the given legacy Body
TemperatureUnits value.
set_temp_celsius
π² Method β> ( Temperature )
Sets ALL body parts on a creature to the given temperature in Celsius.
set_thirst
π² Method β> ( integer )
shout
π² Method β> ( string, boolean )
sight_impaired
π² Method β> ( ) -> boolean
sound_hallu
π² Method β> ( )
spores
π² Method β> ( )
suffer
π² Method β> ( )
takeoff
π² Method β> ( Item ) -> boolean
Attempts to take off the worn
<code>[Item](#sol::Item)</code>from character.
toggle_auto_start_mod
π² Method β> ( BionicDataId )
toggle_safe_fuel_mod
π² Method β> ( BionicDataId )
uncanny_dodge
π² Method β> ( ) -> boolean
unset_mutation
π² Method β> ( MutationBranchId )
unwield
π² Method β> ( ) -> boolean
use_charges
π² Method β> ( ItypeId, integer ) -> Detached<Item>[]
π² Method β> ( ItypeId, integer, function ) -> Detached<Item>[]
use_charges_if_avail
π² Method β> ( ItypeId, integer ) -> boolean
vitamin_get
π² Method β> ( VitaminId ) -> integer
vitamin_mod
π² Method β> ( VitaminId, integer, boolean ) -> integer
vitamin_set
π² Method β> ( VitaminId, integer ) -> boolean
volume_capacity
π² Method β> ( ) -> Volume
volume_carried
π² Method β> ( ) -> Volume
vomit
π² Method β> ( )
wake_up
π² Method β> ( )
wear
π² Method β> ( Item, boolean ) -> boolean
Attempts to wear an item in the creature inventory. If boolean parameter is false, item is worn instantly
wear_detached
π² Method β> ( Detached<Item>, boolean ) -> boolean
Attempts to wear an item not in the creature inventory. If boolean parameter is false, item is worn instantly
wearing_something_on
π² Method β> ( BodyPartTypeIntId ) -> boolean
weight_carried
π² Method β> ( ) -> Mass
wield
π² Method β> ( Item ) -> boolean
wielded_items
π² Method β> ( ) -> Item[]
worn_with_flag
π² Method β> ( JsonFlagId, BodyPartTypeIntId ) -> boolean
worn_with_id
π² Method β> ( ItypeId, BodyPartTypeIntId ) -> boolean
CharacterId
Bases
No base classes.
Constructors
- CharacterId.new( )
- CharacterId.new( int )
Members
get_value
π² Method β> ( ) -> integer
is_valid
π² Method β> ( ) -> boolean
Creature
Bases
No base classes.
Constructors
No constructors.
Members
abs_pos
π² Method β> ( ) -> TripointAbsMs
add_effect
π² Method β> ( EffectTypeId, TimeDuration, BodyPartTypeId?, integer? )
Effecttype, duration, bodypart and intensity
apply_damage
π² Method β> ( Creature, BodyPartTypeIntId, integer, boolean )
as_avatar
π² Method β> ( ) -> Avatar
as_character
π² Method β> ( ) -> Character
as_monster
π² Method β> ( ) -> Monster
as_npc
π² Method β> ( ) -> Npc
attitude_to
π² Method β> ( Creature ) -> Attitude
bub_pos
π² Method β> ( ) -> TripointBubMs
clear_effects
π² Method β> ( )
deal_damage
π² Method β> ( Creature, BodyPartTypeIntId, DamageInstance ) -> DealtDamageInstance
digging
π² Method β> ( ) -> boolean
disp_name
π² Method β> ( possessive: boolean, capitalize_first: boolean ) -> string
dodge_roll
π² Method β> ( ) -> number
erase
π² Method β> ( )
Removes this creature from the game without death notifications or a corpse.
get_all_body_parts
π² Method β> ( boolean ) -> BodyPartTypeIntId[]
get_armor_bash
π² Method β> ( BodyPartTypeIntId ) -> integer
get_armor_bash_base
π² Method β> ( BodyPartTypeIntId ) -> integer
get_armor_bash_bonus
π² Method β> ( ) -> integer
get_armor_bullet
π² Method β> ( BodyPartTypeIntId ) -> integer
get_armor_bullet_base
π² Method β> ( BodyPartTypeIntId ) -> integer
get_armor_bullet_bonus
π² Method β> ( ) -> integer
get_armor_cut
π² Method β> ( BodyPartTypeIntId ) -> integer
get_armor_cut_base
π² Method β> ( BodyPartTypeIntId ) -> integer
get_armor_cut_bonus
π² Method β> ( ) -> integer
get_armor_type
π² Method β> ( DamageType, BodyPartTypeIntId ) -> integer
get_block_bonus
π² Method β> ( ) -> integer
get_dodge
π² Method β> ( ) -> number
get_dodge_base
π² Method β> ( ) -> number
get_dodge_bonus
π² Method β> ( ) -> number
get_effect
π² Method β> ( EffectTypeId, BodyPartTypeId? ) -> Effect
get_effect_dur
π² Method β> ( EffectTypeId, BodyPartTypeId? ) -> TimeDuration
get_effect_int
π² Method β> ( EffectTypeId, BodyPartTypeId? ) -> integer
get_env_resist
π² Method β> ( BodyPartTypeIntId ) -> integer
get_grammatical_genders
π² Method β> ( ) -> string[]
get_hit
π² Method β> ( ) -> number
get_hit_base
π² Method β> ( ) -> number
get_hit_bonus
π² Method β> ( ) -> number
get_hp
π² Method β> ( BodyPartTypeIntId? ) -> integer
get_hp_max
π² Method β> ( BodyPartTypeIntId? ) -> integer
get_melee
π² Method β> ( ) -> number
get_moves
π² Method β> ( ) -> integer
get_name
π² Method β> ( ) -> string
get_num_blocks
π² Method β> ( ) -> integer
get_num_dodges
π² Method β> ( ) -> integer
get_pain
π² Method β> ( ) -> integer
get_part_healed_total
π² Method β> ( BodyPartTypeIntId ) -> integer
get_part_hp_cur
π² Method β> ( BodyPartTypeIntId ) -> integer
get_part_hp_max
π² Method β> ( BodyPartTypeIntId ) -> integer
get_perceived_pain
π² Method β> ( ) -> integer
get_pos_ms
π² Method β> ( ) -> TripointBubMs
get_random_body_part
π² Method β> ( boolean ) -> BodyPartTypeIntId
get_size
π² Method β> ( ) -> MonsterSize
get_speed
π² Method β> ( ) -> integer
get_speed_base
π² Method β> ( ) -> integer
get_speed_bonus
π² Method β> ( ) -> integer
get_speed_mult
π² Method β> ( ) -> number
get_value
π² Method β> ( string ) -> string
Retrieves an arbitrary entry using the same key format as set_value.
get_weight
π² Method β> ( ) -> Mass
get_weight_capacity
π² Method β> ( ) -> integer
has_effect
π² Method β> ( EffectTypeId, BodyPartTypeId? ) -> boolean
has_effect_with_flag
π² Method β> ( JsonFlagId, BodyPartTypeId? ) -> boolean
has_flag
π² Method β> ( MonsterFlag ) -> boolean
has_grab_break_tec
π² Method β> ( ) -> boolean
has_trait
π² Method β> ( MutationBranchId ) -> boolean
has_weapon
π² Method β> ( ) -> boolean
hp_percentage
π² Method β> ( ) -> integer
in_species
π² Method β> ( SpeciesTypeId ) -> boolean
is_avatar
π² Method β> ( ) -> boolean
is_dead
π² Method β> ( ) -> boolean
is_elec_immune
π² Method β> ( ) -> boolean
is_hallucination
π² Method β> ( ) -> boolean
is_immune_damage
π² Method β> ( DamageType ) -> boolean
is_immune_effect
π² Method β> ( EffectTypeId ) -> boolean
is_monster
π² Method β> ( ) -> boolean
is_npc
π² Method β> ( ) -> boolean
is_on_ground
π² Method β> ( ) -> boolean
is_underwater
π² Method β> ( ) -> boolean
is_warm
π² Method β> ( ) -> boolean
knock_back_to
π² Method β> ( TripointBubMs )
mod_all_parts_hp_cur
π² Method β> ( integer )
mod_moves
π² Method β> ( integer )
mod_pain
π² Method β> ( integer )
mod_pain_noresist
π² Method β> ( integer )
mod_part_hp_cur
π² Method β> ( BodyPartTypeIntId, integer )
mod_part_hp_max
π² Method β> ( BodyPartTypeIntId, integer )
power_rating
π² Method β> ( ) -> number
ranged_target_size
π² Method β> ( ) -> number
remove_effect
π² Method β> ( EffectTypeId, BodyPartTypeId? ) -> boolean
remove_value
π² Method β> ( string )
Removes an arbitrary entry using the same key format as set_value.
sees
π² Method β> ( TripointBubMs ) -> boolean
set_all_parts_hp_cur
π² Method β> ( integer )
set_all_parts_hp_to_max
π² Method β> ( )
set_armor_bash_bonus
π² Method β> ( integer )
set_armor_bullet_bonus
π² Method β> ( integer )
set_armor_cut_bonus
π² Method β> ( integer )
set_moves
π² Method β> ( integer )
set_pain
π² Method β> ( integer )
set_part_hp_cur
π² Method β> ( BodyPartTypeIntId, integer )
set_part_hp_max
π² Method β> ( BodyPartTypeIntId, integer )
set_pos
π² Method β> ( TripointBubMs )
π² Method β> ( TripointAbsMs )
set_pos_ms
π² Method β> ( TripointBubMs )
set_underwater
π² Method β> ( boolean )
set_value
π² Method β> ( string, string )
Sets an arbitrary key : value pair for the creature.NPC dialogue system uses this, with the format(βnpctalk_varβ + ββ + type_var + ββ + var_context + β_β + var_base_name) used for the key, skipping type or context if empty.
sight_range
π² Method β> ( integer ) -> integer
size_melee_penalty
π² Method β> ( ) -> integer
skin_name
π² Method β> ( ) -> string
speed_rating
π² Method β> ( ) -> number
stability_roll
π² Method β> ( ) -> number
values_table
π² Method β> ( ) -> table
Returns all stored creature vars as a table mapping each key (string) to its value (string), as written by set_value.
DamageInstance
Represents a bunch of damage amounts
Constructors are:
new(damageType, amount, armorPen, remainingArmorMultiplier, damageMultiplier)
Bases
No base classes.
Constructors
- DamageInstance.new( )
- DamageInstance.new( DamageType, double, double, double, double )
Members
damage_units
π» Variable β> DamageUnit[]
add
π² Method β> ( DamageUnit )
add_damage
π² Method β> ( DamageType, number, number, number, number )
clear
π² Method β> ( )
empty
π² Method β> ( ) -> boolean
mult_damage
π² Method β> ( number, boolean )
total_damage
π² Method β> ( ) -> number
type_damage
π² Method β> ( DamageType ) -> number
DamageUnit
Represents a damage amount
Constructors are:
new()
new(damageType, amount, armorPen, remainingArmorMultiplier, damageMultiplier)
Bases
No base classes.
Constructors
- DamageUnit.new( DamageType, double, double, double, double )
Members
amount
π» Variable β> number
damage_multiplier
π» Variable β> number
res_mult
π» Variable β> number
res_pen
π» Variable β> number
type
π» Variable β> DamageType
DealtDamageInstance
Represents the final dealt damage
Bases
No base classes.
Constructors
No constructors.
Members
bp_hit
π» Variable β> BodyPartTypeId
dealt_dams
π» Variable β> integer[]
total_damage
π² Method β> ( ) -> integer
type_damage
π² Method β> ( DamageType ) -> integer
DiseaseTypeId
Bases
No base classes.
Constructors
- DiseaseTypeId.new( )
- DiseaseTypeId.new( DiseaseTypeId )
- DiseaseTypeId.new( string )
Members
NULL_ID
π« Function β> ( ) -> DiseaseTypeId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> DiseaseTypeRaw
str
π² Method β> ( ) -> string
DistributionGrid
A grid that organizes producers, storage and consumers of a resource like electricity
Bases
No base classes.
Constructors
No constructors.
Members
empty
π² Method β> ( ) -> boolean
Check if grid is empty
get_contents
π² Method β> ( ) -> TripointAbsMs[]
Get current resource amount. Boolean argument (optional) controls recursive behavior (default true) Get vector of absolute map square coordinates of grid contents
get_power_stat
π² Method β> ( ) -> PowerStat
Get power generation and consumption statistics for the grid
get_resource
π² Method β> ( boolean? ) -> integer
Modify resource amount. First argument is amount, second (optional) controls recursive behavior (default true)
is_valid
π² Method β> ( ) -> boolean
Check if grid is valid
mod_resource
π² Method β> ( integer, boolean? ) -> integer
update
π² Method β> ( TimePoint )
Update the grid to the given time point
DistributionGridTracker
Manages all active distribution grids
Bases
No base classes.
Constructors
No constructors.
Members
debug_grid_id
π² Method β> ( TripointAbsOmt ) -> integer
Get unique identifier for grid at given overmap tile (for debug purposes, returns 0 if no grid)
grid_at
π² Method β> ( TripointAbsMs ) -> DistributionGrid
π² Method β> ( TripointAbsMs ) -> DistributionGrid
Get grid at absolute map square position
on_changed
π² Method β> ( TripointAbsMs )
Notify tracker that a tile at the given position has changed
on_options_changed
π² Method β> ( )
Notify tracker that game options have changed
update
π² Method β> ( TimePoint )
Update all grids to the given time point
Effect
Bases
No base classes.
Constructors
No constructors.
Members
activated
π² Method β> ( TimePoint, string, integer, boolean, number ) -> boolean
decay
π² Method β> ( TimePoint, boolean ) -> boolean
disp_desc
π² Method β> ( boolean ) -> string
disp_name
π² Method β> ( ) -> string
disp_short_desc
π² Method β> ( boolean ) -> string
get_addict_mod
π² Method β> ( string, integer ) -> number
get_amount
π² Method β> ( string, boolean ) -> integer
get_avg_mod
π² Method β> ( string, boolean ) -> integer
get_blocks_effects
π² Method β> ( ) -> EffectTypeId[]
get_bp
π² Method β> ( ) -> BodyPartTypeId
get_dur_add_perc
π² Method β> ( ) -> integer
get_duration
π² Method β> ( ) -> TimeDuration
get_harmful_cough
π² Method β> ( ) -> boolean
get_id
π² Method β> ( ) -> EffectTypeId
get_int_add_val
π² Method β> ( ) -> integer
get_int_dur_factor
π² Method β> ( ) -> TimeDuration
get_intensity
π² Method β> ( ) -> integer
get_max_duration
π² Method β> ( ) -> TimeDuration
get_max_intensity
π² Method β> ( ) -> integer
get_max_val
π² Method β> ( string, boolean ) -> integer
get_min_val
π² Method β> ( string, boolean ) -> integer
get_mod
π² Method β> ( string, boolean ) -> integer
get_percentage
π² Method β> ( string, integer, boolean ) -> number
get_removes_effects
π² Method β> ( ) -> EffectTypeId[]
get_resist_effects
π² Method β> ( ) -> EffectTypeId[]
get_resist_traits
π² Method β> ( ) -> MutationBranchId[]
get_sizing
π² Method β> ( string ) -> boolean
get_start_time
π² Method β> ( ) -> TimePoint
get_type
π² Method β> ( ) -> EffectTypeRaw
has_flag
π² Method β> ( JsonFlagId ) -> boolean
is_permanent
π² Method β> ( ) -> boolean
mod_duration
π² Method β> ( TimeDuration, boolean )
mod_intensity
π² Method β> ( integer, boolean ) -> integer
mult_duration
π² Method β> ( number, boolean )
set_duration
π² Method β> ( TimeDuration, boolean )
set_intensity
π² Method β> ( integer, boolean ) -> integer
set_permanent
π² Method β> ( )
use_part_descs
π² Method β> ( ) -> boolean
EffectTypeId
Bases
No base classes.
Constructors
- EffectTypeId.new( )
- EffectTypeId.new( EffectTypeId )
- EffectTypeId.new( string )
Members
NULL_ID
π« Function β> ( ) -> EffectTypeId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> EffectTypeRaw
str
π² Method β> ( ) -> string
EnchantmentFlagId
Bases
No base classes.
Constructors
- EnchantmentFlagId.new( )
- EnchantmentFlagId.new( EnchantmentFlagId )
- EnchantmentFlagId.new( string )
Members
NULL_ID
π« Function β> ( ) -> EnchantmentFlagId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> EnchantmentFlagRaw
str
π² Method β> ( ) -> string
EnchantmentId
Bases
No base classes.
Constructors
- EnchantmentId.new( )
- EnchantmentId.new( EnchantmentId )
- EnchantmentId.new( string )
Members
NULL_ID
π« Function β> ( ) -> EnchantmentId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> Enchantment
str
π² Method β> ( ) -> string
EnchantmentValueId
Bases
No base classes.
Constructors
- EnchantmentValueId.new( )
- EnchantmentValueId.new( EnchantmentValueId )
- EnchantmentValueId.new( string )
Members
NULL_ID
π« Function β> ( ) -> EnchantmentValueId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> EnchantmentValueRaw
str
π² Method β> ( ) -> string
Energy
Bases
No base classes.
Constructors
No constructors.
Members
from_joule
π« Function β> ( integer ) -> Energy
from_kilojoule
π« Function β> ( integer ) -> Energy
to_joule
π² Method β> ( ) -> integer
to_kilojoule
π² Method β> ( ) -> integer
ExplosionData
Bases
No base classes.
Constructors
No constructors.
Members
damage
π» Variable β> integer
Damage dealt by the explosion
fire
π» Variable β> boolean
Whether the explosion creates fire
radius
π» Variable β> number
Radius of the explosion
safe_range
π² Method β> ( ) -> integer
Returns the safe range of the explosion
FactionId
Bases
No base classes.
Constructors
- FactionId.new( )
- FactionId.new( FactionId )
- FactionId.new( string )
Members
NULL_ID
π« Function β> ( ) -> FactionId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> FactionRaw
str
π² Method β> ( ) -> string
FactionRaw
Bases
No base classes.
Constructors
No constructors.
Members
str_id
π² Method β> ( ) -> FactionId
FaultId
Bases
No base classes.
Constructors
- FaultId.new( )
- FaultId.new( FaultId )
- FaultId.new( string )
Members
NULL_ID
π« Function β> ( ) -> FaultId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> FaultRaw
str
π² Method β> ( ) -> string
FieldEmitId
Bases
No base classes.
Constructors
- FieldEmitId.new( )
- FieldEmitId.new( FieldEmitId )
- FieldEmitId.new( string )
Members
NULL_ID
π« Function β> ( ) -> FieldEmitId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> FieldEmitRaw
str
π² Method β> ( ) -> string
FieldTypeId
Bases
No base classes.
Constructors
- FieldTypeId.new( )
- FieldTypeId.new( FieldTypeId )
- FieldTypeId.new( FieldTypeIntId )
- FieldTypeId.new( string )
Members
NULL_ID
π« Function β> ( ) -> FieldTypeId
implements_int_id
π« Function β> ( ) -> boolean
int_id
π² Method β> ( ) -> FieldTypeIntId
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> FieldTypeRaw
str
π² Method β> ( ) -> string
FieldTypeIntId
Bases
No base classes.
Constructors
- FieldTypeIntId.new( )
- FieldTypeIntId.new( FieldTypeIntId )
- FieldTypeIntId.new( FieldTypeId )
Members
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> FieldTypeRaw
str_id
π² Method β> ( ) -> FieldTypeId
FieldTypeRaw
Bases
No base classes.
Constructors
No constructors.
Members
moppable
π» Variable β> boolean
FurnId
Bases
No base classes.
Constructors
Members
NULL_ID
π« Function β> ( ) -> FurnId
implements_int_id
π« Function β> ( ) -> boolean
int_id
π² Method β> ( ) -> FurnIntId
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> FurnRaw
str
π² Method β> ( ) -> string
FurnIntId
Bases
No base classes.
Constructors
Members
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> FurnRaw
str_id
π² Method β> ( ) -> FurnId
FurnRaw
Bases
No base classes.
Constructors
No constructors.
Members
close
π» Variable β> FurnId
open
π» Variable β> FurnId
transforms_into
π» Variable β> FurnId
get_coverage
π² Method β> ( ) -> integer
get_flags
π² Method β> ( ) -> string[]
get_light_emitted
π² Method β> ( ) -> integer
get_max_volume
π² Method β> ( ) -> Volume
get_movecost
π² Method β> ( ) -> integer
has_flag
π² Method β> ( string ) -> boolean
int_id
π² Method β> ( ) -> FurnIntId
name
π² Method β> ( ) -> string
set_coverage
π² Method β> ( integer )
set_flag
π² Method β> ( string )
set_light_emitted
π² Method β> ( integer )
set_max_volume
π² Method β> ( Volume )
set_movecost
π² Method β> ( integer )
str_id
π² Method β> ( ) -> FurnId
Inventory
Represents a characterβs inventory
Bases
No base classes.
Constructors
- Inventory.new( )
Members
clear
π² Method β> ( )
Clear all items from the inventory
count_item
π² Method β> ( ItypeId ) -> integer
Count items of a specific type
find_item
π² Method β> ( integer ) -> Item
Find item at position
has_charges
π² Method β> ( ItypeId, integer ) -> boolean
Check if inventory has the specified charges
has_components
π² Method β> ( ItypeId, integer ) -> boolean
Check if inventory has the specified components
has_tools
π² Method β> ( ItypeId, integer ) -> boolean
Check if inventory has the specified tool
position_by_type
π² Method β> ( ItypeId ) -> integer
Get item position by type
size
π² Method β> ( ) -> integer
Get the number of item stacks in the inventory
volume
π² Method β> ( ) -> Volume
Get the total volume of the inventory
weight
π² Method β> ( ) -> Mass
Get the total weight of the inventory
IslotAmmo
Bases
RangedData
Constructors
No constructors.
Members
ammo_effects
π» Variable β> AmmunitionEffectId[]
ammo_id
π» Variable β> AmmunitionTypeId
Ammo type, basically the βformβ of the ammo that fits into the gun/tool
casing_id
π» Variable β> ItypeId?
Type id of casings, if any
cookoff
π» Variable β> boolean
Should this ammo explode in fire?
def_charges
π» Variable β> integer
Default charges
dont_recover_one_in
π» Variable β> integer
Chance to fail to recover the ammo used.
drop
π» Variable β> ItypeId
drop_active
π» Variable β> boolean
drop_count
π» Variable β> integer
force_stat_display
π» Variable β> boolean?
loudness
π» Variable β> integer
Base loudness of ammo (possibly modified by gun/gunmods)
recoil
π» Variable β> integer
Recoil (per shot), roughly equivalent to kinetic energy (in Joules)
special_cookoff
π» Variable β> boolean
Should this ammo apply a special explosion effect when in fire?
speed
π» Variable β> integer
Base speed of ammo (possibly modified by gun/gunmods)
IslotArmor
Bases
No base classes.
Constructors
No constructors.
Members
env_resist
π» Variable β> integer
Resistance to environmental effects
env_resist_w_filter
π» Variable β> integer
Environmental protection of a gas mask with installed filter
layer_data
π» Variable β> ArmorPortionData[]
Layer, encumbrance and coverage information
resistance
π» Variable β> Resistances
Damage negated by this armor. Usually calculated from materials+thickness
sided
π» Variable β> boolean
Whether this item can be worn on either side of the body
storage
π» Variable β> Volume
How much storage this items provides when worn
thickness
π» Variable β> integer
Multiplier on resistances provided by armorβs materials. Damaged armors have lower effective thickness, low capped at 1. Note: 1 thickness means item retains full resistance when damaged.
valid_mods
π» Variable β> string[]
Whitelisted clothing mods. Restricted clothing mods must be listed here by id to be compatible.
warmth
π» Variable β> integer
How much warmth this item provides
weight_capacity_bonus
π» Variable β> Mass
Bonus to weight capacity
weight_capacity_modifier
π» Variable β> number
Factor modifying weight capacity
IslotArtifact
Bases
No base classes.
Constructors
No constructors.
Members
charge_req
π» Variable β> ArtifactChargeReq
charge_type
π» Variable β> ArtifactCharge
dream_freq_met
π» Variable β> integer
dream_freq_unmet
π» Variable β> integer
dream_msg_met
π» Variable β> string[]
dream_msg_unmet
π» Variable β> string[]
effects_activated
π» Variable β> ArtifactEffectPassive[]
effects_carried
π» Variable β> ArtifactEffectActive[]
effects_wielded
π» Variable β> ArtifactEffectActive[]
effects_worn
π» Variable β> ArtifactEffectActive[]
charge_req_description
π² Method β> ( ) -> string
charge_type_description
π² Method β> ( ) -> string
effects_activated_descriptions
π² Method β> ( ) -> string[]
effects_activated_names
π² Method β> ( ) -> string[]
effects_carried_descriptions
π² Method β> ( ) -> string[]
effects_carried_names
π² Method β> ( ) -> string[]
effects_wielded_descriptions
π² Method β> ( ) -> string[]
effects_wielded_names
π² Method β> ( ) -> string[]
effects_worn_descriptions
π² Method β> ( ) -> string[]
effects_worn_names
π² Method β> ( ) -> string[]
IslotBattery
Bases
No base classes.
Constructors
No constructors.
Members
max_capacity
π» Variable β> Energy
Maximum energy the battery can store
IslotBionic
Bases
No base classes.
Constructors
No constructors.
Members
bionic_id
π» Variable β> BionicDataId
Id of the bionic
difficulty
π» Variable β> integer
Arbitrary difficulty scale
installation_data
π» Variable β> ItypeId
Itemwith installation data that can be used to provide almost guaranteed successful install of corresponding bionic
is_upgrade
π» Variable β> boolean
Whether this CBM is an upgrade of another
IslotBook
Bases
No base classes.
Constructors
No constructors.
Members
chapters
π» Variable β> integer
Fun books have chapters; after all are read, the book is less fun.
fun
π» Variable β> integer
How fun reading this is, can be negative
intelligence
π» Variable β> integer
Intelligence required to read it
martial_art
π» Variable β> MartialArtsId
Which martial art it teaches. Can be
MartialArtsId.NULL_ID
recipes
π» Variable β> BookRecipe[]
Recipes contained in this book
skill
π» Variable β> SkillId
Which skill it upgrades, if any. Can be
SkillId.NULL_ID
skill_max
π» Variable β> integer
The skill level the book provides
skill_min
π» Variable β> integer
The skill level required to understand it
time
π» Variable β> integer
How long in minutes it takes to read. βTo readβ means getting 1 skill point, not all of them.
IslotBrewable
Bases
No base classes.
Constructors
No constructors.
Members
results
π» Variable β> ItypeId[]
What are the results of fermenting this item
time
π» Variable β> TimeDuration
How long for this brew to ferment
IslotComestible
Bases
No base classes.
Constructors
No constructors.
Members
addict_type
π» Variable β> AddictionType
effects of addiction
addict_value
π» Variable β> integer
addiction potential
comest_type
π» Variable β> string
comestible subtype - eg. FOOD, DRINK, MED
contamination
π» Variable β> table<DiseaseTypeId, integer>
List of diseases carried by this comestible and their associated probability
cooks_like
π» Variable β> ItypeId
Reference to other item that replaces this one as a component in recipe results
def_charges
π» Variable β> integer
Defaults # of charges (drugs, loaf of bread? etc)
fatigue_mod
π» Variable β> integer
fatigue altering effect
freeze_point
π» Variable β> integer
freezing point in degrees Fahrenheit, below this temperature item can freeze
healthy
π» Variable β> integer
latent_heat
π» Variable β> number
monotony_penalty
π» Variable β> integer
A penalty applied to fun for every time this food has been eaten in the last 48 hours
parasites
π» Variable β> integer
chance (odds) of becoming parasitised when eating (zero if never occurs)
petfood
π» Variable β> string[]
pet food category
quench
π» Variable β> integer
effect on character thirst (may be negative)
radiation
π» Variable β> integer
Amount of radiation you get from this comestible
rot_spawn
π» Variable β> MonsterGroupId
The monster group that is drawn from when the item rots away
rot_spawn_chance
π» Variable β> integer
Chance the above monster group spawns
smoking_result
π» Variable β> ItypeId
Reference to item that will be received after smoking current item
specific_heat_liquid
π» Variable β> number
specific heats in J/(g K) and latent heat in J/g
specific_heat_solid
π» Variable β> number
spoils
π» Variable β> TimeDuration
Time until becomes rotten at standard temperature, or zero if never spoils
stimulant_type
π» Variable β> integer
stimulant effect
tool
π» Variable β> ItypeId
tool needed to consume (e.g. lighter for cigarettes)
get_default_nutr
π² Method β> ( ) -> integer
get_default_nutrition
π² Method β> ( ) -> table<VitaminId, integer>
Nutrition values to use for this type when they arenβt calculated from components
has_calories
π² Method β> ( ) -> boolean
IslotContainer
Bases
No base classes.
Constructors
No constructors.
Members
contains
π» Variable β> Volume
Inner volume of the container
preserves
π» Variable β> boolean
Contents do not spoil
seals
π» Variable β> boolean
Can be resealed
unseals_into
π» Variable β> ItypeId
If this is set to anything but βnullβ, changing this containerβs contents in any way will turn this item into that type
watertight
π» Variable β> boolean
Can hold liquids
IslotEngine
Bases
No base classes.
Constructors
No constructors.
Members
displacement
π» Variable β> integer
For combustion engines, the displacement
IslotFuel
Bases
No base classes.
Constructors
No constructors.
Members
energy
π» Variable β> number
Energyof the fuel (kilojoules per charge)
explosion_data
π» Variable β> CppVal<fuel_explosion>
has_explosion_data
π» Variable β> boolean
pump_terrain
π» Variable β> TerIntId
IslotGun
Bases
RangedData
Constructors
No constructors.
Members
ammo
π» Variable β> AmmunitionTypeId[]
What type of ammo this gun uses
ammo_effects
π» Variable β> AmmunitionEffectId[]
Effects that are applied to the ammo when fired
ammo_to_fire
π» Variable β> integer
How much ammo is consumed per shot
barrel_volume
π» Variable β> Volume
Volumeof material removed by sawing down the barrel, if left unspecified barrel canβt be sawed down
blackpowder_tolerance
π» Variable β> integer
One in X chance for gun to require major cleanup after firing blackpowder shot
built_in_mods
π» Variable β> ItypeId[]
Built in mods. string is id of mod. These mods will get the IRREMOVABLE flag set
burst
π» Variable β> integer
Burst size for AUTO mode (legacy field for items not migrated to specify modes )
clip
π» Variable β> integer
For guns with an integral magazine what is the capacity?
default_mods
π» Variable β> ItypeId[]
Default mods, string is id of mod. These mods are removable but are default on the weapon
durability
π» Variable β> integer
Gun durability, affects gun being damaged during shooting
handling
π» Variable β> integer
How easy is control of recoil? If unset value automatically derived from weapon type
loudness
π» Variable β> integer
Modifies base loudness as provided by the currently loaded ammo
min_cycle_recoil
π» Variable β> integer
Minimum ammo recoil for gun to be able to fire more than once per attack
recoil
π» Variable β> integer
Additional recoil applied per shot before effects of handling are considered, useful for adding recoil effect to guns which otherwise consume no ammo
reload_noise
π» Variable β> string
Noise displayed when reloading the weapon
reload_noise_volume
π» Variable β> Sound
Volumeof the noise made when reloading this weapon
reload_time
π» Variable β> integer
Reload time, in moves
sight_dispersion
π» Variable β> integer
Maximum aim achievable using base weapon sights
skill_used
π» Variable β> SkillId
What skill this gun uses
speed
π» Variable β> integer
Modifies projectile speed as provided by the currently loaded ammo
ups_charges
π» Variable β> integer
If this uses UPS charges, how many (per shoot), 0 for no UPS charges at all
get_gunmod_locations
π² Method β> ( ) -> table<string, integer>
Location for gun mods. Key is the location (untranslated!), value is the number of mods that the location can have. The value should be > 0
get_modes
π² Method β> ( ) -> string[]
Firing modes are supported by the gun. Always contains at least DEFAULT mode
IslotGunmod
Bases
RangedData
Constructors
No constructors.
Members
aim_speed
π» Variable β> integer
For sights (see @ref sight_dispersion), this value affects time cost of aiming. Higher is better. In case of multiple usable sights, the one with highest aim speed is used.
ammo_effects
π» Variable β> AmmunitionEffectId[]
ammo_to_fire_modifier
π» Variable β> integer
Increases base gun ammo to fire by this value per shot
ammo_to_fire_multiplier
π» Variable β> number
Increases base gun ammo to fire by this many times per shot
consume_chance
π» Variable β> integer
Percentage value change to the gunβs loading time. Higher is less likely
consume_divisor
π» Variable β> integer
Divsor to scale back gunmod consumption damage. lower is more damaging. Affected by ammo loudness and recoil, see ranged.cpp for how much.
exclusion
π» Variable β> CppVal<std_unordered_set<string_id<itype>>>
What kind of weapons this gunmod canβt be used with
exclusion_category
π» Variable β> CppVal<std_unordered_set<string_id<weapon_category>>>[]
What category of weapons this gunmod canβt be used with
handling
π» Variable β> integer
Relative adjustment to base gun handling
install_time
π» Variable β> integer
How many moves does this gunmod take to install?
loudness
π» Variable β> integer
Modifies base loudness as provided by the currently loaded ammo
min_str_required_mod
π» Variable β> integer
Modifies base strength required
reload_modifier
π» Variable β> integer
Percentage value change to the gunβs loading time. Higher is slower
sight_dispersion
π» Variable β> integer
If this value is set (non-negative), this gunmod functions as a sight. A sight is only usable to aim by a character whose current
Character::recoil is at or below this value.
speed
π» Variable β> integer
Modifies projectile speed as provided by the currently loaded ammo
ups_charges_modifier
π» Variable β> integer
Increases base gun UPS consumption by this value per shot
ups_charges_multiplier
π» Variable β> number
Increases base gun UPS consumption by this many times per shot
usable
π» Variable β> CppVal<std_unordered_set<string_id<itype>>>
What kind of weapons this gunmod can be used with
usable_category
π» Variable β> CppVal<std_unordered_set<string_id<weapon_category>>>[]
What category of weapons this gunmod can be used with
volume_multiplier
π» Variable β> number
Increases gun volume by this many times
weight_multiplier
π» Variable β> number
Increases gun weight by this many times
get_added_slots
π² Method β> ( ) -> table<string, integer>
Additional gunmod slots to add to the gun. Key is the location (untranslated!), value is the number of extra mods that location can hold.
get_location
π² Method β> ( ) -> string
Where is this gunmod installed (e.g. βstockβ, βrailβ)?
get_mod_blacklist
π² Method β> ( ) -> string[]
Not compatible on weapons that have this mod slot
get_mode_modifiers
π² Method β> ( ) -> string[]
Firing modes added to or replacing those of the base gun
IslotMagazine
Bases
No base classes.
Constructors
No constructors.
Members
ammo_type
π» Variable β> AmmunitionTypeId[]
What type of ammo this magazine can be loaded with
capacity
π» Variable β> integer
Capacity of magazine (in equivalent units to ammo charges)
count
π» Variable β> integer
Default amount of ammo contained by a magazine (often set for ammo belts)
default_ammo
π» Variable β> ItypeId
Default type of ammo contained by a magazine (often set for ammo belts)
linkage
π» Variable β> ItypeId?
For ammo belts one linkage (of given type) is dropped for each unit of ammo consumed
protects_contents
π» Variable β> boolean
If false, ammo will cook off if this mag is affected by fire
reliability
π» Variable β> integer
How reliable this magazine on a range of 0 to 10?
reload_time
π» Variable β> integer
How long it takes to load each unit of ammo into the magazine
IslotMilling
Bases
No base classes.
Constructors
No constructors.
Members
conversion_rate
π» Variable β> integer
converts_into
π» Variable β> ItypeId
IslotMod
Bases
No base classes.
Constructors
No constructors.
Members
acceptable_ammo
π» Variable β> AmmunitionTypeId[]
If non-empty restrict mod to items with those base (before modifiers) ammo types
ammo_modifier
π» Variable β> AmmunitionTypeId[]
If set modifies parent ammo to this type
capacity_multiplier
π» Variable β> number
Proportional adjustment of parent item ammo capacity
magazine_adaptor
π» Variable β> table<AmmunitionTypeId, ItypeId[]>
If non-empty replaces the compatible magazines for the parent item
IslotPetArmor
Bases
No base classes.
Constructors
No constructors.
Members
bodytype
π» Variable β> string
What animal bodytype can wear this armor
env_resist
π» Variable β> integer
Resistance to environmental effects
env_resist_w_filter
π» Variable β> integer
Environmental protection of a gas mask with installed filter
max_vol
π» Variable β> Volume
The maximum volume a pet can be and wear this armor
min_vol
π» Variable β> Volume
The minimum volume a pet can be and wear this armor
storage
π» Variable β> Volume
How much storage this items provides when worn
thickness
π» Variable β> integer
Multiplier on resistances provided by this armor
IslotSeed
Bases
No base classes.
Constructors
No constructors.
Members
byproducts
π» Variable β> ItypeId[]
Additionally items (a list of their item ids) that will spawn when harvesting the plant.
fruit_div
π» Variable β> integer
Amount of harvested charges of fruits is divided by this number.
fruit_id
π» Variable β> ItypeId
Type id of the fruit item.
grow
π» Variable β> TimeDuration
Time it takes for a seed to grow (based of off a season length of 91 days).
get_plant_name
π² Method β> ( integer ) -> string
Name of the plant.
IslotTool
Bases
No base classes.
Constructors
No constructors.
Members
ammo_id
π» Variable β> AmmunitionTypeId[]
charge_factor
π» Variable β> integer
charges_per_use
π» Variable β> integer
def_charges
π» Variable β> integer
default_ammo
π» Variable β> ItypeId
max_charges
π» Variable β> integer
power_draw
π» Variable β> integer
rand_charges
π» Variable β> integer[]
revert_msg
π» Variable β> string
revert_to
π» Variable β> ItypeId?
subtype
π» Variable β> ItypeId
turns_active
π» Variable β> integer
turns_per_charge
π» Variable β> integer
ups_eff_mult
π» Variable β> integer
ups_recharge_rate
π» Variable β> integer
IslotWheel
Bases
No base classes.
Constructors
No constructors.
Members
diameter
π» Variable β> integer
Diameter of wheel in millimeters. Integer JSON values are legacy inches.
width
π» Variable β> integer
Width of wheel in millimeters. Integer JSON values are legacy inches.
Item
Bases
No base classes.
Constructors
No constructors.
Members
charges
π» Variable β> integer
activate
π² Method β> ( )
add_enchantment
π² Method β> ( EnchantmentId ) -> boolean
π² Method β> ( Enchantment ) -> boolean
Adds an enchantment to this item
add_item_with_id
π² Method β> ( ItypeId, integer )
Creates an item with the given id and adds it to contents.
countsets the itemβs charges, not the number of items: exactly one item is created. For stackable (count-by-charges) items such as ammo,countis the stack size. For non-stackable items, pass a negative value (e.g. -1), since a positive one is still applied as charges. Tools spawned with a negative value get their default charges.
add_technique
π² Method β> ( MartialArtsTechniqueId )
Adds the technique. It isnβt treated original, but additional.
ammo_capacity
π² Method β> ( boolean ) -> integer
Gets the maximum capacity of a magazine
ammo_consume
π² Method β> ( integer, TripointBubMs ) -> integer
ammo_current
π² Method β> ( ) -> ItypeId
ammo_data
π² Method β> ( ) -> ItypeRaw
ammo_remaining
π² Method β> ( ) -> integer
Get remaining ammo, works with batteries & stuff too
ammo_required
π² Method β> ( ) -> integer
ammo_set
π² Method β> ( ItypeId, integer )
ammo_unset
π² Method β> ( )
attack_cost
π² Method β> ( ) -> integer
can_contain
π² Method β> ( Item ) -> boolean
Checks if this item can contain another
clear_vars
π² Method β> ( )
Erase all variables
conductive
π² Method β> ( ) -> boolean
convert
π² Method β> ( ItypeId )
Converts the item as given
<code>[ItypeId](#sol::ItypeId)</code>.
covers
π² Method β> ( BodyPartTypeIntId ) -> boolean
Checks if the item covers a bodypart
current_magazine
π² Method β> ( ) -> Item
Gets the current magazine
deactivate
π² Method β> ( )
display_name
π² Method β> ( integer ) -> string
Display name with all bells and whistles like ammo and prefixes
energy_remaining
π² Method β> ( ) -> Energy
erase_var
π² Method β> ( string )
Erase variable
get_category_id
π² Method β> ( ) -> string
Gets the category id this item is in
get_comestible_fun
π² Method β> ( ) -> integer
get_counter
π² Method β> ( ) -> integer
get_damage
π² Method β> ( ) -> integer
Get current item damage value (durability). Higher values mean more damaged. Default range is -1000 (min) to 4000 (max), configurable via βdamage_statesβ in JSON.
get_damage_level
π² Method β> ( ) -> integer
π² Method β> ( integer ) -> integer
Get item damage as a level from 0 to max. Used for UI display and damage thresholds.
get_dispersion_bonus
π² Method β> ( ) -> integer
get_kcal
π² Method β> ( ) -> integer
get_max_damage
π² Method β> ( ) -> integer
Get maximum possible damage value before item is destroyed. Default is 4000, configurable via βdamage_statesβ in JSON.
get_melee_damage_bonus
π² Method β> ( ) -> DamageInstance
get_melee_hit_bonus
π² Method β> ( ) -> integer
get_min_damage
π² Method β> ( ) -> integer
Get minimum possible damage value (can be negative for reinforced items). Default is -1000, configurable via βdamage_statesβ in JSON.
get_mtype
π² Method β> ( ) -> MonsterTypeId
Almost for a corpse.
get_owner
π² Method β> ( ) -> FactionId
Gets the faction id that owns this item
get_owner_name
π² Method β> ( ) -> string
get_quench
π² Method β> ( ) -> integer
get_range_bonus
π² Method β> ( ) -> integer
get_ranged_damage_bonus
π² Method β> ( ) -> DamageInstance
get_recoil_bonus
π² Method β> ( ) -> integer
get_relative_health
π² Method β> ( ) -> number
Get relative health as ratio 0.0-1.0, where 1.0 is undamaged and 0.0 is destroyed
get_reload_time
π² Method β> ( ) -> integer
get_rot
π² Method β> ( ) -> TimeDuration
Gets the
TimeDurationuntil this item rots
get_techniques
π² Method β> ( ) -> MartialArtsTechniqueId[]
Gets all techniques. Including original techniques.
get_type
π² Method β> ( ) -> ItypeId
get_var_num
π² Method β> ( string, number ) -> number
Get variable as float number
get_var_str
π² Method β> ( string, string ) -> string
Get variable as string
get_var_tri
π² Method β> ( string, Tripoint ) -> Tripoint
Get variable as tripoint
has_flag
π² Method β> ( JsonFlagId ) -> boolean
has_infinite_charges
π² Method β> ( ) -> boolean
has_item_with_id
π² Method β> ( ItypeId ) -> boolean
Checks item contents for a given item id
has_own_flag
π² Method β> ( JsonFlagId ) -> boolean
has_technique
π² Method β> ( MartialArtsTechniqueId ) -> boolean
Checks if this item has the technique as an addition. Doesnβt check original techniques.
has_use
π² Method β> ( string ) -> CppVal<use_function>
has_var
π² Method β> ( string ) -> boolean
Check for variable of any type
invoke_at
π² Method β> ( TripointBubMs ) -> integer
Immediately invokes this itemβs use action at the given map-square position. Returns the charges consumed by the use action.
is_active
π² Method β> ( ) -> boolean
is_ammo
π² Method β> ( ) -> boolean
is_ammo_belt
π² Method β> ( ) -> boolean
is_ammo_container
π² Method β> ( ) -> boolean
is_armor
π² Method β> ( ) -> boolean
is_artifact
π² Method β> ( ) -> boolean
is_bandolier
π² Method β> ( ) -> boolean
is_bionic
π² Method β> ( ) -> boolean
is_book
π² Method β> ( ) -> boolean
is_brewable
π² Method β> ( ) -> boolean
is_bucket
π² Method β> ( ) -> boolean
is_bucket_nonempty
π² Method β> ( ) -> boolean
is_comestible
π² Method β> ( ) -> boolean
is_container
π² Method β> ( ) -> boolean
is_container_empty
π² Method β> ( ) -> boolean
is_corpse
π² Method β> ( ) -> boolean
is_craft
π² Method β> ( ) -> boolean
is_dangerous
π² Method β> ( ) -> boolean
is_deployable
π² Method β> ( ) -> boolean
is_emissive
π² Method β> ( ) -> boolean
is_engine
π² Method β> ( ) -> boolean
is_faulty
π² Method β> ( ) -> boolean
is_firearm
π² Method β> ( ) -> boolean
is_food
π² Method β> ( ) -> boolean
is_food_container
π² Method β> ( ) -> boolean
is_fuel
π² Method β> ( ) -> boolean
is_gun
π² Method β> ( ) -> boolean
is_gunmod
π² Method β> ( ) -> boolean
is_holster
π² Method β> ( ) -> boolean
is_irremovable
π² Method β> ( ) -> boolean
is_made_of
π² Method β> ( MaterialTypeId ) -> boolean
is_magazine
π² Method β> ( ) -> boolean
Is this a magazine? (batteries are magazines)
is_map
π² Method β> ( ) -> boolean
is_med_container
π² Method β> ( ) -> boolean
is_medication
π² Method β> ( ) -> boolean
is_melee
π² Method β> ( DamageType ) -> boolean
Is this item an effective melee weapon for the given damage type?
is_money
π² Method β> ( ) -> boolean
is_non_resealable_container
π² Method β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_owned_by
π² Method β> ( Character, boolean ) -> boolean
Checks if this item owned by a character
is_power_armor
π² Method β> ( ) -> boolean
is_relic
π² Method β> ( boolean ) -> boolean
is_reloadable
π² Method β> ( ) -> boolean
is_salvageable
π² Method β> ( boolean ) -> boolean
is_seed
π² Method β> ( ) -> boolean
is_sided
π² Method β> ( ) -> boolean
is_silent
π² Method β> ( ) -> boolean
is_soft
π² Method β> ( ) -> boolean
is_stackable
π² Method β> ( ) -> boolean
is_tainted
π² Method β> ( ) -> boolean
is_tool
π² Method β> ( ) -> boolean
is_toolmod
π² Method β> ( ) -> boolean
is_transformable
π² Method β> ( ) -> boolean
is_unarmed_weapon
π² Method β> ( ) -> boolean
is_upgrade
π² Method β> ( ) -> boolean
is_watertight_container
π² Method β> ( ) -> boolean
is_wheel
π² Method β> ( ) -> boolean
made_of
π² Method β> ( ) -> MaterialTypeId[]
mod_charges
π² Method β> ( integer )
mod_damage
π² Method β> ( integer ) -> boolean
π² Method β> ( integer, DamageType ) -> boolean
Modify item damage by given amount. Returns true if item should be destroyed.
price
π² Method β> ( boolean ) -> number
Cents of the item.
boolis whether it is a post-cataclysm value.
remaining_capacity_for_id
π² Method β> ( ItypeId, boolean ) -> integer
Gets the remaining space available for a type of liquid
remove_technique
π² Method β> ( MartialArtsTechniqueId )
Removes the additional technique. Doesnβt affect originial techniques.
set_charges
π² Method β> ( integer )
set_counter
π² Method β> ( integer )
set_damage
π² Method β> ( integer )
Set item damage to specified value. Clamped between min_damage and max_damage.
set_dispersion_bonus
π² Method β> ( integer )
set_flag
π² Method β> ( JsonFlagId )
set_flag_recursive
π² Method β> ( JsonFlagId )
set_melee_damage_bonus
π² Method β> ( DamageInstance )
set_melee_hit_bonus
π² Method β> ( integer )
set_owner
π² Method β> ( FactionId )
π² Method β> ( Character )
Sets the ownership of this item to a faction or character
set_range_bonus
π² Method β> ( integer )
set_ranged_damage_bonus
π² Method β> ( DamageInstance )
set_recoil_bonus
π² Method β> ( integer )
set_var_col
π² Method β> ( string, RGBColor )
set_var_num
π² Method β> ( string, number )
set_var_str
π² Method β> ( string, string )
set_var_tri
π² Method β> ( string, Tripoint )
spawn
π« Function β> ( ItypeId, integer ) -> Detached<Item>
Spawns a new item. Same as gapi.create_item
countsets the itemβs charges, not the number of items: exactly one item is created. For stackable (count-by-charges) items such as ammo,countis the stack size. For non-stackable items, pass a negative value (e.g. -1), since a positive one is still applied as charges. Tools spawned with a negative value get their default charges.
stamina_cost
π² Method β> ( ) -> integer
tname
π² Method β> ( integer, boolean, integer ) -> string
Translated item name with prefixes
total_capacity
π² Method β> ( ) -> Volume
Gets maximum volume this item can hold (liquids, ammo, etc)
unset_flag
π² Method β> ( JsonFlagId )
unset_flags
π² Method β> ( )
vars_table
π² Method β> ( ) -> table
Returns all stored item vars as a table mapping each var name (string) to its raw value (string).
volume
π² Method β> ( boolean? ) -> Volume
Volumeof the item.boolis whether it isintegral_volume.
weapon_categories
π² Method β> ( ) -> WeaponCategoryId[]
Gets the weapon category of the item.
weight
π² Method β> ( boolean?, boolean? ) -> Mass
Weight of the item. The first
boolis whether including contents, secondboolis whether it isintegral_weight.
ItemStack
Iterate over this using pairs() for reading. Can also be indexed.
Bases
No base classes.
Constructors
No constructors.
Members
amount_can_fit
π² Method β> ( Item ) -> integer
clear
π² Method β> ( ) -> Detached<Item>[]
count
π² Method β> ( ) -> integer
count_limit
π² Method β> ( ) -> integer
free_volume
π² Method β> ( ) -> Volume
insert
π² Method β> ( Detached<Item> )
items
π² Method β> ( ) -> Item[]
Modifying the stack while iterating may cause problems. This returns a frozen copy of the items in the stack for safe modification of the stack (eg. removing items while iterating).
max_volume
π² Method β> ( ) -> Volume
move_all_to
π² Method β> ( ItemStack )
only_item
π² Method β> ( ) -> Item
remove
π² Method β> ( Item ) -> Detached<Item>
stacks_with
π² Method β> ( Item ) -> Item
stored_volume
π² Method β> ( ) -> Volume
ItypeId
Bases
No base classes.
Constructors
- ItypeId.new( )
- ItypeId.new( ItypeId )
- ItypeId.new( string )
Members
NULL_ID
π« Function β> ( ) -> ItypeId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> ItypeRaw
str
π² Method β> ( ) -> string
ItypeRaw
Slots for various item type properties. Each slot may contain a valid value or nil
Bases
No base classes.
Constructors
No constructors.
Members
attacks
π» Variable β> table<string, CppVal<attack_statblock>>
Attacks this weapon can perform, keyed by attack id.
countdown_destroy
π» Variable β> boolean
countdown_interval
π» Variable β> integer
default_container
π» Variable β> ItypeId?
emits
π» Variable β> FieldEmitId[]
explode_in_fire
π» Variable β> boolean
explosion_data
π» Variable β> ExplosionData
faults
π» Variable β> FaultId[]
integral_volume
π» Variable β> Volume
integral_weight
π» Variable β> Mass
item_tags
π» Variable β> JsonFlagId[]
layer
π» Variable β> CppVal<layer_level>
light_emission
π» Variable β> integer
looks_like
π» Variable β> ItypeId
materials
π» Variable β> MaterialTypeId[]
melee_to_hit
π» Variable β> integer
min_dex
π» Variable β> integer
min_int
π» Variable β> integer
min_per
π» Variable β> integer
min_skills
π» Variable β> table<SkillId, integer>
Minimum skill levels required to use this item, keyed by skill.
min_str
π» Variable β> integer
phase
π» Variable β> Phase
properties
π» Variable β> table<string, string>
Free-form string properties from the itemβs JSON
propertiesfield, keyed by property name.
qualities
π» Variable β> table<QualityId, integer>
Tool qualities this item provides, mapped to their level.
recipes
π» Variable β> RecipeId[]
repair
π» Variable β> ItypeId[]
repairs_like
π» Variable β> ItypeId
rigid
π» Variable β> boolean
stack_size
π» Variable β> integer
techniques
π» Variable β> MartialArtsTechniqueId[]
thrown_damage
π» Variable β> DamageInstance
volume
π» Variable β> Volume
weapon_category
π» Variable β> WeaponCategoryId[]
weight
π» Variable β> Mass
can_have_charges
π² Method β> ( ) -> boolean
can_use
π² Method β> ( string ) -> boolean
charge_factor
π² Method β> ( ) -> integer
charges_default
π² Method β> ( ) -> integer
charges_per_volume
π² Method β> ( Volume ) -> integer
charges_to_use
π² Method β> ( ) -> integer
damage_max
π² Method β> ( ) -> integer
damage_min
π² Method β> ( ) -> integer
get_countdown_action
π² Method β> ( ) -> string
get_description
π² Method β> ( integer ) -> string
get_drop_action
π² Method β> ( ) -> string
get_flags
π² Method β> ( ) -> JsonFlagId[]
get_name
π² Method β> ( integer ) -> string
get_uses
π² Method β> ( ) -> string[]
has_flag
π² Method β> ( JsonFlagId ) -> boolean
has_use
π² Method β> ( ) -> boolean
is_stackable
π² Method β> ( ) -> boolean
maximum_charges
π² Method β> ( ) -> integer
price
π² Method β> ( ) -> integer
price_post
π² Method β> ( ) -> integer
slot_ammo
π² Method β> ( ) -> IslotAmmo
slot_armor
π² Method β> ( ) -> IslotArmor
slot_artifact
π² Method β> ( ) -> IslotArtifact
slot_battery
π² Method β> ( ) -> IslotBattery
slot_bionic
π² Method β> ( ) -> IslotBionic
slot_book
π² Method β> ( ) -> IslotBook
slot_brewable
π² Method β> ( ) -> IslotBrewable
slot_comestible
π² Method β> ( ) -> IslotComestible
slot_container
π² Method β> ( ) -> IslotContainer
slot_engine
π² Method β> ( ) -> IslotEngine
slot_fuel
π² Method β> ( ) -> IslotFuel
slot_gun
π² Method β> ( ) -> IslotGun
slot_gunmod
π² Method β> ( ) -> IslotGunmod
slot_magazine
π² Method β> ( ) -> IslotMagazine
slot_milling
π² Method β> ( ) -> IslotMilling
slot_mod
π² Method β> ( ) -> IslotMod
slot_pet_armor
π² Method β> ( ) -> IslotPetArmor
slot_relic
π² Method β> ( ) -> Relic
slot_seed
π² Method β> ( ) -> IslotSeed
slot_tool
π² Method β> ( ) -> IslotTool
slot_wheel
π² Method β> ( ) -> IslotWheel
source_mod
π² Method β> ( ) -> ModInfoId[]
type_id
π² Method β> ( ) -> ItypeId
JsonFlagId
Bases
No base classes.
Constructors
- JsonFlagId.new( )
- JsonFlagId.new( JsonFlagId )
- JsonFlagId.new( string )
Members
NULL_ID
π« Function β> ( ) -> JsonFlagId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> JsonFlagRaw
str
π² Method β> ( ) -> string
JsonTraitFlagId
Bases
No base classes.
Constructors
- JsonTraitFlagId.new( )
- JsonTraitFlagId.new( JsonTraitFlagId )
- JsonTraitFlagId.new( string )
Members
NULL_ID
π« Function β> ( ) -> JsonTraitFlagId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> JsonTraitFlagRaw
str
π² Method β> ( ) -> string
KnownMagic
Represents a characterβs spellbook and mana pool. Manages all spells known by a character, their mana, and spell learning/forgetting.
Bases
No base classes.
Constructors
No constructors.
Members
casting_ignore
π» Variable β> boolean
Whether casting ignores all distractions. Can be read and written.
available_mana
π² Method β> ( ) -> integer
Get the current available mana.
can_learn_spell
π² Method β> ( Character, SpellTypeId ) -> boolean
Check if the character can learn a specific spell, considering traits and other restrictions.
forget_spell
π² Method β> ( SpellTypeId )
Forget a known spell by spell_id.
get_spell
π² Method β> ( SpellTypeId ) -> Spell
Get a reference to a known spell for editing. Returns the spell associated with the given spell_id.
get_spells
π² Method β> ( ) -> Spell[]
Get all known spells as a vector of spell pointers.
has_enough_energy
π² Method β> ( Character, Spell ) -> boolean
Check if the character has enough energy (of the appropriate type) to cast the given spell.
knows_spell
π² Method β> ( SpellTypeId ) -> boolean
π² Method β> ( ) -> boolean
Check if the character knows a specific spell by spell_id.
learn_spell
π² Method β> ( SpellTypeId, Character, boolean? )
Learn a new spell. Requires a
Characterreference and spell_id. Optional force(boolean) parameter bypasses restrictions.
mana_regen_rate
π² Method β> ( Character ) -> number
Get the mana regeneration rate in units per turn for the given character.
max_mana
π² Method β> ( Character ) -> integer
Get the maximum mana for the given character.
mod_mana
π² Method β> ( Character, integer )
Modify the current mana by adding or subtracting an amount.
set_mana
π² Method β> ( integer )
Set the current mana to a specific value.
spells
π² Method β> ( ) -> SpellTypeId[]
Get a vector of all known spell IDs.
time_to_learn_spell
π² Method β> ( Character, SpellTypeId ) -> integer
Calculate the time in moves required for the character to memorize/learn a spell.
Map
Bases
No base classes.
Constructors
No constructors.
Members
abs_to_bub
π² Method β> ( TripointAbsMs ) -> TripointBubMs
π² Method β> ( TripointAbsSm ) -> TripointBubSm
Convert absolute coordinates to bubble coordinates.
add_field_at
π² Method β> ( TripointBubMs, FieldTypeIntId, integer, TimeDuration ) -> boolean
add_item
π² Method β> ( TripointBubMs, Detached<Item> ) -> Detached<Item>
π² Method β> ( Tripoint, Detached<Item> ) -> Detached<Item>
Places a detached item onto the map. Returns nil on success (item now owned by map), or returns the item back if placement failed.
ambient_light_at
π² Method β> ( TripointBubMs ) -> number
bub_to_abs
π² Method β> ( TripointBubMs ) -> TripointAbsMs
π² Method β> ( TripointBubSm ) -> TripointAbsSm
Convert bubble coordinates to absolute coordinates.
clear_items_at
π² Method β> ( TripointBubMs )
π² Method β> ( Tripoint )
create_corpse_at
π² Method β> ( TripointBubMs, MonsterTypeId?, TimePoint?, string?, integer? )
Creates a new corpse at a position on the map. You can skip
Optones by omitting them or passingnil.<code>[MonsterTypeId](#sol::MonsterTypeId)</code>specifies which monsterβs body it is,<code>[TimePoint](#sol::TimePoint)</code>indicates when it died,stringgives it a custom name, andintdetermines the revival time if the monster has theREVIVESflag.
create_item_at
π² Method β> ( TripointBubMs, ItypeId, integer )
Creates a new item at a position on the map.
countsets the itemβs charges, not the number of items: exactly one item is created. For stackable (count-by-charges) items such as ammo,countis the stack size. For non-stackable items, pass a negative value (e.g. -1), since a positive one is still applied as charges. Tools spawned with a negative value get their default charges. Returns nil. Use gapi.create_item andMap:add_item to modify before placement.
destroy
π² Method β> ( TripointBubMs )
detach_item_at
π² Method β> ( TripointBubMs, Item ) -> Detached<Item>
π² Method β> ( Tripoint, Item ) -> Detached<Item>
Removes an item from the map and returns it as a detached_ptr. The item is now owned by Lua - store it in a table to keep it alive, or let it be GCβd to destroy it. Use add_item to place it back on a map.
disarm_trap_at
π² Method β> ( TripointBubMs )
Disarms a trap using your skills and stats, with consequences depending on success or failure.
drain_vehicle_fuel_at
π² Method β> ( TripointBubMs, string, ItypeId, integer ) -> integer
Drains fuel charges from the vehicle when the position has a part with the given feature. Returns the charges drained.
draw_fill_background
π² Method β> ( string )
erase_furn_var_at
π² Method β> ( TripointBubMs, string ) -> boolean
Removes a furniture variable at the position. Returns whether a variable was removed.
erase_ter_var_at
π² Method β> ( TripointBubMs, string ) -> boolean
Removes a terrain variable at the position. Returns whether a variable was removed.
get_bound_dimension
π² Method β> ( ) -> string
Returns the dimension id currently bound to this map. Empty string means the overworld.
get_field_age_at
π² Method β> ( TripointBubMs, FieldTypeIntId ) -> TimeDuration
get_field_ids_at
π² Method β> ( TripointBubMs ) -> FieldTypeIntId[]
get_field_int_at
π² Method β> ( TripointBubMs, FieldTypeIntId ) -> integer
get_field_name_at
π² Method β> ( TripointBubMs, FieldTypeIntId ) -> string
get_furn_at
π² Method β> ( TripointBubMs ) -> FurnIntId
get_furn_var_at
π² Method β> ( TripointBubMs, string, string? ) -> string
Returns a furniture variable at the position, or
default(empty string if omitted) when it is not set.
get_furn_vars_table_at
π² Method β> ( TripointBubMs ) -> table
Returns all furniture variables at the position as a table mapping each name to its value.
get_items_at
π² Method β> ( TripointBubMs ) -> MapStack
π² Method β> ( Tripoint ) -> MapStack
get_items_in_radius
π² Method β> ( TripointBubMs, integer ) -> MapStack[]
get_map_size
π² Method β> ( ) -> integer
In map squares
get_map_size_in_submaps
π² Method β> ( ) -> integer
get_temperature_c
π² Method β> ( TripointBubMs ) -> number
Get the local ambient temperature in degrees Celsius at a map-square position.
get_ter_at
π² Method β> ( TripointBubMs ) -> TerIntId
get_ter_var_at
π² Method β> ( TripointBubMs, string, string? ) -> string
Returns a terrain variable at the position, or
default(empty string if omitted) when it is not set.
get_ter_vars_table_at
π² Method β> ( TripointBubMs ) -> table
Returns all terrain variables at the position as a table mapping each name to its value.
get_trap_at
π² Method β> ( TripointBubMs ) -> TrapIntId
get_vehicle_fuel_left_at
π² Method β> ( TripointBubMs, string, ItypeId, boolean? ) -> integer
Returns the vehicleβs available fuel charges when the position has a part with the given feature.
get_vehicles
π² Method β> ( ) -> WrappedVehicle[]
Returns every vehicle currently on the map.
has_field_at
π² Method β> ( TripointBubMs, FieldTypeIntId ) -> boolean
has_flag_at
π² Method β> ( string, TripointBubMs ) -> boolean
has_furn_flag_at
π² Method β> ( string, TripointBubMs ) -> boolean
has_furn_var_at
π² Method β> ( TripointBubMs, string ) -> boolean
Returns whether a furniture variable is set at the position.
has_items_at
π² Method β> ( TripointBubMs ) -> boolean
π² Method β> ( Tripoint ) -> boolean
has_ter_flag_at
π² Method β> ( string, TripointBubMs ) -> boolean
has_ter_var_at
π² Method β> ( TripointBubMs, string ) -> boolean
Returns whether a terrain variable is set at the position.
has_vehicle_part_with_feature_at
π² Method β> ( TripointBubMs, string, boolean? ) -> boolean
Returns whether a vehicle at this position has an available part with the given feature.
is_in_sunlight
π² Method β> ( TripointBubMs ) -> boolean
is_ot_match
π« Function β> ( string, OterIntId, OtMatchType ) -> boolean
is_out_of_bounds
π² Method β> ( TripointBubMs ) -> boolean
Returns whether a local map position lies outside the current dimension bounds.
is_outside
π² Method β> ( TripointBubMs ) -> boolean
is_sheltered
π² Method β> ( TripointBubMs ) -> boolean
make_rubble
π² Method β> ( TripointBubMs, FurnIntId, TerIntId )
mod_field_age_at
π² Method β> ( TripointBubMs, FieldTypeIntId, TimeDuration ) -> TimeDuration
mod_field_int_at
π² Method β> ( TripointBubMs, FieldTypeIntId, integer ) -> integer
move_item_to
π² Method β> ( TripointBubMs, Item, TripointBubMs )
Moves an item from one position to another, preserving all item state including contents.
place_items
π² Method β> ( string, integer, TripointBubMs, TripointBubMs, boolean )
place_npc
π² Method β> ( TripointBubMs, string ) -> Npc
Forcibly places an npc using a template at a position on the map. Returns the npc.
place_spawns
π² Method β> ( string, integer, TripointBubMs, TripointBubMs, number, boolean )
points_in_radius
π² Method β> ( TripointBubMs, integer, integer? ) -> TripointBubMs[]
Returns all points within a radius from the center point.
radiuszdefaults to 0.
remove_field_at
π² Method β> ( TripointBubMs, FieldTypeIntId )
remove_item_at
π² Method β> ( TripointBubMs, Item )
π² Method β> ( Tripoint, Item )
remove_trap_at
π² Method β> ( TripointBubMs )
Simpler version of
set_trap_atwithtrap_null.
replace_vehicle
π² Method β> ( WrappedVehicle, string, table? ) -> boolean
π² Method β> ( TripointBubMs, string, table? ) -> boolean
Replaces a specific vehicle with a different prototype at the same origin tile.
Returns false if the vehicle id or an option is invalid.
Pass an optional table with keys:
orientation(Angleor number, optional): Facing of the new vehicle, as anAngleor in degrees. Defaults to the old vehicleβs facing.status(integer, optional): Initial damage. -1 is light damage, 0 is undamaged, 1 is disabled (destroyed tires or engine). Defaults to -1.locks(boolean, optional): If false, removes locking door parts and spawns the vehicle unlocked with keys. Otherwise locks follow the normal spawn rules.
rotate
π² Method β> ( integer )
set_field_age_at
π² Method β> ( TripointBubMs, FieldTypeIntId, TimeDuration, boolean ) -> TimeDuration
set_field_int_at
π² Method β> ( TripointBubMs, FieldTypeIntId, integer, boolean ) -> integer
set_furn_at
π² Method β> ( TripointBubMs, FurnIntId )
set_furn_var_at
π² Method β> ( TripointBubMs, string, string ) -> boolean
Sets a furniture variable at the position. Returns false if the position is out of bounds.
set_temperature
π² Method β> ( TripointBubMs, integer )
set_ter_at
π² Method β> ( TripointBubMs, TerIntId ) -> boolean
set_ter_var_at
π² Method β> ( TripointBubMs, string, string ) -> boolean
Sets a terrain variable at the position. Returns false if the position is out of bounds.
set_trap_at
π² Method β> ( TripointBubMs, TrapIntId )
Set a trap at a position on the map. It can also replace existing trap, even with
trap_null.
spawn_artifact_at
π² Method β> ( TripointBubMs )
Spawns a random artifact at a position on the map.
spawn_natural_artifact_at
π² Method β> ( TripointBubMs, string? )
Spawns a natural artifact at a position on the map. Omit
propertyto choose one at random.
MapStack
Bases
ItemStack
Constructors
No constructors.
Members
as_item_stack
π² Method β> ( ) -> ItemStack
MapgenConstructor
Bases
No base classes.
Constructors
No constructors.
Members
add_field_at
π² Method β> ( PointOmtMs, FieldTypeIntId, integer, TimeDuration ) -> boolean
add_item
π² Method β> ( PointOmtMs, Detached<Item> ) -> Detached<Item>
clear_items_at
π² Method β> ( PointOmtMs )
create_corpse_at
π² Method β> ( PointOmtMs, MonsterTypeId?, TimePoint?, string?, integer? )
create_item_at
π² Method β> ( PointOmtMs, ItypeId, integer )
Creates a new item at a position on the mapgen surface.
countsets the itemβs charges, not the number of items: exactly one item is created. For stackable (count-by-charges) items such as ammo,countis the stack size. For non-stackable items, pass a negative value (e.g. -1), since a positive one is still applied as charges. Tools spawned with a negative value get their default charges.
destroy
π² Method β> ( PointOmtMs )
draw_fill_background
π² Method β> ( string )
erase_furn_var_at
π² Method β> ( PointOmtMs, string ) -> boolean
Removes a furniture variable at the position. Returns whether a variable was removed.
erase_ter_var_at
π² Method β> ( PointOmtMs, string ) -> boolean
Removes a terrain variable at the position. Returns whether a variable was removed.
get_furn_at
π² Method β> ( PointOmtMs ) -> FurnIntId
get_furn_var_at
π² Method β> ( PointOmtMs, string, string? ) -> string
Returns a furniture variable at the position, or
default(empty string if omitted) when it is not set.
get_furn_vars_table_at
π² Method β> ( PointOmtMs ) -> table
Returns all furniture variables at the position as a table mapping each name to its value.
get_items_at
π² Method β> ( PointOmtMs ) -> MapStack
get_items_in_radius
π² Method β> ( PointOmtMs, integer ) -> MapStack[]
get_map_size
π² Method β> ( ) -> integer
get_map_size_in_submaps
π² Method β> ( ) -> integer
get_temperature
π² Method β> ( PointOmtMs ) -> integer
get_ter_at
π² Method β> ( PointOmtMs ) -> TerIntId
get_ter_var_at
π² Method β> ( PointOmtMs, string, string? ) -> string
Returns a terrain variable at the position, or
default(empty string if omitted) when it is not set.
get_ter_vars_table_at
π² Method β> ( PointOmtMs ) -> table
Returns all terrain variables at the position as a table mapping each name to its value.
get_trap_at
π² Method β> ( PointOmtMs ) -> TrapIntId
get_vehicles
π² Method β> ( ) -> CppVal<vehicle>[]
has_flag_at
π² Method β> ( string, PointOmtMs ) -> boolean
has_furn_flag_at
π² Method β> ( string, PointOmtMs ) -> boolean
has_furn_var_at
π² Method β> ( PointOmtMs, string ) -> boolean
Returns whether a furniture variable is set at the position.
has_ter_flag_at
π² Method β> ( string, PointOmtMs ) -> boolean
has_ter_var_at
π² Method β> ( PointOmtMs, string ) -> boolean
Returns whether a terrain variable is set at the position.
is_ot_match
π« Function β> ( string, OterIntId, OtMatchType ) -> boolean
make_rubble
π² Method β> ( PointOmtMs, FurnIntId, TerIntId )
place_items
π² Method β> ( string, integer, PointOmtMs, PointOmtMs, boolean )
place_npc
π² Method β> ( PointOmtMs, string ) -> Npc
Forcibly places an npc using a template at a position on the mapgen surface. Returns the npc.
place_spawns
π² Method β> ( string, integer, PointOmtMs, PointOmtMs, number, boolean )
points_in_radius
π² Method β> ( PointOmtMs, integer ) -> PointOmtMs[]
remove_field_at
π² Method β> ( PointOmtMs, FieldTypeIntId )
remove_trap_at
π² Method β> ( PointOmtMs )
replace_vehicle
π² Method β> ( CppVal<vehicle>, string, table? ) -> boolean
Replaces a vehicle spawned by mapgen with a different prototype at the same position.
Returns false if the vehicle id or an option is invalid.
Pass an optional table with keys:
orientation(Angleor number, optional): Facing of the new vehicle, as anAngleor in degrees. Defaults to the old vehicleβs facing.status(integer, optional): Initial damage. -1 is light damage, 0 is undamaged, 1 is disabled (destroyed tires or engine). Defaults to -1.locks(boolean, optional): If false, removes locking door parts and spawns the vehicle unlocked with keys. Otherwise locks follow the normal spawn rules.
rotate
π² Method β> ( integer )
set_furn_at
π² Method β> ( PointOmtMs, FurnIntId )
set_furn_var_at
π² Method β> ( PointOmtMs, string, string ) -> boolean
Sets a furniture variable at the position. Returns false if the position is out of bounds.
set_temperature
π² Method β> ( PointOmtMs, integer )
set_ter_at
π² Method β> ( PointOmtMs, TerIntId ) -> boolean
set_ter_var_at
π² Method β> ( PointOmtMs, string, string ) -> boolean
Sets a terrain variable at the position. Returns false if the position is out of bounds.
set_trap_at
π² Method β> ( PointOmtMs, TrapIntId )
MapgenData
Bases
No base classes.
Constructors
No constructors.
Members
above
π² Method β> ( ) -> OterIntId
Gets the oter id to the above.
below
π² Method β> ( ) -> OterIntId
Gets the oter id to the below.
east
π² Method β> ( ) -> OterIntId
Gets the oter id to the east.
fill_groundcover
π² Method β> ( )
Fills the ground with default terrain.
generate
π² Method β> ( string )
Generates Normal Mapgen
get_nesw
π² Method β> ( integer ) -> OterIntId
Returns t_nesw at index i
get_rot_suffix
π² Method β> ( ) -> string
Gets rotation string
get_rotation
π² Method β> ( ) -> integer
Gets rotation
id
π² Method β> ( ) -> OterIntId
Gets itβs oter id.
neast
π² Method β> ( ) -> OterIntId
Gets the oter id to the neast.
nest
π² Method β> ( string, PointRelMs )
Generates Nested Mapgen
north
π² Method β> ( ) -> OterIntId
Gets the oter id to the north.
nwest
π² Method β> ( ) -> OterIntId
Gets the oter id to the nwest.
seast
π² Method β> ( ) -> OterIntId
Gets the oter id to the seast.
set_dir
π² Method β> ( integer, integer )
Sets the direction of the mapgen.
south
π² Method β> ( ) -> OterIntId
Gets the oter id to the south.
swest
π² Method β> ( ) -> OterIntId
Gets the oter id to the swest.
west
π² Method β> ( ) -> OterIntId
Gets the oter id to the west.
zlevel
π² Method β> ( ) -> integer
Gets the z-level that it is generated at.
MartialArtsBuffId
Bases
No base classes.
Constructors
- MartialArtsBuffId.new( )
- MartialArtsBuffId.new( MartialArtsBuffId )
- MartialArtsBuffId.new( string )
Members
NULL_ID
π« Function β> ( ) -> MartialArtsBuffId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> MartialArtsBuffRaw
str
π² Method β> ( ) -> string
MartialArtsId
Bases
No base classes.
Constructors
- MartialArtsId.new( )
- MartialArtsId.new( MartialArtsId )
- MartialArtsId.new( string )
Members
NULL_ID
π« Function β> ( ) -> MartialArtsId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> MartialArtsRaw
str
π² Method β> ( ) -> string
MartialArtsTechniqueId
Bases
No base classes.
Constructors
- MartialArtsTechniqueId.new( )
- MartialArtsTechniqueId.new( MartialArtsTechniqueId )
- MartialArtsTechniqueId.new( string )
Members
NULL_ID
π« Function β> ( ) -> MartialArtsTechniqueId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> MartialArtsTechniqueRaw
str
π² Method β> ( ) -> string
MartialArtsTechniqueRaw
Bases
No base classes.
Constructors
No constructors.
Members
avatar_message
π» Variable β> string
block_counter
π» Variable β> boolean
controlled_knockback
π» Variable β> boolean
crit_ok
π» Variable β> boolean
crit_tec
π» Variable β> boolean
defensive
π» Variable β> boolean
disarms
π» Variable β> boolean
dodge_counter
π» Variable β> boolean
down_dur
π» Variable β> integer
force_unarmed
π» Variable β> boolean
grab_break
π» Variable β> boolean
knockback_dist
π» Variable β> integer
knockback_follow
π» Variable β> boolean
knockback_spread
π» Variable β> number
miss_recovery
π» Variable β> boolean
name
π» Variable β> string
npc_message
π» Variable β> string
powerful_knockback
π» Variable β> boolean
side_switch
π» Variable β> boolean
stun_dur
π» Variable β> integer
take_weapon
π» Variable β> boolean
get_description
π² Method β> ( ) -> string
Mass
Bases
No base classes.
Constructors
No constructors.
Members
from_gram
π« Function β> ( integer ) -> Mass
from_kilogram
π« Function β> ( integer ) -> Mass
from_milligram
π« Function β> ( integer ) -> Mass
from_newton
π« Function β> ( integer ) -> Mass
to_gram
π² Method β> ( ) -> integer
to_kilogram
π² Method β> ( ) -> integer
to_milligram
π² Method β> ( ) -> integer
to_newton
π² Method β> ( ) -> integer
MaterialTypeId
Bases
No base classes.
Constructors
- MaterialTypeId.new( )
- MaterialTypeId.new( MaterialTypeId )
- MaterialTypeId.new( string )
Members
NULL_ID
π« Function β> ( ) -> MaterialTypeId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> MaterialTypeRaw
str
π² Method β> ( ) -> string
MaterialTypeRaw
Bases
No base classes.
Constructors
No constructors.
Members
name
π² Method β> ( ) -> string
str_id
π² Method β> ( ) -> MaterialTypeId
Mission
Bases
No base classes.
Constructors
- Mission.new( )
Members
assign
π² Method β> ( Avatar )
Assigns this mission to the given avatar.
fail
π² Method β> ( )
Fails the mission.
get_deadline
π² Method β> ( ) -> TimePoint
Returns the missionβs deadline as a time_point.
get_description
π² Method β> ( ) -> string
Returns the mission description.
get_follow_up
π² Method β> ( ) -> MissionTypeIdRaw
Returns the follow-up mission type ID.
get_id
π² Method β> ( ) -> integer
Returns the missionβs unique ID.
get_item_id
π² Method β> ( ) -> ItypeId
Returns the item ID associated with the mission.
get_likely_rewards
π² Method β> ( ) -> (integer, ItypeId)[]
Returns the likely rewards of the mission (vector of (int chance, itype_id) pairs).
get_npc_id
π² Method β> ( ) -> CharacterId
Returns the NPC character ID associated with the mission.
get_target_point
π² Method β> ( ) -> TripointAbsOmt
Returns the target of the mission as absolute overmap terrain coordinates.
get_type
π² Method β> ( ) -> MissionType
Returns the mission type of the target (pointer to mission_type).
get_value
π² Method β> ( ) -> integer
Returns the missionβs value as an integer.
has_deadline
π² Method β> ( ) -> boolean
Returns true if the mission has a deadline.
has_failed
π² Method β> ( ) -> boolean
Returns true if the mission has failed.
has_follow_up
π² Method β> ( ) -> boolean
Returns true if the mission has a follow-up mission.
has_generic_rewards
π² Method β> ( ) -> boolean
Returns true if the mission has generic rewards.
has_target
π² Method β> ( ) -> boolean
Returns true if the mission has a target.
in_progress
π² Method β> ( ) -> boolean
Returns true if the mission is currently in progress.
is_assigned
π² Method β> ( ) -> boolean
Returns true if the mission is currently assigned.
is_complete
π² Method β> ( CharacterId? ) -> boolean
Returns true if the mission goal has been completed (optionally checked against given NPC ID).
mission_id
π² Method β> ( ) -> MissionTypeIdRaw
Returns the mission type ID of this mission.
name
π² Method β> ( ) -> string
Returns the missionβs name as a string.
reserve_new
π« Function β> ( MissionTypeIdRaw, CharacterId ) -> Mission
Reserves a new mission of the given type for the specified NPC. Returns the new mission.
reserve_random
π« Function β> ( MissionOrigin, TripointAbsOmt, CharacterId ) -> Mission
Reserves a random mission at the specified origin and position for the given NPC. Returns the new mission.
step_complete
π² Method β> ( integer )
Marks a mission step as complete, taking an integer step index.
wrap_up
π² Method β> ( )
Wraps up the mission successfully.
MissionType
Bases
No base classes.
Constructors
- MissionType.new( )
Members
deadline_high
π» Variable β> TimeDuration
Returns the maximum allowed deadline for the mission.
deadline_low
π» Variable β> TimeDuration
Returns the minimum allowed deadline for the mission.
description
π» Variable β> CppVal<translation>
Returns the missionβs description as a string.
dialogue
π» Variable β> table<string, CppVal<translation>>
Returns any associated dialogue for the mission, keyed by situation:
describe,offer,accepted,rejected,advice,inquire,success,success_lieandfailure.
difficulty
π» Variable β> integer
Returns the missionβs difficulty as an integer.
empty_container
π» Variable β> ItypeId
Returns true if the mission requires the container to be empty.
follow_up
π» Variable β> MissionTypeIdRaw
Returns any follow-up mission type ID.
goal
π» Variable β> MissionGoal
Returns the missionβs goal text.
has_generic_rewards
π» Variable β> boolean
Returns true if the mission has generic rewards.
item_count
π» Variable β> integer
Returns the count of items involved in the mission.
item_id
π» Variable β> ItypeId
Returns the ID of the missionβs main item target, if applicable.
likely_rewards
π» Variable β> (integer, ItypeId)[]
Returns a vector of likely rewards (chance, itype_id pairs).
monster_kill_goal
π» Variable β> integer
Returns the number of monsters required to kill for this mission.
monster_type
π» Variable β> MonsterTypeId
Returns the monster type associated with the mission, if any.
origins
π» Variable β> MissionOrigin[]
Returns a list of origins from which this mission can be generated.
remove_container
π» Variable β> boolean
Returns true if the mission requires removing a container.
target_npc_id
π» Variable β> CharacterId
Returns the ID of the target NPC for the mission, if any.
urgent
π» Variable β> boolean
Returns true if the mission is marked as urgent.
value
π» Variable β> integer
Returns the missionβs reward value as an integer.
get_all
π« Function β> ( ) -> MissionType[]
Returns all available missions.
get_random_mission_id
π« Function β> ( MissionOrigin, TripointAbsOmt ) -> MissionTypeIdRaw
Returns a random mission type ID at the specified origin and overmap tile position.
tname
π² Method β> ( ) -> string
MissionTypeIdRaw
Bases
No base classes.
Constructors
- MissionTypeIdRaw.new( string )
Members
No members.
ModInfoId
Bases
No base classes.
Constructors
- ModInfoId.new( )
- ModInfoId.new( ModInfoId )
- ModInfoId.new( string )
Members
NULL_ID
π« Function β> ( ) -> ModInfoId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> ModInfoRaw
str
π² Method β> ( ) -> string
Mongroup
Bases
No base classes.
Constructors
No constructors.
Members
diffuse
π» Variable β> boolean
horde
π» Variable β> boolean
horde_behaviour
π» Variable β> string
interest
π» Variable β> integer
population
π» Variable β> integer
radius
π» Variable β> integer
type
π» Variable β> MonsterGroupId
abs_pos
π² Method β> ( ) -> TripointAbsSm
Get the group position in absolute submap coordinates.
avg_speed
π² Method β> ( ) -> number
Average movement speed of monsters in the group.
clear
π² Method β> ( )
Remove all monsters and clear population.
dec_interest
π² Method β> ( integer )
Decrease horde interest by the given amount (clamped 15..100).
inc_interest
π² Method β> ( integer )
Increase horde interest by the given amount (clamped 15..100).
is_empty
π² Method β> ( ) -> boolean
Check if the group has no members or population.
is_safe
π² Method β> ( ) -> boolean
Check if the group is safe.
monsters
π² Method β> ( ) -> Monster[]
Get individual monster instances tracked inside the horde (if any).
nemesis_target
π² Method β> ( ) -> TripointAbsSm
Get the nemesis target for this group.
set_interest
π² Method β> ( integer )
Set horde interest directly (clamped 15..100).
set_nemesis_target
π² Method β> ( TripointAbsSm )
Set the nemesis target for this group using absolute submap coordinates.
set_pos
π² Method β> ( TripointAbsSm )
Set the group position in absolute submap coordinates.
set_target
π² Method β> ( TripointAbsSm )
Set the current target in absolute submap coordinates.
target
π² Method β> ( ) -> TripointAbsSm
Get the current target in absolute submap coordinates.
Monster
Bases
Creature
Constructors
No constructors.
Members
anger
π» Variable β> integer
death_drops
π» Variable β> boolean
faction
π» Variable β> MonsterFactionIntId
friendly
π» Variable β> integer
morale
π» Variable β> integer
pet_bond_level
π» Variable β> integer
Bond level with the character this pet is bonded to.
training_level
π» Variable β> integer
Pet training level gained through pet training.
unique_name
π» Variable β> string
add_armor_item
π² Method β> ( Detached<Item> ) -> Detached<Item>
add_battery_item
π² Method β> ( Detached<Item> ) -> Detached<Item>
add_detached_item
π² Method β> ( Detached<Item> )
add_faction_anger
π² Method β> ( string, integer )
add_item
π² Method β> ( Item )
add_saddle_item
π² Method β> ( Detached<Item> ) -> Detached<Item>
add_storage_item
π² Method β> ( Detached<Item> ) -> Detached<Item>
attack_target
π² Method β> ( ) -> Creature
Hostile creature this monster sees at its move target, or nil while wandering.
attitude
π² Method β> ( Character ) -> MonsterAttitude
bash_at
π² Method β> ( TripointBubMs ) -> boolean
π² Method β> ( Tripoint ) -> boolean
can_act
π² Method β> ( ) -> boolean
Whether this monster has moves left and is not stunned, downed or webbed.
can_climb
π² Method β> ( ) -> boolean
can_dig
π² Method β> ( ) -> boolean
can_drown
π² Method β> ( ) -> boolean
can_hear
π² Method β> ( ) -> boolean
can_see
π² Method β> ( ) -> boolean
can_submerge
π² Method β> ( ) -> boolean
can_upgrade
π² Method β> ( ) -> boolean
clear_items
π² Method β> ( ) -> Detached<Item>[]
clear_move_target
π² Method β> ( )
clear_special_attack_budget
π² Method β> ( )
Frees the budget so a further use_special_attack can run in the same action. Only for a deliberately multi-attack action; the budget is what stops Lua and the stock scheduler from stacking attacks onto one action.
climbs
π² Method β> ( ) -> boolean
digs
π² Method β> ( ) -> boolean
drop_items
π² Method β> ( TripointBubMs )
drop_items_here
π² Method β> ( )
flies
π² Method β> ( ) -> boolean
get_armor_item
π² Method β> ( ) -> Item
get_battery_item
π² Method β> ( ) -> Item
get_faction_anger
π² Method β> ( string ) -> integer
get_grab_strength
π² Method β> ( ) -> integer
Intensity of the grabbed effect this monster applies.
get_items
π² Method β> ( ) -> Item[]
get_saddle_item
π² Method β> ( ) -> Item
get_special_attack_cooldown
π² Method β> ( string ) -> integer?
Remaining cooldown in turns, or nil for attacks this monster does not have.
get_special_attack_ids
π² Method β> ( ) -> string[]
Sorted IDs of every special attack this monsterβs current type defines.
get_storage_item
π² Method β> ( ) -> Item
get_type
π² Method β> ( ) -> MonsterTypeId
get_upgrade_time
π² Method β> ( ) -> integer
has_special_attack
π² Method β> ( string ) -> boolean
Whether this monsterβs current type and runtime state contain the exact attack ID.
hasten_upgrade
π² Method β> ( )
heal
π² Method β> ( integer, boolean ) -> integer
is_dead_or_dying
π² Method β> ( ) -> boolean
Whether this monster is dead or at 0 HP. Unlike is_dead, which checks only HP, this also includes monsters that already died with HP left, e.g. by self-destructing.
is_fleeing
π² Method β> ( Character ) -> boolean
Whether this monster flees from the given character.
is_wandering
π² Method β> ( ) -> boolean
made_of
π² Method β> ( MaterialTypeId ) -> boolean
make_ally
π² Method β> ( Monster )
make_friendly
π² Method β> ( )
make_fungus
π² Method β> ( ) -> boolean
make_pet
π² Method β> ( )
move_target
π² Method β> ( ) -> TripointBubMs
move_to
π² Method β> ( TripointBubMs, boolean, boolean, number ) -> boolean
π² Method β> ( Tripoint, boolean, boolean, number ) -> boolean
movement_impaired
π² Method β> ( ) -> boolean
Whether this monster has an effect that impairs movement.
name
π² Method β> ( integer ) -> string
name_with_armor
π² Method β> ( ) -> string
refill_udders
π² Method β> ( )
remove_armor_item
π² Method β> ( ) -> Detached<Item>
remove_battery_item
π² Method β> ( ) -> Detached<Item>
remove_item
π² Method β> ( Item ) -> Detached<Item>
remove_saddle_item
π² Method β> ( ) -> Detached<Item>
remove_storage_item
π² Method β> ( ) -> Detached<Item>
run_normal_ai_turn
π² Method β> ( )
set_attitude
π² Method β> ( MonsterAttitude )
set_hp
π² Method β> ( integer )
set_move_target
π² Method β> ( TripointBubMs )
π² Method β> ( Tripoint )
set_special_attack_cooldown
π² Method β> ( string, integer )
Sets the remaining cooldown in turns. Negative values are clamped to 0. Does nothing for attacks this monster does not have.
set_special_attack_enabled
π² Method β> ( string, boolean )
Enables or disables an attack without touching its cooldown. The enabled flag is serialized, so it persists across save/load. A disabled attack is skipped by the stock scheduler and by special_attack_ready.
set_target
π² Method β> ( Creature )
spawn
π² Method β> ( TripointBubMs )
special_attack_budget_spent
π² Method β> ( ) -> boolean
Whether this actionβs one special attack has already been spent.
special_attack_enabled
π² Method β> ( string ) -> boolean
Whether the attack is enabled. False for attacks this monster does not have.
special_attack_ready
π² Method β> ( string ) -> boolean
Checks only enabled state and zero cooldown; does not predict range, target, sight or ammo.
swims
π² Method β> ( ) -> boolean
try_reproduce
π² Method β> ( )
try_upgrade
π² Method β> ( boolean )
use_special_attack
π² Method β> ( string ) -> boolean
Calls a ready special attack once. True means the actor handled use, not necessarily a hit or shot. Resets cooldown only on true. Actor side effects are not rolled back on false. Does not apply the schedulerβs pacified/hallucination restrictions or plan a target. On true the stock scheduler skips its own pick for the rest of this action.
wander_to
π² Method β> ( TripointBubMs, integer )
MonsterFactionId
Bases
No base classes.
Constructors
- MonsterFactionId.new( )
- MonsterFactionId.new( MonsterFactionId )
- MonsterFactionId.new( MonsterFactionIntId )
- MonsterFactionId.new( string )
Members
NULL_ID
π« Function β> ( ) -> MonsterFactionId
implements_int_id
π« Function β> ( ) -> boolean
int_id
π² Method β> ( ) -> MonsterFactionIntId
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> MonsterFactionRaw
str
π² Method β> ( ) -> string
MonsterFactionIntId
Bases
No base classes.
Constructors
- MonsterFactionIntId.new( )
- MonsterFactionIntId.new( MonsterFactionIntId )
- MonsterFactionIntId.new( MonsterFactionId )
Members
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> MonsterFactionRaw
str_id
π² Method β> ( ) -> MonsterFactionId
MonsterGroupEntry
Bases
No base classes.
Constructors
No constructors.
Members
conditions
π» Variable β> string[]
cost_multiplier
π» Variable β> integer
ends
π» Variable β> TimeDuration
frequency
π» Variable β> integer
name
π» Variable β> MonsterTypeId
pack_maximum
π» Variable β> integer
pack_minimum
π» Variable β> integer
starts
π» Variable β> TimeDuration
lasts_forever
π² Method β> ( ) -> boolean
MonsterGroupId
Bases
No base classes.
Constructors
- MonsterGroupId.new( )
- MonsterGroupId.new( MonsterGroupId )
- MonsterGroupId.new( string )
Members
NULL_ID
π« Function β> ( ) -> MonsterGroupId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> MonsterGroupRaw
str
π² Method β> ( ) -> string
MonsterGroupRaw
Bases
No base classes.
Constructors
No constructors.
Members
defaultMonster
π» Variable β> MonsterTypeId
freq_total
π» Variable β> integer
is_animal
π» Variable β> boolean
is_safe
π» Variable β> boolean
monster_group_time
π» Variable β> TimeDuration
monsters
π» Variable β> MonsterGroupEntry[]
name
π» Variable β> MonsterGroupId
new_monster_group
π» Variable β> MonsterGroupId
replace_monster_group
π» Variable β> boolean
contains
π² Method β> ( MonsterTypeId ) -> boolean
Check if a monster type appears in this group.
MonsterTypeId
Bases
No base classes.
Constructors
- MonsterTypeId.new( )
- MonsterTypeId.new( MonsterTypeId )
- MonsterTypeId.new( string )
Members
NULL_ID
π« Function β> ( ) -> MonsterTypeId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> MonsterTypeRaw
str
π² Method β> ( ) -> string
MonsterTypeRaw
Bases
No base classes.
Constructors
No constructors.
Members
difficulty
π» Variable β> integer
difficulty_base
π» Variable β> integer
grab_strength
π» Variable β> integer
Intensity of the grabbed effect this monster type applies.
id
π» Variable β> MonsterTypeId
melee_damage
π» Variable β> DamageInstance
Base melee attack damage.
melee_dice
π» Variable β> integer
Number of dice of bonus bashing damage on melee hit.
melee_sides
π» Variable β> integer
Number of sides of the melee bonus damage dice.
nname
π² Method β> ( integer ) -> string
MoraleTypeDataId
Bases
No base classes.
Constructors
- MoraleTypeDataId.new( )
- MoraleTypeDataId.new( MoraleTypeDataId )
- MoraleTypeDataId.new( string )
Members
NULL_ID
π« Function β> ( ) -> MoraleTypeDataId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> MoraleTypeDataRaw
str
π² Method β> ( ) -> string
MutationBranchId
Bases
No base classes.
Constructors
- MutationBranchId.new( )
- MutationBranchId.new( MutationBranchId )
- MutationBranchId.new( string )
Members
NULL_ID
π« Function β> ( ) -> MutationBranchId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> MutationBranchRaw
str
π² Method β> ( ) -> string
MutationBranchRaw
Bases
No base classes.
Constructors
No constructors.
Members
activated
π» Variable β> boolean
Whether this mutation can be activated at will.
allow_soft_gear
π» Variable β> boolean
Mutation allows soft gear to be worn over otherwise-restricted parts.
attackcost_modifier
π» Variable β> number
bleed_resist
π» Variable β> number
bodytemp_max_btu
π» Variable β> CppVal<units_quantity<int,units_temperature_delta_in_millidegree_celsius_tag>>
bodytemp_min_btu
π» Variable β> CppVal<units_quantity<int,units_temperature_delta_in_millidegree_celsius_tag>>
bodytemp_sleep_btu
π» Variable β> CppVal<units_quantity<int,units_temperature_delta_in_millidegree_celsius_tag>>
construction_speed_modifier
π» Variable β> number
Construction speed multiplier. 2.0 doubles construction speed; 0.5 halves it.
cooldown
π» Variable β> integer
Costs are incurred every βcooldownβ turns.
cost
π» Variable β> integer
crafting_speed_modifier
π» Variable β> number
Crafting speed multiplier. 2.0 doubles crafting speed; 0.5 halves it.
debug
π» Variable β> boolean
Whether or not this mutation is limited to debug use.
dodge_modifier
π» Variable β> number
falling_damage_multiplier
π» Variable β> number
fatigue
π» Variable β> boolean
Mutation causes fatigue when used.
fatigue_modifier
π» Variable β> number
fatigue_regen_modifier
π» Variable β> number
healing_awake
π» Variable β> number
Healing per turn from mutation.
healing_resting
π» Variable β> number
Healing per turn from mutation, while asleep.
healthy_rate
π» Variable β> number
How quickly health (not HP) trends toward healthy_mod.
hearing_modifier
π» Variable β> number
hp_adjustment
π» Variable β> number
Flat adjustment to HP.
hp_modifier
π» Variable β> number
Bonus HP multiplier. 1.0 doubles HP; -0.5 halves it.
hp_modifier_secondary
π» Variable β> number
Secondary HP multiplier; stacks with the other one. 1.0 doubles HP; -0.5 halves it.
hunger
π» Variable β> boolean
Mutation deducts calories when used.
id
π» Variable β> MutationBranchId
local_detail_sight
π» Variable β> number
max_stamina_modifier
π» Variable β> number
mending_modifier
π» Variable β> number
Multiplier applied to broken limb regeneration. Normally 0.25; clamped to 0.25..1.0.
metabolism_modifier
π» Variable β> number
mixed_effect
π» Variable β> boolean
Whether this mutation has positive /and/ negative effects.
movecost_flatground_modifier
π» Variable β> number
movecost_modifier
π» Variable β> number
movecost_obstacle_modifier
π» Variable β> number
movecost_swim_modifier
π» Variable β> number
night_vision_range
π» Variable β> number
noise_modifier
π» Variable β> number
overmap_multiplier
π» Variable β> number
overmap_sight
π» Variable β> number
packmule_modifier
π» Variable β> number
Packmule multiplier. 2.0 doubles backpack/container volume; 0.5 halves it.
pain_recovery
π» Variable β> number
Pain recovery per turn from mutation.
player_display
π» Variable β> boolean
Whether or not this mutation shows up in the status (
@) menu.
points
π» Variable β> integer
Pointcost in character creation(?).
profession
π» Variable β> boolean
Whether this trait is ONLY gained through professional training/experience (and/or quests).
purifiable
π» Variable β> boolean
Whether this mutation is possible to remove through Purifier. False for βspecialβ mutations.
reading_speed_multiplier
π» Variable β> number
scent_modifier
π» Variable β> number
skill_rust_multiplier
π» Variable β> number
speed_modifier
π» Variable β> number
stamina_regen_modifier
π» Variable β> number
starting_trait
π» Variable β> boolean
Whether this trait can normally be taken during character generation.
starts_active
π» Variable β> boolean
Whether a mutation activates when granted.
stealth_modifier
π» Variable β> number
str_modifier
π» Variable β> number
Adjustment to Strength that doesnβt affect HP.
temperature_speed_modifier
π» Variable β> number
thirst
π» Variable β> boolean
Mutation dehydrates when used.
thirst_modifier
π» Variable β> number
threshold
π» Variable β> boolean
Whether this is a Threshold mutation, and thus especially difficult to mutate. One per character.
ugliness
π» Variable β> integer
How physically unappealing the mutation is. Can be negative.
valid
π» Variable β> boolean
Whether this mutation is available through generic mutagen.
visibility
π» Variable β> integer
How visible the mutation is to others.
weight_capacity_modifier
π» Variable β> number
addition_mutations
π² Method β> ( ) -> MutationBranchId[]
categories
π² Method β> ( ) -> MutationCategoryTraitId[]
Lists the categories this mutation belongs to.
conflicts_with
π² Method β> ( ) -> MutationBranchId[]
Lists conflicting mutations.
desc
π² Method β> ( ) -> string
get_all
π« Function β> ( ) -> MutationBranchRaw[]
Returns a (long) list of every mutation in the game.
mutation_types
π² Method β> ( ) -> string[]
Lists the type(s) of this mutation. Mutations of a given type are mutually exclusive.
name
π² Method β> ( ) -> string
other_prerequisites
π² Method β> ( ) -> MutationBranchId[]
Lists the secondary mutation(s) needed to gain this mutation.
prerequisites
π² Method β> ( ) -> MutationBranchId[]
Lists the primary mutation(s) needed to gain this mutation.
replaced_by
π² Method β> ( ) -> MutationBranchId[]
Lists mutations that replace (e.g. evolve from) this one.
thresh_requirements
π² Method β> ( ) -> MutationBranchId[]
Lists the threshold mutation(s) required to gain this mutation.
MutationCategoryTraitId
Bases
No base classes.
Constructors
- MutationCategoryTraitId.new( )
- MutationCategoryTraitId.new( MutationCategoryTraitId )
- MutationCategoryTraitId.new( string )
Members
NULL_ID
π« Function β> ( ) -> MutationCategoryTraitId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> MutationCategoryTraitRaw
str
π² Method β> ( ) -> string
MutationCategoryTraitRaw
Bases
No base classes.
Constructors
No constructors.
Members
id
π» Variable β> MutationCategoryTraitId
iv_additional_mutations
π» Variable β> integer
iv_additional_mutations_chance
π» Variable β> integer
iv_fatigue
π» Variable β> integer
iv_hunger
π» Variable β> integer
iv_message
π» Variable β> CppVal<std_basic_string<char>()const>
iv_min_mutations
π» Variable β> integer
iv_morale
π» Variable β> integer
iv_morale_max
π» Variable β> integer
iv_noise
π» Variable β> integer
iv_pain
π» Variable β> integer
iv_sleep
π» Variable β> boolean
iv_sleep_dur
π» Variable β> integer
iv_sleep_message
π» Variable β> CppVal<std_basic_string<char>()const>
iv_sound
π» Variable β> boolean
iv_sound_id
π» Variable β> CppVal<std_basic_string<char>()const>
iv_sound_message
π» Variable β> CppVal<std_basic_string<char>()const>
iv_sound_variant
π» Variable β> CppVal<std_basic_string<char>()const>
iv_thirst
π» Variable β> integer
junkie_message
π» Variable β> CppVal<std_basic_string<char>()const>
memorial_message_female
π» Variable β> CppVal<std_basic_string<char>()const>
memorial_message_male
π» Variable β> CppVal<std_basic_string<char>()const>
mutagen_fatigue
π» Variable β> integer
mutagen_hunger
π» Variable β> integer
mutagen_message
π» Variable β> CppVal<std_basic_string<char>()const>
mutagen_morale
π» Variable β> integer
mutagen_pain
π» Variable β> integer
mutagen_thirst
π» Variable β> integer
threshold_muts
π» Variable β> MutationBranchId[]
The traits that you gain when you break the thresholds for this category.
get_mutations
π² Method β> ( ) -> MutationBranchId[]
Returns a list of all mutations in this category.
name
π² Method β> ( ) -> string
Npc
Bases
PlayerCharacterCreature
Constructors
No constructors.
Members
current_activity_id
π» Variable β> ActivityTypeId
hit_by_player
π» Variable β> boolean
marked_for_death
π» Variable β> boolean
needs
π» Variable β> NpcNeed[]
op_of_u
π» Variable β> NpcOpinion
patience
π» Variable β> integer
personality
π» Variable β> NpcPersonality
can_move_to
π² Method β> ( TripointBubMs, boolean ) -> boolean
can_open_door
π² Method β> ( TripointBubMs, boolean ) -> boolean
complain
π² Method β> ( ) -> boolean
Finds something to complain about and complains. Returns if complained.
complain_about
π² Method β> ( string, TimeDuration, string, boolean? ) -> boolean
Complain about an issue if enough time has passed. The first string is the issue identifier, with the second being the complaint text. The optional bool allows you to force a complaint without concern for the input time.
current_ally
π² Method β> ( ) -> Creature
Returns the npcβs current ally, if it has one.
current_target
π² Method β> ( ) -> Creature
Returns the npcβs current target as a creature, if it has one.
danger_assessment
π² Method β> ( ) -> number
Gets a value based on the npcβs perspective of the areaβs danger.
evaluate_enemy
π² Method β> ( Creature ) -> number
Rates how dangerous a target is from 0 (harmless) to 1 (max danger).
follow_distance
π² Method β> ( ) -> integer
Gets the npcβs follow distance. This can only be a few values, and is determined by npc rules.
get_attitude
π² Method β> ( ) -> NpcAttitude
get_first_topic
π² Method β> ( ) -> string
Returns the first topic of the npcβs chatbin.
get_monster_faction
π² Method β> ( ) -> MonsterFactionIntId
Returns the npcβs faction id. If itβs part of a monster faction, it returns the id of the monster faction.
guaranteed_hostile
π² Method β> ( ) -> boolean
Returns true if the npc would be hostile to the player on sight regardless of their current attitude.
has_activity
π² Method β> ( ) -> boolean
has_omt_destination
π² Method β> ( ) -> boolean
has_player_activity
π² Method β> ( ) -> boolean
hostile_anger_level
π² Method β> ( ) -> integer
is_ally
π² Method β> ( Character ) -> boolean
is_enemy
π² Method β> ( ) -> boolean
is_following
π² Method β> ( ) -> boolean
is_friendly
π² Method β> ( Character ) -> boolean
is_guarding
π² Method β> ( ) -> boolean
is_leader
π² Method β> ( ) -> boolean
is_minion
π² Method β> ( ) -> boolean
Returns true if the npc is a player ally and their op_of_u.trust is >= 5.
is_obeying
π² Method β> ( Character ) -> boolean
is_patrolling
π² Method β> ( ) -> boolean
is_player_ally
π² Method β> ( ) -> boolean
is_simulated
π² Method β> ( ) -> boolean
True if this NPC is in a simulated (fully loaded, AI-eligible) submap.
is_stationary
π² Method β> ( boolean ) -> boolean
is_travelling
π² Method β> ( ) -> boolean
Returns true if the npc has the βNPC_MISSION_TRAVELLINGβ mission.
is_walking_with
π² Method β> ( ) -> boolean
make_angry
π² Method β> ( )
move_to
π² Method β> ( TripointBubMs, boolean? )
Attempts to move the NPC to an adjacent map square.
mutiny
π² Method β> ( )
Causes the npc to leave your faction, incur various negative opinion maluses, and say explatives to the player.
npc_menu
π² Method β> ( boolean? )
Triggers the npc menu to open.
saw_player_recently
π² Method β> ( ) -> boolean
say
π² Method β> ( string )
Has the npc say the given string in the sidebar.
set_attitude
π² Method β> ( NpcAttitude )
set_faction_id
π² Method β> ( FactionId )
set_first_topic
π² Method β> ( string )
Sets the first topic of the npcβs chatbin. Note that some circumstances may cause this to not be the first topic used, such as player allies.
set_move_target
π² Method β> ( TripointBubMs, boolean?, boolean? ) -> boolean
π² Method β> ( Tripoint, boolean?, boolean? ) -> boolean
smash_ability
π² Method β> ( ) -> integer
Gets the npcβs blunt damage with their currently equipped weapon.
talk_to_u
π² Method β> ( string?, boolean? )
Causes the npc to talk to you. Passing a topic will force that topic to be used in place of all others, including code enforced topics such as βTALK_STOLE_ITEMβ.
turned_hostile
π² Method β> ( ) -> boolean
warn_about
π² Method β> ( string, TimeDuration, string, integer, TripointBubMs )
Wrapper for complain_about that warns about a specific type of threat, with different warnings for hostile or friendly NPCs and hostile NPCs always complaining.
NpcOpinion
Bases
No base classes.
Constructors
- NpcOpinion.new( )
- NpcOpinion.new( int, int, int, int, int )
Members
anger
π» Variable β> integer
fear
π» Variable β> integer
owed
π» Variable β> integer
trust
π» Variable β> integer
value
π» Variable β> integer
NpcPersonality
Bases
No base classes.
Constructors
- NpcPersonality.new( )
Members
aggression
π» Variable β> integer
altruism
π» Variable β> integer
bravery
π» Variable β> integer
collector
π» Variable β> integer
OmtFindParams
Bases
No base classes.
Constructors
- OmtFindParams.new( )
Members
exclude_types
π» Variable β> (string, OtMatchType)[]
Vector of (terrain_type, match_type) pairs to exclude from search.
existing_only
π» Variable β> boolean
If true, restricts search to existing overmaps only.
explored
π» Variable β> boolean?
If set, filters by terrain explored status (true = explored only, false = unexplored only).
max_results
π» Variable β> integer?
If set, limits the number of results returned.
seen
π» Variable β> boolean?
If set, filters by terrain seen status (true = seen only, false = unseen only).
types
π» Variable β> (string, OtMatchType)[]
Vector of (terrain_type, match_type) pairs to search for.
add_exclude_type
π² Method β> ( string, OtMatchType )
Helper method to add a terrain type to exclude from search.
add_type
π² Method β> ( string, OtMatchType )
Helper method to add a terrain type to search for.
set_search_layers
π² Method β> ( integer, integer )
Set the search layer range (z-levels).
set_search_range
π² Method β> ( integer, integer )
Set the search range in overmap tiles (min, max).
OterId
Bases
No base classes.
Constructors
Members
NULL_ID
π« Function β> ( ) -> OterId
implements_int_id
π« Function β> ( ) -> boolean
int_id
π² Method β> ( ) -> OterIntId
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> OterRaw
str
π² Method β> ( ) -> string
OterIntId
Bases
No base classes.
Constructors
Members
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> OterRaw
str_id
π² Method β> ( ) -> OterId
OvermapBuffer
Global overmap buffer that manages all overmap data
Bases
No base classes.
Constructors
No constructors.
Members
add_grid_connection
π² Method β> ( TripointAbsOmt, TripointAbsOmt ) -> boolean
Add an electric grid connection between two positions
electric_grid_at
π² Method β> ( TripointAbsOmt ) -> TripointAbsOmt[]
Get all overmap tiles belonging to the electric grid at the given position
electric_grid_connectivity_at
π² Method β> ( TripointAbsOmt ) -> TripointRelOmt[]
Get all electric grid connections from the given position
remove_grid_connection
π² Method β> ( TripointAbsOmt, TripointAbsOmt ) -> boolean
Remove an electric grid connection between two positions
PerkId
Bases
No base classes.
Constructors
- PerkId.new( )
- PerkId.new( PerkId )
- PerkId.new( string )
Members
NULL_ID
π« Function β> ( ) -> PerkId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> PerkRaw
str
π² Method β> ( ) -> string
PerkRaw
Bases
No base classes.
Constructors
No constructors.
Members
id
π» Variable β> PerkId
get_category
π² Method β> ( ) -> string
get_description
π² Method β> ( ) -> string
get_name
π² Method β> ( ) -> string
Player
Bases
CharacterCreature
Constructors
No constructors.
Members
No members.
PlayerActivity
Bases
No base classes.
Constructors
No constructors.
Members
coords
π» Variable β> TripointAbsMs[]
interruptable_with_kb
π» Variable β> boolean
moves_left
π» Variable β> integer
moves_total
π» Variable β> integer
name
π» Variable β> string
id
π² Method β> ( ) -> ActivityTypeId
id_str
π² Method β> ( ) -> string
Point
Bases
No base classes.
Constructors
- Point.new( )
- Point.new( Point )
- Point.new( int, int )
Members
x
π» Variable β> integer
y
π» Variable β> integer
abs
π² Method β> ( ) -> Point
reinterpret_as
π² Method β> ( origin: string, scale: string ) -> PointCoord
Reinterpret this raw point as a typed point coordinate without changing x or y.
rotate
π² Method β> ( integer, Point ) -> Point
PointCoord
A typed two-dimensional coordinate. Its origin and scale describe how to interpret x and y, and coordinate operations only combine compatible coordinate spaces.
Bases
No base classes.
Constructors
No constructors.
Members
x
π» Variable β> integer
y
π» Variable β> integer
origin
π² Method β> ( ) -> string
project_combine
π² Method β> ( fine: any ) -> nil | PointCoord | TripointCoord
Combines this coarse point with a remainder from project_remain. Returns
PointCoordorTripointCoorddepending on the inputs, or nil if the pair is incompatible.
project_remain
π² Method β> ( scale: string ) -> (PointCoord?, PointCoord?)
Splits this point into a coarse
PointCoordat the requested scale and aPointCoordremainder at this pointβs original scale. Returns nil, nil if the split is not valid.
project_remain_mmr
π² Method β> ( ) -> (PointCoord?, PointCoord?)
Shortcut for
project_remain("mmr").
project_remain_om
π² Method β> ( ) -> (PointCoord?, PointCoord?)
Shortcut for
project_remain("om").
project_remain_omt
π² Method β> ( ) -> (PointCoord?, PointCoord?)
Shortcut for
project_remain("omt").
project_remain_seg
π² Method β> ( ) -> (PointCoord?, PointCoord?)
Shortcut for
project_remain("seg").
project_remain_sm
π² Method β> ( ) -> (PointCoord?, PointCoord?)
Shortcut for
project_remain("sm").
raw
π² Method β> ( ) -> Point
reinterpret_as
π² Method β> ( origin: string, scale: string ) -> PointCoord
Reinterpret this coordinate as another point coordinate kind without changing x or y.
rl_dist
π² Method β> ( other: PointCoord ) -> integer?
Rectilinear distance to another
PointCoordwith matching origin and scale. Returns nil if the argument is incompatible.
rotate
π² Method β> ( integer, Point ) -> PointCoord
scale
π² Method β> ( ) -> string
square_dist
π² Method β> ( other: PointCoord ) -> integer?
Chebyshev distance to another
PointCoordwith matching origin and scale. Returns nil if the argument is incompatible.
to
π² Method β> ( scale: string ) -> PointCoord?
Projects this coordinate to another scale, preserving its origin and point dimension. Returns nil if the conversion is not valid.
to_mmr
π² Method β> ( ) -> PointCoord?
Shortcut for
to("mmr").
to_ms
π² Method β> ( ) -> PointCoord?
Shortcut for
to("ms").
to_om
π² Method β> ( ) -> PointCoord?
Shortcut for
to("om").
to_omt
π² Method β> ( ) -> PointCoord?
Shortcut for
to("omt").
to_seg
π² Method β> ( ) -> PointCoord?
Shortcut for
to("seg").
to_sm
π² Method β> ( ) -> PointCoord?
Shortcut for
to("sm").
to_veh
π² Method β> ( ) -> PointCoord?
Shortcut for
to("veh").
trig_dist
π² Method β> ( other: PointCoord ) -> number?
Euclidean distance to another
PointCoordwith matching origin and scale. Returns nil if the argument is incompatible.
type
π² Method β> ( ) -> string
PopupInputStr
Bases
No base classes.
Constructors
- PopupInputStr.new( )
Members
desc
π² Method β> ( string )
descis above input field.
query_int
π² Method β> ( ) -> integer
Returns your input, but allows numbers only.
query_str
π² Method β> ( ) -> string
Returns your input.
title
π² Method β> ( string )
titleis on the left of input field.
PowerStat
Power generation and consumption statistics for a grid
Bases
No base classes.
Constructors
No constructors.
Members
gen_w
π» Variable β> integer
Power generation in watts
use_w
π» Variable β> integer
Power consumption in watts
net_w
π² Method β> ( ) -> integer
Net power (generation - consumption) in watts
QualityId
Bases
No base classes.
Constructors
- QualityId.new( )
- QualityId.new( QualityId )
- QualityId.new( string )
Members
NULL_ID
π« Function β> ( ) -> QualityId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> QualityRaw
str
π² Method β> ( ) -> string
QueryPopup
Bases
No base classes.
Constructors
- QueryPopup.new( )
Members
allow_any_key
π² Method β> ( boolean )
Set whether to allow any key
message
π² Method β> ( any )
message_color
π² Method β> ( Color )
query
π² Method β> ( ) -> string
Returns selected action
query_yn
π² Method β> ( ) -> string
Returns
YESorNO. If ESC pressed, returnsNO.
query_ynq
π² Method β> ( ) -> string
Returns
YES,NOorQUIT. If ESC pressed, returnsQUIT.
RGBColor
Bases
No base classes.
Constructors
No constructors.
Members
name
π» Variable β> CppVal<std_basic_string<char>()const>
RangedData
Bases
No base classes.
Constructors
No constructors.
Members
aimed_crit_bonus
π» Variable β> number
aimed_crit_max_bonus
π» Variable β> number
damage
π» Variable β> DamageInstance
dispersion
π» Variable β> integer
range
π» Variable β> integer
RecipeId
Bases
No base classes.
Constructors
- RecipeId.new( )
- RecipeId.new( RecipeId )
- RecipeId.new( string )
Members
NULL_ID
π« Function β> ( ) -> RecipeId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> RecipeRaw
str
π² Method β> ( ) -> string
RecipeRaw
Bases
No base classes.
Constructors
No constructors.
Members
booksets
π» Variable β> table<ItypeId, integer>
Books that teach this recipe, mapped to the skill level required to learn it from them.
category
π» Variable β> string
difficulty
π» Variable β> integer
learn_by_disassembly
π» Variable β> table<SkillId, integer>
Skill levels required to learn this recipe by disassembling its result.
required_skills
π» Variable β> table<SkillId, integer>
Secondary skill levels required to craft this recipe, besides
skill_usedatdifficulty.
skill_used
π» Variable β> SkillId
subcategory
π» Variable β> string
time
π» Variable β> integer
get_all
π« Function β> ( ) -> RecipeRaw[]
get_from_flag
π« Function β> ( string ) -> RecipeRaw[]
get_from_skill_used
π« Function β> ( SkillId ) -> RecipeRaw[]
has_flag
π² Method β> ( string ) -> boolean
recipe_id
π² Method β> ( ) -> RecipeId
result
π² Method β> ( ) -> ItypeId
result_name
π² Method β> ( boolean ) -> string
Relic
Bases
No base classes.
Constructors
No constructors.
Members
get_enchantments
π² Method β> ( ) -> Enchantment[]
get_recharge_scheme
π² Method β> ( ) -> CppVal<relic_recharge>[]
get_spells
π² Method β> ( ) -> SpellSimple[]
name
π² Method β> ( ) -> string
RequirementData
Represents crafting requirements (tools, components, qualities)
Bases
No base classes.
Constructors
No constructors.
Members
can_make_with_inventory
π² Method β> ( Inventory ) -> boolean
Check if requirements can be made with given inventory
get_components
π² Method β> ( ) -> CppVal<item_comp>[][]
Get list of all required components
get_qualities
π² Method β> ( ) -> CppVal<quality_requirement>[][]
Get list of all required qualities
get_tools
π² Method β> ( ) -> CppVal<tool_comp>[][]
Get list of all required tools
id
π² Method β> ( ) -> string
Get the requirement ID as string
is_blacklisted
π² Method β> ( ) -> boolean
Check if this requirement is blacklisted
is_empty
π² Method β> ( ) -> boolean
Check if this requirement is empty
is_null
π² Method β> ( ) -> boolean
Check if this is a null requirement
list_all
π² Method β> ( ) -> string
Get a formatted list of all requirements
list_missing
π² Method β> ( ) -> string
Get a formatted list of missing requirements
Resistances
Bases
No base classes.
Constructors
No constructors.
Members
get_all_resist
π² Method β> ( ) -> table<DamageType, number>
Returns flat resistance values keyed by damage type. Damage types without resistance may be absent.
get_effective_resist
π² Method β> ( DamageUnit ) -> number
get_resist
π² Method β> ( DamageType ) -> number
ScenarioId
Bases
No base classes.
Constructors
- ScenarioId.new( )
- ScenarioId.new( ScenarioId )
- ScenarioId.new( string )
Members
NULL_ID
π« Function β> ( ) -> ScenarioId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> ScenarioRaw
str
π² Method β> ( ) -> string
ScenarioRaw
Bases
No base classes.
Constructors
No constructors.
Members
forbids_bionics
π» Variable β> boolean
Returns true if the scenario forbids bionics outright.
forbids_spells
π» Variable β> boolean
Returns true if the scenario forbids spells outright.
has_map_extra
π» Variable β> boolean
Returns true if the scenario has a starting map extra.
id
π» Variable β> string
String id of the scenario, e.g. βevacueeβ. Useful for equality checks.
is_blacklisted
π» Variable β> boolean
Returns true if the scenario is blacklisted.
map_extra
π» Variable β> string
String id of the starting map extra, or an empty string if the scenario has none.
point_cost
π» Variable β> integer
Pointcost of the scenario.
start_name
π» Variable β> string
Name of the starting situation shown during character creation.
starting_vehicle
π» Variable β> string
String id of the starting vehicle, or an empty string if the scenario has none.
str_id
π» Variable β> ScenarioId
allowed_bionics
π² Method β> ( ) -> BionicDataId[]
Allowed bionics, empty meaning all starting bionics are allowed.
allowed_spells
π² Method β> ( ) -> SpellTypeId[]
Allowed spells, empty meaning all starting spells are allowed.
allowed_start
π² Method β> ( CppVal<string_id<start_location>> ) -> boolean
Returns true if the given start location is allowed by this scenario.
allowed_start_locations
π² Method β> ( ) -> string[]
String ids of the starting locations allowed by this scenario.
allowed_traits
π² Method β> ( ) -> MutationBranchId[]
Allowed traits, empty meaning all starting traits are allowed.
bionicquery
π² Method β> ( BionicDataId ) -> boolean
Returns true if the given bionic is allowed in this scenario.
description
π² Method β> ( boolean ) -> string
Description of the scenario for the given gender (true = male).
forbidden_bionics
π² Method β> ( ) -> BionicDataId[]
Bionics forbidden in this scenario.
forbidden_spells
π² Method β> ( ) -> SpellTypeId[]
Spells forbidden in this scenario.
forbidden_traits
π² Method β> ( ) -> MutationBranchId[]
Traits forbidden in this scenario.
forced_bionics
π² Method β> ( ) -> BionicDataId[]
Bionics forced by the scenario.
forced_spells
π² Method β> ( ) -> SpellTypeId[]
Spells forced by the scenario.
forced_traits
π² Method β> ( ) -> MutationBranchId[]
Traits forced by the scenario, granted for free during character creation.
get_flags
π² Method β> ( ) -> string[]
All scenario flags, e.g. βFIRE_STARTβ.
has_flag
π² Method β> ( string ) -> boolean
Returns true if the scenario has the given flag.
is_forbidden_bionic
π² Method β> ( BionicDataId ) -> boolean
Returns true if the given bionic is forbidden in this scenario.
is_forbidden_spell
π² Method β> ( SpellTypeId ) -> boolean
Returns true if the given spell is forbidden in this scenario.
is_forbidden_trait
π² Method β> ( MutationBranchId ) -> boolean
Returns true if the given trait is forbidden in this scenario.
is_locked_bionic
π² Method β> ( BionicDataId ) -> boolean
Returns true if the given bionic is forced by this scenario.
is_locked_trait
π² Method β> ( MutationBranchId ) -> boolean
Returns true if the given trait is forced by this scenario.
missions
π² Method β> ( ) -> MissionTypeIdRaw[]
Missiontypes assigned at the start of the game.
name
π² Method β> ( boolean ) -> string
The scenarioβs id as a plain string. Display name of the scenario for the given gender (true = male).
perks
π² Method β> ( ) -> PerkId[]
Perks forced by the scenario.
permitted_professions
π² Method β> ( ) -> string[]
String ids of professions permitted by this scenario.
spellquery
π² Method β> ( SpellTypeId ) -> boolean
Returns true if the given spell is allowed in this scenario.
surround_groups
π² Method β> ( ) -> (MonsterGroupId, number)[]
Monstergroups surrounding the start: array of (mongroup_id, chance) pairs.
traitquery
π² Method β> ( MutationBranchId ) -> boolean
Returns true if the given trait is allowed in this scenario.
SkillId
Bases
No base classes.
Constructors
- SkillId.new( )
- SkillId.new( SkillId )
- SkillId.new( string )
Members
NULL_ID
π« Function β> ( ) -> SkillId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> SkillRaw
str
π² Method β> ( ) -> string
SkillLevel
Bases
No base classes.
Constructors
No constructors.
Members
can_train
π² Method β> ( ) -> boolean
highest_level
π² Method β> ( ) -> integer
is_training
π² Method β> ( ) -> boolean
level
π² Method β> ( ) -> integer
train
π² Method β> ( integer, boolean )
SkillLevelMap
Bases
Dict( SkillId, SkillLevel )
Constructors
No constructors.
Members
get_skill_level
π² Method β> ( SkillId ) -> integer
get_skill_level_object
π² Method β> ( SkillId ) -> SkillLevel
mod_skill_level
π² Method β> ( SkillId, integer )
Sound
Bases
No base classes.
Constructors
No constructors.
Members
from_decibel
π« Function β> ( integer ) -> Sound
to_decibel
π² Method β> ( ) -> integer
SpeciesTypeId
Bases
No base classes.
Constructors
- SpeciesTypeId.new( )
- SpeciesTypeId.new( SpeciesTypeId )
- SpeciesTypeId.new( string )
Members
NULL_ID
π« Function β> ( ) -> SpeciesTypeId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> SpeciesTypeRaw
str
π² Method β> ( ) -> string
Spell
The class used for spells that a player knows, casts, and gains experience for using. If a given spell is not supposed to be directly cast by a player, consider using
SpellSimpleinstead.
Bases
No base classes.
Constructors
- Spell.new( SpellTypeId, int )
Members
id
π» Variable β> SpellTypeId
cast
π² Method β> ( Creature, TripointBubMs )
Cast this spell, as well as any sub-spells.
cast_single_effect
π² Method β> ( Creature, TripointBubMs )
Cast only this spellβs main effects. Generally, cast() should be used instead.
desc
π² Method β> ( ) -> string
gain_exp
π² Method β> ( integer )
gain_levels
π² Method β> ( integer )
get_level
π² Method β> ( ) -> integer
name
π² Method β> ( ) -> string
set_exp
π² Method β> ( integer )
set_level
π² Method β> ( integer )
xp
π² Method β> ( ) -> integer
SpellSimple
The type for basic spells. If you donβt need to track XP from casting (e.g., if a spell is intended to be cast by anything other than a player), this is likely the appropriate type. Otherwise, see the
Spelltype.
Bases
No base classes.
Constructors
- SpellSimple.new( SpellTypeId, bool )
- SpellSimple.new( SpellTypeId, bool, int )
Members
force_target_source
π» Variable β> boolean
Whether or not the target point is locked to the sourceβs location.
id
π» Variable β> SpellTypeId
level
π» Variable β> integer
trigger_once_in
π» Variable β> integer
Used for enchantments; the spellβs chance to trigger every turn.
cast
π² Method β> ( Creature, TripointBubMs, integer? )
max_level
π² Method β> ( ) -> integer
Returns the defined maximum level of this
SpellSimpleinstance, if defined. Otherwise, returns 0.
prompt_cast
π« Function β> ( SpellTypeId, TripointBubMs, integer? ) -> SpellSimple
Static function: Creates and immediately casts a SimpleSpell, then returns the new spell for potential reuse. If the given tripoint is the playerβs location, the spell will be locked to the player. (This does not necessarily cause friendly fire!) If an integer is specified, the spell will be cast at that level.
SpellTypeId
Bases
No base classes.
Constructors
- SpellTypeId.new( )
- SpellTypeId.new( SpellTypeId )
- SpellTypeId.new( string )
Members
NULL_ID
π« Function β> ( ) -> SpellTypeId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> SpellTypeRaw
str
π² Method β> ( ) -> string
SpellTypeRaw
The βrawβ type for storing the information defining every spell in the game. Itβs not possible to cast directly from this type; check
SpellSimpleandSpell.
Bases
No base classes.
Constructors
No constructors.
Members
aoe_increment
π» Variable β> number
base_casting_time
π» Variable β> integer
base_energy_cost
π» Variable β> integer
casting_time_increment
π» Variable β> number
damage_increment
π» Variable β> number
difficulty
π» Variable β> integer
dot_increment
π» Variable β> number
duration_increment
π» Variable β> integer
effect_name
π» Variable β> string
The name of the primary effect this spell will enact.
effect_str
π» Variable β> string
Specifics about the effect this spell will enact.
energy_increment
π» Variable β> number
field_chance
π» Variable β> integer
field_intensity_increment
π» Variable β> number
field_intensity_variance
π» Variable β> number
final_casting_time
π» Variable β> integer
final_energy_cost
π» Variable β> integer
id
π» Variable β> SpellTypeId
max_aoe
π» Variable β> integer
max_damage
π» Variable β> integer
max_dot
π» Variable β> integer
max_duration
π» Variable β> integer
max_field_intensity
π» Variable β> integer
max_level
π» Variable β> integer
max_range
π» Variable β> integer
min_aoe
π» Variable β> integer
min_damage
π» Variable β> integer
min_dot
π» Variable β> integer
min_duration
π» Variable β> integer
min_field_intensity
π» Variable β> integer
min_range
π» Variable β> integer
range_increment
π» Variable β> number
additional_spells
π² Method β> ( ) -> SpellSimple[]
Other spells cast by this spell.
get_all
π« Function β> ( ) -> SpellTypeRaw[]
Returns a (long) list of every spell in the game.
Temperature
Bases
No base classes.
Constructors
No constructors.
Members
from_celsius
π« Function β> ( number ) -> Temperature
from_fahrenheit
π« Function β> ( number ) -> Temperature
from_kelvin
π« Function β> ( number ) -> Temperature
to_celsius
π² Method β> ( ) -> number
to_fahrenheit
π² Method β> ( ) -> number
to_kelvin
π² Method β> ( ) -> number
TerId
Bases
No base classes.
Constructors
Members
NULL_ID
π« Function β> ( ) -> TerId
implements_int_id
π« Function β> ( ) -> boolean
int_id
π² Method β> ( ) -> TerIntId
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> TerRaw
str
π² Method β> ( ) -> string
TerIntId
Bases
No base classes.
Constructors
Members
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> TerRaw
str_id
π² Method β> ( ) -> TerId
TerRaw
Bases
No base classes.
Constructors
No constructors.
Members
close
π» Variable β> TerId
heat_radiation
π» Variable β> integer
open
π» Variable β> TerId
roof
π» Variable β> TerId
transforms_into
π» Variable β> TerId
trap_id_str
π» Variable β> string
get_coverage
π² Method β> ( ) -> integer
get_flags
π² Method β> ( ) -> string[]
get_light_emitted
π² Method β> ( ) -> integer
get_max_volume
π² Method β> ( ) -> Volume
get_movecost
π² Method β> ( ) -> integer
has_flag
π² Method β> ( string ) -> boolean
int_id
π² Method β> ( ) -> TerIntId
name
π² Method β> ( ) -> string
set_coverage
π² Method β> ( integer )
set_flag
π² Method β> ( string )
set_light_emitted
π² Method β> ( integer )
set_max_volume
π² Method β> ( Volume )
set_movecost
π² Method β> ( integer )
str_id
π² Method β> ( ) -> TerId
TimeDuration
Represent duration between 2 fixed points in time
Bases
No base classes.
Constructors
- TimeDuration.new( )
Members
from_days
π« Function β> ( integer ) -> TimeDuration
from_hours
π« Function β> ( integer ) -> TimeDuration
from_minutes
π« Function β> ( integer ) -> TimeDuration
from_seconds
π« Function β> ( integer ) -> TimeDuration
from_turns
π« Function β> ( integer ) -> TimeDuration
from_weeks
π« Function β> ( integer ) -> TimeDuration
make_random
π² Method β> ( TimeDuration ) -> TimeDuration
to_days
π² Method β> ( ) -> integer
to_hours
π² Method β> ( ) -> integer
to_minutes
π² Method β> ( ) -> integer
to_seconds
π² Method β> ( ) -> integer
to_turns
π² Method β> ( ) -> integer
to_weeks
π² Method β> ( ) -> integer
TimePoint
Library for dealing with time primitives.
Represent fixed point in time
Bases
No base classes.
Constructors
- TimePoint.new( )
Members
from_turn
π« Function β> ( integer ) -> TimePoint
hour_of_day
π² Method β> ( ) -> integer
is_dawn
π² Method β> ( ) -> boolean
is_day
π² Method β> ( ) -> boolean
is_dusk
π² Method β> ( ) -> boolean
is_night
π² Method β> ( ) -> boolean
minute_of_hour
π² Method β> ( ) -> integer
moon_phase
π² Method β> ( ) -> MoonPhase
season
π² Method β> ( ) -> string
second_of_minute
π² Method β> ( ) -> integer
sunrise
π² Method β> ( ) -> TimePoint
sunset
π² Method β> ( ) -> TimePoint
to_string_time_of_day
π² Method β> ( ) -> string
to_turn
π² Method β> ( ) -> integer
TrapId
Bases
No base classes.
Constructors
Members
NULL_ID
π« Function β> ( ) -> TrapId
implements_int_id
π« Function β> ( ) -> boolean
int_id
π² Method β> ( ) -> TrapIntId
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> TrapRaw
str
π² Method β> ( ) -> string
TrapIntId
Bases
No base classes.
Constructors
Members
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> TrapRaw
str_id
π² Method β> ( ) -> TrapId
Tripoint
Bases
No base classes.
Constructors
Members
x
π» Variable β> integer
y
π» Variable β> integer
z
π» Variable β> integer
abs
π² Method β> ( ) -> Tripoint
reinterpret_as
π² Method β> ( origin: string, scale: string ) -> TripointCoord
Reinterpret this raw tripoint as a typed tripoint coordinate without changing x, y, or z.
rotate_2d
π² Method β> ( integer, Point ) -> Tripoint
xy
π² Method β> ( ) -> Point
TripointCoord
A typed three-dimensional coordinate. Its origin and scale describe how to interpret x, y, and z, and coordinate operations only combine compatible coordinate spaces.
Bases
No base classes.
Constructors
No constructors.
Members
x
π» Variable β> integer
y
π» Variable β> integer
z
π» Variable β> integer
origin
π² Method β> ( ) -> string
project_combine
π² Method β> ( fine: any ) -> nil | PointCoord | TripointCoord
Combines this coarse tripoint with a remainder from project_remain. Returns
TripointCoord, or nil if the pair is incompatible.
project_remain
π² Method β> ( scale: string ) -> (TripointCoord?, PointCoord?)
Splits this tripoint into a coarse
TripointCoordat the requested scale and aPointCoordremainder at this tripointβs original scale. The z value stays on the coarse tripoint. Returns nil, nil if the split is not valid.
project_remain_mmr
π² Method β> ( ) -> (TripointCoord?, PointCoord?)
Shortcut for
project_remain("mmr").
project_remain_om
π² Method β> ( ) -> (TripointCoord?, PointCoord?)
Shortcut for
project_remain("om").
project_remain_omt
π² Method β> ( ) -> (TripointCoord?, PointCoord?)
Shortcut for
project_remain("omt").
project_remain_seg
π² Method β> ( ) -> (TripointCoord?, PointCoord?)
Shortcut for
project_remain("seg").
project_remain_sm
π² Method β> ( ) -> (TripointCoord?, PointCoord?)
Shortcut for
project_remain("sm").
raw
π² Method β> ( ) -> Tripoint
reinterpret_as
π² Method β> ( origin: string, scale: string ) -> TripointCoord
Reinterpret this coordinate as another tripoint coordinate kind without changing x, y, or z.
rl_dist
π² Method β> ( other: TripointCoord ) -> integer?
Rectilinear distance to another
TripointCoordwith matching origin and scale. Returns nil if the argument is incompatible.
rotate_2d
π² Method β> ( integer, Point ) -> TripointCoord
scale
π² Method β> ( ) -> string
square_dist
π² Method β> ( other: TripointCoord ) -> integer?
Chebyshev distance to another
TripointCoordwith matching origin and scale. Returns nil if the argument is incompatible.
to
π² Method β> ( scale: string ) -> TripointCoord?
Projects this coordinate to another scale, preserving its origin and tripoint dimension. Returns nil if the conversion is not valid.
to_mmr
π² Method β> ( ) -> TripointCoord?
Shortcut for
to("mmr").
to_ms
π² Method β> ( ) -> TripointCoord?
Shortcut for
to("ms").
to_om
π² Method β> ( ) -> TripointCoord?
Shortcut for
to("om").
to_omt
π² Method β> ( ) -> TripointCoord?
Shortcut for
to("omt").
to_seg
π² Method β> ( ) -> TripointCoord?
Shortcut for
to("seg").
to_sm
π² Method β> ( ) -> TripointCoord?
Shortcut for
to("sm").
to_veh
π² Method β> ( ) -> TripointCoord?
Shortcut for
to("veh").
trig_dist
π² Method β> ( other: TripointCoord ) -> number?
Euclidean distance to another
TripointCoordwith matching origin and scale. Returns nil if the argument is incompatible.
type
π² Method β> ( ) -> string
xy
π² Method β> ( ) -> PointCoord
UiList
Bases
No base classes.
Constructors
- UiList.new( )
Members
entries
π» Variable β> UiListEntry[]
Entries from uilist. Remember, in lua, the first element of vector is
entries[1], notentries[0].
add
π² Method β> ( integer, string )
Adds an entry.
stringis its name, andintis what it returns. Ifintis-1, the number is decided orderly.
add_w_col
π² Method β> ( integer, string, string, string )
Adds an entry with desc and col(third
string). col is additional text on the right of the entry name.
add_w_desc
π² Method β> ( integer, string, string )
Adds an entry with desc(second
string).desc_enabled(true)is required for showing desc.
border_color
π² Method β> ( Color )
Changes the color. Default color is
c_magenta.
desc_enabled
π² Method β> ( boolean )
Puts a lower box. Footer or entry desc appears on it.
footer
π² Method β> ( string )
Sets footer text which is in lower box. It overwrites descs of entries unless is empty.
hilight_color
π² Method β> ( Color )
Changes the color. Default color is
h_white.
hotkey_color
π² Method β> ( Color )
Changes the color. Default color is
c_light_green.
query
π² Method β> ( ) -> integer
Returns retval for selected entry, or a negative number on fail/cancel
text
π² Method β> ( string )
Sets text which is in upper box.
text_color
π² Method β> ( Color )
Changes the color. Default color is
c_light_gray.
title
π² Method β> ( string )
Sets title which is on the top line.
title_color
π² Method β> ( Color )
Changes the color. Default color is
c_green.
UiListEntry
This type came from
UiList.
Bases
No base classes.
Constructors
No constructors.
Members
ctxt
π» Variable β> string
Entry text of column.
desc
π» Variable β> string
Entry description
enable
π» Variable β> boolean
Entry whether itβs enabled or not. Default is
true.
txt
π» Variable β> string
Entry text
txt_color
π² Method β> ( Color )
Entry text color. Its default color is
c_red_red, which makes color of the entry same as whatuilistdecides. So if you want to make color different, choose one exceptc_red_red.
VitaminId
Bases
No base classes.
Constructors
- VitaminId.new( )
- VitaminId.new( VitaminId )
- VitaminId.new( string )
Members
NULL_ID
π« Function β> ( ) -> VitaminId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> VitaminRaw
str
π² Method β> ( ) -> string
VitaminRaw
Bases
No base classes.
Constructors
No constructors.
Members
deficiency
π² Method β> ( ) -> EffectTypeId
excess
π² Method β> ( ) -> EffectTypeId
has_flag
π² Method β> ( string ) -> boolean
is_null
π² Method β> ( ) -> boolean
max
π² Method β> ( ) -> integer
min
π² Method β> ( ) -> integer
name
π² Method β> ( ) -> string
rate
π² Method β> ( ) -> TimeDuration
severity
π² Method β> ( integer ) -> integer
vitamin_id
π« Function β> ( )
vitamin_type
π² Method β> ( ) -> VitaminType
Volume
Bases
No base classes.
Constructors
No constructors.
Members
from_liter
π« Function β> ( integer ) -> Volume
from_milliliter
π« Function β> ( integer ) -> Volume
to_liter
π² Method β> ( ) -> number
to_milliliter
π² Method β> ( ) -> integer
WeaponCategoryId
Bases
No base classes.
Constructors
- WeaponCategoryId.new( )
- WeaponCategoryId.new( WeaponCategoryId )
- WeaponCategoryId.new( string )
Members
NULL_ID
π« Function β> ( ) -> WeaponCategoryId
implements_int_id
π« Function β> ( ) -> boolean
is_null
π² Method β> ( ) -> boolean
is_valid
π² Method β> ( ) -> boolean
obj
π² Method β> ( ) -> WeaponCategoryRaw
str
π² Method β> ( ) -> string
WrappedVehicle
Bases
No base classes.
Constructors
No constructors.
Members
charge_batteries
π² Method β> ( integer ) -> integer
Charges the onboard batteries by up to
amount. Returns the charges actually added.
drain_batteries
π² Method β> ( integer ) -> integer
Drains up to
amountcharges from the onboard batteries. Returns the charges actually drained.
drain_fuel
π² Method β> ( ItypeId, integer ) -> integer
Drains up to
amountcharges of the given fuel type from the vehicle. Returns the charges actually drained.
facing
π² Method β> ( ) -> number
Returns the vehicleβs facing in degrees (0 = east, 90 = north), or 0 if the handle is invalid.
fuel_left
π² Method β> ( ItypeId ) -> integer
Returns the charges of the given fuel type left in the vehicle (e.g.
ItypeId.new(βbatteryβ)), or 0 if the handle is invalid.
is_locked
π² Method β> ( ) -> boolean
Returns true if the vehicle is locked, false otherwise (also false if the handle is invalid).
is_valid
π² Method β> ( ) -> boolean
Returns true if the wrapped vehicle still exists, false if the handle is invalid (e.g. the vehicle was destroyed).
name
π² Method β> ( ) -> string
Returns the vehicleβs display name, or an empty string if the handle is invalid.
pos
π² Method β> ( ) -> TripointBubMs
Returns the vehicle origin tile in local map-square coordinates.
set_locked
π² Method β> ( boolean )
Locks or unlocks the vehicle. Does nothing if the handle is invalid.
type
π² Method β> ( ) -> string
Returns the vehicle prototype id string.
Enums
ActionId
Entries
ACTION_NULL=0ACTION_SELECT=1ACTION_SEC_SELECT=2ACTION_PAUSE=3ACTION_TIMEOUT=4ACTION_MOVE_FORTH=5ACTION_MOVE_FORTH_RIGHT=6ACTION_MOVE_RIGHT=7ACTION_MOVE_BACK_RIGHT=8ACTION_MOVE_BACK=9ACTION_MOVE_BACK_LEFT=10ACTION_MOVE_LEFT=11ACTION_MOVE_FORTH_LEFT=12ACTION_MOVE_DOWN=13ACTION_MOVE_UP=14ACTION_CYCLE_MOVE=15ACTION_RESET_MOVE=16ACTION_TOGGLE_RUN=17ACTION_TOGGLE_CROUCH=18ACTION_TOGGLE_PRONE=19ACTION_OPEN_MOVEMENT=20ACTION_TOGGLE_MAP_MEMORY=21ACTION_CENTER=22ACTION_SHIFT_N=23ACTION_SHIFT_NE=24ACTION_SHIFT_E=25ACTION_SHIFT_SE=26ACTION_SHIFT_S=27ACTION_SHIFT_SW=28ACTION_SHIFT_W=29ACTION_SHIFT_NW=30ACTION_OPEN=31ACTION_CLOSE=32ACTION_SMASH=33ACTION_EXAMINE=34ACTION_JUMP=35ACTION_PICKUP=36ACTION_PICKUP_ALL=37ACTION_PICKUP_FEET=38ACTION_GRAB=39ACTION_HAUL=40ACTION_BUTCHER=41ACTION_CHAT=42ACTION_LOOK=43ACTION_PEEK=44ACTION_LIST_ITEMS=45ACTION_ZONES=46ACTION_LOOT=47ACTION_INVENTORY=48ACTION_ADVANCEDINV=49ACTION_COMPARE=50ACTION_ORGANIZE=51ACTION_USE=52ACTION_USE_WIELDED=53ACTION_WEAR=54ACTION_TAKE_OFF=55ACTION_EAT=56ACTION_OPEN_CONSUME=57ACTION_READ=58ACTION_WIELD=59ACTION_PICK_STYLE=60ACTION_RELOAD_ITEM=61ACTION_RELOAD_WEAPON=62ACTION_RELOAD_WIELDED=63ACTION_UNLOAD=64ACTION_UNLOAD_ALL=65ACTION_MEND=66ACTION_THROW=67ACTION_FIRE=68ACTION_FIRE_BURST=69ACTION_SELECT_FIRE_MODE=70ACTION_SELECT_DEFAULT_AMMO=71ACTION_CAST_SPELL=72ACTION_CAST_LAST_SPELL=73ACTION_DROP=74ACTION_DIR_DROP=75ACTION_BIONICS=76ACTION_MUTATIONS=77ACTION_PERKS=78ACTION_SORT_ARMOR=79ACTION_AUTOATTACK=80ACTION_TOGGLE_MANUAL_COMBAT_MODE=81ACTION_WAIT=82ACTION_CRAFT=83ACTION_RECRAFT=84ACTION_LONGCRAFT=85ACTION_CONSTRUCT=86ACTION_DISASSEMBLE=87ACTION_SALVAGE=88ACTION_SLEEP=89ACTION_CONTROL_VEHICLE=90ACTION_TOGGLE_AUTO_TRAVEL_MODE=91ACTION_TOGGLE_SAFEMODE=92ACTION_TOGGLE_AUTOSAFE=93ACTION_TOGGLE_THIEF_MODE=94ACTION_IGNORE_ENEMY=95ACTION_WHITELIST_ENEMY=96ACTION_SAVE=97ACTION_QUICKSAVE=98ACTION_QUICKLOAD=99ACTION_SUICIDE=100ACTION_PL_INFO=101ACTION_MAP=102ACTION_SKY=103ACTION_MISSIONS=104ACTION_SCORES=105ACTION_FACTIONS=106ACTION_MORALE=107ACTION_MESSAGES=108ACTION_OPEN_WIKI=109ACTION_OPEN_HHG=110ACTION_HELP=111ACTION_MAIN_MENU=112ACTION_DIARY=113ACTION_KEYBINDINGS=114ACTION_OPTIONS=115ACTION_AUTOPICKUP=116ACTION_AUTONOTES=117ACTION_SAFEMODE=118ACTION_COLOR=119ACTION_WORLD_MODS=120ACTION_DISTRACTION_MANAGER=121ACTION_TOGGLE_CHARACTER_PREVIEW_CLOTHES=122ACTION_TOGGLE_FULLSCREEN=123ACTION_DEBUG=124ACTION_LUA_CONSOLE=125ACTION_LUA_RELOAD=126ACTION_DISPLAY_SCENT=127ACTION_DISPLAY_SCENT_TYPE=128ACTION_TOGGLE_DEBUG_MODE=129ACTION_ZOOM_OUT=130ACTION_ZOOM_IN=131ACTION_ACTIONMENU=132ACTION_ITEMACTION=133ACTION_TOGGLE_PIXEL_MINIMAP=134ACTION_TOGGLE_PANEL_ADM=135ACTION_PANEL_MGMT=136ACTION_RELOAD_TILESET=137ACTION_TOGGLE_AUTO_FEATURES=138ACTION_TOGGLE_AUTO_PULP_BUTCHER=139ACTION_TOGGLE_AUTO_MINING=140ACTION_TOGGLE_AUTO_FORAGING=141ACTION_TOGGLE_AUTO_PICKUP=142ACTION_DISPLAY_TEMPERATURE=143ACTION_DISPLAY_VEHICLE_AI=144ACTION_DISPLAY_VISIBILITY=145ACTION_DISPLAY_LIGHTING=146ACTION_DISPLAY_RADIATION=147ACTION_DISPLAY_TRANSPARENCY=148ACTION_DISPLAY_OUTSIDE=149ACTION_DISPLAY_SUBMAP_GRID=150ACTION_DISPLAY_SOUND_ABSORPTION=151ACTION_DISPLAY_SOUND_WALLS=152ACTION_TOGGLE_ZONE_OVERLAY=153ACTION_DISPLAY_TILES_NO_VFX=154ACTION_TOGGLE_HOUR_TIMER=155ACTION_SWAP_TO_NPC=156
AddictionType
Entries
NONE=0CAFFEINE=1ALCOHOL=2SLEEP=3PKILLER=4SPEED=5CIG=6COKE=7CRACK=8MUTAGEN=9DIAZEPAM=10MARLOSS_R=11MARLOSS_B=12MARLOSS_Y=13
ArtifactCharge
Entries
ARTC_NULL=0ARTC_TIME=1ARTC_SOLAR=2ARTC_PAIN=3ARTC_HP=4ARTC_FATIGUE=5ARTC_PORTAL=6
ArtifactChargeReq
Entries
ACR_NULL=0ACR_EQUIP=1ACR_SKIN=2ACR_SLEEP=3ACR_RAD=4ACR_WET=5ACR_SKY=6
ArtifactEffectActive
Entries
AEP_NULL=0AEP_STR_UP=1AEP_DEX_UP=2AEP_PER_UP=3AEP_INT_UP=4AEP_ALL_UP=5AEP_SPEED_UP=6AEP_PBLUE=7AEP_SNAKES=8AEP_INVISIBLE=9AEP_CLAIRVOYANCE=10AEP_SUPER_CLAIRVOYANCE=11AEP_STEALTH=12AEP_EXTINGUISH=13AEP_GLOW=14AEP_PSYSHIELD=15AEP_RESIST_ELECTRICITY=16AEP_CARRY_MORE=17AEP_SAP_LIFE=18AEP_FUN=19AEP_SPLIT=20AEP_HUNGER=21AEP_THIRST=22AEP_SMOKE=23AEP_EVIL=24AEP_SCHIZO=25AEP_RADIOACTIVE=26AEP_MUTAGENIC=27AEP_ATTENTION=28AEP_STR_DOWN=29AEP_DEX_DOWN=30AEP_PER_DOWN=31AEP_INT_DOWN=32AEP_ALL_DOWN=33AEP_SPEED_DOWN=34AEP_FORCE_TELEPORT=35AEP_MOVEMENT_NOISE=36AEP_BAD_WEATHER=37AEP_SICK=38AEP_CLAIRVOYANCE_PLUS=39
ArtifactEffectPassive
Entries
AEA_NULL=0AEA_STORM=1AEA_FIREBALL=2AEA_ADRENALINE=3AEA_MAP=4AEA_BLOOD=5AEA_FATIGUE=6AEA_ACIDBALL=7AEA_PULSE=8AEA_HEAL=9AEA_CONFUSED=10AEA_ENTRANCE=11AEA_BUGS=12AEA_TELEPORT=13AEA_LIGHT=14AEA_GROWTH=15AEA_HURTALL=16AEA_FUN=17AEA_SPLIT=18AEA_RADIATION=19AEA_PAIN=20AEA_MUTATE=21AEA_PARALYZE=22AEA_FIRESTORM=23AEA_ATTENTION=24AEA_TELEGLOW=25AEA_NOISE=26AEA_SCREAM=27AEA_DIM=28AEA_FLASH=29AEA_VOMIT=30AEA_SHADOWS=31AEA_STAMINA_EMPTY=32
Attitude
Entries
Hostile=0Neutral=1Friendly=2Any=3
BodyPart
Entries
TORSO=0HEAD=1EYES=2MOUTH=3ARM_L=4ARM_R=5HAND_L=6HAND_R=7LEG_L=8LEG_R=9FOOT_L=10FOOT_R=11
CharacterMoveMode
Entries
walk=0run=1crouch=2prone=3
Color
Entries
c_black=0c_white=1c_light_gray=2c_dark_gray=3c_red=4c_green=5c_blue=6c_cyan=7c_magenta=8c_brown=9c_light_red=10c_light_green=11c_light_blue=12c_light_cyan=13c_pink=14c_yellow=15h_black=16h_white=17h_light_gray=18h_dark_gray=19h_red=20h_green=21h_blue=22h_cyan=23h_magenta=24h_brown=25h_light_red=26h_light_green=27h_light_blue=28h_light_cyan=29h_pink=30h_yellow=31i_black=32i_white=33i_light_gray=34i_dark_gray=35i_red=36i_green=37i_blue=38i_cyan=39i_magenta=40i_brown=41i_light_red=42i_light_green=43i_light_blue=44i_light_cyan=45i_pink=46i_yellow=47c_unset=48c_black_red=49c_white_red=50c_light_gray_red=51c_dark_gray_red=52c_red_red=53c_green_red=54c_blue_red=55c_cyan_red=56c_magenta_red=57c_brown_red=58c_light_red_red=59c_light_green_red=60c_light_blue_red=61c_light_cyan_red=62c_pink_red=63c_yellow_red=64c_black_white=65c_dark_gray_white=66c_light_gray_white=67c_white_white=68c_red_white=69c_light_red_white=70c_green_white=71c_light_green_white=72c_brown_white=73c_yellow_white=74c_blue_white=75c_light_blue_white=76c_magenta_white=77c_pink_white=78c_cyan_white=79c_light_cyan_white=80c_black_green=81c_dark_gray_green=82c_light_gray_green=83c_white_green=84c_red_green=85c_light_red_green=86c_green_green=87c_light_green_green=88c_brown_green=89c_yellow_green=90c_blue_green=91c_light_blue_green=92c_magenta_green=93c_pink_green=94c_cyan_green=95c_light_cyan_green=96c_black_yellow=97c_dark_gray_yellow=98c_light_gray_yellow=99c_white_yellow=100c_red_yellow=101c_light_red_yellow=102c_green_yellow=103c_light_green_yellow=104c_brown_yellow=105c_yellow_yellow=106c_blue_yellow=107c_light_blue_yellow=108c_magenta_yellow=109c_pink_yellow=110c_cyan_yellow=111c_light_cyan_yellow=112c_black_magenta=113c_dark_gray_magenta=114c_light_gray_magenta=115c_white_magenta=116c_red_magenta=117c_light_red_magenta=118c_green_magenta=119c_light_green_magenta=120c_brown_magenta=121c_yellow_magenta=122c_blue_magenta=123c_light_blue_magenta=124c_magenta_magenta=125c_pink_magenta=126c_cyan_magenta=127c_light_cyan_magenta=128c_black_cyan=129c_dark_gray_cyan=130c_light_gray_cyan=131c_white_cyan=132c_red_cyan=133c_light_red_cyan=134c_green_cyan=135c_light_green_cyan=136c_brown_cyan=137c_yellow_cyan=138c_blue_cyan=139c_light_blue_cyan=140c_magenta_cyan=141c_pink_cyan=142c_cyan_cyan=143c_light_cyan_cyan=144
DamageType
Entries
DT_NULL=0DT_TRUE=1DT_BIOLOGICAL=2DT_BASH=3DT_CUT=4DT_ACID=5DT_STAB=6DT_HEAT=7DT_COLD=8DT_DARK=9DT_LIGHT=10DT_PSI=11DT_ELECTRIC=12DT_BULLET=13
Direction
Entries
center=0west=1east=2north=3north_west=4north_east=5south=6south_west=7south_east=8below=9below_west=10below_east=11below_north=12below_north_west=13below_north_east=14below_south=15below_south_west=16below_south_east=17above=18above_west=19above_east=20above_north=21above_north_west=22above_north_east=23above_south=24above_south_west=25above_south_east=26
MissionGoal
Entries
MGOAL_NULL=0MGOAL_GO_TO=1MGOAL_GO_TO_TYPE=2MGOAL_FIND_ITEM=3MGOAL_FIND_ANY_ITEM=4MGOAL_FIND_ITEM_GROUP=5MGOAL_FIND_MONSTER=6MGOAL_FIND_NPC=7MGOAL_ASSASSINATE=8MGOAL_KILL_MONSTER=9MGOAL_KILL_MONSTER_TYPE=10MGOAL_KILL_NEMESIS=11MGOAL_RECRUIT_NPC=12MGOAL_RECRUIT_NPC_CLASS=13MGOAL_COMPUTER_TOGGLE=14MGOAL_KILL_MONSTER_SPEC=15MGOAL_TALK_TO_NPC=16MGOAL_CONDITION=17MGOAL_KILL_MONSTERS=18
MissionOrigin
Entries
ORIGIN_NULL=0ORIGIN_GAME_START=1ORIGIN_OPENER_NPC=2ORIGIN_ANY_NPC=3ORIGIN_SECONDARY=4ORIGIN_COMPUTER=5
MonsterAttitude
Entries
MATT_NULL=0MATT_FRIEND=1MATT_FPASSIVE=2MATT_FLEE=3MATT_IGNORE=4MATT_FOLLOW=5MATT_ATTACK=6MATT_ZLAVE=7MATT_UNKNOWN=8
MonsterFactionAttitude
Entries
ByMood=0Neutral=1Friendly=2Hate=3
MonsterFlag
Entries
SEES=0HEARS=1GOODHEARING=2SMELLS=3KEENNOSE=4STUMBLES=5WARM=6NEMESIS=7NOHEAD=8HARDTOSHOOT=9GRABS=10GRAB_IMMUNE=11BASHES=12DESTROYS=13BORES=14POISON=15VENOM=16BADVENOM=17PARALYZEVENOM=18BLEED=19WEBWALK=20DIGS=21CAN_DIG=22FLIES=23AQUATIC=24SWIMS=25ATTACKMON=26ANIMAL=27PLASTIC=28SUNDEATH=29ELECTRIC=30ACIDPROOF=31ACIDTRAIL=32SHORTACIDTRAIL=33FIREPROOF=34SLUDGEPROOF=35SLUDGETRAIL=36COLDPROOF=37BIOPROOF=38DARKPROOF=39LIGHTPROOF=40PSIPROOF=41FIREY=42QUEEN=43ELECTRONIC=44FUR=45LEATHER=46WOOL=47FEATHER=48BONES=49FAT=50CONSOLE_DESPAWN=51IMMOBILE=52STATIONARY=53ID_CARD_DESPAWN=54RIDEABLE_MECH=55CARD_OVERRIDE=56MILITARY_MECH=57MECH_RECON_VISION=58MECH_DEFENSIVE=59HIT_AND_RUN=60GUILT=61PAY_BOT=62HUMAN=63NO_BREATHE=64FLAMMABLE=65REVIVES=66CHITIN=67VERMIN=68NOGIB=69LARVA=70ARTHROPOD_BLOOD=71ACID_BLOOD=72BILE_BLOOD=73ABSORBS=74ABSORBS_SPLITS=75CBM_CIV=76CBM_POWER=77CBM_SCI=78CBM_OP=79CBM_TECH=80CBM_SUBS=81UNUSED_76=82FISHABLE=83GROUP_BASH=84SWARMS=85GROUP_MORALE=86INTERIOR_AMMO=87CLIMBS=88PACIFIST=89KEEP_DISTANCE=90PUSH_MON=91PUSH_VEH=92NIGHT_INVISIBILITY=93CAMOUFLAGE=94UNCANNY_DODGE=95REVIVES_HEALTHY=96NO_NECRO=97PATH_AVOID_DANGER_1=98PATH_AVOID_DANGER_2=99PATH_AVOID_FIRE=100PATH_AVOID_FALL=101NO_SLIP=102PRIORITIZE_TARGETS=103NOT_HALLUCINATION=104CANPLAY=105PET_MOUNTABLE=106PET_HARNESSABLE=107CAN_FETCH=108DOGFOOD=109DOG_WHISTLE=110MILKABLE=111SHEARABLE=112NO_BREED=113NO_FUNG_DMG=114PET_WONT_FOLLOW=115DRIPS_NAPALM=116DRIPS_GASOLINE=117ELECTRIC_FIELD=118LOUDMOVES=119CAN_OPEN_DOORS=120STUN_IMMUNE=121DROPS_AMMO=122CAN_BE_ORDERED=123SMALL_HEAD=124TINY_HEAD=125NO_HEAD_BONUS_CRIT=126HEAD_BONUS_CRIT_1=127HEAD_BONUS_CRIT_2=128TORSO_BONUS_CRIT_1=129TORSO_BONUS_CRIT_2=130PROJECTILE_RESISTANT_1=131PROJECTILE_RESISTANT_2=132PROJECTILE_RESISTANT_3=133PROJECTILE_RESISTANT_4=134VOLATILE=135CANT_CLONE=136MOUNTABLE_STAIRS=137MOUNTABLE_LADDER=138MOUNTABLE_OBSTACLES=139MOUNTABLE_DOORS=140MOUNTABLE_LEDGE=141FACTION_MEMORY=142COMBAT_MOUNT=143CANT_TRAIN=144POLICE_EYEBOT=145IRRADIATED=146NO_VEHICLE_COLLISION=147
MonsterSize
Entries
TINY=0SMALL=1MEDIUM=2LARGE=3HUGE=4
MoonPhase
Entries
MOON_NEW=0MOON_WAXING_CRESCENT=1MOON_HALF_MOON_WAXING=2MOON_WAXING_GIBBOUS=3MOON_FULL=4MOON_WANING_GIBBOUS=5MOON_HALF_MOON_WANING=6MOON_WANING_CRESCENT=7
MsgType
Entries
good=0bad=1mixed=2warning=3info=4neutral=5debug=6headshot=7critical=8grazing=9
NpcAttitude
Entries
NPCATT_NULL=0NPCATT_TALK=1NPCATT_LEGACY_1=2NPCATT_FOLLOW=3NPCATT_LEGACY_2=4NPCATT_LEAD=5NPCATT_WAIT=6NPCATT_LEGACY_6=7NPCATT_MUG=8NPCATT_WAIT_FOR_LEAVE=9NPCATT_KILL=10NPCATT_FLEE=11NPCATT_LEGACY_3=12NPCATT_HEAL=13NPCATT_LEGACY_4=14NPCATT_LEGACY_5=15NPCATT_ACTIVITY=16NPCATT_FLEE_TEMP=17NPCATT_RECOVER_GOODS=18
NpcNeed
Entries
need_none=0need_ammo=1need_weapon=2need_gun=3need_food=4need_drink=5need_safety=6
OtMatchType
Entries
EXACT=0TYPE=1PREFIX=2CONTAINS=3
SfxChannel
Entries
daytime_outdoors_env=0nighttime_outdoors_env=1underground_env=2indoors_env=3indoors_rain_env=4outdoors_snow_env=5outdoors_flurry_env=6outdoors_thunderstorm_env=7outdoors_rain_env=8outdoors_drizzle_env=9outdoor_blizzard=10deafness_tone=11danger_extreme_theme=12danger_high_theme=13danger_medium_theme=14danger_low_theme=15stamina_75=16stamina_50=17stamina_35=18idle_chainsaw=19chainsaw_theme=20player_activities=21exterior_engine_sound=22interior_engine_sound=23radio=24
VitaminType
Entries
vitamin=0toxin=1drug=2counter=3
Libraries
PointAbsMmr
Members
new
π« Function β> ( ) -> PointAbsMmr
π« Function β> ( Point ) -> PointAbsMmr
π« Function β> ( integer, integer ) -> PointAbsMmr
PointAbsMs
Members
new
π« Function β> ( ) -> PointAbsMs
π« Function β> ( Point ) -> PointAbsMs
π« Function β> ( integer, integer ) -> PointAbsMs
PointAbsOm
Members
new
π« Function β> ( ) -> PointAbsOm
π« Function β> ( Point ) -> PointAbsOm
π« Function β> ( integer, integer ) -> PointAbsOm
PointAbsOmt
Members
new
π« Function β> ( ) -> PointAbsOmt
π« Function β> ( Point ) -> PointAbsOmt
π« Function β> ( integer, integer ) -> PointAbsOmt
PointAbsSeg
Members
new
π« Function β> ( ) -> PointAbsSeg
π« Function β> ( Point ) -> PointAbsSeg
π« Function β> ( integer, integer ) -> PointAbsSeg
PointAbsSm
Members
new
π« Function β> ( ) -> PointAbsSm
π« Function β> ( Point ) -> PointAbsSm
π« Function β> ( integer, integer ) -> PointAbsSm
PointBubMs
Members
new
π« Function β> ( ) -> PointBubMs
π« Function β> ( Point ) -> PointBubMs
π« Function β> ( integer, integer ) -> PointBubMs
PointBubSm
Members
new
π« Function β> ( ) -> PointBubSm
π« Function β> ( Point ) -> PointBubSm
π« Function β> ( integer, integer ) -> PointBubSm
PointMmrMs
Members
new
π« Function β> ( ) -> PointMmrMs
π« Function β> ( Point ) -> PointMmrMs
π« Function β> ( integer, integer ) -> PointMmrMs
PointMmrOmt
Members
new
π« Function β> ( ) -> PointMmrOmt
π« Function β> ( Point ) -> PointMmrOmt
π« Function β> ( integer, integer ) -> PointMmrOmt
PointMmrSm
Members
new
π« Function β> ( ) -> PointMmrSm
π« Function β> ( Point ) -> PointMmrSm
π« Function β> ( integer, integer ) -> PointMmrSm
PointMntVeh
Members
new
π« Function β> ( ) -> PointMntVeh
π« Function β> ( Point ) -> PointMntVeh
π« Function β> ( integer, integer ) -> PointMntVeh
PointOmMmr
Members
new
π« Function β> ( ) -> PointOmMmr
π« Function β> ( Point ) -> PointOmMmr
π« Function β> ( integer, integer ) -> PointOmMmr
PointOmMs
Members
new
π« Function β> ( ) -> PointOmMs
π« Function β> ( Point ) -> PointOmMs
π« Function β> ( integer, integer ) -> PointOmMs
PointOmOmt
Members
new
π« Function β> ( ) -> PointOmOmt
π« Function β> ( Point ) -> PointOmOmt
π« Function β> ( integer, integer ) -> PointOmOmt
PointOmSeg
Members
new
π« Function β> ( ) -> PointOmSeg
π« Function β> ( Point ) -> PointOmSeg
π« Function β> ( integer, integer ) -> PointOmSeg
PointOmSm
Members
new
π« Function β> ( ) -> PointOmSm
π« Function β> ( Point ) -> PointOmSm
π« Function β> ( integer, integer ) -> PointOmSm
PointOmtMs
Members
new
π« Function β> ( ) -> PointOmtMs
π« Function β> ( Point ) -> PointOmtMs
π« Function β> ( integer, integer ) -> PointOmtMs
PointOmtSm
Members
new
π« Function β> ( ) -> PointOmtSm
π« Function β> ( Point ) -> PointOmtSm
π« Function β> ( integer, integer ) -> PointOmtSm
PointRelMmr
Members
new
π« Function β> ( ) -> PointRelMmr
π« Function β> ( Point ) -> PointRelMmr
π« Function β> ( integer, integer ) -> PointRelMmr
PointRelMs
Members
new
π« Function β> ( ) -> PointRelMs
π« Function β> ( Point ) -> PointRelMs
π« Function β> ( integer, integer ) -> PointRelMs
PointRelOm
Members
new
π« Function β> ( ) -> PointRelOm
π« Function β> ( Point ) -> PointRelOm
π« Function β> ( integer, integer ) -> PointRelOm
PointRelOmt
Members
new
π« Function β> ( ) -> PointRelOmt
π« Function β> ( Point ) -> PointRelOmt
π« Function β> ( integer, integer ) -> PointRelOmt
PointRelSeg
Members
new
π« Function β> ( ) -> PointRelSeg
π« Function β> ( Point ) -> PointRelSeg
π« Function β> ( integer, integer ) -> PointRelSeg
PointRelSm
Members
new
π« Function β> ( ) -> PointRelSm
π« Function β> ( Point ) -> PointRelSm
π« Function β> ( integer, integer ) -> PointRelSm
PointRelVeh
Members
new
π« Function β> ( ) -> PointRelVeh
π« Function β> ( Point ) -> PointRelVeh
π« Function β> ( integer, integer ) -> PointRelVeh
PointSegMmr
Members
new
π« Function β> ( ) -> PointSegMmr
π« Function β> ( Point ) -> PointSegMmr
π« Function β> ( integer, integer ) -> PointSegMmr
PointSegMs
Members
new
π« Function β> ( ) -> PointSegMs
π« Function β> ( Point ) -> PointSegMs
π« Function β> ( integer, integer ) -> PointSegMs
PointSegOmt
Members
new
π« Function β> ( ) -> PointSegOmt
π« Function β> ( Point ) -> PointSegOmt
π« Function β> ( integer, integer ) -> PointSegOmt
PointSegSm
Members
new
π« Function β> ( ) -> PointSegSm
π« Function β> ( Point ) -> PointSegSm
π« Function β> ( integer, integer ) -> PointSegSm
PointSmMs
Members
new
π« Function β> ( ) -> PointSmMs
π« Function β> ( Point ) -> PointSmMs
π« Function β> ( integer, integer ) -> PointSmMs
TripointAbsMmr
Members
new
π« Function β> ( ) -> TripointAbsMmr
π« Function β> ( Tripoint ) -> TripointAbsMmr
π« Function β> ( Point, integer ) -> TripointAbsMmr
π« Function β> ( PointAbsMmr, integer ) -> TripointAbsMmr
π« Function β> ( integer, integer, integer ) -> TripointAbsMmr
TripointAbsMs
Members
new
π« Function β> ( ) -> TripointAbsMs
π« Function β> ( Tripoint ) -> TripointAbsMs
π« Function β> ( Point, integer ) -> TripointAbsMs
π« Function β> ( PointAbsMs, integer ) -> TripointAbsMs
π« Function β> ( integer, integer, integer ) -> TripointAbsMs
TripointAbsOm
Members
new
π« Function β> ( ) -> TripointAbsOm
π« Function β> ( Tripoint ) -> TripointAbsOm
π« Function β> ( Point, integer ) -> TripointAbsOm
π« Function β> ( PointAbsOm, integer ) -> TripointAbsOm
π« Function β> ( integer, integer, integer ) -> TripointAbsOm
TripointAbsOmt
Members
new
π« Function β> ( ) -> TripointAbsOmt
π« Function β> ( Tripoint ) -> TripointAbsOmt
π« Function β> ( Point, integer ) -> TripointAbsOmt
π« Function β> ( PointAbsOmt, integer ) -> TripointAbsOmt
π« Function β> ( integer, integer, integer ) -> TripointAbsOmt
TripointAbsSeg
Members
new
π« Function β> ( ) -> TripointAbsSeg
π« Function β> ( Tripoint ) -> TripointAbsSeg
π« Function β> ( Point, integer ) -> TripointAbsSeg
π« Function β> ( PointAbsSeg, integer ) -> TripointAbsSeg
π« Function β> ( integer, integer, integer ) -> TripointAbsSeg
TripointAbsSm
Members
new
π« Function β> ( ) -> TripointAbsSm
π« Function β> ( Tripoint ) -> TripointAbsSm
π« Function β> ( Point, integer ) -> TripointAbsSm
π« Function β> ( PointAbsSm, integer ) -> TripointAbsSm
π« Function β> ( integer, integer, integer ) -> TripointAbsSm
TripointBubMs
Members
new
π« Function β> ( ) -> TripointBubMs
π« Function β> ( Tripoint ) -> TripointBubMs
π« Function β> ( Point, integer ) -> TripointBubMs
π« Function β> ( PointBubMs, integer ) -> TripointBubMs
π« Function β> ( integer, integer, integer ) -> TripointBubMs
TripointBubSm
Members
new
π« Function β> ( ) -> TripointBubSm
π« Function β> ( Tripoint ) -> TripointBubSm
π« Function β> ( Point, integer ) -> TripointBubSm
π« Function β> ( PointBubSm, integer ) -> TripointBubSm
π« Function β> ( integer, integer, integer ) -> TripointBubSm
TripointMmrMs
Members
new
π« Function β> ( ) -> TripointMmrMs
π« Function β> ( Tripoint ) -> TripointMmrMs
π« Function β> ( Point, integer ) -> TripointMmrMs
π« Function β> ( PointMmrMs, integer ) -> TripointMmrMs
π« Function β> ( integer, integer, integer ) -> TripointMmrMs
TripointMmrOmt
Members
new
π« Function β> ( ) -> TripointMmrOmt
π« Function β> ( Tripoint ) -> TripointMmrOmt
π« Function β> ( Point, integer ) -> TripointMmrOmt
π« Function β> ( PointMmrOmt, integer ) -> TripointMmrOmt
π« Function β> ( integer, integer, integer ) -> TripointMmrOmt
TripointMmrSm
Members
new
π« Function β> ( ) -> TripointMmrSm
π« Function β> ( Tripoint ) -> TripointMmrSm
π« Function β> ( Point, integer ) -> TripointMmrSm
π« Function β> ( PointMmrSm, integer ) -> TripointMmrSm
π« Function β> ( integer, integer, integer ) -> TripointMmrSm
TripointMntVeh
Members
new
π« Function β> ( ) -> TripointMntVeh
π« Function β> ( Tripoint ) -> TripointMntVeh
π« Function β> ( Point, integer ) -> TripointMntVeh
π« Function β> ( PointMntVeh, integer ) -> TripointMntVeh
π« Function β> ( integer, integer, integer ) -> TripointMntVeh
TripointOmMmr
Members
new
π« Function β> ( ) -> TripointOmMmr
π« Function β> ( Tripoint ) -> TripointOmMmr
π« Function β> ( Point, integer ) -> TripointOmMmr
π« Function β> ( PointOmMmr, integer ) -> TripointOmMmr
π« Function β> ( integer, integer, integer ) -> TripointOmMmr
TripointOmMs
Members
new
π« Function β> ( ) -> TripointOmMs
π« Function β> ( Tripoint ) -> TripointOmMs
π« Function β> ( Point, integer ) -> TripointOmMs
π« Function β> ( PointOmMs, integer ) -> TripointOmMs
π« Function β> ( integer, integer, integer ) -> TripointOmMs
TripointOmOmt
Members
new
π« Function β> ( ) -> TripointOmOmt
π« Function β> ( Tripoint ) -> TripointOmOmt
π« Function β> ( Point, integer ) -> TripointOmOmt
π« Function β> ( PointOmOmt, integer ) -> TripointOmOmt
π« Function β> ( integer, integer, integer ) -> TripointOmOmt
TripointOmSeg
Members
new
π« Function β> ( ) -> TripointOmSeg
π« Function β> ( Tripoint ) -> TripointOmSeg
π« Function β> ( Point, integer ) -> TripointOmSeg
π« Function β> ( PointOmSeg, integer ) -> TripointOmSeg
π« Function β> ( integer, integer, integer ) -> TripointOmSeg
TripointOmSm
Members
new
π« Function β> ( ) -> TripointOmSm
π« Function β> ( Tripoint ) -> TripointOmSm
π« Function β> ( Point, integer ) -> TripointOmSm
π« Function β> ( PointOmSm, integer ) -> TripointOmSm
π« Function β> ( integer, integer, integer ) -> TripointOmSm
TripointOmtMs
Members
new
π« Function β> ( ) -> TripointOmtMs
π« Function β> ( Tripoint ) -> TripointOmtMs
π« Function β> ( Point, integer ) -> TripointOmtMs
π« Function β> ( PointOmtMs, integer ) -> TripointOmtMs
π« Function β> ( integer, integer, integer ) -> TripointOmtMs
TripointOmtSm
Members
new
π« Function β> ( ) -> TripointOmtSm
π« Function β> ( Tripoint ) -> TripointOmtSm
π« Function β> ( Point, integer ) -> TripointOmtSm
π« Function β> ( PointOmtSm, integer ) -> TripointOmtSm
π« Function β> ( integer, integer, integer ) -> TripointOmtSm
TripointRelMmr
Members
new
π« Function β> ( ) -> TripointRelMmr
π« Function β> ( Tripoint ) -> TripointRelMmr
π« Function β> ( Point, integer ) -> TripointRelMmr
π« Function β> ( PointRelMmr, integer ) -> TripointRelMmr
π« Function β> ( integer, integer, integer ) -> TripointRelMmr
TripointRelMs
Members
new
π« Function β> ( ) -> TripointRelMs
π« Function β> ( Tripoint ) -> TripointRelMs
π« Function β> ( Point, integer ) -> TripointRelMs
π« Function β> ( PointRelMs, integer ) -> TripointRelMs
π« Function β> ( integer, integer, integer ) -> TripointRelMs
TripointRelOm
Members
new
π« Function β> ( ) -> TripointRelOm
π« Function β> ( Tripoint ) -> TripointRelOm
π« Function β> ( Point, integer ) -> TripointRelOm
π« Function β> ( PointRelOm, integer ) -> TripointRelOm
π« Function β> ( integer, integer, integer ) -> TripointRelOm
TripointRelOmt
Members
new
π« Function β> ( ) -> TripointRelOmt
π« Function β> ( Tripoint ) -> TripointRelOmt
π« Function β> ( Point, integer ) -> TripointRelOmt
π« Function β> ( PointRelOmt, integer ) -> TripointRelOmt
π« Function β> ( integer, integer, integer ) -> TripointRelOmt
TripointRelSeg
Members
new
π« Function β> ( ) -> TripointRelSeg
π« Function β> ( Tripoint ) -> TripointRelSeg
π« Function β> ( Point, integer ) -> TripointRelSeg
π« Function β> ( PointRelSeg, integer ) -> TripointRelSeg
π« Function β> ( integer, integer, integer ) -> TripointRelSeg
TripointRelSm
Members
new
π« Function β> ( ) -> TripointRelSm
π« Function β> ( Tripoint ) -> TripointRelSm
π« Function β> ( Point, integer ) -> TripointRelSm
π« Function β> ( PointRelSm, integer ) -> TripointRelSm
π« Function β> ( integer, integer, integer ) -> TripointRelSm
TripointRelVeh
Members
new
π« Function β> ( ) -> TripointRelVeh
π« Function β> ( Tripoint ) -> TripointRelVeh
π« Function β> ( Point, integer ) -> TripointRelVeh
π« Function β> ( PointRelVeh, integer ) -> TripointRelVeh
π« Function β> ( integer, integer, integer ) -> TripointRelVeh
TripointSegMmr
Members
new
π« Function β> ( ) -> TripointSegMmr
π« Function β> ( Tripoint ) -> TripointSegMmr
π« Function β> ( Point, integer ) -> TripointSegMmr
π« Function β> ( PointSegMmr, integer ) -> TripointSegMmr
π« Function β> ( integer, integer, integer ) -> TripointSegMmr
TripointSegMs
Members
new
π« Function β> ( ) -> TripointSegMs
π« Function β> ( Tripoint ) -> TripointSegMs
π« Function β> ( Point, integer ) -> TripointSegMs
π« Function β> ( PointSegMs, integer ) -> TripointSegMs
π« Function β> ( integer, integer, integer ) -> TripointSegMs
TripointSegOmt
Members
new
π« Function β> ( ) -> TripointSegOmt
π« Function β> ( Tripoint ) -> TripointSegOmt
π« Function β> ( Point, integer ) -> TripointSegOmt
π« Function β> ( PointSegOmt, integer ) -> TripointSegOmt
π« Function β> ( integer, integer, integer ) -> TripointSegOmt
TripointSegSm
Members
new
π« Function β> ( ) -> TripointSegSm
π« Function β> ( Tripoint ) -> TripointSegSm
π« Function β> ( Point, integer ) -> TripointSegSm
π« Function β> ( PointSegSm, integer ) -> TripointSegSm
π« Function β> ( integer, integer, integer ) -> TripointSegSm
TripointSmMs
Members
new
π« Function β> ( ) -> TripointSmMs
π« Function β> ( Tripoint ) -> TripointSmMs
π« Function β> ( Point, integer ) -> TripointSmMs
π« Function β> ( PointSmMs, integer ) -> TripointSmMs
π« Function β> ( integer, integer, integer ) -> TripointSmMs
ch_names
Members
generate
π« Function β> ( boolean? ) -> string
Generates a random full name with an optional boolean for gender. The loaded name is one of usage with optional gender. The combinations used in names files are as follows: Backer | (Female|Male|Unisex) Given | (Female|Male) // unisex names are duplicated in each group Family | Unisex Nick City World
pick
π« Function β> ( any ) -> string
Generates a single name using any combination of search flags.
const
Various game constants
Members
OMT_MS_SIZE
π¨ Constant β> integer = 24
OMT_SM_SIZE
π¨ Constant β> integer = 2
OM_MS_SIZE
π¨ Constant β> integer = 4320
OM_OMT_SIZE
π¨ Constant β> integer = 180
OM_SM_SIZE
π¨ Constant β> integer = 360
SM_MS_SIZE
π¨ Constant β> integer = 12
coords
Members
overmap_terrain_tiles
π« Function β> ( ) -> PointCoord[]
Returns every map-square offset within one overmap terrain tile as
PointCoordvalues.
overmap_tiles
π« Function β> ( ) -> PointCoord[]
Returns every map-square offset within one overmap as
PointCoordvalues.
point
π« Function β> ( string, string, Point ) -> PointCoord
π« Function β> ( string, string, integer, integer ) -> PointCoord
point_abs_mmr
π« Function β> ( integer, integer ) -> PointCoord
point_abs_ms
π« Function β> ( integer, integer ) -> PointCoord
point_abs_om
π« Function β> ( integer, integer ) -> PointCoord
point_abs_omt
π« Function β> ( integer, integer ) -> PointCoord
point_abs_seg
π« Function β> ( integer, integer ) -> PointCoord
point_abs_sm
π« Function β> ( integer, integer ) -> PointCoord
point_bub_ms
π« Function β> ( integer, integer ) -> PointCoord
point_bub_sm
π« Function β> ( integer, integer ) -> PointCoord
point_mmr_ms
π« Function β> ( integer, integer ) -> PointCoord
point_mmr_omt
π« Function β> ( integer, integer ) -> PointCoord
point_mmr_sm
π« Function β> ( integer, integer ) -> PointCoord
point_mnt_veh
π« Function β> ( integer, integer ) -> PointCoord
point_om_mmr
π« Function β> ( integer, integer ) -> PointCoord
point_om_ms
π« Function β> ( integer, integer ) -> PointCoord
point_om_omt
π« Function β> ( integer, integer ) -> PointCoord
point_om_seg
π« Function β> ( integer, integer ) -> PointCoord
point_om_sm
π« Function β> ( integer, integer ) -> PointCoord
point_omt_ms
π« Function β> ( integer, integer ) -> PointCoord
point_omt_sm
π« Function β> ( integer, integer ) -> PointCoord
point_rel_mmr
π« Function β> ( integer, integer ) -> PointCoord
point_rel_ms
π« Function β> ( integer, integer ) -> PointCoord
point_rel_om
π« Function β> ( integer, integer ) -> PointCoord
point_rel_omt
π« Function β> ( integer, integer ) -> PointCoord
point_rel_seg
π« Function β> ( integer, integer ) -> PointCoord
point_rel_sm
π« Function β> ( integer, integer ) -> PointCoord
point_rel_veh
π« Function β> ( integer, integer ) -> PointCoord
point_seg_mmr
π« Function β> ( integer, integer ) -> PointCoord
point_seg_ms
π« Function β> ( integer, integer ) -> PointCoord
point_seg_omt
π« Function β> ( integer, integer ) -> PointCoord
point_seg_sm
π« Function β> ( integer, integer ) -> PointCoord
point_sm_ms
π« Function β> ( integer, integer ) -> PointCoord
project_combine
π« Function β> ( coarse: any, fine: any ) -> nil | PointCoord | TripointCoord
Combines a coarse coordinate with a remainder from project_remain. Returns
PointCoordorTripointCoorddepending on the inputs, or nil if the pair is incompatible.
project_remain
π« Function β> ( coord: any, scale: string ) -> (nil | PointCoord | TripointCoord, PointCoord?)
Splits a
PointCoordorTripointCoordinto a coarser coordinate plus a remainder.Pointinput returnsPointCoord,PointCoord; tripoint input returnsTripointCoord,PointCoord. Returns nil, nil if the split is not valid.
project_remain_mmr
π« Function β> ( coord: any ) -> (nil | PointCoord | TripointCoord, PointCoord?)
Shortcut for
project_remain(coord, "mmr").
project_remain_om
π« Function β> ( coord: any ) -> (nil | PointCoord | TripointCoord, PointCoord?)
Shortcut for
project_remain(coord, "om").
project_remain_omt
π« Function β> ( coord: any ) -> (nil | PointCoord | TripointCoord, PointCoord?)
Shortcut for
project_remain(coord, "omt").
project_remain_seg
π« Function β> ( coord: any ) -> (nil | PointCoord | TripointCoord, PointCoord?)
Shortcut for
project_remain(coord, "seg").
project_remain_sm
π« Function β> ( coord: any ) -> (nil | PointCoord | TripointCoord, PointCoord?)
Shortcut for
project_remain(coord, "sm").
project_to
π« Function β> ( coord: any, scale: string ) -> nil | PointCoord | TripointCoord
Projects a
PointCoordorTripointCoordto another scale, preserving its origin and point dimension. Returns nil if the conversion is not valid.
project_to_mmr
π« Function β> ( coord: any ) -> nil | PointCoord | TripointCoord
Shortcut for
project_to(coord, "mmr").
project_to_ms
π« Function β> ( coord: any ) -> nil | PointCoord | TripointCoord
Shortcut for
project_to(coord, "ms").
project_to_om
π« Function β> ( coord: any ) -> nil | PointCoord | TripointCoord
Shortcut for
project_to(coord, "om").
project_to_omt
π« Function β> ( coord: any ) -> nil | PointCoord | TripointCoord
Shortcut for
project_to(coord, "omt").
project_to_seg
π« Function β> ( coord: any ) -> nil | PointCoord | TripointCoord
Shortcut for
project_to(coord, "seg").
project_to_sm
π« Function β> ( coord: any ) -> nil | PointCoord | TripointCoord
Shortcut for
project_to(coord, "sm").
project_to_veh
π« Function β> ( coord: any ) -> nil | PointCoord | TripointCoord
Shortcut for
project_to(coord, "veh").
rl_dist
π« Function β> ( lhs: Point, rhs: Point ) -> integer
π« Function β> ( lhs: Tripoint, rhs: Tripoint ) -> integer
π« Function β> ( lhs: PointCoord, rhs: PointCoord ) -> integer?
π« Function β> ( lhs: TripointCoord, rhs: TripointCoord ) -> integer?
Rectilinear distance between two raw coordinates, or between two typed coordinates with matching origin and scale. Returns nil if the typed coordinates are incompatible.
square_dist
π« Function β> ( lhs: Point, rhs: Point ) -> integer
π« Function β> ( lhs: Tripoint, rhs: Tripoint ) -> integer
π« Function β> ( lhs: PointCoord, rhs: PointCoord ) -> integer?
π« Function β> ( lhs: TripointCoord, rhs: TripointCoord ) -> integer?
Chebyshev distance between two raw coordinates, or between two typed coordinates with matching origin and scale. Returns nil if the typed coordinates are incompatible.
submap_tiles
π« Function β> ( ) -> PointCoord[]
Returns every map-square offset within one submap as
PointCoordvalues.
trig_dist
π« Function β> ( lhs: Point, rhs: Point ) -> number
π« Function β> ( lhs: Tripoint, rhs: Tripoint ) -> number
π« Function β> ( lhs: PointCoord, rhs: PointCoord ) -> number?
π« Function β> ( lhs: TripointCoord, rhs: TripointCoord ) -> number?
Euclidean distance between two raw coordinates, or between two typed coordinates with matching origin and scale. Returns nil if the typed coordinates are incompatible.
tripoint
π« Function β> ( string, string, Tripoint ) -> TripointCoord
π« Function β> ( string, string, integer, integer, integer ) -> TripointCoord
tripoint_abs_mmr
π« Function β> ( integer, integer, integer ) -> TripointCoord
tripoint_abs_ms
π« Function β> ( integer, integer, integer ) -> TripointCoord
tripoint_abs_om
π« Function β> ( integer, integer, integer ) -> TripointCoord
tripoint_abs_omt
π« Function β> ( integer, integer, integer ) -> TripointCoord
tripoint_abs_seg
π« Function β> ( integer, integer, integer ) -> TripointCoord
tripoint_abs_sm
π« Function β> ( integer, integer, integer ) -> TripointCoord
tripoint_bub_ms
π« Function β> ( integer, integer, integer ) -> TripointCoord
tripoint_bub_sm
π« Function β> ( integer, integer, integer ) -> TripointCoord
tripoint_mmr_ms
π« Function β> ( integer, integer, integer ) -> TripointCoord
tripoint_mmr_omt
π« Function β> ( integer, integer, integer ) -> TripointCoord
tripoint_mmr_sm
π« Function β> ( integer, integer, integer ) -> TripointCoord
tripoint_mnt_veh
π« Function β> ( integer, integer, integer ) -> TripointCoord
tripoint_om_mmr
π« Function β> ( integer, integer, integer ) -> TripointCoord
tripoint_om_ms
π« Function β> ( integer, integer, integer ) -> TripointCoord
tripoint_om_omt
π« Function β> ( integer, integer, integer ) -> TripointCoord
tripoint_om_seg
π« Function β> ( integer, integer, integer ) -> TripointCoord
tripoint_om_sm
π« Function β> ( integer, integer, integer ) -> TripointCoord
tripoint_omt_ms
π« Function β> ( integer, integer, integer ) -> TripointCoord
tripoint_omt_sm
π« Function β> ( integer, integer, integer ) -> TripointCoord
tripoint_rel_mmr
π« Function β> ( integer, integer, integer ) -> TripointCoord
tripoint_rel_ms
π« Function β> ( integer, integer, integer ) -> TripointCoord
tripoint_rel_om
π« Function β> ( integer, integer, integer ) -> TripointCoord
tripoint_rel_omt
π« Function β> ( integer, integer, integer ) -> TripointCoord
tripoint_rel_seg
π« Function β> ( integer, integer, integer ) -> TripointCoord
tripoint_rel_sm
π« Function β> ( integer, integer, integer ) -> TripointCoord
tripoint_rel_veh
π« Function β> ( integer, integer, integer ) -> TripointCoord
tripoint_seg_mmr
π« Function β> ( integer, integer, integer ) -> TripointCoord
tripoint_seg_ms
π« Function β> ( integer, integer, integer ) -> TripointCoord
tripoint_seg_omt
π« Function β> ( integer, integer, integer ) -> TripointCoord
tripoint_seg_sm
π« Function β> ( integer, integer, integer ) -> TripointCoord
tripoint_sm_ms
π« Function β> ( integer, integer, integer ) -> TripointCoord
date_time
System date and time API.
Members
day
π« Function β> ( ) -> integer
hour
π« Function β> ( ) -> integer
0 -> 23
millisecond
π« Function β> ( ) -> integer
minute
π« Function β> ( ) -> integer
month
π« Function β> ( ) -> integer
second
π« Function β> ( ) -> integer
weekday
π« Function β> ( ) -> integer
Days since Saturday.
weekday_str
π« Function β> ( ) -> string
year
π« Function β> ( ) -> integer
gapi
Global game methods
Members
abs_to_bub
π« Function β> ( TripointAbsMs ) -> TripointBubMs
π« Function β> ( TripointAbsSm ) -> TripointBubSm
add_msg
π« Function β> ( MsgType, any )
π« Function β> ( any )
add_npc_follower
π« Function β> ( Npc )
add_on_every_x_hook
π« Function β> ( TimeDuration, function )
Registers
fnto run once everyintervalof game time.fnreceives no arguments. Returnfalsefrom it to unregister it; any other return value keeps it registered.
before_time_starts
π« Function β> ( ) -> TimePoint
bodytemp_cold
π« Function β> ( ) -> integer
bodytemp_hot
π« Function β> ( ) -> integer
bodytemp_norm
π« Function β> ( ) -> integer
bub_to_abs
π« Function β> ( TripointBubMs ) -> TripointAbsMs
π« Function β> ( TripointBubSm ) -> TripointAbsSm
call_builtin_examine
π« Function β> ( string, Player, TripointBubMs )
Run a built-in examine action at a position.
choose_adjacent
π« Function β> ( string, boolean? ) -> TripointBubMs?
choose_adjacent_highlight
π« Function β> ( string, string, ActionId, boolean? ) -> TripointBubMs?
π« Function β> ( string, string, bool, boolean? ) -> TripointBubMs?
choose_adjacent_uilist
π« Function β> ( string, string, function, function ) -> TripointBubMs?
choose_area
π« Function β> ( string, TripointBubMs, boolean ) -> (TripointBubMs, TripointBubMs)?
choose_direction
π« Function β> ( string, boolean? ) -> TripointRelMs?
clear_all_omt_weather_overrides
π« Function β> ( )
Clear every active OMT weather override.
clear_omt_weather_override
π« Function β> ( TripointAbsOmt, integer )
Clear weather overrides for all OMTs in a radius around center. Radius is in OMT tiles.
create_item
π« Function β> ( ItypeId, integer ) -> Detached<Item>
Spawns a new item. Same as
Item::spawncountsets the itemβs charges, not the number of items: exactly one item is created. For stackable (count-by-charges) items such as ammo,countis the stack size. For non-stackable items, pass a negative value (e.g. -1), since a positive one is still applied as charges. Tools spawned with a negative value get their default charges.
current_turn
π« Function β> ( ) -> TimePoint
delete_dimension
π« Function β> ( dim_id: string ) -> boolean
Fully saves the game, then deletes an inactive, non-primary dimension from memory and save storage.
direction_from
π« Function β> ( TripointCoord ) -> Direction
Get direction from a relative tripoint coordinate delta.
direction_name
π« Function β> ( Direction ) -> string
Get direction name from direction enum
fling_creature
π« Function β> ( Creature, Angle, number, boolean )
get_all_creatures
π« Function β> ( ) -> table
Returns all active creatures as an array of
Creature: the player first, then living NPCs, then living monsters.
get_all_monsters
π« Function β> ( ) -> table
Returns all living active monsters as an array of
Monster.
get_all_npcs
π« Function β> ( ) -> table
Returns all living active NPCs as an array of
Npc.
get_avatar
π« Function β> ( ) -> Avatar
get_character_at
π« Function β> ( TripointBubMs, boolean? ) -> Character
π« Function β> ( Tripoint, boolean? ) -> Character
get_creature_at
π« Function β> ( TripointBubMs, boolean? ) -> Creature
π« Function β> ( Tripoint, boolean? ) -> Creature
get_current_dimension_id
π« Function β> ( ) -> string
Returns the current dimension id. Empty string means the overworld.
get_distribution_grid_tracker
π« Function β> ( ) -> DistributionGridTracker
get_items_if
π« Function β> ( table ) -> table
Returns items on the map within a radius of a point, matching every given filter, as an array of
Item.
Items inside containers on the ground are included.
Takes a table where each key is a filter; unknown keys show a debug message and are ignored. Available filters:
pos(Tripoint): Center point to search around.radius(integer, optional): Search radius in tiles. Defaults to the pickup range.category(string or string[]):Itemcategory id is one of these, e.g. βfoodβ.type(ItemTypeId or ItemTypeId[]):Itemtype is one of these.is_food(boolean): Whether the item is food.flags(FlagId or FlagId[]):Itemhas at least one of these flags.need_charges(boolean): Tool items must have charges left.has_charges(table): { id = ItemTypeId, amount = integer }: item type isidand has at leastamountcharges.addiction_type(AddictionType, string, or array of those): Comestibleβs addiction type is one of these, e.g.<code>[AddictionType](#sol::AddictionType)</code>.ALCOHOLor"alcohol".material(MaterialTypeId, string, or array of those):Itemis made of at least one of these materials, e.g."stone".
Thewornandwieldedfilters only apply to<code>[Character](#sol::Character)</code>:get_items_ifand are ignored here.
get_lua_log
π« Function β> ( integer ) -> table
Get recent Lua console log entries. Returns array of { level=string, text=string, from_user=bool }.
get_map
π« Function β> ( ) -> Map
get_messages
π« Function β> ( integer ) -> table
Get recent player message log entries. Returns array of { time=string, text=string }.
get_monster_at
π« Function β> ( TripointBubMs, boolean? ) -> Monster
π« Function β> ( Tripoint, boolean? ) -> Monster
get_monsters_if
π« Function β> ( table ) -> table
Returns active monsters matching every given filter as an array of
Monster.
Takes a table where each key is a filter; unknown keys show a debug message and are ignored. Available filters:
type_ids(MonsterTypeId[]):Monstertype is one of these.faction_ids(MonsterFactionId[]):Monsterfaction is one of these.species_ids(SpeciesTypeId[]):Monsterhas at least one of these species.sees(Monster[]): At least one of these monsters can see it.hostile_to(Monster[]): It is hostile to at least one of these monsters.within_range_of(table): { range = number, monsters =Monster[] }. It is withinrangetiles of at least one of these monsters.limit(integer): Stop searching once this many monsters have matched.
get_monsters_near_omt
π« Function β> ( table ) -> table
Returns active monsters near an absolute overmap terrain tile as an array of
Monster.
Takes a table with keys:
center(TripointAbsOmt): Overmap terrain tile to search around.radius(integer, optional): Search radius in overmap terrain tiles. Defaults to 0.ignore_z(boolean, optional): If true, matches every z-level. Defaults to false.
get_npc_at
π« Function β> ( TripointBubMs, boolean? ) -> Npc
π« Function β> ( Tripoint, boolean? ) -> Npc
get_npcs_near_omt
π« Function β> ( table ) -> table
Returns active NPCs near an absolute overmap terrain tile as an array of
Npc.
Takes a table with keys:
center(TripointAbsOmt): Overmap terrain tile to search around.radius(integer, optional): Search radius in overmap terrain tiles. Defaults to 0.ignore_z(boolean, optional): If true, matches every z-level. Defaults to false.
get_omt_weather_override
π« Function β> ( TripointAbsOmt ) -> string?
Get the current OMT weather override at a location, or nil if none is set.
get_option
π« Function β> ( string ) -> string
get_option_bool
π« Function β> ( string ) -> boolean
get_option_float
π« Function β> ( string ) -> number
get_option_int
π« Function β> ( string ) -> integer
get_overmap_buffer
π« Function β> ( ) -> OvermapBuffer
Get the global overmap buffer
get_player_pets
π« Function β> ( ) -> table
Returns the playerβs living active pet monsters as an array of
Monster.
get_scenario
π« Function β> ( ) -> ScenarioRaw
Returns the scenario the current game started with, or nil if no game is active.
get_simulated_npcs
π« Function β> ( ) -> table
Returns living NPCs in simulated (fully loaded, AI-eligible) submaps as an array of
Npc.
has_omt_weather_override
π« Function β> ( TripointAbsOmt ) -> boolean
Returns true if an OMT weather override exists at the given location.
inv_map_splice
π« Function β> ( table ) -> Item
Opens an item selection menu listing the playerβs inventory and nearby items that pass a filter, and returns the chosen item or nil.
Takes a table with keys:
title(string): Menu title.failure(string): Message shown when no item passes the filter.check(function): Filter called with a table { item =Item}. Must return a boolean.radius(integer, optional): Search radius for nearby items. Defaults to the pickup range.
inv_map_splice_if
π« Function β> ( table ) -> Item
Opens an item selection menu listing the playerβs inventory and nearby items that match the given filters, and returns the chosen item or nil.
Takes a table with keys:
title(string): Menu title.failure(string): Message shown when no item passes the filter.radius(integer, optional): Search radius for nearby items. Defaults to the pickup range.- plus any filter key accepted by
gapi.get_items_if(e.g.category,type,is_food,flags,need_charges,has_charges,addiction_type,material).
Containers whose contents match a filter are listed as well; the returned item is then the container itself.
light_ambient_lit
π« Function β> ( ) -> number
look_around
π« Function β> ( ) -> TripointBubMs?
map_inv_edit
π« Function β> ( table )
Runs a function editing the playerβs inventory and nearby items.
Takes a table with keys:
func(function): Editing function called with a table { item =Item}. Must return a boolean.radius(integer, optional): Search radius for nearby items. Defaults to the pickup range.
place_monster_around
π« Function β> ( MonsterTypeId, TripointBubMs, integer ) -> Monster
π« Function β> ( MonsterTypeId, Tripoint, integer ) -> Monster
place_monster_at
π« Function β> ( MonsterTypeId, TripointBubMs ) -> Monster
π« Function β> ( MonsterTypeId, Tripoint ) -> Monster
place_player_dimension_at
π« Function β> ( opts: DimensionTravelOptions ) -> boolean
Moves the player into another dimension and loads the destination around required target_ms or target_omt. Moves the player to a position in another dimension, creating the dimension if needed. Does nothing if the player is already in that dimension.
Returns false if the options are invalid or there is no safe landing spot.OvermapTerrainLayoutis string[][][].
Fields ofDimensionTravelOptions:
dimension_id(string, optional): Target dimension id. Empty string means the overworld.target_ms(TripointAbsMs, optional): Absolute map-square destination. Required when target_omt is absent.target_omt(TripointAbsOmt, optional): Absolute overmap-terrain destination. Required when target_ms is absent.world_type(string, optional): World type for creating a new non-overworld dimension.bounds_min_omt(TripointAbsOmt, optional): Inclusive pocket dimension minimum overmap-terrain bound.bounds_max_omt(TripointAbsOmt, optional): Inclusive pocket dimension maximum overmap-terrain bound.boundary_terrain(string, optional):Mapterrain used outside pocket bounds.boundary_overmap_terrain(string, optional): Overmap terrain used outside pocket bounds.overmap_terrain(OvermapTerrainLayout, optional): Optional z/y/x table anchored at bounds_min_omt.pregen_special_id(string, optional): Overmap special to force before loading the destination.pregen_special_omt(TripointAbsOmt, optional): Overmap-terrain position for pregen_special_id; defaults to target_omt.
place_player_local_at
π« Function β> ( TripointBubMs )
Teleports player to local coordinates within active map
place_player_overmap_at
π« Function β> ( TripointAbsOmt )
Teleports player to absolute coordinate in overmap
play_ambient_variant_sound
π« Function β> ( string, string, integer, SfxChannel, integer, number, integer )
play_variant_sound
π« Function β> ( string, string, integer, boolean )
π« Function β> ( string, string, integer, Angle, number, number, boolean )
register_action_menu_entry
π« Function β> ( table )
Register a Lua-defined action menu entry in the in-game action menu.
Takes a table with keys:
id(string): Unique entry id. Registering the same id again replaces the old entry.fn(function): Called with no arguments when the entry is selected.name(string, optional): Displayed text. Defaults toid.category(string, optional): Submenu to show the entry in. Defaults tomisc. Built-in categories arelook,interact,inventory,combat,craft,info,miscanddebug;backplaces it in the top-level menu, and any other id adds a new submenu.hotkey(string, optional): Key name for the entryβs hotkey.
remove_npc_follower
π« Function β> ( Npc )
reset_dimension
π« Function β> ( dim_id: string ) -> boolean
Fully saves the game, then deletes generated data for an inactive, non-primary dimension while keeping its loaded metadata.
rng
π« Function β> ( integer, integer ) -> integer
send_event
π« Function β> ( string )
π« Function β> ( string, any )
Sends a game event by name so statistics, achievements and the memorial keep working when the triggering logic is implemented in Lua.
Event names and their fields are theevent_typevalues andevent_specfields listed insrc/event.h.
The payload is a table keyed by the eventβs field names (e.g.{ character = who, itype = "marloss_berry" }forconsumes_marloss_item), a bareCharacter-like object for events whose only field ischaracter, or nil for events without fields.characterfields accept aCharacter-like object, a character_id, or an integer id;boolfields take a Lua boolean;intfields take an integer; every other field takes a string (an integer is converted to its string form) that must be a valid value for the field, e.g. an existing item id.
Unknown event names, unknown, missing or invalid fields raise Lua errors and send nothing.game_startandgame_overare sent only by the game. Events can do more than feed statistics, achievements and the memorial: some subscribers have gameplay effects (for example,player_levels_spellteaches the follow-up spells that leveling a spell grants), so send an event only when the action it describes actually happened.
set_omt_weather_override
π« Function β> ( TripointAbsOmt, integer, string, TimePoint? )
Override weather for all OMTs in a radius around center. Radius is in OMT tiles. Optionally expires at a given time_point.
six_cardinal_directions
π« Function β> ( ) -> TripointRelOmt[]
Get the six cardinal overmap-terrain direction offsets (N, S, E, W, Up, Down).
spawn_hallucination
π« Function β> ( TripointBubMs ) -> boolean
π« Function β> ( Tripoint ) -> boolean
trait_generation
π« Function β> ( ) -> integer
Returns a counter that changes whenever the traits of a character may change: a mutation is gained or lost, or an enchantment grants or removes one.
turn_zero
π« Function β> ( ) -> TimePoint
gdebug
Debugging and logging API.
Members
clear_lua_log
π« Function β> ( )
debugmsg
π« Function β> ( any )
log_error
π« Function β> ( any )
log_info
π« Function β> ( any )
log_warn
π« Function β> ( any )
reload_lua_code
π« Function β> ( )
save_game
π« Function β> ( ) -> boolean
set_log_capacity
π« Function β> ( integer )
hooks
Documentation for hooks
Members
on_character_death
π« Function β> ( params: table )
Called when a character is dead.
The hook receives a table with keys:
on_character_display_skill_action
π« Function β> ( params: table )
Called when a skill is confirmed on the character display (
@) skill tab.
Setparams.results.handled = trueto prevent the default training toggle.
The hook receives a table with keys:
on_character_display_skill_info
π« Function β> ( params: table )
Called when drawing skill info on the character display (
@) skill tab.
Setparams.results.textto append text below the regular skill description.
The hook receives a table with keys:
on_character_effect
π« Function β> ( params: table )
Called when character is on the effect which has
EFFECT_LUA_ON_TICKflag.
The hook receives a table with keys:
on_character_effect_added
π« Function β> ( params: table )
Called when character gets the effect which has
EFFECT_LUA_ON_ADDEDflag.
The hook receives a table with keys:
on_character_effect_removed
π« Function β> ( params: table )
Called when character loses the effect which has
EFFECT_LUA_ON_REMOVEDflag.
The hook receives a table with keys:
on_character_item_takeoff
π« Function β> ( params: table )
Called after a character has taken off an item.
The hook receives a table with keys:
on_character_item_wear
π« Function β> ( params: table )
Called after a character has put on an item.
The hook receives a table with keys:
on_character_reset_stats
π« Function β> ( params: table )
Called when character stat gets reset.
The hook receives a table with keys:
character(Character)
on_character_try_move
π« Function β> ( params: table )
Called after on_player_try_move or on_npc_try_move regardless of whether the specific hook vetoed.
All registered callbacks run; if any returns false, movement is blocked.
Return false to block the move.
The hook receives a table with keys:
char(Character)from(TripointBubMs)to(TripointBubMs)movement_mode(CharacterMoveMode)via_ramp(bool)mounted(bool)mount(Creature, if mounted)
on_character_try_takeoff
π« Function β> ( params: table )
Called when a character tries to take off a worn item.
Return false to block taking off the item.
Setparams.results.allowed = falseandparams.results.message(string), then returnparams.resultsto block it with a custom message.
Once a callback blocks, the remaining callbacks registered to this hook are not called.
The hook receives a table with keys:
on_character_try_wear
π« Function β> ( params: table )
Called when a character tries to wear an item.
Return false to block wearing the item.
Setparams.results.allowed = falseandparams.results.message(string), then returnparams.resultsto block it with a custom message.
Once a callback blocks, the remaining callbacks registered to this hook are not called.
The hook receives a table with keys:
on_character_wake_up
π« Function β> ( params: table )
Called when a character wakes up from sleep.
The hook receives a table with keys:
char(Character)
on_control_npc
π« Function β> ( params: table )
Called when the player swaps control to an npc.
The hook receives a table with keys:
npc(NPC): The NPC being controlled.
on_craft_result
π« Function β> ( params: table )
Called when a craft is completed, and when the crafting menu builds a preview of the result.
The hook receives a table with keys:
crafter(Character)craft(Item, nil in the crafting menu): The in-progress craft itemitem(Item): The resulting item, or its contents if the result is a containerrecipe(RecipeRaw)batch_size(int)hot_result(bool): True if the result is food and the recipe requires a heating tool (e.g.surface_heat)dehydrated_result(bool): True if the result is food and the recipe requires a dehydrator or a charcoal smokercrafting_menu(bool): True if called for the crafting menu preview
on_creature_attacked_by_character
π« Function β> ( params: table )
Called after a character has attacked a creature in melee or hit it with a projectile.
The hook receives a table with keys:
on_creature_blocked
π« Function β> ( params: table )
Called when a character successfully blocks.
The hook receives a table with keys:
char(Character)source(Creature)bodypart_id(BodyPartTypeId)damage_instance(DamageInstance)damage_blocked(float)
on_creature_do_turn
π« Function β> ( params: table )
Called every turn for each active creature, before it acts.
This is the base hook;on_monster_do_turnandon_npc_do_turnalso trigger this.
The hook receives a table with keys:
creature(Creature)
on_creature_dodged
π« Function β> ( params: table )
Called when a character or monster successfully dodges.
The hook receives a table with keys:
on_creature_loaded
π« Function β> ( params: table )
Called when any creature is loaded onto the active map.
This is the base hook;on_monster_loadedandon_npc_loadedalso trigger this.
The hook receives a table with keys:
creature(Creature)
on_creature_melee_attacked
π« Function β> ( params: table )
Called after a character or monster has attacked in melee.
The hook receives a table with keys:
on_creature_performed_technique
π« Function β> ( params: table )
Called when a character has performed a technique.
The hook receives a table with keys:
char(Character)technique(MartialArtsTechniqueRaw)target(Creature)damage_instance(DamageInstance)move_cost(integer)
on_creature_spawn
π« Function β> ( params: table )
Called when any creature is spawned for the first time.
This is the base hook;on_monster_spawnandon_npc_spawnalso trigger this.
The hook receives a table with keys:
creature(Creature)
on_dialogue_end
π« Function β> ( params: table )
Called when the dialogue window closes.
The hook receives a table with keys:
npc(NPC): The NPC speaking
on_dialogue_option
π« Function β> ( params: table )
Called when a dialogue option is selected.
Return a new talk_topic id to add it as the next topic.
The hook receives a table with keys:
npc(NPC): The NPC speakingnext_topic(string): The topic that was selected
on_dialogue_start
π« Function β> ( params: table )
Called just before the dialogue window opens and the first topic is chosen.
Return a new talk_topic id to add it as the next topic.
The hook receives a table with keys:
npc(NPC): The NPC speakingnext_topic(string): The topic that will be shown first
on_elevator_try_use
π« Function β> ( params: table )
Called before the player uses elevator controls.
All registered callbacks run; if any returns false, elevator use is blocked.
Return false to block elevator use.
The hook receives a table with keys:
player(Player)pos(TripointBubMs)om_terrain(string)
on_every_x
π« Function β> ( )
Called every in-game period.
Not registered throughgame.add_hook; usegapi.add_on_every_x_hook( interval, fn )instead.
The callback receives no arguments. Returnfalseto unregister it.
on_explosion_start
π« Function β> ( params: table )
Called when an explosion starts.
The hook receives a table with keys:
pos(TripointBubMs)damage(int)radius(int)fire(bool)
on_game_load
π« Function β> ( )
Called right after game has loaded.
on_game_save
π« Function β> ( )
Called when game is about to save.
on_game_started
π« Function β> ( )
Called when the game has first started.
on_make_mapgen_factory_list
π« Function β> ( params: table )
Called when checking which mapgen ids are used, during mapgen consistency checks.
Insert mapgen ids that are only used from Lua to suppress the βnot used by anythingβ error.
The hook receives a table with keys:
results(set of string): The mapgen ids that are in use
on_mapgen_postprocess
π« Function β> ( params: table )
Called right after mapgen has completed.
The hook receives a table with keys:
map(MapgenConstructor): The OMT-local mapgen surface.omt(TripointAbsOmt): The absolute overmap terrain position.when(TimePoint): The current time (for time-based effects).
on_mission_end
π« Function β> ( params: table )
Called right after mission has ended.
The hook receives a table with keys:
mission_type(mission_type): The type of the mission.mission(mission): The mission instance.success(bool): Successful if true else failed.
on_mission_start
π« Function β> ( params: table )
Called right after mission has started.
The hook receives a table with keys:
mission_type(mission_type): The type of the mission.mission(mission): The mission instance.
on_mon_death
π« Function β> ( params: table )
Called when a monster is dead.
The hook receives a table with keys:
on_mon_effect
π« Function β> ( params: table )
Called when character is on the effect which has
EFFECT_LUA_ON_TICKflag.
The hook receives a table with keys:
on_mon_effect_added
π« Function β> ( params: table )
Called when monster gets the effect which has
EFFECT_LUA_ON_ADDEDflag.
The hook receives a table with keys:
on_mon_effect_removed
π« Function β> ( params: table )
Called when monster loses the effect which has
EFFECT_LUA_ON_REMOVEDflag.
The hook receives a table with keys:
on_monster_do_turn
π« Function β> ( params: table )
Called every turn for each active monster, before it acts.
Also triggerson_creature_do_turn.
The hook receives a table with keys:
monster(Monster)
on_monster_examine_menu_entry
π« Function β> ( params: table )
Called when an entry is selected in the examine menu of a pet monster.
The hook receives a table with keys:
on_monster_get_examine_menu_entries
π« Function β> ( params: table )
Called when building the examine menu of a pet monster.
Return an array of tables withmenu_id(string) andmenu_label(string) to add menu entries.
The hook receives a table with keys:
on_monster_loaded
π« Function β> ( params: table )
Called when a monster is loaded onto the active map.
Also triggerson_creature_loaded.
The hook receives a table with keys:
monster(Monster)
on_monster_spawn
π« Function β> ( params: table )
Called when a monster is spawned for the first time.
Also triggerson_creature_spawn.
Note: monsters spawned via mapgen submap spawn points will fire this hook,
but monsters materialized from overmap monster groups may not.
The hook receives a table with keys:
monster(Monster)
on_monster_tame
π« Function β> ( params: table )
Called when a monster is tamed by a character.
The hook receives a table with keys:
on_monster_try_move
π« Function β> ( params: table )
Called when a monster attempts to move.
All registered callbacks run; if any returns false, movement is blocked.
Return false to block the move.
The hook receives a table with keys:
monster(Monster)from(TripointBubMs)to(TripointBubMs)force(bool): If the monster move call was forced
on_npc_do_turn
π« Function β> ( params: table )
Called every turn for each simulated NPC, before it acts.
Also triggerson_creature_do_turn.
The hook receives a table with keys:
npc(Npc)
on_npc_interaction
π« Function β> ( params: table )
Called when the player interacts with an NPC.
The hook receives a table with keys:
npc(NPC): The NPC being interacted with
on_npc_loaded
π« Function β> ( params: table )
Called when an NPC is loaded onto the active map.
Also triggerson_creature_loaded.
The hook receives a table with keys:
npc(Npc)
on_npc_spawn
π« Function β> ( params: table )
Called when an NPC is spawned for the first time.
Also triggerson_creature_spawn.
The hook receives a table with keys:
npc(Npc)
on_npc_try_move
π« Function β> ( params: table )
Called when an NPC attempts to move.
All registered callbacks run; if any returns false, movement is blocked.
Return false to block the move.
The hook receives a table with keys:
npc(Npc)from(TripointBubMs)to(TripointBubMs)movement_mode(CharacterMoveMode)via_ramp(bool)mounted(bool)mount(Creature, if mounted)
on_player_try_move
π« Function β> ( params: table )
Called when the player attempts to move.
All registered callbacks run; if any returns false, movement is blocked.
Return false to block the move.
The hook receives a table with keys:
player(Player)from(TripointBubMs)to(TripointBubMs)movement_mode(CharacterMoveMode)via_ramp(bool)mounted(bool)mount(Creature, if mounted)
on_shoot
π« Function β> ( params: table )
Called when shot(s) is fired from a gun.
The hook receives a table with keys:
shooter(Character)target_pos(TripointBubMs)shots(int)gun(item)ammo(item): ForRELOAD_AND_SHOOTguns like a bow. On the others, it returnsnilvalue.
on_spell_cast
π« Function β> ( params: table )
Called after a spell has been cast.
The hook receives a table with keys:
on_spell_try_cast
π« Function β> ( params: table )
Called when the player tries to cast a spell, before the casting activity starts.
Return false to block casting.
The hook receives a table with keys:
on_throw
π« Function β> ( params: table )
Called when an item is thrown.
The hook receives a table with keys:
thrower(Character)target_pos(TripointBubMs)throw_from_pos(TripointBubMs)thrown(item)
on_try_monster_interaction
π« Function β> ( params: table )
Called when the player tries to interact with a monster.
Return false to prevent monster interaction actions from running.
The hook receives a table with keys:
monster(Monster): The monster being interacted with
on_try_npc_interaction
π« Function β> ( params: table )
Called when the player tries to interact with an NPC.
Return false to prevent the npc interaction menu from appearing.
The hook receives a table with keys:
npc(NPC): The NPC being interacted with
on_weather_changed
π« Function β> ( params: table )
Called when the weather has changed.
The hook receives a table with keys:
weather_id(string): Current weather IDold_weather_id(string): Previous weather IDtemperature(float): Current temperature in Celsiustemperature_f(float): Current temperature in Fahrenheitwindspeed(float): Wind speedwinddirection(integer): Wind direction in degreeshumidity(float): Humidity percentagepressure(float): Atmospheric pressureis_sheltered(boolean): Whether player is sheltered
on_weather_updated
π« Function β> ( params: table )
Called every 5 minutes when weather data is updated.
The hook receives a table with keys:
weather_id(string): Current weather IDtemperature(float): Current temperature in Celsiustemperature_f(float): Current temperature in Fahrenheitwindspeed(float): Wind speedwinddirection(integer): Wind direction in degreeshumidity(float): Humidity percentagepressure(float): Atmospheric pressureis_sheltered(boolean): Whether player is sheltered
locale
Localization API.
Members
gettext
π« Function β> ( string ) -> string
Expects english source string, returns translated string.
pgettext
π« Function β> ( string, string ) -> string
First is context string. Second is english source string.
vgettext
π« Function β> ( string, string, integer ) -> string
First is english singular string, second is english plural string. Number is amount to translate for.
vpgettext
π« Function β> ( string, string, string, integer ) -> string
First is context string. Second is english singular string. third is english plural. Number is amount to translate for.
monster_groups
Monster group definitions and helpers
Members
get_all
π« Function β> ( ) -> MonsterGroupRaw[]
Get all monster group definitions.
get_all_ids
π« Function β> ( ) -> MonsterGroupId[]
List all monster group ids currently loaded.
get_group
π« Function β> ( MonsterGroupId ) -> MonsterGroupRaw
Get a monster group definition by id.
get_monsters_from_group
π« Function β> ( MonsterGroupId ) -> MonsterTypeId[]
Get the monster ids directly listed in a group (default monster first).
monster_types
Monster type definitions and helpers
Members
get_all_ids
π« Function β> ( ) -> MonsterTypeId[]
List all monster type ids currently loaded.
overmapbuffer
Global overmap buffer interface for finding and inspecting overmap terrain.
Members
add_grid_connection
π« Function β> ( TripointAbsOmt, TripointAbsOmt ) -> boolean
Add an electric grid connection between two positions. Returns true on success.
check_ot
π« Function β> ( string, OtMatchType, TripointAbsOmt ) -> boolean
Check if the terrain at the given position matches the type and match mode. Returns boolean.
create_horde
π« Function β> ( table ) -> Mongroup
Create a monster horde at the given absolute OMT position. Returns nil if
typeorposis missing.
Takes a table with keys:
type(MonsterGroupIdor string):Monstergroup to spawn.pos(TripointAbsOmt): Where to create the horde.radius(integer, optional): Spread radius in submaps. Defaults to 1.population(integer, optional): Number of monsters. Defaults to 100.horde(boolean, optional): Whether the group moves as a horde. Defaults to true.behaviour(string, optional): Horde behaviour:roam,cityornemesis. Defaults toroam.diffuse(boolean, optional): If true, monster density doesnβt depend on distance frompos. Defaults to false.target(TripointAbsOmt, optional): Initial movement target.
drain_fluid_grid_liquid_charges
π« Function β> ( TripointAbsOmt, ItypeId, integer ) -> integer
Drain liquid charges from the fluid grid at the given TripointAbsOmt position. Returns the number removed.
electric_grid_at
π« Function β> ( TripointAbsOmt ) -> TripointAbsOmt[]
Get all overmap tiles belonging to the electric grid at the given position. Returns TripointAbsOmt values.
electric_grid_connectivity_at
π« Function β> ( TripointAbsOmt ) -> TripointRelOmt[]
Get all electric grid connections from the given position. Returns TripointRelOmt offsets.
find_all
π« Function β> ( TripointAbsOmt, OmtFindParams ) -> TripointAbsOmt[]
Find all overmap terrain tiles matching the given parameters. Returns TripointAbsOmt values.
find_closest
π« Function β> ( TripointAbsOmt, OmtFindParams ) -> TripointAbsOmt?
Find the closest overmap terrain tile matching the given parameters. Returns TripointAbsOmt or nil if not found.
find_random
π« Function β> ( TripointAbsOmt, OmtFindParams ) -> TripointAbsOmt?
Find a random overmap terrain tile matching the given parameters. Returns TripointAbsOmt or nil if not found.
fluid_grid_at
π« Function β> ( TripointAbsOmt ) -> TripointAbsOmt[]
Get all overmap tiles belonging to the fluid grid at the given TripointAbsOmt position. Returns TripointAbsOmt values.
fluid_grid_connectivity_at
π« Function β> ( TripointAbsOmt ) -> TripointRelOmt[]
Get all fluid grid connections from the given TripointAbsOmt position. Returns TripointRelOmt offsets.
fluid_grid_liquid_charges_at
π« Function β> ( TripointAbsOmt, ItypeId ) -> integer
Get the available charges of a liquid in the fluid grid at the given TripointAbsOmt position.
fluid_grid_would_contaminate
π« Function β> ( TripointAbsOmt, ItypeId ) -> boolean
Check whether adding a liquid would contaminate the fluid grid at the given TripointAbsOmt position.
get_note
π« Function β> ( TripointAbsOmt ) -> string?
Get a player note at the given position. Returns string or nil.
has_horde
π« Function β> ( TripointAbsOmt ) -> boolean
Check if a horde is present at the given overmap tile.
horde_count
π« Function β> ( TripointAbsOmt ) -> integer
Count hordes influencing the given overmap tile (absolute OMT coordinates).
horde_size
π« Function β> ( TripointAbsOmt ) -> integer
Get the estimated size of the horde at the given overmap tile.
hordes_at
π« Function β> ( TripointAbsOmt ) -> Mongroup[]
List hordes influencing the given overmap tile (absolute OMT coordinates).
is_explored
π« Function β> ( TripointAbsOmt ) -> boolean
Check if the terrain at the given position has been explored by the player. Returns boolean.
monster_groups_at
π« Function β> ( TripointAbsOmt ) -> Mongroup[]
List monster groups influencing the given overmap tile (absolute OMT coordinates).
move_hordes
π« Function β> ( )
Advance horde movement across all loaded overmaps.
remove_grid_connection
π« Function β> ( TripointAbsOmt, TripointAbsOmt ) -> boolean
Remove an electric grid connection between two positions. Returns true on success.
reveal
π« Function β> ( TripointAbsOmt, integer, function? ) -> boolean
Reveal a square area around a TripointAbsOmt center on the overmap. Returns true if any new tiles were revealed. Optional filter callback receives oter_id and should return true to reveal that tile.
seen
π« Function β> ( TripointAbsOmt ) -> boolean
Check if the terrain at the given position has been seen by the player. Returns boolean.
set_note
π« Function β> ( TripointAbsOmt, string? )
Set a player note at the given position. Pass nil or empty string to clear.
set_seen
π« Function β> ( TripointAbsOmt, boolean? )
Set the seen status of terrain at the given position.
signal_hordes
π« Function β> ( TripointAbsSm, integer )
Signal nearby hordes toward an absolute submap position with the given strength.
ter
π« Function β> ( TripointAbsOmt ) -> OterIntId
Get the overmap terrain type at the given position. Returns an oter_id.
requirements
Requirement definitions and lookup helpers.
Members
get
π« Function β> ( string ) -> RequirementData?
Look up requirement_data by ID string. Returns nil if not found.
rgb_colors
RGB Color Getters.
Members
get_all_named_colors
π« Function β> ( ) -> CppVal<std_unordered_map<RGBColor,std_basic_string<char>>>
Get
RGBColor-> string mapping
get_random
π« Function β> ( string ) -> (RGBColor, string)
Get random RGB
Colorfrom fuzzy match string
try_parse
π« Function β> ( string ) -> RGBColor?
Get RGB
Colorfrom string
sidebar
Sidebar utility functions.
Members
clear_widgets
π« Function β> ( )
Clear all registered Lua sidebar widgets.
get_layout_id
π« Function β> ( ) -> string
Returns current sidebar layout id (e.g. classic, compact, labels).
register_widget
π« Function β> ( table )
Register a Lua sidebar widget.
Takes a table with keys:
id(string): Unique widget id.draw(function):draw(width, height)returns an array of lines. Each line is a string or a table { text = string, color =Color|string }.textmay include color tags like <color_red>text for multi-color lines.name(string, optional): Name shown in the sidebar options. Defaults toid.height(integer, optional): Height in lines. Use -2 to fill the remaining space. Defaults to 1.order(integer, optional): 1-based position in the sidebar.default_toggle(boolean, optional): Whether the widget is enabled by default. Defaults to true.redraw_every_frame(boolean, optional): Redraw on every frame instead of only on sidebar refresh. Defaults to false.panel_visible(boolean or function, optional): Whether to show the widget. A function is called with no arguments and should return a boolean.render(function, optional): Visibility check used whenpanel_visibleis not a function. Called with no arguments; return false to hide the widget.
tests_lib
Library for testing purposes
Members
my_awesome_lambda_1
π« Function β> ( ) -> integer
my_awesome_lambda_2
π« Function β> ( ) -> integer