views:

388

answers:

3

Lately I am preparing myself to develop yet another game in XNA C#.

The last time I worked on a game in XNA C#, I ran into this problem of having to add maps and customizable data into the game. Each time I want to add in new content or change some values to the game character or something, I had to rebuild the whole game or what - which can take quite some time.

Is there any way which I can write gaming scripts to load the content that can be interpreted by my XNA C# game without having to compile? I am looking at hopefully Javascript.

I would hope that I can add in functions and other small API which can be called from the external gaming script to manipulate the game or load data so on. I am not concerned about the game being hacked since it's quite early yet - the development is of much priority.

Any help would be greatly appreciated.

+1  A: 

Would IronPython be more appropriate? That should work well on "full" framework - but it looks like it might not work (yet) on xbox 360 (which uses compact framework).

For an IronPython / xna example, see here.

Marc Gravell
+2  A: 

The compact framework doesn't include System.Reflection.Emit, which means you can't use IronPython. I recommend LUA, and you can find an XNA interpreter implementation with open source here

seraphym
it looks good. but I can't get it working on Visual C# 2008. The project seems to be very old.
thephpdeveloper
If you don't want to mess with getting it to compile, he offers precompiled binaries - just add a reference in your game to the dll.
seraphym
+5  A: 

You can try Jint which is a open source Javascript interpreter written in C#

Arriu
this looks like a very cool and easy idea. But how can I define pre-defined functions that can be called to run certain C# methods for example?
thephpdeveloper
thephpdeveloper