O'Reilly logo

Programming Game AI by Example by Mat Buckland

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

State changes are made by switching the table the luabind::object
m_CurrentState
points to.
You can check out firsthand how everything works by compiling the
ScriptedStateMachine project. Fool around with it a little, add some addi
-
tional states, and play around for a while to get a feel for how everything
integrates.
Useful URLS
If you start to use Lua and Luabind seriously, you will probably run into
many problems requiring assistance. Fortunately, you can find a lot of sup
-
port on the Internet. The following is a list of some of the more useful
resources available to help you out of difficulty:
n
http://www.lua.org/
The home page of Lua and the place where you can subscribe to the
Lua mailing list
n
http://lua-users.org/wiki/LuaDirectory
This is the Lua wiki. It has many useful articles and links to help you
out.
n
http://lua-users.org/lists/lua-l/
This is a searchable database of the Lua mailing list.
n
http://luabind.sourceforge.net/
The home of Luabind. Luabind also has a mailing list you can sub-
scribe to.
It Doesn’t All Smell of Roses
By now, I bet you’re thinking that scripting languages are the code equiva
-
lent of a trip to Willy Wonka’s chocolate factory. Everything you want and
more, all wrapped up in pretty ribbons. Well, I have to give it to you
straight… it’s not. There are a few downsides. For starters, all those lovely
helper apps you’ve come to know and love aren’t going to help you when
you type your scripts (not without modification, anyway). Say farewell to
auto-complete and a teary adieu to those lovely little info boxes that appear
when your mouse hovers over a variable. Oh boy! Like electricity or
doughnuts, you don’t realize how much you rely on these things until you
have to make do without.
z
TIP There are a number of editors available that are useful for writing scripts
(providing colored syntax and auto indent, for example). Two of the best free
editors are SciTE (www.scintilla.org/SciTE.html) and Crimson Editor
(www.crimsoneditor.com).
292 | Chapter 6
Useful URLS

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required