pulpcore

[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: Scripting (javax.script) & Pulpcore David Brackeen Mon Jun 22 12:01:04 2009

I'm not sure what the
issue is, but it might be a good idea to avoid rhino because it's not
available by default on Java 5.

On Sat, Jun 20, 2009 at 11:36 AM, giroigavno <[EMAIL PROTECTED]> wrote:

>
> Hello,
> I want to enable scripting for my Pulpcore Project (I'm using Scala
> but I don't think that's part of the problem). I played around a bit
> with the javax.script Api and the Rhino Language and managed to create
> a script file that can do simple things for my game. I've put that
> file in the build directory.
> However, the crux is that I want to be able to create instances of
> classes in my script for example "new Human(20,20)". The only way to
> achieve this (as far as I figured out but frankly idk) is to import
> the Classes/Package of my Project by using the "importClass
> ()"/"importPackage()" functions of Rhino. It works for very simple
> HelloWorld examples, so basically it should work with Pulpcore, too.
> But when I put that script file into the build directory I simply
> cannot import the classes of my Project. There are always errors like
> that
> "javax.script.ScriptException:
> sun.org.mozilla.javascript.internal.EvaluatorException: Function
> importClass must be called with a class; had "[JavaPackage
> pong.HumanPlayer]" instead."
> Since I'm a newbie I can only guess the problem. As the importClass()
> function works fine for simple projects I assume there's something
> about the ant build file that somehow changes the hierarchy. Or it is
> the jar file, and the script can't acess the jarfile. Or maybe it is
> even the PulpCore player, i just don't know.
> Any ideas?
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"PulpCore" group.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pulpcore?hl=en
-~----------~----~----~----~------~----~------~--~---