• Advertisement
Sign in to follow this  

compiling C# Scripts at runtime

This topic is 3943 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

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
Advertisement
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
As Washu said, it is quite possible. Quite easily possible. But I am not too good at C#, I personally prefer premade game engines better. But good luck, and keep at it!

Share this post


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

  • Advertisement