Modding Help Pre-wired rail system on player ship

Discussion in 'Starbound Modding' started by Viikoreaux, May 24, 2019.

  1. Viikoreaux

    Viikoreaux Space Spelunker

    Has this been done, can it be done, and how? I'm looking to set up a stationtram elevator system similar to a station on my race mod's ship.
     
  2. Max17

    Max17 Scruffy Nerf-Herder

    I'm not sure whatsoever, but maybe you could use the same old image system dungeons used to use. I have no idea if you can use the same parameters though for a ship in the blockKey.config but you could certainly try. An example of the old image system can be found here along with their key ( \dungeons\avian\aviantemple ), an avian temple that still uses that system to this day. Take a look in the .dungeon file for how the color codes are set up. (No idea why they haven't updated all of these dungeons to the new json stuff, including the player ships. Would be great to have that updated and more manageable).
     
  3. bk3k

    bk3k Oxygen Tank

    To have it pre-wired, I think you'd need to deploy a dungeon. To deploy the dungeon, you'd need to make an object specifically to do this - namely a script that spawns the dungeon before self-destructing. The script would be pretty simple, and thus would not require a lot of scripting ability. The object itself can be placed in your T0 or T1 ship via the blockKey.

    And this reminds me that the API has no way to connect wire nodes between 2 objects via LUA. Therefore deploying a dungeon is the only way currently. I don't know if that's been added in the latest unstable, but I am not counting on it.

    What is possible though is having it wireless - detecting (perhaps expecting) particular objects, and having them communicate with the messaging system. Clearly this requires more scripting ability.
     
    Viikoreaux likes this.
  4. Viikoreaux

    Viikoreaux Space Spelunker

    I have 0 scripting ability, so this may be challenging for me.

    Can you explain in more detail what "deploy a dungeon" specifically means? Or point me in the right direction to begin learning about such things? Such as an example of an object that does this already?
     
  5. bk3k

    bk3k Oxygen Tank

    No one has any scripting ability until they do. I taught myself LUA for the purpose of Starbound. At a minimum you don't need anything complicated.
    Code:
    function init()
      local offset = {10, 0}
      local dungeon = "ancientgateway"
      world.placeDungeon(offset, outpost)
      object.smash(true)
    end
    
    This would place the "ancientgateway" 10 tiles to the right of the object, then self destruct. And that's the bare minimum script it needs. You could add other features like loading the dungeon and offset from your .object file easily enough too.

    Code:
    function init()
      local offset = config.getParameter("offset", {10, 0})
      local dungeon = config.getParameter("dungeon", "ancientgateway")
      world.placeDungeon(offset, outpost)
      object.smash(true)
    end
    
    The 2nd parameter is a default in case the .object file doesn't define these. It is optional.
    I suggest studying some vanilla scripted objects anyhow. And the documentation in /starbound/doc/ list the functions but it might not make sense until you see the code in real use.
     

Share This Page