Page 1 of 2
Scripting Laungages
Posted: Sun Mar 01, 2009 5:35 pm
by herby490
As i have been looking through the forums i have found a lot about scripting languages such as lua or ruby and I was wondering what there importance is in a game and do you have to know them in order to write a game.
Re: Scripting Laungages
Posted: Sun Mar 01, 2009 5:42 pm
by MarauderIIC
Importance: Handle things outside the engine, easily changeable and expandable. Easy to test and modify on the go. Used to handle special events or non-generic things, typically (like an NPC's conversation).
Necessary: No. You can do everything in the engine and combine it with data files and essentially write your own mini script engine. For instance, you might load an NPC from a text file that specifies their conversation and how they move on such and such a level.
Re: Scripting Laungages
Posted: Sun Mar 01, 2009 6:12 pm
by herby490
Would you recommend that I learn one once i finish learn c++ and the direct3d api and if so which one and why.
Re: Scripting Laungages
Posted: Sun Mar 01, 2009 6:47 pm
by CC Ricers
XML would be a good format to start with, as it's based off HTML. There are some C++ XML parsers already available for use in your engine. XML is an easy, straightforward manner to express data, especially if it's hierarchical.
If you know even a hint of HTML, XML is easy to pick up on. Even if you don't it's still easy since its whole purpose is to define your own custom markup language with custom tags and attributes. A lot of programs use XML in a way to keep data in a context separate from the usage and manipulation of data.
Re: Scripting Laungages
Posted: Sun Mar 01, 2009 7:02 pm
by herby490
I hear that for AI you need to use a scripting language could xml do that fairly well?
Re: Scripting Laungages
Posted: Sun Mar 01, 2009 7:10 pm
by aamesxdavid
herby490 wrote:I hear that for AI you need to use a scripting language could xml do that fairly well?
You don't
need a scripting language, but it can certainly be useful. I've done most of my scripting in Python, and I like it a lot. Scripting languages are generally slower at runtime than programming languages like C++, but if you keep most of the heavy load on the engine and not the scripting, you'll be fine. A scripting language is good to know, but keep in mind you'll also have to know how to implement it in your engine.
Re: Scripting Laungages
Posted: Sun Mar 01, 2009 7:58 pm
by eatcomics
It is definately worth your interest to learn a scripting language such as lua. All the cool kids are doing it, which explains why I don't know any..... But yes after you are competent in c++ you might as well look into it.
Re: Scripting Laungages
Posted: Sun Mar 01, 2009 7:59 pm
by herby490
What advantages do they provide
Re: Scripting Laungages
Posted: Sun Mar 01, 2009 8:03 pm
by dandymcgee
herby490 wrote:Would you recommend that I learn one once i finish learn c++ and the direct3d api and if so which one and why.
Personally I would recommend you go ahead and attempt those things first. You will learn a lot along the way and will almost definitely be able to answer this question for yourself long before you "finish learning" C++ or Direct3D.
Re: Scripting Laungages
Posted: Sun Mar 01, 2009 8:31 pm
by eatcomics
In a nutshell, they are very simple and flexible
Re: Scripting Laungages
Posted: Mon Mar 02, 2009 12:53 am
by MadPumpkin
eatcomics wrote:It is definately worth your interest to learn a scripting language such as lua. All the cool kids are doing it, which explains why I don't know any..... But yes after you are competent in c++ you might as well look into it.
do you realize that half of your posts make me laugh? lol
well i guess this makes me cool XD
LUA, is what i am going to start learning later... probably next week lol
Perl,(not just for scripts) is what i already know, and its gay as shit so i dont actually use it
another approach would be to make your engine read a certain file extension, and have the engine plain and simply receive variables, hashes, and arrays from that
(E.G.) lets say i have set up my engine to read a file called *.vag where as, in place of the Astrix (*) you would actually put a filename/exact location. For the sake of this i am putting an Astrix.
SO my engine reads *.vag which all this vagina file has in it is a C++/C(whatever language) array that the engine will read... this way you can just keep creating vagina files for the engine. without changing the engine its self in any way.
Re: Scripting Laungages
Posted: Fri Mar 06, 2009 3:06 am
by ansatsusha_gouki
Is python easy to learn cuz I would like to try it out.
Re: Scripting Laungages
Posted: Fri Mar 06, 2009 8:42 am
by deryni21
ansatsusha_gouki wrote:Is python easy to learn cuz I would like to try it out.
had a friend that tried to tell me python was better then c++ that made me laugh.
Re: Scripting Laungages
Posted: Fri Mar 06, 2009 9:59 am
by avansc
deryni21 wrote:ansatsusha_gouki wrote:Is python easy to learn cuz I would like to try it out.
had a friend that tried to tell me python was better then c++ that made me laugh.
there is some truth to that statement your friend made.
the easy of use makes it better to use in lab environments where quick and small scale applications are needed.
ps: this notion that scripting languages are slow is fallacy by the way.
REXX for instance is one of the most powerful scripting languages, and runs just as fast a C.
Re: Scripting Laungages
Posted: Fri Mar 06, 2009 10:12 am
by deryni21
avansc wrote:deryni21 wrote:ansatsusha_gouki wrote:Is python easy to learn cuz I would like to try it out.
had a friend that tried to tell me python was better then c++ that made me laugh.
there is some truth to that statement your friend made.
the easy of use makes it better to use in lab environments where quick and small scale applications are needed.
ps: this notion that scripting languages are slow is fallacy by the way.
REXX for instance is one of the most powerful scripting languages, and runs just as fast a C.
he tried to tell me that it was twice as powerful though so he just sounded ignorant