Lua programming

Things that are not directly connected with Factorio.
Post Reply
Morzan
Burner Inserter
Burner Inserter
Posts: 16
Joined: Fri Apr 12, 2013 6:27 pm
Contact:

Lua programming

Post by Morzan »

Hello everyone!

So i've been playing with ComputerCraft, which is a mod for Minecraft. And if i remember correctly Factorio is programmed in Lua. And ComputerCraft also uses Lua for programming. My only problem with ComputerCraft is limitation. So i looked around in the internet for a way to run things from the Lua source code. I was not able to do so, i would like to get some help from you guys (mainly developers and modders).
Sorry for the bad english!

Used mods: F mod, Treefarm mod

User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: Lua programming

Post by FreeER »

Morzan wrote:And if i remember correctly Factorio is programmed in Lua
Just because it makes a difference, Factorio is programmed in C++ and it has a Lua modding interface/API... In comparison to ComputerCraft which is (I assume since it's for Minecraft) programmed in Java and has a Lua interface/API (and almost certainly a Java API as well, for other Minecraft mods)

Just to be clear, are you wanting to know a way to run 'things' from Lua source code in Factorio mods or in CC? And do be a little more specific about 'things' so that people have a better idea of exactly what you need information about :)

I'll assume in CC, so... I haven't used CC in a long time (because I haven't played Minecraft... in over a year? wow) and I never did anything particularly complicated so I may not be able to help you, but if you provide more info it's possible that someone else may be able to.

Morzan
Burner Inserter
Burner Inserter
Posts: 16
Joined: Fri Apr 12, 2013 6:27 pm
Contact:

Re: Lua programming

Post by Morzan »

Well i want to run "things" from Lua source code. But not in CC because i feel it a little bit limited but also a little bit easier. So i want to try out myself how good i could be with Lua itself.

And i'm thinking about doing a strategy game (pretty much CnC style) with Lua. (By the way my longest CC program is about 500 lines long + an api i wrote which is only 100 lines long)

So my problem is that i can't find pretty much anywhere a good explanation on how to install a Lua developer envinronment. Because i think i can code without the CC's added APIs (for example: term API) and try to make programs that work without a Minecraft instance with CC installed or a CC emulator. (Big sorry for not being clear, i was a little bit tired when i wroted the first post)
Sorry for the bad english!

Used mods: F mod, Treefarm mod

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Lua programming

Post by ssilk »

Speed difference between lua and c++ is between factor 10 and 100...

Not very relevant, but interesting:
http://onlyjob.blogspot.de/2011/03/perl ... a-tcl.html
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

BenWo
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sat May 10, 2014 3:30 am
Contact:

Re: Lua programming

Post by BenWo »

If you're looking to write a game in LUA, you probably want to check out Love2D.

Morzan
Burner Inserter
Burner Inserter
Posts: 16
Joined: Fri Apr 12, 2013 6:27 pm
Contact:

Re: Lua programming

Post by Morzan »

BenWo: Thank you very much! I guess i'll have to learn how LÖVE is actually working and everything, but i like it! :) ssilk: Probably you're right, but i'm only 15 years old and for me Lua right now is enough.
Sorry for the bad english!

Used mods: F mod, Treefarm mod

BenWo
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sat May 10, 2014 3:30 am
Contact:

Re: Lua programming

Post by BenWo »

Morzan wrote:BenWo: Thank you very much! I guess i'll have to learn how LÖVE is actually working and everything, but i like it! :) ssilk: Probably you're right, but i'm only 15 years old and for me Lua right now is enough.
No problem! If you just follow the tutorials for Love you can have a basic game window displaying a sprite in minutes. And once you get the basics it's simply a matter of experimenting!

I learned Lua through using ComputerCraft myself, so good luck. :D

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Lua programming

Post by ssilk »

Morzan wrote:ssilk: Probably you're right, but i'm only 15 years old and for me Lua right now is enough.
Sweet.
Not kidding: maybe you should begin to think a little bit bigger, cause you will be never be so young then yet and will never learn so easy like now. :)
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: Lua programming

Post by FreeER »

ssilk wrote:
Morzan wrote:ssilk: Probably you're right, but i'm only 15 years old and for me Lua right now is enough.
Sweet.
Not kidding: maybe you should begin to think a little bit bigger, cause you will be never be so young then yet and will never learn so easy like now. :)
I'd like to somewhat support this! Feel free to start with Lua but if you do get the time to learn other programming languages (Java, Python, D, C++, C, Perl, PHP etc.) do so! It'll be a bit easier for you now than later and once you learn one or two you'll be absolutely amazed at how quickly you can learn others :) (not to mention amazed that so many people allow others to control their computing experience :lol:)
<I'm really not active any more so these may not be up to date>
~FreeER=Factorio Modding
- Factorio Wiki
- My Factorio Modding Guide
- Wiki Modding Guide
Feel free to pm me :)
Or drop into #factorio on irc.esper.net

Morzan
Burner Inserter
Burner Inserter
Posts: 16
Joined: Fri Apr 12, 2013 6:27 pm
Contact:

Re: Lua programming

Post by Morzan »

Okay,okay i'll start those a little bit later. I do programming a little bit everyday, so i learn slowly but surely. But summer is coming so i'll speed up! :)
BenWo wrote: No problem! If you just follow the tutorials for Love you can have a basic game window displaying a sprite in minutes. And once you get the basics it's simply a matter of experimenting!

I learned Lua through using ComputerCraft myself, so good luck. :D
Thanks! So far i do pretty good after reading a tutorial from the wiki. And i now understand what callbacks mean. It was weird for me when i first saw it but now i see the potential in it! :)
Sorry for the bad english!

Used mods: F mod, Treefarm mod

Post Reply

Return to “Off topic”