I have heard time and again that scripting languages can be used to quickly speed up the development process for a game.

Using scripting languages we don't have to build the whole game from scratch every time we make a small change. and it can also help with keeping different parts of the game like the logic from the main engine etc. separate

So can anyone tell me :

1. What exactly are the uses of a Script2. How can I use scripts in my java game for the logic part or other things ... (a Guide or Tutorial regarding this would be great)

I did a cool thing in an RPG where each level file had a class file generated too from some Java code you could write into the level editor. Then you just use javac and, voila, you've accomplished what a lot of people use scripts to do.

I did a cool thing in an RPG where each level file had a class file generated too from some Java code you could write into the level editor. Then you just use javac and, voila, you've accomplished what a lot of people use scripts to do.

The java tools are not part of the JRE but of the JDK, so you will be out of luck for this approach on the client side (you are not allowed to bundle the JDK or JDK classes with your game). I think Eli used this on his development-system, so he simply can execute javac or start an ant buildscript on the commandline (using the java.lang.Runtime class).

If you really need this (which I doubt) on the client side, the best bet would probably be using janino.

I've been using Janino for a bit. It's great, except for an issue I ran into a couple of weeks ago - it doesn't seem doesn't seem to handle break and continue! It compiles the source using those just fine, but then fails on next compilation unit. Kind of a bummer, because it's so good otherwise.

I personally only find myself utilizing scripts (and usually only for plug-ins built alongside an API of mine) when I'm wanting other people to contribute to parts of the game's development...people that are less experienced with Java.

Scripts are overall just a waste of environment building time if you're going to develop by yourself.

Find me on GitHub: connergdavisMy current project is called Obsidian Framework and is a private Minecraft server application used to play Multiplayer.

The java tools are not part of the JRE but of the JDK, so you will be out of luck for this approach on the client side (you are not allowed to bundle the JDK or JDK classes with your game). I think Eli used this on his development-system, so he simply can execute javac or start an ant buildscript on the commandline (using the java.lang.Runtime class).

If you really need this (which I doubt) on the client side, the best bet would probably be using janino.

LOL no wonder other people had trouble running it! XD I didn't even think of that - this game obviously never made it to prime time.

>I have heard time and again that scripting languages can be used to>quickly speed up the development process for a game.

Essentially, that's true. But strictly speaking, this actually isn't limited to scripting languages. Replacing old code with new code on-the-fly can be even done with C or plain Java.

>What exactly are the uses of a Script[?]

Generally speaking, any kind of "cold" code (i.e. code which gets executed rarely and which isn't processing intensive) can be replaced with scripts.

Scripting in games is often used for some sort of hybrid which is somewhere between configuration and code. Basically, it's some configuration with logic thrown in. E.g. there are conditions here and there and arrays/dictionaries and some loops to keep things DRY (don't repeat yourself -> less repetitive) and maintainable.

E.g. if this weapon (a shotgun) is fired, there shall be 12 randomized projectiles each one got a knockback of 5, this particular sound file should be played, this animation is triggered, and the next shot can be fired in 500 msec.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org