Scripting in Java (+ jME [but not necessarily] :) )

hello … it’s me again :slight_smile:

as you may know i’m (trying to) working on a sort of rts …

[size=9px](which soon get a little web presentation on but theres nothing to see atm)[/size]

so … i’m planing to define units through external scripts …

first i thought i would at this later but now i’m thinking that it’ll be to much work to rearrange the whole thingy again … :slight_smile:

my big problem: actually i have no idea about external scripting languages in java :wink: … i googled around a bit and found jython which sort of looks nice to me …

but before i get myself in trouble just cause i use a (maybe) difficult to handle library i just wanted to ask if there are other (possibly easier) scripting librarys you know about …


Most people tend to use Groovy or BeanShell. I think DarkProphet has played with some of them? Not sure, but I would at least google on those two and take a look. No personal experience myself.

hmm thanks :slight_smile:

i guess i’ll await a comment from dp (if i may call him that way) then make a decision which languange to use

beanshell is in essence java minus the defintion types.

So you dont need to do “String data = “”;”

you just do “data = “”;”

Groovy just rocks, its the best scripting language out there that isn’t some other language wrapped in a java wrapper (like jpython). So you might find it hard to learn groovy because groovy is a new language. JPython you can learn by learning python.

Being this a jME related board, il link it in with jME. Im not sure if your using the AI, but in the AI, you extend Entity from a scripting language and process all the messages from there. Thats one way.

The other idea is to extend entity in java, and using ClassLoader() load the scripting language method in the constructor. Then in the processMessage(); method, you would call a method in the scripting language depending on what the message is.

Either way is good. But Groovy fits in perfectly with the second.

Wants the links to some of the scripting languages?


actually i’m impressed by groovy at first glace … and although it’ll take some some hard “work’in” i think i’ll get along with groovy :slight_smile:

I made my one scripting engine for my game. It was slow, coected into the game, and toulk me months to wright. I would recommend using a external engine if you can, but you could always wright your one if you need to.