General Community > Scripting Help

[Programming Tutorial] Creating a basic command-based scripting language in C#

(1/1)

Minalien:
This is just a small tutorial I whipped up a little bit ago on creating a simple command-based scripting language using C#. It's not all that complicated to follow, and includes the full source code.

http://www.minalien.com/~Cassy/Tut_CommandBasedScripting.rar

rsw686:
Not to be a pain, but what is the point of building an interpreter on top of another framework. The amount of overhead with your script is high. I could see writing something in C or C++ since it is fully compiled before interpreting the commands.

Minalien:
(it's been a bit since I've botherred checking this, but)
Basically, I designed this as an introductory method to people who are interested in developing scripting languages. It's much easier to start through something easier, such as C#, so that the focus can be first on designing the scripting language itself, rather than going through all of the intricacies of parsing the scripts that would be required, for example, in C++.

As for the point of having a scripting language used by applications built on the .NET Framework, it's a very simple thing to explain: Separation of media and data. In game development, which is my primary field, it's important to keep data, such as the engine itself, separate from media, such as 3D meshes, textures, et cetera. Using scripting languages further separates the engine from the content by making things such as game level scripting (i.e. elevators, events, and other things that go on in the map) separate from the engine, so you avoid having to recompile to change minute details. This is just as important for games running on the .NET Framework as it is in games running natively.

Navigation

[0] Message Index

Go to full version