Space Station 13 - Nebula13 - Modules - Types — Var Details - Proc Details

merchant

Represents an NPC which the crew (or others) can trade with.

Vars

HIGH_DISPOSITION_THRESHOLDDisposition values at or above this value are considered to be 'high' for certain purposes.
MAX_DISPOSITION_THRESHOLDDisposition values above this value cease to have any additional effect for certain purposes.
TRANSACTION_BUYINGIndicates a transaction where the merchant is buying from players.
TRANSACTION_SELLINGIndicates a transaction where the merchant is selling to players.
accepts_goods_as_paymentWhether or not the merchant accepts items as payment. This must be TRUE for barter to be possible.
accepts_money_as_paymentWhether or not the merchant accepts money as payment.
active_demandList of commodities that the merchant wants to buy from players.
active_supplyList of commodities that are presently being offered for sale.
bribe_disposition_divisorDetermines how much disposition goes up when bribed, by dividing the bribe amount by this value.
bribe_duration_divisorDetermines how much longer, in minutes, merchants will stay when bribed (if they are temporary), by dividing the bribe amount by this value.
comms_refusal_thresholdMerchants will refuse to interact with anyone who has this amount of disposition, or lower.
currency_usedThe currency used by the merchant. If unset, the map's default currency is used instead.
current_cashHow much cash the merchant currently has. If set to null, the merchant has unlimited funds.
demand_potentialList containing one or more /decl/merchant_potential_commodities, which are used to determine what the merchant wants to buy from players.
demand_strategyDetermines how demand is initially stocked and how it rotates over time, if at all.
duration_of_stayHow long the merchant is planning to stay, in minutes. Set automatically on init if is_temporary_merchant is true.
forbidden_objectsList of type paths the merchant refuses to buy, with a unique dialogue compared to regular junk.
haggle_disposition_penaltyScales how far disposition drops when players try to offer bad deals to this merchant. Higher numbers make the merchants get fed up faster.
haggling_refusal_thresholdDetermines how far away from the merchant's perferred price players can haggle for. The actual threshold is randomized to be between 0 and this value.
hubThe trade hub which this merchant is located at.
inactive_demandList of commodities that didn't make the cut for active_demand.
inactive_supplyList of commodities that didn't make the cut for active_supply.
is_temporary_merchantIf true, the merchant will eventually leave their hub, and players won't be able to interact with them anymore. This can be changed in-round to make temp. merchants stay.
merchant_languagesList of languages which the merchant communicates with. Players who do not possess at least one of these cannot easily interact with the merchant, and the text will be scrambled in the UI.
nameThe merchant's name, shown in the UI to players. If blank, a random name will be generated.
name_backgroundBackground decl which will generate a random name for the merchant, overwriting it, if it is set.
negative_disposition_multiplierMultiplies how easy it is to lower disposition with this merchant.
originWhere the merchant is trading from, or in other words, the store's name. Shown in the UI.
positive_disposition_multiplierMultiplies how easy it is to raise disposition with this merchant.
possible_originsIf set, origin is replaced by one of these randomly at init.
price_varianceObject values can randomly vary based on this. Values higher than 1.0 make potential prices 'swingier'. A value of 1.0 causes prices to be consistent.
refuse_anonymous_commsIf true, the merchant won't respond to hails if the user lacks an ID.
refuse_bribesIf TRUE, the merchant cannot be bribed with cash under any circumstances.
refuse_giftsIf TRUE, the merchant will not accept receiving wanted items for free.
refuse_hagglingIf TRUE, the merchant refuses all attempts to haggle buying or selling prices.
remembered_identitiesList of character names (on their IDs) the merchant remembers from prior interactions, along with their individual disposition values.
skill_levelHow good the merchant is at trading, and is compared against players' Finance skills to determine whether the merchant or player has an advantage in negotiations.
speechDecl which contains dialogue shown to players interacting with this merchant.
starting_cash_lower_boundUpper bound for how much cash a merchant can start with.
starting_cash_upper_boundLower bound for how much cash a merchant can start with.
supply_potentialList containing one or more /decl/merchant_potential_commodities, which are used to determine what the merchant could sell to players.
supply_strategyDetermines how supply is initially stocked and how it rotates over time, if at all.
times_complimentedHow many times this merchant received a compliment. Used to punish compliment spam.
typical_duration_lower_boundLower bound for how long this merchant stays, in minutes.
typical_duration_upper_boundUpper bound for how long this merchant stays, in minutes.
will_pay_with_moneyIf false, the merchant cannot give money for items, and players must barter to trade with them.

Procs

adjust_cashAdds or subtracts a specific quantity from the merchant's cash reserves.
adjust_dispositonIncreases or decreases the merchant's opinion of a mob's associated identity by a set amount. Due to disposition multipliers, the actual result may be different or may not actually change anything. Returns the actual change in disposition.
bribeAttempts to bribe the merchant with amount units of value, which will generally increase their disposition and make them stay longer, if applicable. Override for extra behavior when bribed.
calculate_haggle_limitReturns the 'price' of an item that the merchant will still accept, even if it's slightly off from their regular price.
can_be_understoodDetermines if the user can understand what this merchant says. Users who cannot understand merchants will be greatly hindered in interacting with them.
can_bribeDetermines if the merchant is bribable.
can_hailDetermines if the merchant will refuse hails or not. Override for custom hailing rules. Despite the name, interaction will cease if this returns FALSE in the middle of interacting with a merchant, not just the beginning.
complimentAttempts to raise the merchant's disposition with flattery. Note that this returns TRUE even if no disposition is gained, but merely that the merchant took it well.
default_dispositionDetermines the default disposition value for a new identity. This can be overriden to conditionally have merchants have different starting disposition values. One example could be to simulate certain merchants already having a vague opinion on certain kinds of characters, perhaps by pulling from a character's background details.
denying_anonymous_commsReturns TRUE if the merchant doesn't want to interact with scary nameless people.
evaluate_offerReturns TRUE if the merchant would agree to an offer to buy or sell at the inputted price.
find_demand_commodityReturns a commodity instance representing an item in demand, that matches the inputted item instance, if one exists.
find_supply_commodityReturns a commodity instance representing an item being sold, that matches the inputted item instance or type path, if one exists.
generate_inventoryCreates commodity datums out of /decl/merchant_potential_commodity types inside of the relevant [supply|demand]_potential lists.
get_dispositionRetrieves the disposition value for a particular mob instance with an associated 'identity', which is just their name as stated on their ID, if one exists. Merchants will treat mobs with the same identity as being the same person for opinion purposes. This will likely be most common in the case of people without IDs being remembered as 'Unknown'.
get_identityRetrieves a string to be used as a particular mob's 'identity'. Generally it will just be what their ID says, or Unknown if they lack one, as presumably the trading computer reads it off the ID. Using name strings instead of weakrefs to actual mobs opens the door to impersonation as well as letting players have a second chance if they accidentally offended the merchant, by showing up as "Unknown" (assuming nobody else burned that identity as well).
get_item_valueReturns how much the merchant values a particular item.
get_value_of_itemsReturns how much the merchant values a group of items, provided for convenience.
hailDetermines if hailing the merchant succeeded or not.
has_cashReturns whether the merchant has a specific quantity of cash.
insultDeliberately worsens the relationship between the merchant and a mob's associated identity, for whatever reason.
offer_contains_forbidden_itemsReturns TRUE if one or more items in the list are inside of the merchant's list of forbidden types.
offer_contains_wanted_itemsReturns TRUE if all items in the list are in demand by the merchant.
on_completed_transactionCalled after a successful trade, either buying or selling something. Bribes are not considered transactions for that purpose. Override for custom behavior.
on_disposition_changedCalled whenever the merchant's disposition changes. Override for custom behavior when that happens.
pre_hailCalled just before the hail actually happens.
pre_inventory_generationCalled just before merchant inventory is built. This exists mostly for cross-modpack interactions to inject their items into a particular merchant type.
processCalled by the trade hub once a minute.
remember_identityCommits a newly encountered identity to the merchant's memory, giving it a default opinion value. Called automatically if the merchant fails to pull an already existing identity from remembered_identities.
scramble_responseGarbles the text based on the merchant's languages. Generally you want to check and then scramble just before serving the text to each player, so that different players will see what they're supposed to see.
set_dispositionSets the merchant's opinion of a mob's associated identity to a specific value, no matter what.
setup_inventoryDetermines which items are put into active and inactive 'supply' and 'demand' lists, based on the merchant's [supply|demand]_strategy decls.
transaction_disposition_shiftCalled after a successful trade, awarding disposition based on how much value the merchant bought or sold.

Var Details

HIGH_DISPOSITION_THRESHOLD

Disposition values at or above this value are considered to be 'high' for certain purposes.

MAX_DISPOSITION_THRESHOLD

Disposition values above this value cease to have any additional effect for certain purposes.

TRANSACTION_BUYING

Indicates a transaction where the merchant is buying from players.

TRANSACTION_SELLING

Indicates a transaction where the merchant is selling to players.

accepts_goods_as_payment

Whether or not the merchant accepts items as payment. This must be TRUE for barter to be possible.

accepts_money_as_payment

Whether or not the merchant accepts money as payment.

active_demand

List of commodities that the merchant wants to buy from players.

active_supply

List of commodities that are presently being offered for sale.

bribe_disposition_divisor

Determines how much disposition goes up when bribed, by dividing the bribe amount by this value.

bribe_duration_divisor

Determines how much longer, in minutes, merchants will stay when bribed (if they are temporary), by dividing the bribe amount by this value.

comms_refusal_threshold

Merchants will refuse to interact with anyone who has this amount of disposition, or lower.

currency_used

The currency used by the merchant. If unset, the map's default currency is used instead.

current_cash

How much cash the merchant currently has. If set to null, the merchant has unlimited funds.

demand_potential

List containing one or more /decl/merchant_potential_commodities, which are used to determine what the merchant wants to buy from players.

demand_strategy

Determines how demand is initially stocked and how it rotates over time, if at all.

duration_of_stay

How long the merchant is planning to stay, in minutes. Set automatically on init if is_temporary_merchant is true.

forbidden_objects

List of type paths the merchant refuses to buy, with a unique dialogue compared to regular junk.

haggle_disposition_penalty

Scales how far disposition drops when players try to offer bad deals to this merchant. Higher numbers make the merchants get fed up faster.

haggling_refusal_threshold

Determines how far away from the merchant's perferred price players can haggle for. The actual threshold is randomized to be between 0 and this value.

hub

The trade hub which this merchant is located at.

inactive_demand

List of commodities that didn't make the cut for active_demand.

inactive_supply

List of commodities that didn't make the cut for active_supply.

is_temporary_merchant

If true, the merchant will eventually leave their hub, and players won't be able to interact with them anymore. This can be changed in-round to make temp. merchants stay.

merchant_languages

List of languages which the merchant communicates with. Players who do not possess at least one of these cannot easily interact with the merchant, and the text will be scrambled in the UI.

name

The merchant's name, shown in the UI to players. If blank, a random name will be generated.

name_background

Background decl which will generate a random name for the merchant, overwriting it, if it is set.

negative_disposition_multiplier

Multiplies how easy it is to lower disposition with this merchant.

origin

Where the merchant is trading from, or in other words, the store's name. Shown in the UI.

positive_disposition_multiplier

Multiplies how easy it is to raise disposition with this merchant.

possible_origins

If set, origin is replaced by one of these randomly at init.

price_variance

Object values can randomly vary based on this. Values higher than 1.0 make potential prices 'swingier'. A value of 1.0 causes prices to be consistent.

refuse_anonymous_comms

If true, the merchant won't respond to hails if the user lacks an ID.

refuse_bribes

If TRUE, the merchant cannot be bribed with cash under any circumstances.

refuse_gifts

If TRUE, the merchant will not accept receiving wanted items for free.

refuse_haggling

If TRUE, the merchant refuses all attempts to haggle buying or selling prices.

remembered_identities

List of character names (on their IDs) the merchant remembers from prior interactions, along with their individual disposition values.

skill_level

How good the merchant is at trading, and is compared against players' Finance skills to determine whether the merchant or player has an advantage in negotiations.

speech

Decl which contains dialogue shown to players interacting with this merchant.

starting_cash_lower_bound

Upper bound for how much cash a merchant can start with.

starting_cash_upper_bound

Lower bound for how much cash a merchant can start with.

supply_potential

List containing one or more /decl/merchant_potential_commodities, which are used to determine what the merchant could sell to players.

supply_strategy

Determines how supply is initially stocked and how it rotates over time, if at all.

times_complimented

How many times this merchant received a compliment. Used to punish compliment spam.

typical_duration_lower_bound

Lower bound for how long this merchant stays, in minutes.

typical_duration_upper_bound

Upper bound for how long this merchant stays, in minutes.

will_pay_with_money

If false, the merchant cannot give money for items, and players must barter to trade with them.

Proc Details

adjust_cash

Adds or subtracts a specific quantity from the merchant's cash reserves.

adjust_dispositon

Increases or decreases the merchant's opinion of a mob's associated identity by a set amount. Due to disposition multipliers, the actual result may be different or may not actually change anything. Returns the actual change in disposition.

bribe

Attempts to bribe the merchant with amount units of value, which will generally increase their disposition and make them stay longer, if applicable. Override for extra behavior when bribed.

calculate_haggle_limit

Returns the 'price' of an item that the merchant will still accept, even if it's slightly off from their regular price.

can_be_understood

Determines if the user can understand what this merchant says. Users who cannot understand merchants will be greatly hindered in interacting with them.

can_bribe

Determines if the merchant is bribable.

can_hail

Determines if the merchant will refuse hails or not. Override for custom hailing rules. Despite the name, interaction will cease if this returns FALSE in the middle of interacting with a merchant, not just the beginning.

compliment

Attempts to raise the merchant's disposition with flattery. Note that this returns TRUE even if no disposition is gained, but merely that the merchant took it well.

default_disposition

Determines the default disposition value for a new identity. This can be overriden to conditionally have merchants have different starting disposition values. One example could be to simulate certain merchants already having a vague opinion on certain kinds of characters, perhaps by pulling from a character's background details.

denying_anonymous_comms

Returns TRUE if the merchant doesn't want to interact with scary nameless people.

evaluate_offer

Returns TRUE if the merchant would agree to an offer to buy or sell at the inputted price.

find_demand_commodity

Returns a commodity instance representing an item in demand, that matches the inputted item instance, if one exists.

find_supply_commodity

Returns a commodity instance representing an item being sold, that matches the inputted item instance or type path, if one exists.

generate_inventory

Creates commodity datums out of /decl/merchant_potential_commodity types inside of the relevant [supply|demand]_potential lists.

get_disposition

Retrieves the disposition value for a particular mob instance with an associated 'identity', which is just their name as stated on their ID, if one exists. Merchants will treat mobs with the same identity as being the same person for opinion purposes. This will likely be most common in the case of people without IDs being remembered as 'Unknown'.

get_identity

Retrieves a string to be used as a particular mob's 'identity'. Generally it will just be what their ID says, or Unknown if they lack one, as presumably the trading computer reads it off the ID. Using name strings instead of weakrefs to actual mobs opens the door to impersonation as well as letting players have a second chance if they accidentally offended the merchant, by showing up as "Unknown" (assuming nobody else burned that identity as well).

get_item_value

Returns how much the merchant values a particular item.

get_value_of_items

Returns how much the merchant values a group of items, provided for convenience.

hail

Determines if hailing the merchant succeeded or not.

has_cash

Returns whether the merchant has a specific quantity of cash.

insult

Deliberately worsens the relationship between the merchant and a mob's associated identity, for whatever reason.

offer_contains_forbidden_items

Returns TRUE if one or more items in the list are inside of the merchant's list of forbidden types.

offer_contains_wanted_items

Returns TRUE if all items in the list are in demand by the merchant.

on_completed_transaction

Called after a successful trade, either buying or selling something. Bribes are not considered transactions for that purpose. Override for custom behavior.

on_disposition_changed

Called whenever the merchant's disposition changes. Override for custom behavior when that happens.

pre_hail

Called just before the hail actually happens.

pre_inventory_generation

Called just before merchant inventory is built. This exists mostly for cross-modpack interactions to inject their items into a particular merchant type.

process

Called by the trade hub once a minute.

remember_identity

Commits a newly encountered identity to the merchant's memory, giving it a default opinion value. Called automatically if the merchant fails to pull an already existing identity from remembered_identities.

scramble_response

Garbles the text based on the merchant's languages. Generally you want to check and then scramble just before serving the text to each player, so that different players will see what they're supposed to see.

set_disposition

Sets the merchant's opinion of a mob's associated identity to a specific value, no matter what.

setup_inventory

Determines which items are put into active and inactive 'supply' and 'demand' lists, based on the merchant's [supply|demand]_strategy decls.

transaction_disposition_shift

Called after a successful trade, awarding disposition based on how much value the merchant bought or sold.