drincs-productions/nqtr

nqtr-quest

Use when creating or driving NQTR quests — QuestBaseModel with StageBaseModel stages (onStart, deltaDateRequired, flags, questsRequired), RegisteredQuests, start/continue/advanceIfCompleted, failing a quest, state queries (started, completed, failed, curren…

Quelltext ansehen

Verwendung

  1. Installationsbefehl kopieren und das Quellpaket vor der Installation in der eigenen Agentenumgebung prüfen.
  2. Benötigte Werkzeuge, Zugangsdaten und Hosts im Original prüfen.
  3. Eingabe und gewünschtes Ergebnis beschreiben und die Ausgabe mit den Quellen abgleichen.
npx skills add https://github.com/drincs-productions/nqtr --skill nqtr-quest

Vor dem Start

  • Die Installation umfasst weder Modellabo noch API-Kontingent oder Dateizugriffsrechte.
  • Sterne und Installationen zeigen Aktivität, keine unabhängige Qualitäts- oder Sicherheitsprüfung.
Originales Skill-Dokument

Aus dem Quell-Repository gerendert; Überschriften, Beispiele, Code, Tabellen, Links und Bilder bleiben erhalten.

NQTR quests

Official docs: pixi-vn.com/nqtr/quest. Index: nqtr. Ink commands and variables: nqtr-ink.

A quest is an ordered list of stages. Starting it enters stage 0; continuing moves to the next stage; after the last stage the quest is completed.

Initialize

new QuestBaseModel(id, stages, props); new StageBaseModel(id, props). Register with RegisteredQuests.add(...) (required). Stage onStart is the place to link activities/commitments that make the stage playable.

ts
import { QuestBaseModel, RegisteredQuests, StageBaseModel } from "@drincs/nqtr";
import { mcRoom, terrace } from "@/content/rooms";

export const aliceQuest = new QuestBaseModel(
    "aliceQuest",
    [
        new StageBaseModel("talk_alice1", {
            name: "Talk to Alice",
            description: "Talk to Alice on the terrace",
            onStart: () => terrace.addCommitment("alice_quest_talk"),
        }),
        new StageBaseModel("order_products", {
            name: "Order products",
            description: "Order the products with your PC",
            onStart: () => mcRoom.addActivity("order_product"),
        }),
        new StageBaseModel("take_products", {
            name: "Take products",
            description: "Take products on the Terrace",
            requestDescriptionToStart: "Wait for the products (2 days)",
            deltaDateRequired: 2,
            onStart: (_, { toast }) => {
                terrace.addActivity("take_product");
                toast("You can take the products on the Terrace");
            },
        }),
    ],
    {
        name: "Help Alice",
        description: "...",
        image: "alice_terrace0A",
        onStart: (quest, { toast }) => toast(`${quest.name} started`),
        onContinue: (stage, { toast }) => toast(`${stage.name} updated`),
    },
);

RegisteredQuests.add(aliceQuest);

QuestProps: name, description, icon, image, inDevelopment, onStart, onContinue (onNextStage is deprecated). StageProps: name, description, adviceDescription, image, flags / flagsRequired ({ flag, description } — Pixi'VN flag names), questsRequired ({ quest, stageNumber }), deltaDateRequired (days after the previous stage ended), requestDescriptionToStart, onStart, onEnd.

Start / continue

Prefer ink when configured:

ink
=== start ===
# start quest aliceQuest
-> DONE

=== alice_gave_book ===
# continue quest aliceQuest
-> DONE
ts
await aliceQuest.start(props);     // OnRunProps; pass {} if none
await aliceQuest.continue(props);  // completes current stage and goes on, unconditionally
await aliceQuest.advanceIfCompleted(props); // only if the current stage is completed (flags, etc.)

advanceUnconditionally(props) skips the completed check. continue is what # continue quest calls. advanceIfCompleted has no ink command.

Query

TypeScriptink variable
quest.startedaliceQuest_started
quest.completedaliceQuest_completed
quest.failedaliceQuest_failed
quest.currentStageIndexaliceQuest_currentStageIndex

Also quest.inProgress, quest.currentStage, quest.stages. currentStageIndex goes from 0 to stages.length - 1, and equals stages.length when completed. In ink use a conditional on the index to select the dialogue per stage:

ink
{ aliceQuest_currentStageIndex:
- 0: -> talk_alice0
- 1: -> talk_alice1
- else: alice: Thanks again.
}

Fail

aliceQuest.failed = true; in TypeScript (no ink command by default; register a custom hashtag command if you need one).

Get

RegisteredQuests.get(id) / .values().

Custom class

Extend QuestStoredClass (super(id, stages, props) with QuestStoredClassProps), implement QuestInterface, augment it in nqtr.d.ts with name, description, image?, inDevelopment.

Pitfalls

  • Stage onStart runs when the stage becomes current; with deltaDateRequired/questsRequired it may start later (currentStageMustStart, startCurrentStage are system functions).
  • # continue quest on a quest that is not started does nothing useful: start it first (# start quest).
  • Quest variables in ink are read-only and must not be declared with VAR.
aus demselben Repository

Weitere Skills

Alle Skills
drincs-productions
Community

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.

Installationen / 1h
3
GitHub Stars
2
Aktualisiert
17. Nov.
drincs-productions
Community

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.

Installationen / 1h
3
GitHub Stars
2
Aktualisiert
17. Nov.
drincs-productions
Community

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.

Installationen / 1h
3
GitHub Stars
2
Aktualisiert
17. Nov.
drincs-productions
Community

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.

Installationen / 1h
3
GitHub Stars
2
Aktualisiert
17. Nov.