Modding Help Ways to learn LUA

Discussion in 'Starbound Modding' started by RedArch, Feb 23, 2017.

  1. RedArch

    RedArch Void-Bound Voyager

    So I would love to start trying to make mods for Starbound. I already have a program to sprite with so now I just need a way to easily learn the coding language of Starbound which I believe is LUA. Anyone have some good resources I could possibly use?
     
  2. The | Suit

    The | Suit Agent S. Forum Moderator

    xaliber, bk3k and MetaFace like this.
  3. MetaFace

    MetaFace Guest

    Yeah the Lua part only is for changing mechanics of the game, if you're making a weapon then its just json unless a new ability or mechanic is needed for it. So a gun or melee weapon is straight json most of the time, really most of anything is determined by json when it comes to starbound.
     
  4. bk3k

    bk3k Oxygen Tank

    I might point out that as far as languages go, Starbound actually has 2. The C++(compiled) side we can't really touch. The LUA(scripted) side we can.

    As stated, JSON makes up the majority of Starbound content, but JSON is an information storage/transport format more so than a language so learning it is easy. It is derived from an actual language though - javascript.

    The harder part is learning all the supported JSON attributes and how they can be used. That's just going to be a grind I'm afraid. There is some stuff on Starbounder though. Mostly you'll need to look at the vanilla stuff and play with it. Also look at mods, especially mods doing something similar in nature to what you want.

    LUA you'll have to play around with too... the best way to learn is to play with and fail many times. There is the issue of learning the LUA language itself. Another link that will help too.
    www.lua.org/manual/5.3/manual.html
    But there is a lot of irrelevant information there, and not everything will make sense when you aren't looking at real code examples. Maybe it isn't the best place to start, but to look up things you have questions about. And note that while there are many LUA tutorials on the internet, Starbound uses LUA 5.3 and so some tutorials might contain obsolete information.

    The other issue isn't learning LUA in general, but using the engine provided functions in your code. Look in \starbound\doc\ for references. Mostly you'll want to look at actual Starbound code to see how they are used where the documentation isn't clear. If you have an advanced text editor, a "find in files" search for say world.entityQuery should bring you code examples showing how to use it in multiple ways. Again look at vanilla first, but also any mods you find interesting. Then try to replicate it yourself.

    You probably should first look to see if your ambitions can be satisfied through JSON alone. If that doesn't satisfy your needs, then look to LUA.
     
  5. RedArch

    RedArch Void-Bound Voyager

    Thanks for all the advice so far!
    I'm definitely going to work on making time to try and learn all I'll need. Seeing as people seem to be looking at this forum post for now I have one other question. If I wanted to say make a hammer that you can point like the Firestorm's Fury special attack, then have it animate so the top half opens up like the Protectorate's broadsword, then have it shoot a laser beam like the Erchius Eye weapon. Would that be more LUA or JSON? I'd imagine it would be more LUA but I'd just like to get everyone's opinion on it.
     
  6. Nexus Of Chaos

    Nexus Of Chaos Parsec Taste Tester

    i'd say LUA. unless there is a way to have multiple effects from one weapon, lua is likely the best answer


    i'm not that big of a modder, but i know some things
     
  7. IHart

    IHart Scruffy Nerf-Herder

    only a little but of lua
     
  8. RedArch

    RedArch Void-Bound Voyager

    Thanks guys! I'll definitely try to work on learning to code and such.
     

Share This Page