I want to implement an interesting concept into my game in which clients can program certain parts of their AI. I will provide them an unchangeable namespace and class formatting and they will code their AI within the class (I.e. OnEnemyInRange(Unit enemy) {}). I want to save this code in a string and run it as C# code in-game.
My problem is that I don't even know where to start. I've heard about reflection but only seen it done for method names. How would I go about running string as code? - conditions, methods, variables, and operations.
eval
. Google that and you will find answers. – Kilian Foth Jan 14 at 7:34