Tutorial Learning how to write script ( .lua )

Discussion in 'Starbound Modding' started by Hooligan, Jan 19, 2014.

  1. Hooligan

    Hooligan Space Spelunker

    i recently found a guide that might be a good reference for those of you that want to learn how to script. its not the latest edition but its free and should still be somewhat relevant.

    http://www.lua.org/pil/contents.html#P1 ( official guide)

    below is also a list of added links that may also be of use
     
    Last edited: Jan 22, 2014
    The | Suit likes this.
  2. Sethh

    Sethh Subatomic Cosmonaut

    \Starbound\assets\scripts also seems to hold some useful information.
     
    Last edited: Jan 21, 2014
  3. coolsp0t

    coolsp0t Phantasmal Quasar

    Yes some informations are given, but it holds only the API which is used in Starbound. How to learn LUA has given the author the most best link.
     
  4. Hooligan

    Hooligan Space Spelunker

    correct; its useful for finding out what variables are already declared, but learning the programming language will help you understand how it works and help you fix or avoid future problems.
     
  5. coolsp0t

    coolsp0t Phantasmal Quasar

    The LUA API is allready included in Starbound:
    ./assets/scripts/API
     
  6. Sethh

    Sethh Subatomic Cosmonaut

    It may already be included but the link he provided makes it much easier to look through them
     
  7. The | Suit

    The | Suit Agent S. Forum Moderator

    Just because you know the API doesn't mean you will know how to write the code properly.
    It would be akin to knowing random words in a language - but not knowing the proper grammar of that language.

    With computer languages - grammar is quite important or nothing will work.
     
  8. coolsp0t

    coolsp0t Phantasmal Quasar

    *g* you talking with a programmer. The Author of this thread has allready postet the right link to the syntax of LUA.
     
  9. Sethh

    Sethh Subatomic Cosmonaut

    Actually with the code you could essentially just reverse engineer it
     
  10. coolsp0t

    coolsp0t Phantasmal Quasar

    1. Reverse Engineering on Starbound is not allowed! copyrighted code!
    2. guys whats the problem with LUA API that is build in? You got so many possibilities that you can done and you have nothing better to do as reverse engineering?

    Sometimes i loose my trust in human beeings...


    Sorry, missinterpretation.
     
    Last edited: Jan 21, 2014
  11. I both agree and disagree. Bad code may still yield desired results but can also look ugly as hell. A computer is a machine... feed it code and it will do what it's told. Knowing the API for a given system will likely get most of the job done and the user can kinda get the rest with trial and error without knowing the language. However, I agree with you in the sense that it's only half of the process as they still should know how the language works. Being a self-taught... The best way to learn is trial, error, and fiddling.
     
  12. Sethh

    Sethh Subatomic Cosmonaut

    You are taking reverse engineering way too far and way out of context (I meant with the current LUAs we have access to)
     
  13. vileRaisin

    vileRaisin Tentacle Wrangler

    I think the miscommunication is based on the fact that reading/analyzing sourced code is something entirely different from reverse engineering. Reverse engineering suggests that you have to take an existing piece of hardware/software apart to try and analyze its working, the reason behind it being that you would not have any access to the processes that created the final product. In the case of starbound mods, the mod is the final product, and not the LUA/JSON code. In this context, you're not reverse engineering anything because the inner workings of the mod is readily available.

    So simply saying "analyzing" or "reading" the code would suffice.

    I know, bit of a smartass comment, but I guess it just saves a bit of discussion on a simple miscommunication.

    And to add to the discussion, I learned the basics of LUA from: http://tylerneylon.com/a/learn-lua/
    Although it's meant for people who already have some knowledge of other coding languages, it's still a nice overview.
     
    Last edited: Jan 21, 2014
  14. Hooligan

    Hooligan Space Spelunker

    thanks for the link , not really a tutorial for people just getting into programming , but for those of us that already know at least one programming language it would be useful. i will have to start creating a list for all the useful guides and tutorials.
     
  15. vileRaisin

    vileRaisin Tentacle Wrangler

  16. Hooligan

    Hooligan Space Spelunker

  17. The | Suit

    The | Suit Agent S. Forum Moderator

    Learning LUA the hardway is really great starter for anyone wanting to take the path
     
  18. MysticPing

    MysticPing Subatomic Cosmonaut

    one thing that s really, really bugging me:

    ITS "Lua" Not "LUA" it doesnt stand for anything, at all. There i'm happy
     
    severedskullz likes this.
  19. The | Suit

    The | Suit Agent S. Forum Moderator

    Technically it means "Moon" in Portuguese :p But i know what your saying. [ Not an Abbreviation of anything ]
     
    coolsp0t likes this.

Share This Page