Plug-in scripting tutorial

From Vendetta Lua
Revision as of 14:40, 13 June 2009 by Rubin427 (Talk | contribs) (New page: ==UNDER CONSTRUCTION WARNING== This document is a work-in-progress draft. It has not been finalized or reviewed. Please treat it as such. ==INTRODUCTION== This tutorial is designed for...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

UNDER CONSTRUCTION WARNING

This document is a work-in-progress draft. It has not been finalized or reviewed. Please treat it as such.

INTRODUCTION

This tutorial is designed for anyone new to writing Vendetta plug-ins that wants to jump in and get started. The format of the tutorial will be to introduce a couple of new ideas and then use those ideas in an example creating a small plug-in for the purposes of demonstration.

Hopefully, this approach will allow beginners to progress with careful study, but at the same time will not bore experienced programmers to tears.

VENDETTA AND THE LUA SCRIPTING LANGUAGE

Many games today allow player created plug-ins and mods. Most games do this in the same basic way. First the core of the game (both server and client code) is written in a language such as C or C++, which is very efficient but takes a lot of experience and care to avoid subtle mistakes. The language is chosen to achieve the best possible performance at the cost of slower development time or more complicated code.

Then, to allow programmers to build upon this core rapidly, a second programming language is used. This second language known as a scripting language. The principle benefit of a scripting language is that scripts are isolated from many low level, complex, details of the game core. This allow code written in scripts to be comparatively simple and easy to read (once you get the hang of it). As a result, development times using scripts can be very fast. As an added bonus, anyone, whether they are a member of the game development team, or regular a player, can use the scripting language to build upon the core game in creative new ways.

In Vendetta, that scripting language is Lua. All of the Vendetta Plug-in code you write will be written in Lua. Lua is a widely used language with free documentation and interpreters available on-line. So, the time you spend learning Lua while writing Vendetta plug-ins is a good investment, because you are free install Lua on your machine at any time and use the language however you see fit.

This tutorial will not spend much time covering the features of Lua itself, but will focus on using Lua in combination with Vendetta plug-ins. When you feel the need, you may benefit from spending an hour or two with some of the excellent Lua tutorials available.

  • The Programming Language Lua[1]
  • Lua Tutorial Directory [2]

APPENDIX A: LINKS AND RESOURCES

  • The Programming Language Lua[3]
  • Lua Tutorial Directory [4]
  • Vendetta Lua Interface Documentation Wiki [5]
  • Available Plug-ins [6]