Topic: translate funcion in c++?

what is the equivalent of translate from lua in c++ ?

btw  is there  a way to use the script functions in c++?

the reason i need is i can code in c++ but i can't find equivalent of functions of lua in c++
my lua script is getting really huge i would like to get some character codes in a plugin .(its  not much yet but i would like to create character code in a plugin for future ).

Re: translate funcion in c++?

Crucio777 wrote:

i can't find equivalent of functions of lua in c++

Sometimes they have different names or they may even not exist and you need to do 2 or 3 lines of C++ code to replicate them.
The cool thing is that you just need to refer to the MScript source file to see how the Lua functions are made:
http://code.google.com/p/maratis/source … .cpp?r=203
Just do a search with your browser and you'll end up to the function body that you need.
With minor modifications you should get a working code.
In the case of "translate":

MVector3 axis(1,0,0);
axis = object->getRotatedVector(axis);
object->setPosition(object->getPosition() + axis);

Last edited by 255 (2013-10-21 19:58:56)

Re: translate funcion in c++?

oh thank you 255 .
i thought there might be an easier way for this but i guess ill have to work with that.