Modding Help My first attempt - Lag Metter

Discussion in 'Starbound Modding' started by proveisso, Dec 21, 2014.

  1. proveisso

    proveisso Void-Bound Voyager

    hello everyone =) It's been a while since I last played - I'm loving the winter unstable update, been playing with a couple friends for 3 days! But one thing I've noticed is my lag has been humongous... and so far, the only way to tell this was guessing at the time chat messages take to show up.

    So I tried searching for this and found nothing about... decided to try on my own, designing a Lag Metter mod. It'd stay right under pixel count, besides the inventory button, and it'd check lag with remote server when playing multiplayer.

    I have some noob knowledge on programming with javascript/java/XML, and I'm already reading the materials you guys made available on http://community.playstarbound.com/index.php?threads/modding-guides.34001/ and http://community.playstarbound.com/index.php?threads/lua-part-1-terms-and-strings.84833/

    Any tips I could use? =) I'll try to keep this thread updated on my progress!

    -#1 bump: can't insert button on /inventoryBar
     
    Last edited: Dec 23, 2014
  2. proveisso

    proveisso Void-Bound Voyager

    Okay, found my first road bump and I couldn't get any help from ##starbound-modding (and they tried, but none of them ever tried modding the on-screen interface) - I thought: okay, this is my first time trying my hand at modding, so what do I need to do first? Getting the placeholder where I want the lag metter to show up - which right now, for testing, is above beam icon, moving the beam icon down.

    So, for testing and learning, I made 2 PNGs: "lagGreen.png" lagGreen.png and "lagRed.png" lagRed.png - green as base, red as hover. I learned how to use .patch file to move the beam icon down, but I can't get the lagMetter to show up...

    Here's code:
    Code:
    [
    {
        "op" : "add",
        "path" : "/inventoryBar/lagMetter",
        "value": {
            "base" : "/interface/lagGreen.png",
            "hover" : "/interface/lagRed.png",
            "pos" : [57, -100],
            "poly" : [ [57, -100], [74, -100], [74, -77], [57, -77] ]
        }
    },
    {
        "op" : "replace",
        "path" : "/inventoryBar/beam",
        "value": {
            "base" : [ "/interface/beamup.png", "/interface/beamdown.png" ],
            "hover" : [ "/interface/beamuphover.png", "/interface/beamdownhover.png" ],
            "disabled" : "/interface/beamno.png",
            "pos": [57, -120],
            "poly" : [ [57, -120], [74, -120], [74, -103], [57, -103] ]
        }
    
    }
    ]
    lagMetter.modinfo and interface.config.patch files are in place, beam icon got moved down.... but lagMetter button don't show up =(

    2014-12-22_04h13_12.png
     
  3. Dunto

    Dunto Guest

  4. proveisso

    proveisso Void-Bound Voyager

    Dunto, I had read that thread, and I don't see why it wouldn't work. Anyway, no matter, if I remove the op:replace and adjust the op:add to include it below the beam button, still won't show up
     
  5. Dunto

    Dunto Guest

    Have you validated your patch code yet? There should be a link to an online validator in that patching guide.
     
  6. proveisso

    proveisso Void-Bound Voyager

    Last edited: Dec 23, 2014
  7. Dunto

    Dunto Guest

    proveisso likes this.
  8. The | Suit

    The | Suit Agent S. Forum Moderator

    As far as I am aware you can't currently add elements to the ingame GUI, only move them around.
    The only elements you can add are to the Intro Screen + Main game screen + character selection screen.
     
    Dunto likes this.
  9. proveisso

    proveisso Void-Bound Voyager

    how. sad.
     
  10. The | Suit

    The | Suit Agent S. Forum Moderator

    Well not exactly - you can still do it in a more creative way.
    A lag meter object or tech.
     
  11. proveisso

    proveisso Void-Bound Voyager

    no idea how I'd make it with an object or tech... I'll have to think a little while more on that, or drop it altogether until GUI becomes moddable...
     
    Claith likes this.
  12. Claith

    Claith Big Damn Hero

    That is pretty much my stance for my own problem. I want to add a button to the general interface or even the AI system, but I've been forced to fallback to the canvas system conceptually. I haven't the time right now (hopefully I can start over the weekend) to actually work on it, but it isn't what I want to do; it is what I'm forced to do. At least what I want to do doesn't requite a need to be constantly available.
     

Share This Page