Welcome to Coding Kick

Welcome!

... to Coding Kick, the website about hobbyist programming by a hobbyist programmer. Here you'll find my various talks about programming, rants on technology, and more- please look around, take a browse through my blog, get to know the place! (the About page is a good place to start, you know)


Integrating with Lua

Posted by Linkage on 6 February, 2012 at 5:47pm

Under the Christmas tree this year came (amongst everything else) a copy of Programming in Lua- just what I had asked for (believe it or not). I got to reading through it over the last month or so and- setting aside the fact that Lua 5.3 came out just recently, rendering the book a little outdated- thought I’d have a go at utilising the Lua C API to get some integration going in a simple project.

I took a version of StealthDemo that I had previously stripped down to its most basic parts- basically just a base ‘OBJECT’ class along with various foundational/graphics code. My goal was to allow an external Lua script to create, access, and control in-game objects through script-defined types in a style akin to this:

Resources/Screens/NP_Screen01.png


Starting up with the Lua C API takes a little getting used to mainly because of the stack system used to exchange values between Lua and C. Anyone familiar with stack operati...
[See Full]
Website Design and Coding by Chris Lewis
Thanks to Ming for much help with Layout Design
E-mail: contact@codingkick.com