I want to have some script in a file, execute a function in that script, and have that function able to call a C++ function in my code.
Specifically I want to write script(s) that will be the configuration for my levels - so script1.txt will have script to configure stuff in level 1.
In the long run I would want to be able to download those scripts so I can give the user new levels.
really, I don’t care what scripting language - LUA would seem sensible as cocos2d-x seems to already support it. JavaScript would be dine - again as I understand it is supported ‘out of the box’.
I have now been searching for two days, and I have to say I am gobsmacked by the lack of information out there, considering LUA support at least has been part of cocos2d for ever!
I do not want to create a LUA or Javascript game, though. I just want to use scripts as a convenient and flexible way to supply configuration to my game.
I found
http://www.cocos2d-x.org/wiki/How_to_call_javascript_code_from_c++
which would seem to be what I want, if only there was actually any information there!
Surely someone is doing this sort of thing?