Modding:Phone calls
← Index
This page explains phone calls. This is an advanced guide for mod developers.
Incoming calls format
You can add or customize incoming calls by editing the Data/IncomingPhoneCalls asset.
This consists of a string → model lookup, where...
- The key is a unique string ID for the incoming call data.
- The value is a model with the fields listed below.
field | effect |
---|---|
Dialogue | The dialogue text to show when the player answers the phone. This can use the full dialogue format (including questions and different dialogue based on the selected answer). |
FromNpc | (Optional) The internal name of the NPC making the call. If specified, that NPC's name and portrait will be shown. |
FromPortrait | (Optional) The asset name for the portrait spritesheet to display (like Portraits/Abigail). If FromNpc is specified too, this overrides the portrait from that NPC. If both FromNpc and FromDisplayName are null, this portrait will be shown with the display name "???". |
FromDisplayName | (Optional) A tokenizable string for the calling NPC's display name. If FromNpc is specified too, this overrides the display name from that NPC. |
MaxCalls | (Optional) The maximum number of times a player can receive this phone call, or -1 for no limit. Default 1. |
TriggerCondition RingCondition |
(Optional) If set, a game state query which indicates whether to trigger this phone call (TriggerCondition) or whether the phone rings when this call is received (RingCondition).
Whether a player receives this call depends on both fields: TriggerCondition is checked on the main player before sending the call to all players, then RingCondition is checked on each player to determine whether the phone rings for them. |
IgnoreBaseChance | (Optional) Whether to ignore the 1% base chance when checking whether to trigger an incoming call. If true, the game will check if this call can be received regardless of the base chance. Default false. |
SimpleDialogueSplitBy | (Optional, specialized) If set, marks the call as having a simple dialogue string without an NPC name and portrait, with lines split into multiple boxes by this substring. For example, "SimpleDialogueSplitBy": "#" will split Box A#Box B#Box C into three consecutive dialogue boxes.
You should omit this in most cases, and use the regular dialogue format in Dialogue to split lines if needed. This is mainly intended to support some older vanilla phone calls. |
CustomFields | The custom fields for this entry. |
Custom handlers in C#
C# mods can implement StardewValley.PhoneCalls.IPhoneHandler and add it to Phone.PhoneHandlers for full control over both incoming and outgoing calls:
/// <summary>The mod entry point.</summary>
internal sealed class ModEntry : Mod
{
/// <inheritdoc />
public override void Entry(IModHelper helper)
{
Phone.PhoneHandlers.Add(new CustomPhoneHandler());
}
}
/// <summary>A custom phone handler.</summary>
internal sealed class CustomPhoneHandler : IPhoneHandler
{
...
}
See StardewValley.PhoneCalls.DefaultPhoneHandler in the decompiled game code for an example implementation.