C# 脚本语言
这是一个有点奇怪的问题。
我想为我为 XNA 构建的模组游戏提供一种脚本语言。如果我在 PC 上部署这些游戏,那么我将只能使用在运行时编译的 C# 文件(使用 reflection.emit)作为脚本就可以了 - 一种修改游戏的简单好方法。但是,.net紧凑框架(xbox提供的)不支持reflection.emit,那么我如何编写考虑到这一点的脚本语言呢?
- 是否有任何项目已经在这样做?
- 是否有任何好的资源来启动我自己的项目来做到这一点
- 选择什么是最好的语言?这是用于游戏脚本的,因此它可以是一种相当小的语言,只要它非常高效且易于实现解释器即可
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?
- Are there any projects already doing this
- Are there any good resources to start my own project to do this
- 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Lua 通常用于游戏脚本编写。例如,《魔兽世界》为其所有模组制造商提供了它。
另请查看这些网站:
Lua is often used for game scripting. World of Warcraft for example offers it for all its mod makers.
Also take a look at these sites:
我知道这是一个老问题,但我之前有类似的要求,并且我发现了托管脚本。看起来它最初是为了解决 XNA 游戏中的脚本问题而开发的,所以这更好。
来自网站:
我自己没有更深入地研究过它,但这听起来像是我们想要的。
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:
I have not looked into it deeper myself but it sounds like what we want.
我想指出这个相关的SO问题,添加JavaScript 作为一个选项。对于某些人来说,Javascript 会比 Lua 更熟悉。
I would like to point to this related SO question, adding Javascript as an option. To some, Javascript will be more familiar than Lua.
您可能想研究一下 VSTA,它提供 C# 或 VB.Net。我不知道运行时编译。
You might want to look into VSTA, it provides C# or VB.Net. I don't know about the runtime compiling.