C#脚本语言 [英] C# Scripting language

查看:117
本文介绍了C#脚本语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个有些奇怪的问题。

我想为改装游戏,我建立XNA的脚本语言。如果我deplying这些游戏的PC,然后我只想能够使用C#的文件,在运行时编译(使用的 Reflection.Emit的)为脚本,这将是很好 - 一个不错的简单的方法mod游戏。但是,.NET Compact Framework的(这是在Xbox提供)不支持Reflection.Emit的,所以我怎么能写一个脚本语言,考虑到这一点?


  1. 是否有任何项目已经这样做了

  2. 是否有良好的资源来开始自己的项目要做到这一点

  3. 什么是最好的语言选择?这是游戏脚本,以便它可以是一个相当小的语言,只要它是相当高效且易于实施跨preTER


解决方案

我知道这是一个老问题,但我刚才也有类似的要求,我发现了的管理脚本。看起来它最初是为了解决脚本的问题XNA游戏,所以这是更好的。

从网站:


  

管理脚本引擎


  
  

管理脚本为开发人员提供需要实现一个脚本引擎到他们的解决方案的快速和简单的解决方案。管理脚本带有一个简单的脚本引擎,可以编译和放大器;在飞行实例脚本,生成所述组件在存储器或本地硬盘驱动器上,并允许动态地调用方法和运行时间期间访问属性。
  ManagedScripting在Windows Vista,XP,Linux和Xbox 360和微软的Zune播放器上运行使用Visual Basic或使用脚本写C#与计划增加对Ruby,Python和JScript的支持的语言。


我还没有看过,更深自己,但它听起来像我们所希望的。

This is a somewhat odd question.

I want to provide a scripting language for modding games that I build for XNA. If I was deplying these games for the PC then I would just be able to use C# files, compiled at runtime (Using reflection.emit) as scripts and that would be fine - a nice simple way to mod the game. However, the .net compact framework (which is what the xbox provides) does not support reflection.emit, so how can I write a scripting language taking this into account?

  1. Are there any projects already doing this
  2. Are there any good resources to start my own project to do this
  3. What would be the best language to choose? This is for games scripting so it can be a fairly small language so long as it's quite efficient and easy to implement an interpreter for

解决方案

I know this is an old question but I had similar requirements earlier and I found out about Managed Scripting. Looks like it is developed initially to solve the problem of scripting in XNA games so this is even better.

From the website:

Managed Scripting Engine

Managed Scripting provides a quick and easy solution for developers needing to implement a scripting engine into their solutions. Managed Scripting comes with a straight forward script engine that can compile & instance scripts on the fly, generating the assemblies in memory or locally on the hard-drive, and allow for dynamically invoking methods and accessing properties during runtime. ManagedScripting runs on Windows Vista, XP, Linux, XBox 360 and Microsofts Zune Player with scripts wrote using either Visual Basic or C# as the language with plans to add support for Ruby, Python and JScript.

I have not looked into it deeper myself but it sounds like what we want.

这篇关于C#脚本语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆