I'm about to start scripting Lua for my current project. I'll be using Luabind to bind it to c++. But before I started scripting I wanted to make sure I understood how this is typically done, and what things it's typically done for.
My understanding of it as it stands is that I will create a scripts folder in my project folder and put a few more folders in that specifying the type of scripts inside for organization. Inside those I'll make short .lua scripts for each type of enemy/item/etc. These scripts will contain a few methods like OnCreate() to set up the values of the c++ instance of "Enemy"
When I start the game it will load the map (I'm using .tmx files for loading maps) and through reading the map it will find say an enemy on tile (16,12) with a name value of "man." It will create an instance of "Enemy.cpp" and in the constructor of "Enemy.cpp" it will take the name value and find "scripts/enemies/man.lua" and call the OnCreate() method of that .lua file which will set up the values that go along with the "man" enemy.
I also plan to have an Update() method that will keep track of AI and that particular enemies behavior. The Update() method will be called every time the enemy finished the last task provided by the Update() method.
I also plan to make similar scripts for abilities and actions/spells (like attacks or teleports) as well as quests (although those will be implemented fairly differently.)
I just want to make sure I'm on the right path with this as I haven't been able to find to many examples.