Lua embedding

Started by
23 comments, last by Sneftel 21 years, 8 months ago
Well for MindScript we create a function in a special header file that the interpreter calls called builtin.h. Inside of builtin.h we create our internal functions like say we want to add a function called LoadAMesh( meshname , x , y...etc. We create a new object called LoadAMesh and create the parameters that it will take. Then we write what is to happen when LoadAMesh is read in a script file. In this case we would have it take the variables you pass through it and then proceed to load a mesh at the designated x y an z.

Mindgamez Entertainment
Advertisement
So if I understand correctly you would the VM would get an opcode for a function call, followed by the function "index". The index would lookup into a table to figure out the number of params and such like and the function to call?

Thanks.
Yes essentially that''s what goes on (in mine at least)
Thanks.

That makes things clearer for when I finally get around to finnishing my VM!

btw you must be up late over there in the USA
Glad I could be of some help, and yes, its 2:30 AM here lol I need to go to bed...

Mindgamez Entertainment

This topic is closed to new replies.

Advertisement