Modding Help Tech isn't showing up in tech console

Discussion in 'Starbound Modding' started by PistolRcks, Jul 30, 2017.

Tags:
  1. PistolRcks

    PistolRcks Void-Bound Voyager

    I'm trying to make a test tech that will output useful information into the log so I can figure out how things work. However, I can't seem to equip it. I'm not seeing anything in the logs that would be useful.

    Here's the code:
    /tech/distortionsphere/techdebug.tech
    Code:
    {
      "name" : "techdebug",
      "type" : "head",
    
      "scripts" : ["techdebug.lua"],
    
      "description" : "^green; Pay no attention to the man behind the curtain.",
      "shortDescription" : "Tech Debugger",
      "rarity" : "Uncommon",
      "icon" : "/tech/techdebug.png",
    
      "chipCost" : 1,
    
      "energyCost" : 2
    }
    
    /tech/distortionsphere/techdebug.lua
    Code:
    require "/scripts/vec2.lua"
    require "/scripts/keybinds.lua"
    
    function init()
      Bind.create("f", debugCommands())
    end
    function debugCommands()
      sb.logInfo("Current aim position: " .. tech.aimPosition)
      sb.logInfo("Current gender/species: " .. player.gender() .. " / " ..player.species())
      sb.logInfo("Current player entity ID: " .. player.id())
      sb.logInfo("Current unique player ID: " .. player.uniqueID())
      if player.isAdmin() == true then
        sb.logInfo("Player is currently the Admin.")
      else
        sb.logInfo("Player is not currently the Admin.")
    end
    function update(args)
    end
    function uninit()
    end
    
    This is my first time using Lua, so some tips and advice would be nice too.
     
  2. bk3k

    bk3k Oxygen Tank

    Well you have do enable your tech somehow. Usually by quest, but there is another way. See my tech mod to see me hooking the tech console's interface. For your purpose here, just piggy back onto it.
     
  3. Cyel

    Cyel Scruffy Nerf-Herder

    Code:
    /admin
    /enabletech techdebug
    ?
     
  4. bk3k

    bk3k Oxygen Tank

    True for debug use, that makes more sense.
     
  5. PistolRcks

    PistolRcks Void-Bound Voyager

    I was using that, but after saying that it was enabled, looking at my character sheet and the logs, nothing happened.
     
  6. bk3k

    bk3k Oxygen Tank

    Enabled is one thing, equipped is another. Check the tech console.
     
  7. PistolRcks

    PistolRcks Void-Bound Voyager

    That worked! Thanks. Now I've got to fix my code!
     

Share This Page