Viv JavaScript Runtime - v0.10.2
    Preparing search index...

    Function queuePlan

    • Invokes the Viv planner to force queueing of the specific given plan.

      This function can be useful for debugging, and it can also support designs where a host application takes a more direct role in narrative control. For instance, a host application might implement something like a drama manager that decides to orchestrate high-level logic around actions that should be pursued. For instance, the drama manager could decide that a particular character should begin to pursue some course of action that is captured in a plan, which can be precipitated by passing that plan along here. Of course, plans can always be selected in the course of normal Viv operation, but it can be also be useful to force plan queueing to assert more fine-grained control.

      Parameters

      Returns Promise<string>

      const planID = await queuePlan({
      planName: "move-to-big-city",
      urgent: true,
      precastBindings: { "mover": ["cid-alice"], "city": ["cid-nyc"] },
      causes: ["aid-824"]
      });
      console.log(`Queued plan with UID '${planID}'`);

      VivNotInitializedError If Viv is not initialized.

      VivInterpreterError If the Viv interpreter encounters an issue in the course of plan queueing.

      VivValidationError If the supplied args do not conform to the expected schema.

      VivValidationError If there is no defined plan with the given planName.

      VivValidationError If causes is provided, but contains something other than an entity ID for an action.