You can but it costs you a 10 to 50 times more lines of code.thats actually what led me to asking this question on gameplay as i was wondering why I cant just do it in c++ and not a scripting language
Not necessarily -- its true that many scripting languages are compact or have features (e.g. actor-model, prototypal inheritance model) that lend themselves to scripting game entities and game interactions, but that does not mean that writing gameplay code in C++ has to more difficult or more verbose for the people "scripting" the gameplay elements, albeit in C++.
If you were to use C++ for gameplay code, you might not take any special effort if yourself or the entire team is fluent in C++ (and the engine); if you have less-experienced people "scripting" gameplay through C++, then your goal as an engine programmer would be much like any other task -- provide an API, or indeed an embedded domain-specific language, that makes it easy for client code "scripts" to express high-level intent while encapsulating the low-level details away; In practice, this ends up being not much different than the work of integrating a scripting language with your engine, though you might be providing more of the cogs and widgets yourself. The payoff is that, done well, your "scripting" staff gets many of the productivity, expressivity, sandboxing, and hand-holding benefits that stand-alone scripting languages are known for.
Indeed. This is basically the argument I try to make when I hear that you cant use C++ because the people doing the scripting have limited knowledge of programming and using native code will be too hard or whatever. If you know that the scripters or gameplay programmers or whoever only need a subset of functionality, then the engine should provide them with the appropriate API for that purpose. You can even implement a runtime compiled C++ type solution if they really dont want to work with a compiler. It's entirely possible to get close to the simplicity of a scripting language without taking on any of the negatives associated with them. The problem with scripting languages is that people tend to focus on the front-end benefits and dont realize the magnitude of the back-end drawbacks.
This is the sort of thing i was looking for because right now my "Team" is just two people and both of us are pretty good at c++ and we dont have plans to have more programmers on our team so thats why i was wondering why not just use c++ for gameplay code. if you know that no inexperienced c++ programmer will be usinng it.
Then I see no reason why you shouldnt just use C++ for all your code. And if you really need to be able to edit the code without re-compiling, you can consider this project:
https://github.com/RuntimeCompiledCPlusPlus/RuntimeCompiledCPlusPlus/wiki
thanks!!!!