Page 1 of 1

Question on Lua

Posted: Tue Aug 03, 2010 8:09 am
by PaperDuckyFTW
I have been thinking about incorporating Lua/Perl into my game. Before I do, I was wondering if anyone could offer advice or elaborate my knowledge of adding a scripting language into my game. Is it worth it? Is it useful for games or mainly game engines?

Thanks for your help, and if you could, can you post a link or tutorial? It would be quicer to learn from the same source as you, then to hunt for them myself =p

Re: Question on Lua

Posted: Tue Aug 03, 2010 1:09 pm
by Milch
First, you need to know exactly what you want to do with the scripting language.

Do you make new gamemodes with it?
Do you want to make new enemies/world object/...?
Do you want to make something like render independent shaders? ( like Quake has? )

Then, you have to decide what people should use your scripting language.

Is it for you or a other fellow coder?
Is it for a modding community?
Or is it just for testing purposes, so you can test new stuff without recompiling?

Considering these facts, there are different approaches/languages.
For testing purposes, I would take a language that has a similar syntax like the one your developing your real game in.
For a modding community, I would take the easiest do learn language ( that would be any kind of Basic-like syntax language )
For you or a fellow coder, you can just take any language you want to.

So it all depends on what you want to achieve with it, if you should implement a scripting language or not, and
not if your are developing a game or a game engine.

Re: Question on Lua

Posted: Sat Aug 07, 2010 12:43 am
by PaperDuckyFTW
After re-watching many of the Adventures in Game Development videos, I became interested in incorporating a scripting language, much like Perter's Lua, as it could mean I can add objects, change stats, and much more from an external source. I wouldnt have to recompile it everytime I wanted to add/change things. If i plan to make an engine that can be used for anything, I was thinking that games made from it can all be made from Lua, and the engine just reads the Lua files. If i ever distribute the engine to other people, all they'll need to learn is the Lua functions.

If i meet any friends who are interested in game development, they might be more interested in the scripting side of it, and not too interested in programming. Would it be worth learning and incoporating Lua, or would text files be more appropriate?

Thansk for your reply as it game me some much needed info

Re: Question on Lua

Posted: Sat Aug 07, 2010 6:09 am
by Milch
Nah, you dont want to use textfiles, as you would have to write everything yourself.
And scripting and programming is often pretty much the same.
On both you have an idea an you have to make it happen. ( So you make a game )

So basically, you have 2 choices on how to implement this, both with Pros and Cons.

Implement the scripting language for the creation of new entities.
So you can create new enemies, new objects and stuff.

OR

Implement the scripting language for the creation of new gamemodes/new games.
So you can create a whole new game just with the scripting side.

The problem with the second approach is that you have to provide much more functions ( or low level functions ).

So if you are inexperienced on working with scripting languages, you should rather go for the first approach and make a good 2D Sidescrolling engine,... with scriptable enemies,
instead of making a new gamemaker :3

Re: Question on Lua

Posted: Sat Aug 07, 2010 6:41 am
by PaperDuckyFTW
Haha thanks for your help. With the project im working on now, I hope to incorporate a scripting language for the first choice, to add text, warp player etc. I was thinking about making a 'new gamemaker' so I can make quick games but your very right, it would take a long time and a lot of effort which I cbf doing "^.^ . Thanks for your time as well :mrgreen: Best luck with your project(s)