PDA

View Full Version : This game is good LUA learning source?


wsxdrfv
08-17-2010, 11:01 PM
I read some thread from here about mods the various things and cheat.

And I did.

I am very surprised that I can directly access game's script itself and re-make it.

Normally all game is not possible to access to this, right?

I have interest in LUA programming language. Is it bright-future?

Is this PQ2 is good for learning and reference for LUA language?

Phileosophos
08-19-2010, 09:42 AM
Not all games use a scripting language. Of those that do some use Python, some use Lua, and some use others. Lua seems pretty popular right now, but as to whether it has a bright future it's hard to say. It's just a scripting language, really, and not very useful for major application development. But if you learn it you'll be able to make World of Warcraft mods/macros, write custom script for the Logitech G13 gameboard, etc.

Cerritus
08-19-2010, 06:18 PM
I read some thread from here about mods the various things and cheat.

And I did.

I am very surprised that I can directly access game's script itself and re-make it.

Normally all game is not possible to access to this, right?


Correct, most games are written in C++ or another compiled language that you cannot access the code for without some sort of decompiler.


I have interest in LUA programming language. Is it bright-future?


Lua is a fantastic language that a lot of developers use in addition to another language. The main advantage of a scripting language like lua over traditional programming languages is the ease of use, and that you can change it without the need to recompile your program. Unfortunately scripting languages like lua often come with the overhead of a virtual machine at runtime to process the scripts as they are loaded, as well as not offering very fine control over optimisation and memory use. This means that they are not as usefull for expensive processing.

The advantage of becoming fluent in a scripting language like Lua
is that your knowledge is transferable, as a lot of scripting languages are similar, so it won't take you long to absorb a new one.


Is this PQ2 is good for learning and reference for LUA language?


Probably not. As the lua overlaps with the C++ calls it can be confusing as to what is going on. I would suggest starting with some more classic tutorials and getting accustomed to using Lua before exploring the PQ2 scripts. However if you are already familiar with Lua, you may learn some interesting optimisation and clever tricks you may not have seen before in the PQ2 scripts. They may also be useful for understanding game structure and code architecture.

wmsigler
09-08-2010, 02:00 AM
Garry's Mod uses lua scripts all over. That might be another good source. Only $10, too.