Sign in to follow this  
Scionwest

compiling C# Scripts at runtime

Recommended Posts

Greetings Gamedev members! I have used C# for a little over a year now and have a MUD styled game engine that includes a complete GUI based tool set to create objects and environments for the game. I am wanting to include a C# scripting language that allows developers to write scripts in C# and then during runtime the engine would compile the script into memory and execute it. Is this possible? When I asked on the MSDN forums I was told that the scripts can only be compiled into binary code, but this is incorrect according to the MSDN included with C# Express. Has anyone done anything like this? Would it be simpler for me to integrate an existing programing language (like Lua) for my engine to use? If so, how would I go about doing so? Thanks alot for any help or advice you guys provide! Scionwest

Share this post


Link to post
Share on other sites
Nice! Thanks for the reply, I did some searchs on here as well and found some good information. I will be giving the mdxInfo.com library a shot tonight and see how it works.
The only thing I am confused about is people talk about sandboxing your code. If it is 'sandboxed' can the script and my C# application pass information back and forth from each other? What if I have an NPC that is loaded by my C# library and updated in my game loop, but it's actions are all within the C# script. I would need to retrieve all of the NPC variables that have it's location and actions from within the script and apply to my NPC class within the engine on my next loop.
Is that possible?

Thanks again,
Scionwest

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this