I have loved Lua scripting for years and I have the urge to make a small webplayer game that allows players to script in Lua (no details yet) would it be possible to convert Lua into javascript while the game is running? (I am willing to take the time to make it work work myself I just don’t have any method to start it.)
The problem you would run into is that it’s not possible to add on extra scripts at runtime. This is because .NET is compiled into an intermediate layer prior to the game running.
You could however write an extensive translator tool and call those functions via reflection, however that would be a pretty large undertaking, as it would essentially be a text interpreter that has to take in all the nuances of the script.
It would take less time to learn to script well in js. I too have a little lua in my vains. I hear that is what they used for WoW. When i was learning a little something about blitz though, i came across a fighting game where you had to code in the moves to hit someone. Faster coder type of thing. Now that would be a cool idea with unity :idea:
I already know javascript. But I prefer Lua. And about not being able to create scripts a runtime. Its actually going to be a function that reads a .Lua (which is the same as a .txt) file and generates the javascript equivilent. =P
As NTero pointed out, the problem is not creating something that translates LUA into JS on the fly. The problem is: even if you write the translator, UnityEngine won´t have access to this translation because there won´t be .NET dlls to these new on the fly scripts.
What you´ll have to do is write a LUA interpreter in JS or C# integrated to UnityEngine that can read the scripts and translate into Unity instructions. If that´s your objective with Unity, it´s a great thing to have another language available, but if your intention is to write games with Unity, like most of users of Unity, I don´t think it´s worth the effort.