LUA question, sorry if it's been answered

Discussion in 'Planetary Annihilation General Discussion' started by RaTcHeT302, November 9, 2012.

  1. RaTcHeT302

    RaTcHeT302 Guest

    Search isn't working for me so I don't know if this was asked.

    I am starting to learn Lua to start making my mods, how powerfull is it usualy? Can I do anything I want with Lua and will PA support Lua coding? :mrgreen:
  2. sylvesterink

    sylvesterink Active Member

    Messages:
    907
    Likes Received:
    41
    Lua scripting is only as powerful as the developers allow it to be. If every single function in the game engine is bound to a Lua equivalent, then one can effectively use the entire engine. It's quite powerful and quick, and tends to be used in a lot of game engines (and other software) for modding and customization, so it's definitely worth learning.

    However, according to the devs, PA will not use Lua. The scripting language of choice has yet to be announced, but with the focus on modability in PA, I'm pretty sure it will cover a wide range of functionality.
  3. RaTcHeT302

    RaTcHeT302 Guest

    I hope so, thank you :mrgreen:
  4. supremevoid

    supremevoid Member

    Messages:
    340
    Likes Received:
    0
    If i´m not correct pls feel free to say.

    They said Lua will NOT be in Plannetary Annihilation in any form because they don´t like it. The Game(Engine is written in C#)
  5. sylvesterink

    sylvesterink Active Member

    Messages:
    907
    Likes Received:
    41
    C++, not C#. (At least, I sincerely hope not . . .)
  6. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    I am pretty sure Neutrino wrote somewhere that they use C++.
  7. RaTcHeT302

    RaTcHeT302 Guest

    C++? Should I move to that instead?
  8. sylvesterink

    sylvesterink Active Member

    Messages:
    907
    Likes Received:
    41
    C++ is a lower level language that is used for the actual engine implementation. Learning it is always handy from a programming perspective (In fact, I always recommend that it be a new programmer's first language, but that's just me), but when it comes to modding, few games actually expose their C++ api for modders to use. (Unless they are open source.)

    More commonly, an intermediary language is used to interface with the C++ api, which allows the developers more control over what the modders can do with the engine. These are generally chosen to be Lua, Angelscript, Pawn, Scheme, Javascript (surprisingly), Python, etc. Lua tends to be the most popular, but the language to learn really depends on the game you are modding.
  9. BulletMagnet

    BulletMagnet Post Master General

    Messages:
    3,263
    Likes Received:
    591
    You don't learn a language.

    You learn how to program. Once you know how to program, working out how to do that in a new language only takes a day or so.

    What I suggest you do is pick something that you want to work on (for example, FA) and code like all hell. Push yourself as hard and as far as you can.

    If you need to jump to C++ to mod PA, then so be it. The more experience you have beforehand the easier it will be. That said, C++ certainly isn't a beginners language.
  10. neutrino

    neutrino low mass particle Uber Employee

    Messages:
    3,123
    Likes Received:
    2,687
    True but learning how to program includes getting some experience with different languages. Still some languages are hard to master even for programmers with experience. C++ for example is a very insane language that requires extreme discipline to use well.

    This is literally how I learned how to program. I picked something I wanted to build and figured out how to build it a piece at a time. The first thing I ever wrote in C was a paint program. It ran at 640x480 16-color mode. Since I wasn't doing animation I had room for two full pages that I could quickly toggle between. One was the canvas and one was the tools. Paint programs are a great place to start because they are fundamentally simply (sample mouse position and draw a pixel).

    None of the C++ stuff will be exposed directly because it's hard to do cross platform. I considered embedding LLVM and just using C++ for scripting but chucked that idea after some internal discussions. It's possible that we may end up with more than one scripting language in the game although we currently only have one. For a while we actually considered writing the client and server in different languages (e.g. something like Go for the server). I partially rejected that because I know that I can make it work in C++ and I don't want to take on more technical risk than I already am. C++ is definitely starting to show it's age.
  11. sylvesterink

    sylvesterink Active Member

    Messages:
    907
    Likes Received:
    41
    Well, now that the C++ standards committee is starting to work on more frequent revisions, I suspect its longevity will increase.

    Also, embedding LLVM in the game engine? That's an interesting concept indeed . . .
  12. RaTcHeT302

    RaTcHeT302 Guest

    Excuse my ignorance but what does FA stand for? Also I'll probably try to make some very basic programs in C++, where can I find documentation for it? For Lua I'm using going to use "Love 2D" in order to learn how to program with that.

    I'm already used to Pascal so I know some of the basic stuff anyway.
  13. KNight

    KNight Post Master General

    Messages:
    7,681
    Likes Received:
    3,268
    What is this I don't even
    It stands for Forged Alliance BTW
    Mike
  14. BulletMagnet

    BulletMagnet Post Master General

    Messages:
    3,263
    Likes Received:
    591
  15. RaTcHeT302

    RaTcHeT302 Guest

    Ah, I only played at the first Supreme Commander but I never played at the expansion....

    Thanks I guess...
  16. KNight

    KNight Post Master General

    Messages:
    7,681
    Likes Received:
    3,268
    Glad to help ;p

    Mike
  17. svip

    svip Member

    Messages:
    71
    Likes Received:
    1
    Indeed, I asked Bjarne Stroustrup (creator of C++) about it, and he said he would not create C++ today. Also, admitted that it would probably take 10,000 years before they got a decent syntax.

    Oh, Go would be an excellent choice for server. Well, I find it an excellent language all around; it is one of the few languages that has recently gotten me very excited, and excited as I am, I am writing a game I'm developing in Go.

Share This Page