#### Archived

This topic is now archived and is closed to further replies.

# Script Language (which do YOU recommend?)

This topic is 6136 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I''ve decided that rather than doing a scripting language from scratch (overkill), I''ll modify an already available one. Currently I''m going with Lua, since it has met all my demands in theory: free (even for commercial use) source code included simple but powerful language, quick to integrate with project easy to add new functions Other languages I have looked into: Python Small Language Anyway, I am mainly looking for simple and fast. I don''t need C++ here, just a simple script language. Decisions, loops, etc. Anyone have to say anythinga bout Lua or other language? Btw, I am working on a game engine, not MS Word, keep that in mind
Get Banner At: http://www.crosswinds.net/~druidgames/resist.jpg

##### Share on other sites
I don''t really use any scripting languages, but I read something I''ve never even thought of in a LaMothe book the other day:

Instead of having to make a compiler or interpreter of your own and screwing around with lex and yacc, you could just use your own programming compiler like Visual C++. Just write preprocessor macros for commands, etc. after the design process is complete-- and yes you should design it.

I haven''t tried it, but when I get around to it, I will...

##### Share on other sites
Python has some advantages due to it''s popularity. One of those advantages is being able to walk into a book store and buy a book on it. Another is the extensive variety of extensions that have been implemented in it. Hopefully whoever is going to be using it in your game isn''t going to be doing COM, Sockets or GUI calls, but it does provide a wellspring of examples and ideas on how to interface to your game. I don''t know anything about the other two languages you mentioned, but the ability to create classes is a big plus. If the other support this as well then it doesn''t give Python an advantage, but if they don''t it certainly does. The classes let you abstract the interface to your game. That means you can have a rather complex set of rules on how and when you game engine can be called while still presenting it in a simple and straight forward manner. The COM extensions to Python seem a good example of that.

##### Share on other sites
Hmmm, a book on Python? See that is partly why the language scared me off, it''s big enough to need a book. I didn''t explain myself too well in my first post, but i dont think that my purposes justify such a massive language. Im just doing a 2D tile engine that I hope will be one of the better (if not the best ) out there. It will be very strongly script oriented, because the not-often-used method of handling and storing tiles in my design makes for tiles that can take advantage of hard-coded stuff for common abilities, while taking advantages of scripting for some really neat stuff. To give you an idea, say I use this engine to write some cave exploring game, where u hunt down treasure while avoiding monsters and stuff. I go and put it up for download, and a fan could literally go and turn this game into PacMan without having to touch the .exe. All done through clever scripting. So in other words, I''m trying to do for a 2D tile world what Half-Life has done for the FPS world.

Don''t mistake me for trying to create a whole game construction kit. It''s simply a game that is very flexible, much like Half-Life, to the point where you CAN make your "own game", but that''s not what the product is being released as. There will be a full IDE that allows map making, scripting, tile building, object/creature creation all in one program.

I might also sell licenses to the engine for a few bucks or even free on the side, in which case someone could expand on it and make a whole RPG system or something, but that''s another story.

Now that I''m done rambling about it being really versatile, why don''t I get back on topic? Sounds good! Okay, so now, Python has books on it. That is big, too big. I just want a basic scripting languages that actually works, because all that Lex/Yacc stuff was giving me a headache and I couldn''t shake the feeling that I was overworking myself needlessly. I just want a core scripting language, simple ifs, loops, etc, so I can expand it. The way the engine works, you can do a LOT with the most basic of programming constructs. I''ve already basically "learned" Lua in like two days, so I''m liking it. ANd it works and everything. But if someone has had bad experiences with it, id rather know now.

Get Banner At: http://www.crosswinds.net/~druidgames/resist.jpg

##### Share on other sites
Lua is great, don''t be ashamed to use it! If it makes you feel any better, there are a few commercial games out that use it, like MDK2 and Baldur''s Gate. It''s simple, fast, and expandable so you can''t really go wrong.
Dan

##### Share on other sites
Hey, think you could post some the (if any) links you have about Lua ? I''m pretty interested in using it, but the reference wasn''t too helpful in showing examples of useful implementation (I understand the basic syntax from reading over it though).

"Finger to spiritual emptiness underlying everything." -- How a C manual referred to a "pointer to void." --Things People Said

http://druidgames.cjb.net/

##### Share on other sites
Well I''d go with whatever suits you.

Is the language flexible enough to fit your needs?

Is it easy enough to read?

Can you modify it if you ever wanted to without permission from the original author?

Is it free, and if not, how much is it?

Is it fun to use? Seriously. If you don''t like using it, don''t use it. That''s why I turned away from making Jedi Knight mods-- because COG (the scripting language used) is too difficult to understand. And I use C++ for crying out loud.

##### Share on other sites
That is an interesting perspective. I can''t say that I have ever heard anyone argue that readily available documentation was a bad thing. I suppose to each their own.

##### Share on other sites
Alright, I''m expecting to get flamed for this, given all those resist windows XP banners above, but if you program in windows, can''t you just use the windows scripting engine to parse and interpret java script or VB script? This saves you the time of having to learn a new language©

##### Share on other sites
One scripting language which I came across which seems pretty useful and powerful is seer. Not sure if anyone has had any experience of this one, I know it was used on a adventure game tool. Also I''m not sure about the licensing of it etc but well worth checking out.....

oh btw it''s based on C/C++.

##### Share on other sites
quote:
Original post by LilBudyWizer

That is an interesting perspective. I can''t say that I have ever heard anyone argue that readily available documentation was a bad thing. I suppose to each their own.

It''s the size of the documentation. Although it isn''t more than a week of reading for me at the most, I want to make this scripting language accessible to people with little or even no programming language. Plus I''ll have to write a custom manual for it and everything. For example, Some Guy mentioned Jedi Knight''s scripting engine was a turn off because it is too complex. I want to avoid the pitfall. Even a basic programming language is mind bogglingly powerful. Anything complex I want to implement I can do by adding functions whose use is completely optional instead of adding more and more syntax on to the shoulders of people who may not even know what a variable is.

And to whoever posted about MDK2 and Balduer''s Gate using Lua, if that is the case, then I certainly can use Lua too. THX A LOT

Oh and here''s a link to Lua''s main site, it''s got all the documentation and stuff. I''ve only had minor problems adding it to projects (the server was down when I was playing with it, so I wasn''t able to read that I have to put the include files in extern "C", so that caused me a bit of frustration).
http://www.tecgraf.puc-rio.br/lua/home.html

Get Banner At: http://www.crosswinds.net/~druidgames/resist.jpg

##### Share on other sites
quote:
Original post by invective

Alright, I''m expecting to get flamed for this, given all those resist windows XP banners above, but if you program in windows, can''t you just use the windows scripting engine to parse and interpret java script or VB script? This saves you the time of having to learn a new language©

RESIST M$!!! Seriously, either choice you mention is useless for several reasons. Neither langauge is fast enough, and both have very awkward syntax. java-script isn''t the greatest langauge period, and I have never seen a freely available parser for it (dont give me some stuff about some embedded IE functions, since I am aiming for portable code M$ provided stuff is useless).

As for VBScript, I have an extreme hatred for VB period. It''s syntax is horrible, it has a lot of little quirks, it requires M\$, and im pretty sure it wouldn''t meet the speed requirements of my game.

So there''s your lecture Learning a new language is not a problem, if you know how to program, you know how to program. And if a programmer had trouble learning a scripting language, then the language is useless to the public, hence it''s worthless.

Get Banner At: http://www.crosswinds.net/~druidgames/resist.jpg

##### Share on other sites
java-script is pretty fun to work with (it is very forgiving) but it is slow. I use it a lot on my websites and such (just look at the source code, everything I reuse is stored in manager.js and theme.js). I''ve even written a low-performance database in java-script before, but I probably wouldn''t have done that if CGI was an option at the time.

I hate VBScript, that is the only reason I don''t like ASP too much, is that it has some unholy link with VBScript.

"Finger to spiritual emptiness underlying everything." -- How a C manual referred to a "pointer to void." --Things People Said

http://druidgames.cjb.net/

##### Share on other sites
Ahh, it did it again. I write "Javascript" (that should come out, I use the Latin-Iso dealies) but it turns it into java-script (notice the lowered casing of the first letter), trying to make it look like I can''t type or something...

"Finger to spiritual emptiness underlying everything." -- How a C manual referred to a "pointer to void." --Things People Said

http://druidgames.cjb.net/

##### Share on other sites
quote:
Original post by Null and Void

java-script is pretty fun to work with (it is very forgiving) but it is slow. I use it a lot on my websites and such (just look at the source code, everything I reuse is stored in manager.js and theme.js). I''ve even written a low-performance database in java-script before, but I probably wouldn''t have done that if CGI was an option at the time.

Once i learnt PHP/mySQL, i have had trouble finding much use for java-script anymore. At most, it''s good for scripting a little navigation menu for navigating a large set of dynamic data. Most of everything else that a website really needs that is traditionally done through stuff like JS (and none of those damn gimmicks!) is better done through a server side script. Then you are guarenteed compatibility with all browsers, and you can do sooo much more server side.

And personally i havent found JS forgiving, especially in the area of browser compatiblity, which is a big issue for me on many of my websites. Anyway, i''ve gotten a bit off topic here

Get Banner At: http://www.crosswinds.net/~druidgames/resist.jpg

##### Share on other sites
I was just giving you a hard time. I knew what you meant, but I think you are looking at it wrong. It isn''t any idiot that is going to make entertaining mods for your game. Most people just play mods, they don''t create them. If you haven''t played with UnrealEd or one of the other more popular game editors then I would suggest you do so. It is a very time consuming task to learn to use one, much less actually create an entertaining level. Two things you should notice is that it is very time consuming to design just a simple level and second is that what makes it time consuming isn''t just laying things out, but also learning what all the differant scripts do and how to use them. You might also notice that the scripts themselves are pretty simple and you can do a great deal without ever changing a single script.

##### Share on other sites
quote:
Original post by LilBudyWizer

That is an interesting perspective. I can''t say that I have ever heard anyone argue that readily available documentation was a bad thing. I suppose to each their own.

I didn''t say that. If you misread my post I said, "Is it easy enough to read?" That''s the only thing I can think of where you could have gotten that.

Every language allows you to comment, so why would I say that? It''s up to YOU to document your code well.

I hate you guys. I hate you so very very much...

##### Share on other sites
It wasn''t a response to your post. It was a response to LordElectro''s response to my post.

##### Share on other sites
quote:
Original post by LilBudyWizer

I was just giving you a hard time. I knew what you meant, but I think you are looking at it wrong. It isn''t any idiot that is going to make entertaining mods for your game. Most people just play mods, they don''t create them. If you haven''t played with UnrealEd or one of the other more popular game editors then I would suggest you do so. It is a very time consuming task to learn to use one, much less actually create an entertaining level. Two things you should notice is that it is very time consuming to design just a simple level and second is that what makes it time consuming isn''t just laying things out, but also learning what all the differant scripts do and how to use them. You might also notice that the scripts themselves are pretty simple and you can do a great deal without ever changing a single script.

Yea, true. But the more complicated the script language, the more people you alienate. Not only because it requires more understanding of programming, but also because people are naturally lazy. If a scripting language takes too much time to learn to use, even ppl with the proper ability wont bother, because there''s other stuff to do. Many mod makers started scripting a particular game just out of curiosity. The more time it takes to do anything "COOL" in the game, the less people will get into it. There are so many other games out there, it has to be worth the time invested, and the initial investment most ppl are willing to make is small.

Get Banner At: http://www.crosswinds.net/~druidgames/resist.jpg

##### Share on other sites
quote:
Original post by Null and Void
I hate VBScript, that is the only reason I don''t like ASP too much, is that it has some unholy link with VBScript.

I totally agree with you on that. ASP uses VBScript. That''s why I use PHP instead. It''s syntax is more like C/C++. anyhow, that''s not the subject of the thread but I still had to get my word in. ( sorry about that )

"And that''s the bottom line cause I said so!"

Cyberdrek
A division of DLC Multimedia