Tool Sublime Text Starbound Lua Syntax

Discussion in 'Starbound Modding' started by UnknownX, May 14, 2015.

  1. UnknownX

    UnknownX Scruffy Nerf-Herder

  2. The | Suit

    The | Suit Agent S. Forum Moderator

    I am sure a lot of users will really appreciate this thanks!
    Though I don't see why so many people use ST over Np++
     
  3. Alex WaveDiver

    Alex WaveDiver Pangalactic Porcupine

  4. Healthire

    Healthire Can't Most Program the Least

    Oh man, so many reasons.

    Fuzzy file search, actual projects, simple syntax specific settings, build macros, multiple cursors, multiple selections, commands.

    This plugin is really cool, I'll definitely try it out!
     
  5. Alex WaveDiver

    Alex WaveDiver Pangalactic Porcupine

    Package control, the SFTP plugin, It's multiplatform...

    [​IMG]
     
  6. SpaceCurly

    SpaceCurly Void-Bound Voyager

    Looks pretty neat, but it should be noted that it's 70$. (with an unlimited trial)
     
  7. The | Suit

    The | Suit Agent S. Forum Moderator

    Since you guys used Sublime Text I thought I will just post the question here
    In Np++ when you move over a bracket the opening and closing bracket turns red.
    While in Sublime Text it is barely noticeable underline.

    Is there anyway to add a similar functionality to sublime text?

    Edit:
    Nvm figured it out you need to download a package.
    Psh, so much work to get some decent functionality for $70. :laugh:
     
    Last edited: May 15, 2015
  8. UnknownX

    UnknownX Scruffy Nerf-Herder

    It's actually a setting for the theme you are using. The easiest way to get there would be to install "PackageResourceViewer", use Shift+Ctrl+P, "Open Resource", "Color Scheme - Default", then find the .tmTheme of your current theme.

    The default code for bracket underlining:
    Code:
    <key>bracketsForeground</key>
    <string>#20FF00</string>
    <key>bracketsOptions</key>
    <string>underline</string>
    
    <key>bracketContentsForeground</key>
    <string>#20FF00</string>
    <key>bracketContentsOptions</key>
    <string>underline</string>

    To change it to changing the color of the text instead, you would need to change the "underline" option to "foreground".
    Code:
    <key>bracketsForeground</key>
    <string>#20FF00</string>
    <key>bracketsOptions</key>
    <string>foreground</string>
    
    <key>bracketContentsForeground</key>
    <string>#20FF00</string>
    <key>bracketContentsOptions</key>
    <string>foreground</string>
     
    The | Suit likes this.
  9. The | Suit

    The | Suit Agent S. Forum Moderator

    Thanks - though I think I accepted an honest truth.
    Notepad ++ is more for casual users.
    While Sublime Text is more for hardcore programmers.

    But i am wholly starting to see the benefits of sublime text.
     
  10. renojonathanr

    renojonathanr Scruffy Nerf-Herder

    It's a useful plugin, no doubt. I wish I could also use a regular Lua linting plugin with this.
     
  11. UnknownX

    UnknownX Scruffy Nerf-Herder

    If you are using SublimeLinter, just go to Tools > SublimeLinter > Open User Settings (it should open a file that already exists, if not then save it and reopen it so that it is initialized) and find the "syntax_map" value and change it to the following:
    Code:
    "syntax_map": {
                "html (django)": "html",
                "html (rails)": "html",
                "html 5": "html",
                "php": "html",
                "python django": "python",
                "lua starbound": "lua"
            }
    
     
    Alex WaveDiver and The | Suit like this.
  12. renojonathanr

    renojonathanr Scruffy Nerf-Herder

    Thanks.
     
  13. UnknownX

    UnknownX Scruffy Nerf-Herder

    I've updated the syntax to the newest stable update. I also documented quite a few of the changes to the Lua API as a result: http://pastebin.com/SgdZn8pz
     
    The | Suit likes this.
  14. The | Suit

    The | Suit Agent S. Forum Moderator

    I really appreciate your tool quite a bit. I keep forgetting the codes often and constantly have to look it up.
     
    UnknownX likes this.
  15. UnknownX

    UnknownX Scruffy Nerf-Herder

  16. lornlynx

    lornlynx Cosmic Narwhal

    Nice, thank you!

    But can it be that the "args" keyword is not implemented

    Oh, and is it possible to also apply a color to custom function usage before their definition linewise?
     
    Last edited: Dec 15, 2015
  17. UnknownX

    UnknownX Scruffy Nerf-Herder

    I don't color "args" because its a table passed into hooks meaning anyone could name it anything they wanted. I only consider a table (or function) to be colored if its explicitly defined by C++.

    I would love to color custom functions as well, but Sublime lacks intellisense, so it would need to be something done with python. However, I may eventually explore python-related options when I have more time.
     
    lornlynx likes this.
  18. lornlynx

    lornlynx Cosmic Narwhal

    ok, thanks for the reply :)
     
  19. UnknownX

    UnknownX Scruffy Nerf-Herder

    This update took awhile, but it's finally finished! This update consisted of two parts, the removal of most old functions and addition of all documented functions: http://pastebin.com/mpW4gEJ8, and the final in-game verification for all functions (which reintroduced some old functions that were removed previously): http://pastebin.com/z1JVszy4.
    Also, here's a list of all undocumented functions (as well as documented functions that had their names changed after being documented): http://pastebin.com/UspzZcLY.
    EDIT: Oops, my regex missed sb.interpolateSinEase(), it is actually documented!

    EDIT2: Metadept updated the documentation with some of the missing functions! http://metadept.com/starbound/luadocs.zip is the link for anyone who wants to update theirs.
    Here are the remaining functions that don't have documentation (all documented functions are correct now): http://pastebin.com/4KsZdNKJ
     
    Last edited: Jul 24, 2016
    lornlynx, Peelz and The | Suit like this.
  20. Peelz

    Peelz Giant Laser Beams

    Just finished updating my primary mod, but this will be a lifesaver for the future.
    You are the hero this modding subforum needs.
     
    UnknownX likes this.

Share This Page