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?
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 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, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.
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++