ID:181831
 
Hey. I am looking to get started programming in Lua. But I need help and hopefully I can get answers here.

My programming experience is limited. I can catch on to syntax and so on given time, but that is not the main problem. My main problem is lack of knowledge about tools, resources, libraries, and so on.

So my question is: What is the equivalent of a "byond compiler" that I can use for Lua? It must be free, and preferable.

I prefer minimalist things usually if that helps. (I don't mean "wordpad" minimalist lol, perhaps rather than "minimalist" I mean "not overcomplicated"? Remember I'm not a professional there are some things I'll probably never do with the language.)

And, other than that, what other essentials will I need to make applications in Lua?

Thanks for the help. I asked around many places this is just one of them.

I can learn the language just fine. The problem is knowing "what to type it in to make it do stuff" XD
http://lua-users.org/wiki/LuaBinaries

I imagine you just run "lua name_of_program"
In response to Jp
Jp wrote:
http://lua-users.org/wiki/LuaBinaries

I imagine you just run "lua name_of_program"

I don't know what I'm looking at or what to do with it or what it actually does either.

Can I have an explanation? Thanks XD

Also, Sub Question: I have looked over the Lua tutorials and I see instead of "!" it uses "not" and instead of "&&" it uses "and". As well as other things.

Is that just in the tutorials or am I forced to actually use it? Is it still possible to use !/&&/etc?

Because why would I want to type:

if(Fart and not Diarrhea) ..Rather than:
if(Fart&&!Diarrhea) ...?

It's about 20% less typing the second way.
In response to Dragonn
Dragonn wrote:
Jp wrote:
http://lua-users.org/wiki/LuaBinaries

I imagine you just run "lua name_of_program"

I don't know what I'm looking at or what to do with it or what it actually does either.

Can I have an explanation? Thanks XD

The first thing you should realize is that Lua is not a compiled language designed to work with a particular IDE and runtime.

It is a scripting language meant to be embedded within other systems, allowing you to control some of the objects in those systems.

You are probably interested in learning Lua because a game offers scripting via Lua. You obviously aren't interested because you like the syntax better:

Also, Sub Question: I have looked over the Lua tutorials and I see instead of "!" it uses "not" and instead of "&&" it uses "and". As well as other things.

Is that just in the tutorials or am I forced to actually use it? Is it still possible to use !/&&/etc?

Because why would I want to type:

if(Fart and not Diarrhea) ..Rather than:
if(Fart&&!Diarrhea) ...?

It's about 20% less typing the second way.


It's not about typing efficiency. It's about increasing the approachability of the code.

A lot of Lua programmers are mostly gamers or artists or designers. Asking those people to write C code would be pretty unacceptable -- there's quite a learning curve there.

Lua is designed to make things pretty simple and straight-forward. The syntax for logical operators rose out of mathematics, but the way we use &&, ||, !, and so on are also present in language. For programmers who aren't mathematicians, it makes more sense to use plain language when possible.
In response to Dragonn
As Ryan stated, Lua is not designed to be a standalone product. It was made specifically as an addon language to lower the barrier of entry to creating modifications of programs. Great examples of its use are games like World of Warcraft and Garry's Mod(might also be Half-Life 2).

As such, its entire design was focused on such uses, not on creating a deep and useful programming language for RAD(Rapid Application Development) like Python or Perl. If you are looking for an easy to use RAD language, I highly recommend Python. A simple language with plenty of power geared at creating standalone applications.
In response to Ryan P
That's one question answered. I'm really having trouble turning my computer into a suitable Development Environment for Lua (I guess that made sense. What I mean by that is I have no idea what all I need to download to start using Lua.).

As in, I can't seem to get all the tools properly set up, probably because I don't actually know what tools I need and in what order to install them.
lop
I downloaded Microsoft Visual C++ Studio Express and installed it. Then I read that Eclipse was a "better" IDE for Lua because it has better Add-Ons. So instead I downloaded Eclipse.

I can't even get to the point where I can type and run Lua Code.

It just seems like there is so many file dependancies so I'm downloading all this crap and I don't even know what it does. And it still doesn't work.
In response to Danial.Beta
Yea I saw a list of games that use it to whatever extent. Pretty impressive.

So wait, are you saying I can NOT use Lua to program/script (I don't exactly know the difference) an entire game?

Yea I have studied tutorials on coding with Lua and Python, and I would be using Python right now, if I could just figure out how to set it up. I already been through that and I simply was too confused about what I needed to do to get a proper game development environment running.

I can't even find clear answers on Google when I try to find a start-to-finish guide. All guides assume that I went to college to learn programming or am otherwise already semi-experienced making applications.

[edit] All I really want to do is make a 2d "classic" fighting game with online versus. Nothing too impressive by real Game Developer standards.

The language/syntax itself isn't even the confusing part to me. Getting set up is 100x harder from what I have tried so far.

See I read the Lua and Python coding tutorials already and pretty extensively, my first coding experience is with byond and syntax-wise they look just as easy to get into. But that doesn't help if I can't even set-up the tools to enough extent to allow me to type+run the language.

I would have gotten started in Python a long time ago if I could get past that. About a day ago I saw Lua and I was HOPING it would be simpler to get to a point where I could make stuff, but so far it's just as hard and it seems I'm on a path to failing again before I even can start.
In response to Dragonn
LUA might very well be capable of creating a standalone game, but it wasn't designed for it. Games like WoW aren't built with LUA but rather use it for their addons.

As for python, I recommend pythonportable for a quick and easy to use setup with a preconfigured IDE on Windows. I've been quite impressed with it.
In response to Dragonn
What you want to do really isn't all that simple. It's going to take you a number of steps to get there.

I suggest joining ShowMeDo: http://showmedo.com/joinus

It costs $60 per year, which could buy you a handful of BYOND memberships, but it includes actual videos showing you how to set up your development environment, great help and support forums, and a whole range of tutorials geared towards getting python newbies up and running fast.
In response to Ryan P
That's interesting. I'll have that favorited but I'm willing to keep searching for free methods a bit longer before I pay out 60$.

You seem to imply that Lua cannot do the same things that Python can do? (In respects to making 2d games only I mean). Is that what you meant to imply to me?

Thanks for the help.
In response to Danial.Beta
I read "What is Python Portable" and it sounds interesting. I am going to try to use it. I never knew of this before... I don't know if it will work but I am trying it.

I'm not sure which I like better, Lua or Python. And I'm not qualified to know. I read good things about both. The things I read about Lua seem better than Python though. Someone even said Lua is faster than Python (In what ways I do not know), and more preferred by Game Developers (In what ways I also do not know).

If I can get it set up with the new information you two are giving me I'll experiment with both Python and Lua and keep gathering information about both as well.

Thanks.

I like the syntax of Lua more than Python over all. However I like how Python uses "def" instead of "function" to make a function, it's shorter. But I feel that Python uses ":" too much so in that respect I like Lua. As for the more complex levels of syntax which I haven't experienced yet, I can not really say which is best.
In response to Dragonn
Dragonn wrote:
Someone even said Lua is faster than Python (In what ways I do not know), and more preferred by Game Developers (In what ways I also do not know).

Neither language is very good when it comes to performance. If you get into thing that need really fast execution, either Python or Lua would make calls to extensions written in C or another fast language rather than doing things internally. So, performance isn't a whole lot of an issue here.

As far as preferable to game developers, I think that perhaps you got mixed up here. Many game developers who are writing games in C or another low-level language like Lua because it's easily embeddable, meaning that they can then script the low-level, high-efficiency bits they've written in C using the higher-level Lua language. You can do that with Python too, but the Lua technology was built around that principle.

If you're looking to design your own game top to bottom, Lua is probably not the language you're looking for.
In response to Ryan P
Not long before now I was under the impression that applications of any kind, even games, were scripted entirely in one language.

Now that I know otherwise this really complicates things.

Ok you seem to be a pro (at least compared to me), maybe you know a good answer to my next question:

If my goal is only to use Python or Lua exclusively (No other languages) to make a 2d "Classic" Fighting Game (My dreams are small), can I make it entirely in Python OR Lua exclusively? And with out any serious set backs, restrictions, or worrying about the language being "slow"? (Lets just assume it isn't slow due to poor coding by whoever typed it)

My opinion (Not worth much) would tell me that a game like that doesn't have to worry too much about the speed of the language itself. And if that is the case, the main concern (I assume) switches to ease of use rather than speed. That is, so long as the language is still flexible enough (It appears to be plenty flexible to me).

This has helped a lot. Thanks.
In response to Dragonn
Speed is always a concern. Drop the idea of using Lua and either go with Python, Java or C#. Stop trying to overanalyze what language you should be using and just try one, stick with it for a while and if you end up disliking the way it does things then try a new one.

For all 3 (Python, Java, C#) there are plenty of available ways to make things easier for yourself. Python has PyGame, Java probably has similar stuff and with C# you can write games in Microsoft.Xna which is incredibly easy to get started with.
In response to Alathon
XNA is not an option unfortunately. It would have been my first choice until I found out I would need a new computer. And if I can't do this for free I'm not doing it at all.

Maybe some day. I would love to sell my games made with XNA on the Xbox Live Marketplace. But spending 1000$ on a computer is not an option.

I don't like the syntax of C# anyway. But XNA's features seem excellent.
In response to Dragonn
Alathon mentioned PyGame. That's a Python extension which makes calls to the SDL (Simple Direct-media Layer) library, which is fast and written in C.

SDL lets you control sound, 2-D graphics, and other things useful when making a game. It would probably suit your purposes for a 2-D old skool fighting game.
In response to Dragonn
Visual C++ is for programming in C++, >_>
In response to Dragonn
Dragonn wrote:
XNA is not an option unfortunately. It would have been my first choice until I found out I would need a new computer. And if I can't do this for free I'm not doing it at all.

Maybe some day. I would love to sell my games made with XNA on the Xbox Live Marketplace. But spending 1000$ on a computer is not an option.

I don't like the syntax of C# anyway. But XNA's features seem excellent.

Enlighten me again as to why you would need a $1000 computer to run VS2008 ?

As for SDL.NET or SDL, its pretty good. But compared to Xna its incomplete, lacking and has some serious showstopping bugs in various parts of it. There are workarounds for most of it, but I'd prefer Xna for sure unless you're very specifically looking for cross-platform support (In which case SDL and SDL.NET are of course a viable choice).

I'm pretty sure I'd be able to run Xna on a TinyXP installation on a crap, old computer.
In response to Dragonn
Dragonn wrote:
So wait, are you saying I can NOT use Lua to program/script (I don't exactly know the difference) an entire game?

Lua is a wonderful scripting language in that it is fast and simple. The learning code for DM programmers is almost nonexistant because lua is very structurally similar to DM. There are a couple of basics to learn about the language, but it's so easy to pick up as a DM programmer because both languages are so incredibly similar.

To my original reason posting this message:
An entire game is definitely doable, you just need an environment to run the code from. There are certain programs that act like a sandbox for lua and provide things such as windowing functionality and the like, you just have to do a little searching. GMod is a great example of this, only it comes as quite a heavy package.

One of the coolest things I've seen was computer emulation on GMod for some RP mod. It displayed a desktop environment over the screen and provided the time, games, internet access, a nice little browser, a notepad, and I think file saving. It was a neat little addon. Playing Pong on it was pretty fun.
In response to Dragonn
When I said Python Portable I misspoke, it's PortablePython that I have used. It is simple and comes preconfigured. It can be extracted to any folder(your desktop, for example) and does not need to be installed.

http://www.portablepython.com/