I am trying to implement Lua into my game, but am having trouble. Say I have a weapon class, which is just a hollow shell, lacking real functions. I was thinking of creating an onFire function, which will simply call a pointer to a Lua function that was created for that weapon. Is this the way most people do it? Are there any other ways?
Tell me more
×
Game Development Stack Exchange is a question and answer site for
professional and independent game developers. It's 100% free, no registration required.
|
closed as not constructive by Nicol Bolas, Josh Petrie, Sam Hocevar, Byte56, bummzack Feb 14 at 16:30
As it currently stands, this question is not a good fit for our Q&A; format. We expect answers to be supported by facts, references, or specific expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, see the FAQ for guidance.
You can indeed call Lua functions from C++ code, you'd just need to import a Lua header and compile against Lua libraries This site offers great examples: Using Lua with C++ |
|||
|