Jump to content

[Help] Advanced Mapping API


ApacheTech

Recommended Posts

So, I've finally got around to looking into modding, and I'd like to start with something that I thought would be fairly easy, but now I'm looking into it, I'm finding myself stumbling.

The "Advanced Mapping" code mod I would like to create has a few functions:

  • .advmap connect [waypointId1] [waypointId2] - Connects two waypoints together, making it easier to see where translocators and teleporters connect to. When either waypoint is hovered over, the connecting line will show on the map, allowing you to easily locate the other endpoint. When either waypoint is pinned, the line will remain visible on the map. The child endpoint will adopt the same name, and colour as the parent, as will the line between them.
  • .advmap disconnect [waypointId] - Disconnects all endpoints from a waypoint node. When a waypoint is deleted, all connections are disconnected.
  • .advmap show-all-connections [true|false] - Effectively pins any connected waypoints, showing all connecting lines on the map.
  • .advmap centre-map - Recentres the map on the player.
  • .advmap follow [true|false] - Updates the position on the map, as the player moves, so you will always remain in the centre of the map.

Some of this is pretty easy, but I'm having trouble interacting with waypoints. I assumed that there would be an IWaypoint contract that I could extend, but I see very little within the API that interacts with the map, or with waypoints, at all. Would I have to build my own waypoint repository and contract strategy?

I'm also unsure as to how to render the line to the map, although I haven't looked into that yet. Just thinking ahead as I start coding this thing.

I've been using https://apidocs.vintagestory.at/api/index.html as a reference, as well as intellisense, but can't quite understand how to interact with the map, and with waypoints. If possible, I'd like to keep this as a client-side mod, so that it's not a requirement for people on SMP servers.

 

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.