Pages

Thursday, December 15, 2011

On Scripting

One of the more useful features i have come across is a scripting language. From may WoW days, i picked up a little of the language known as Lua. Its is a dynamically typed object oriented language. Meaning you don't define variables, and variables can even be methods. That's right, METHODS!

While trying to conquor the problem of key binding, custom user key binding (Aka, the user can set any key to do whatever they want), i came upon a problem. How to do this? I can't just assign the key 'K' to execute, WalkForward(). But with Lua, you actually can, in a way. You can use a table(with a key and a value) to use 'K' as the key and WalkForward() as the value. Now that i sit here and type this, i am most positive (not 100%) that C# probably as a similar data structure, possibly. Though i will still stick with the Lua fix because writing in a scripting language will much improve my game in the long run.

Ask yourself: Why is WoW so popular? It's because you can nearly do WHAT EVER THE HELL YOU WANT.
Custom GUI, here you go.
No Gui? Got your keys memorized? Sure. Macros, hell yeah.
GIANT ASS WORLD?! Got that too.

This is what i aim to replicate. The sheer depth of the game. Players will customize the game, i only provide the means to do so. This means custom armor (yes, you will be able to make your own armor, no not in the traditional, 'smithing i need 5 copper and 10 bronze to make a chest plate' No, you'll be able to mix and match metals to make alloys of various strength, the mix will determine what colors you can have your armor appear, its resistance to damage types... and so on.) custom building, custom enchantments, i've even thought about a language that would allow you to write words down in books, then if you click on the books, it would cast a custom spell.

All this would not be possible without a scripting language. Scripting means compiling while the game is running. You don't compile it until it is needed, that is the beauty of it, along with other things.

To Sum It Up: Scripting is beautiful, use it to take those leaps you couldn't with your core language. Learn a scripting language. Use one, it can make your life easier.

TNariskan.

No comments:

Post a Comment