Extremely Simple Lua Tutorial?

Saltbeard

Chieftain
Joined
Jan 16, 2013
Messages
5
Okay, I apologize in advance for asking. I've been to sooo many web pages, and I was really trying to avoid actually asking and being a nuisance.

On here, on the Lua website, etc. I just can't find a beginner's Lua tutorial that tells me how to do anything other than say "Hello World!" I've looked in the UI and Scenario folders and it's all alien to me. I can do XML just fine (then again, that's super basic). But every time I try to learn lua, I give up in frustration a few hours later and get discouraged from trying for a few months.

Where do I start? Do I have to learn another programming language before jumping into Lua? Is this something that will take years to learn? If so, is it even worth the effort?
 
That's the same thing he's talking about, all it tells you is how to say "hello world", then check to see if you are Egypt and then say "hello egypt".

Which is not an acceptable place for a tutorial to say "from here you are on your own"! There should be, you know, a couple tutorials on how to actually perform actions that affect the game!
 
That's the same thing he's talking about, all it tells you is how to say "hello world", then check to see if you are Egypt and then say "hello egypt".

Which is not an acceptable place for a tutorial to say "from here you are on your own"! There should be, you know, a couple tutorials on how to actually perform actions that affect the game!

I don't know of any other tutorials for Civ 5.

I learned Lua by looking at the interface files and learning what they did. But I had a background in C++ already.

There isn't much more I can tell you except look at online tutorials or stuff. I'm by no means an Lua expert and me writing a tutorial on it would be nonsensical.

Although I do know how to do some neat stuff in it...the possibility exists that I may do some mini tutorials - but where to post them?

I ask the OP now: What kind of Lua are you looking to do?
 
If you have any kind of experience in object oriented programming language, lua should be fairly easy to learn.

http://modiki.civfanatics.com/index.php/Lua_and_UI_Reference

That link has quite a lot of information on civ 5 related lua stuff. Of course, there's always the reference manual:

http://www.lua.org/manual/5.1/index.html

Also, if you are debugging stuff, make sure you have FireTuner setup and turn on. It really helps with the debugging. It can also help you learn lua and run commands that you are not sure if they will work without having to put them into your game.
 
I don't know of any other tutorials for Civ 5.

I learned Lua by looking at the interface files and learning what they did. But I had a background in C++ already.

There isn't much more I can tell you except look at online tutorials or stuff. I'm by no means an Lua expert and me writing a tutorial on it would be nonsensical.

Although I do know how to do some neat stuff in it...the possibility exists that I may do some mini tutorials - but where to post them?

I ask the OP now: What kind of Lua are you looking to do?

Thanks for replying. The thing I wanted to do was make a unit similar to a Great Prophet. Although rather than converting the religion of the city, it would switch the current owner and consume the great person (possibly with a diplomatic penalty). I thought something like that might be easy to do, at least for someone who understands Lua. Perhaps I missed some examples of something similar somewhere? I couldn't find a file for the Great Prophet's religion spreading act, and I'm under the idea that wouldn't even be anywhere in the Assets folder.
 
If you have any kind of experience in object oriented programming language, lua should be fairly easy to learn.

http://modiki.civfanatics.com/index.php/Lua_and_UI_Reference

That link has quite a lot of information on civ 5 related lua stuff. Of course, there's always the reference manual:

http://www.lua.org/manual/5.1/index.html

Also, if you are debugging stuff, make sure you have FireTuner setup and turn on. It really helps with the debugging. It can also help you learn lua and run commands that you are not sure if they will work without having to put them into your game.

Thanks, I looked at the reference manual quite awhile back, along with some other civfanatics wiki pages on lua - but that page looks like it may be a better one to start with.
 
Back
Top Bottom