[.net] How do you build this?

Started by
2 comments, last by remigius 15 years, 9 months ago
How do you build a program that lets the user write scripts to interact with the items in your program? You are essentially creating your own scripting language and the user is using that scripting language to interact with stuff within your program. It's kind of like the user is using your custom built IDE and your custom scripting language. I hope I am describing this clearly. Can someone point me in the right direction in terms of how to get this project started and what I need to do? Thanks.
Advertisement
Well...

Google is your friend...

So is flipcode!

As for your IDE - it would be easier for you to have your users code it outside of the gun.
We should do this the Microsoft way: "WAHOOOO!!! IT COMPILES! SHIP IT!"
Here are some tutorials I found useful:
Writing an Interpreter with Lex, Yacc, and Memphis
Implementing a scripting language with Antlr
(Antlr can also be used from c# if I remember correctly.)
You can find more tutorials online by googling.

But there are good reasons why shouldn't create your own scripting language:
1)Its hard and time consuming
2)Finding bugs in an interpreter is a challenge. Thousands of scripts may run without a problem until a script show you that there is a bug.
3)The user needs to learn a new language.

So maybe you should consider using a preexisting embeddable scripting language like Python, Lua or Ruby. You can also use a .net language like c# as a scripting language (via CodeDom).

[Edited by - Kambiz on June 25, 2008 6:09:53 AM]

I'm not sure what you're asking exactly, but if you'll settle for C# as your scripting language this here little sample may prove useful.
Rim van Wersch [ MDXInfo ] [ XNAInfo ] [ YouTube ] - Do yourself a favor and bookmark this excellent free online D3D/shader book!

This topic is closed to new replies.

Advertisement