Modding Help Private Teleporter Network

Discussion in 'Starbound Modding' started by swefpifh, Nov 20, 2017.

  1. swefpifh

    swefpifh Scruffy Nerf-Herder

    Hello everyone, i have a question.

    I create a mod and i need a private network teleporter system.

    I found this in "Interface/warping" folder, but it hides all the coordinates :
    Code:
    "canBookmark" : true,
    "includePartyMembers" : false,
    "includePlayerBookmarks" : false,
    
    I want hide all coordinates vanilla bookmarks without hide coordonates created with my special object. Its possible ?

    Thanks in advance.
     
  2. bk3k

    bk3k Oxygen Tank

    Yes lets look at the whole returnark.config file
    Code:
    {
      "canBookmark" : false,
      "includePartyMembers" : false,
      "includePlayerBookmarks" : false,
      "destinations" : [
        {
          "name" : "Back to the Ark",
          "planetName" : "Return to the Ark ruins",
          "warpAction" : "InstanceWorld:outpost=arkteleporter",
          "icon" : "outpost"
        }
      ]
    }
    in which case this is a single destination already plugged into it
    Code:
        {
          "name" : "Back to the Ark",
          "planetName" : "Return to the Ark ruins",
          "warpAction" : "InstanceWorld:outpost=arkteleporter",
          "icon" : "outpost"
        }
    You can add more destinations just like so -
    Code:
    {
      "canBookmark" : false,
      "includePartyMembers" : false,
      "includePlayerBookmarks" : false,
      "destinations" : [
        {
          "name" : "Back to the Ark",
          "planetName" : "Return to the Ark ruins",
          "warpAction" : "InstanceWorld:outpost=arkteleporter",
          "icon" : "outpost"
        },
        {
          "name" : "Back to Ship",
          "planetName" : "Leave this world behind",
          "warpAction" : "OwnShip",
          "icon" : "beamup"
        }
      ]
    }
    That would work and isn't complex at all, but hard-coding the destinations for your private network doesn't sound as useful. Fortunately you can script your teleporter, and the interface which is passed by the object(upon interaction) can be altered prior to being passed.

    Just a small example script -
    Code:
    init = function()
      object.setInteractive(true)
    end
    
    
    onInteraction = function(args)
      local action, data
      action = config.getParameter("interactAction")
      data = config.getParameter("interactData", {})
      
      if type(data) == "string" then
        data = root.assetJson(data.config)  --full UI config
      end
    
      data.destinations = data.destinations or {}
    
      return { action, data }
    end
    
    Before you return the data, you could easily add additional teleport destinations into data.destinations. The next question being how you get that data from one teleporter to another. I'm thinking something like the teleporters could spawn an item containing their data and the objects look for this. Or maybe you have a better idea.

    Another minor thing is that I've used examples of "InstanceWorld:eek:utpost=arkteleporter" and "OwnShip" but neither of those include actual coordinate data. I could guess what the actual coordinate data looks like, but it would be more useful to see actual player bookmark data to be sure.
     
  3. swefpifh

    swefpifh Scruffy Nerf-Herder

    Hello, thx for your answer. My mod is based on the stargate franchise.

    Basically, what I want is to be able to isolate the coordinates vanilla teleporters and vanilla flags so that it does not appear in the list of a custom teleporter. But that this custom teleporter displays only the coordinates of the same custom teleporters found on every planet.

    The goal would be to see only the addresses of the stargate in the list of the same object.

    ...And i haven't skill for coding. :(
     

Share This Page