Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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?

share|improve this question
1  
This question is really too open-ended. You need to, at the very least, explain in some detail about what you want scripts to control and do in your game. –  Nicol Bolas Feb 14 '13 at 5:27
add comment

closed as not constructive by Nicol Bolas, Josh Petrie, Sam Hocevar, Byte56, bummzack Feb 14 '13 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.

1 Answer

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++

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.