drincs-productions/nqtr

nqtr-routine

Use when scheduling NQTR character routines — CommitmentBaseModel (where a character is at a given time), RegisteredCommitments, timeSlot/dateScheduling/priority/executionType, linking at init (routine in the room constructor) vs runtime (room.addCommitment…

ソースを見る

使い方

  1. インストールコマンドをコピーし、自分の環境へ導入する前にソースを確認します。
  2. 必要なツール、認証情報、対応環境を原文で確認します。
  3. 入力と成果物を指定し、出力を資料と照合します。
npx skills add https://github.com/drincs-productions/nqtr --skill nqtr-routine

開始前の確認

  • 導入にはモデル契約、API枠、ファイルへのアクセス許可は含まれません。
  • スター数や導入数は活動の指標であり、独立した品質・安全性試験ではありません。
リポジトリの原文

見出し、例、コード、表、リンク、参照画像を含む原文を表示しています。

NQTR routine (commitments)

Official docs: pixi-vn.com/nqtr/routine. Index: nqtr. Ink commands: nqtr-ink.

A commitment says that a character is busy in a room during a time slot. The routine is the set of commitments active now; it decides which characters are in the current room and what happens when the player interacts with them.

Initialize

new CommitmentBaseModel(id, character | characters | undefined, props), then RegisteredCommitments.add(...) (required). character is a character id/instance, or an array.

ts
import { CommitmentBaseModel, RegisteredCommitments } from "@drincs/nqtr";
import { narration } from "@drincs/pixi-vn";

export const aliceSleep = new CommitmentBaseModel("alice_sleep", "alice", {
    priority: 1,
    timeSlot: { from: 20, to: 10 }, // wraps over midnight
    onRun: async (_, props) => {
        await props.navigate({ to: "/game/narration" });
        await narration.jump("talk_alice_sleep", props);
    },
});

RegisteredCommitments.add(aliceSleep);

CommitmentProps: name, timeSlot, dateScheduling, image, icon, onRun, disabled/hidden (boolean or flag name), priority (default 0), executionType.

  • executionType: "interaction" (default): onRun runs when the player interacts with the character. "automatic": onRun runs automatically when the player enters the room — remove the commitment when no longer needed or it repeats every time.
  • A disabled commitment is ignored, so the character is not in the room but free for other commitments.
  • A character cannot be in two places: among valid simultaneous commitments of the same character the highest priority wins; by default runtime-added commitments beat init-time ones.

Link (one commitment → one room)

  1. At initialization — routine: ["alice_sleep"] in the RoomBaseModel constructor. Not saved.
  2. During the game — saved with the game.
ink
# add routine alice_smokes in terrace
ts
terrace.addCommitment("alice_smokes");

Unlink

Init-time links cannot be removed: add a higher-priority commitment for the same character and time slot instead. Runtime links:

ink
# remove routine alice_smokes
ts
import { routine } from "@drincs/nqtr";
routine.remove("alice_smokes");       // optional second argument: roomId

Query

RegisteredCommitments.get(id) / .values(). routine.currentRoutine (active commitments), routine.roomCommitments[roomId], routine.characterCommitments[characterId], routine.getCommitmentByCharacter(...), routine.clearExpiredRoutine().

Custom class

Extend CommitmentStoredClass (super(id, characters, props.onRun, props)), implement CommitmentInterface, augment it in nqtr.d.ts (name, sprite?, background?, icon?, disabled, hidden). Persist disabled/hidden with getStorageProperty/setStorageProperty, override isActive (false when hidden) and run (invalidate UI afterwards), like the templates.

Pitfalls

  • Commitments depend on time: nothing changes until time advances (# wait).
  • Forgetting RegisteredCommitments.add or the character not being registered.
同じリポジトリから

関連する Skills

すべての Skills
drincs-productions
コミュニティ

nqtr

Index and entry point of the NQTR skill set — start here for any task on a project using @drincs/nqtr (Navigation Quest Time Routine), then follow the skill map to the right skill (navigation, time, activity, routine, quest, ink). Use when installing/configuring @drincs/nqtr, wiring vitePluginNqtr, overriding OnRunProps or the Interface types in nqtr.d.ts, writing custom Room/Location/Map/Activity/Commitment/Quest classes, or deciding whether to write NQTR logic in ink or TypeScript.

1時間の導入数
3
GitHub Stars
2
更新日
11月17日
drincs-productions
コミュニティ

nqtr-activity

Use when creating NQTR activities (actions the player can take, linked to rooms/locations/maps) — ActivityBaseModel, RegisteredActivities, linking at init (activities in the room constructor) vs at runtime (room.addActivity / " add activity X in room"), unlinking, timeSlot/dateScheduling, disabled/hidden, and custom Activity classes.

1時間の導入数
3
GitHub Stars
2
更新日
11月17日
drincs-productions
コミュニティ

nqtr-ink

Use when writing .ink files in a Pixi'VN project that uses @drincs/nqtr — every NQTR hashtag command ( enter room, set time, set date, wait, add/remove activity, add/remove routine, start/continue quest) and the quest state variables (questIdstarted, completed, failed, currentStageIndex), plus createNqtrHandler setup and options. Prefer this over TypeScript labels whenever ink is configured.

1時間の導入数
3
GitHub Stars
2
更新日
11月17日
drincs-productions
コミュニティ

nqtr-navigation

Use when defining or navigating NQTR rooms, locations and maps — RoomBaseModel/LocationBaseModel/MapBaseModel, RegisteredRooms/RegisteredLocations/RegisteredMaps, navigator.currentRoom, " enter room" in ink, entrance rooms, and custom Room/Location/Map classes. Navigation is the base of NQTR; activities and routines attach to it.

1時間の導入数
3
GitHub Stars
2
更新日
11月17日