Scripting Laungages

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

herby490
Chaos Rift Regular
Chaos Rift Regular
Posts: 122
Joined: Thu Feb 12, 2009 5:59 pm

Scripting Laungages

Post 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.
User avatar
MarauderIIC
Respected Programmer
Respected Programmer
Posts: 3406
Joined: Sat Jul 10, 2004 3:05 pm
Location: Maryland, USA

Re: Scripting Laungages

Post 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.
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
herby490
Chaos Rift Regular
Chaos Rift Regular
Posts: 122
Joined: Thu Feb 12, 2009 5:59 pm

Re: Scripting Laungages

Post 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.
CC Ricers
Chaos Rift Regular
Chaos Rift Regular
Posts: 120
Joined: Sat Jan 24, 2009 1:36 am
Location: Chicago, IL

Re: Scripting Laungages

Post 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.
herby490
Chaos Rift Regular
Chaos Rift Regular
Posts: 122
Joined: Thu Feb 12, 2009 5:59 pm

Re: Scripting Laungages

Post by herby490 »

I hear that for AI you need to use a scripting language could xml do that fairly well?
User avatar
aamesxdavid
ES Beta Backer
ES Beta Backer
Posts: 347
Joined: Wed Jan 07, 2009 8:49 pm
Location: Bellevue, WA
Contact:

Re: Scripting Laungages

Post 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.
User avatar
eatcomics
ES Beta Backer
ES Beta Backer
Posts: 2528
Joined: Sat Mar 08, 2008 7:52 pm
Location: Illinois

Re: Scripting Laungages

Post 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. :lol:
Image
herby490
Chaos Rift Regular
Chaos Rift Regular
Posts: 122
Joined: Thu Feb 12, 2009 5:59 pm

Re: Scripting Laungages

Post by herby490 »

What advantages do they provide
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: Scripting Laungages

Post 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. ;)
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
eatcomics
ES Beta Backer
ES Beta Backer
Posts: 2528
Joined: Sat Mar 08, 2008 7:52 pm
Location: Illinois

Re: Scripting Laungages

Post by eatcomics »

In a nutshell, they are very simple and flexible
Image
User avatar
MadPumpkin
Chaos Rift Maniac
Chaos Rift Maniac
Posts: 484
Joined: Fri Feb 13, 2009 4:48 pm
Current Project: Octopia
Favorite Gaming Platforms: PS1-3, Genesis, Dreamcast, SNES, PC
Programming Language of Choice: C/++,Java,Py,LUA,XML
Location: C:\\United States of America\Utah\West Valley City\Neighborhood\House\Computer Desk

Re: Scripting Laungages

Post 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. :lol:
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.
While Jesus equipped with angels, the Devil's equipped with cops
For God so loved the world that he blessed the thugs with rock
Image
Image
Image
User avatar
ansatsusha_gouki
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 37
Joined: Fri Jul 04, 2008 1:19 am
Location: Cleveland
Contact:

Re: Scripting Laungages

Post by ansatsusha_gouki »

Is python easy to learn cuz I would like to try it out.
User avatar
deryni21
Chaos Rift Regular
Chaos Rift Regular
Posts: 124
Joined: Wed Dec 24, 2008 9:55 pm

Re: Scripting Laungages

Post 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.
Image
User avatar
avansc
Respected Programmer
Respected Programmer
Posts: 1708
Joined: Sun Nov 02, 2008 6:29 pm

Re: Scripting Laungages

Post 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.
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
User avatar
deryni21
Chaos Rift Regular
Chaos Rift Regular
Posts: 124
Joined: Wed Dec 24, 2008 9:55 pm

Re: Scripting Laungages

Post 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
Image
Post Reply