Is it possible (and/or advisable) to make use of the existing Navigation marker system, but, instead of using it with the built-in navigation hud I want to display the navigation markers in my own map system?

I would also like to allow the player to set up their own custom navigation markers at runtime and have the position of these markers saved when the game is saved.
  • You can access the navigation markers via Maki.Game.Scene, e.g. to get all markers of a defined type:
    List<NavigationMarker> list = Maki.Game.Scene.GetNavigationMarkers("type");

    Also, each marker can have multiple positions, you can see how many via the marker's Count property and access them like this:
    for(int i = 0; i < marker.Count; i++)
    {
    Vector3 position = marker[i];
    }


    And you can set a navigation marker like this:
    Maki.Game.Scene.SetNavigationMarker("markerName", marker);
    marker being a NavigationMarker instance, which you can just create and set it's data.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited March 2023
    So few more things for clarification.

    1. You don't necessarily need a navigation marker component to set up a marker. This means you can either use the navigation marker component to manually place a marker in the scene. Or you can do it via script through the API mentioned above.

    2. Once a marker has been set does ORK manage the serialization of its position or do you need to reset the position every time the game is booted up?

    3.
    each marker can have multiple positions
    So when creating a marker instance you can assign several positions to a marker?

    4. I could probably verify this myself, but when you bind a marker to a quest do you still need to setup up the maker manually either by placing navigation marker components or via script? Also when a Quest is activated/deactivated are the markers toggled on and off? Or they don't react at all and you have to toggle related quest markers manually?
    Post edited by CobaltBlue73 on
  • 1) That's just a convinience component to add navigation information to a game object and have it handle adding/removing that marker based on the game object being active or not.
    Markers can be added or removed via scripting as explaind above.

    2) Navigation markers are saved with save games. So save/load will take care of the markers for you.

    3) Yes - there's the AddPosition function for that.
    Or, if the marker searches for game objects in the scene (e.g. by name) it'll also be able to use multiple game objects.

    4) The quest/task automatically takes care of the markers you set up for it. Only an active quest will do that, so an inactive quest's markers are off.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.