I am creating a game, where part of the game play component is writing the logic for an AI. To do this, I would like to link a scripting language like python or lua to my game, then give the user a function that they may edit, which will be called by one of my c++ functions that handles game play. It would be ideal to let the bot be programmed in c++; however, having the user compile their bot into a .o file and then linking it to the game would be tedious, especially for users not very adept in c++ and using console commands. This is the reason I would like to use a scripting language, as it could be interpreted during run time.
in .cpp file i would like to do something like this
-import a scripting language
-open the file
-call function that writes to a .txt file
-parse the data from the .txt file
-execute based on the new data
Is it possible to use a scripting language in this fashion? If so, are there any resources that help explain how to do this?
Any other ideas for implementing a somewhat dynamically programmed AI would be greatly appreciated.