Jump to content
  • Advertisement
Sign in to follow this  
elvman

Export functions to Java ScriptEngine

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! I am developing a script system for my game, but can't figure out, how to bind only a few functions for using in the scripts. The example of the script would look like this (ECMAScript): var i = getSelectedCreature(); dealDamage(i, 10); Here I exported 2 functions = getSelectedCreature and dealDamage. Is it possible to export only 2 functions and restrict access to all other classes and functions so that it isn't possible to do something like this in scripts: importClass(Packages.Main); var test = new Main();

Share this post


Link to post
Share on other sites
Advertisement
Ok, I found out, that it is impossible to sandbox javascript. Maybe you can suggest a scripting language for Java? I googled a lot, but it seam that making a sandbox for all these scripting languages is not an easy task.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!