Table of Contents

Class NPCMessaging

Namespace
S1API.Entities
Assembly
S1API.dll

Provides conversation state, events, and messaging helpers for an NPC.

public sealed class NPCMessaging
Inheritance
NPCMessaging
Inherited Members
Extension Methods

Properties

HasUnreadMessages

Gets whether the NPC's conversation is currently marked as unread.

public bool HasUnreadMessages { get; }

Property Value

bool

Remarks

This reflects the game's conversation-level state, not per-message read receipts.

IsOpen

Gets whether the NPC's conversation is currently open in the phone's Messages app.

public bool IsOpen { get; }

Property Value

bool

IsRead

Gets whether the NPC's conversation is currently marked as read.

public bool IsRead { get; }

Property Value

bool

Remarks

A conversation that has not been created yet is treated as read.

Methods

SendTextMessage(string, Response[]?, float, bool)

Sends a text message from this NPC to the players.

public void SendTextMessage(string message, Response[]? responses = null, float responseDelay = 1, bool network = true)

Parameters

message string

The message to display. Unity rich text is allowed.

responses Response[]

Optional responses to display after the message.

responseDelay float

The delay before the player can select a response.

network bool

Whether the message should propagate to all players.

Events

OnConversationOpened

Occurs when the player opens the NPC's conversation in the phone's Messages app.

public event Action OnConversationOpened

Event Type

Action

Remarks

The event is raised again each time the conversation is closed and reopened.