Mode d’emploi
- Copiez la commande et examinez le paquet avant de l’installer dans votre environnement agent.
- Consultez le document original pour les outils, identifiants et environnements requis.
- Décrivez les entrées et le livrable souhaité ; comparez la sortie aux sources.
npx skills add https://github.com/drincs-productions/nqtr --skill nqtr-routineAvant de commencer
- L’installation n’inclut ni abonnement au modèle, ni quota API, ni accès aux fichiers.
- Étoiles et installations reflètent l’activité, pas un test indépendant de qualité ou de sécurité.
Rendu depuis le dépôt source en conservant titres, exemples, code, tableaux, liens et images.
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.
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):onRunruns when the player interacts with the character."automatic":onRunruns 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
prioritywins; by default runtime-added commitments beat init-time ones.
Link (one commitment → one room)
- At initialization —
routine: ["alice_sleep"]in theRoomBaseModelconstructor. Not saved. - During the game — saved with the game.
# add routine alice_smokes in terraceterrace.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:
# remove routine alice_smokesimport { routine } from "@drincs/nqtr";
routine.remove("alice_smokes"); // optional second argument: roomIdQuery
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.addor the character not being registered.