Cosmos Journeyer API Documentation - v1.10.1
    Preparing search index...

    General mission abstraction. The mission can have any arbitrary task tree and reward. If you want to create new mission archetypes, you should register a new enum variant in MissionType

    Index

    Constructors

    • Creates a new mission

      Parameters

      • tree: MissionNode

        The task tree that the player has to complete to finish the mission

      • reward: number

        The reward that the player gets for completing the mission

      • missionGiver: {
            idInSystem: string;
            systemCoordinates: {
                localX: number;
                localY: number;
                localZ: number;
                starSectorX: number;
                starSectorY: number;
                starSectorZ: number;
            };
        }

        The space station that gave the mission

        • idInSystem: string
        • systemCoordinates: {
              localX: number;
              localY: number;
              localZ: number;
              starSectorX: number;
              starSectorY: number;
              starSectorZ: number;
          }

          The coordinates of the star system.

          • localX: number

            Floating point X coordinate of the star system inside the star sector. Must be between -0.5 and 0.5.

          • localY: number

            Floating point Y coordinate of the star system inside the star sector. Must be between -0.5 and 0.5.

          • localZ: number

            Floating point Z coordinate of the star system inside the star sector. Must be between -0.5 and 0.5.

          • starSectorX: number

            Integer coordinates of the star sector along the universe X axis

          • starSectorY: number

            Integer coordinates of the star sector along the universe Y axis

          • starSectorZ: number

            Integer coordinates of the star sector along the universe Z axis

      • missionType: MissionType

        The type of the mission (useful for displaying localized strings)

      Returns Mission

    Properties

    missionGiver: {
        idInSystem: string;
        systemCoordinates: {
            localX: number;
            localY: number;
            localZ: number;
            starSectorX: number;
            starSectorY: number;
            starSectorZ: number;
        };
    }

    The space station that gave the mission

    Type declaration

    • idInSystem: string
    • systemCoordinates: {
          localX: number;
          localY: number;
          localZ: number;
          starSectorX: number;
          starSectorY: number;
          starSectorZ: number;
      }

      The coordinates of the star system.

      • localX: number

        Floating point X coordinate of the star system inside the star sector. Must be between -0.5 and 0.5.

      • localY: number

        Floating point Y coordinate of the star system inside the star sector. Must be between -0.5 and 0.5.

      • localZ: number

        Floating point Z coordinate of the star system inside the star sector. Must be between -0.5 and 0.5.

      • starSectorX: number

        Integer coordinates of the star sector along the universe X axis

      • starSectorY: number

        Integer coordinates of the star sector along the universe Y axis

      • starSectorZ: number

        Integer coordinates of the star sector along the universe Z axis

    missionType: MissionType

    The type of the mission (useful for displaying localized strings)

    reward: number

    The reward that the player gets for completing the mission

    The task tree that the player has to complete to finish the mission

    Methods

    • Returns all the current target systems that the player has to visit to complete the mission

      Returns {
          localX: number;
          localY: number;
          localZ: number;
          starSectorX: number;
          starSectorY: number;
          starSectorZ: number;
      }[]

      • localX: number

        Floating point X coordinate of the star system inside the star sector. Must be between -0.5 and 0.5.

      • localY: number

        Floating point Y coordinate of the star system inside the star sector. Must be between -0.5 and 0.5.

      • localZ: number

        Floating point Z coordinate of the star system inside the star sector. Must be between -0.5 and 0.5.

      • starSectorX: number

        Integer coordinates of the star sector along the universe X axis

      • starSectorY: number

        Integer coordinates of the star sector along the universe Y axis

      • starSectorZ: number

        Integer coordinates of the star sector along the universe Z axis

    • Serializes the mission to a JSON object for storage in save files

      Returns {
          missionGiver: {
              idInSystem: string;
              systemCoordinates: {
                  localX: number;
                  localY: number;
                  localZ: number;
                  starSectorX: number;
                  starSectorY: number;
                  starSectorZ: number;
              };
          };
          reward: number;
          tree: MissionNodeSerializedShape;
          type: MissionType;
      }

    • Parameters

      • missionSerialized: {
            missionGiver: {
                idInSystem: string;
                systemCoordinates: {
                    localX: number;
                    localY: number;
                    localZ: number;
                    starSectorX: number;
                    starSectorY: number;
                    starSectorZ: number;
                };
            };
            reward: number;
            tree: MissionNodeSerializedShape;
            type: MissionType;
        }
      • starSystemDatabase: StarSystemDatabase

      Returns null | Mission