Jump to content

Running Lua in C#


Davaris
 Share

Recommended Posts

This might help. http://www.gamedev.net/reference/articles/article2275.asp

 

I'm sure you'll need a 3rd party library.

 

I tried that one last night. I was hoping it would get me to the stage of compiling and running Lua scripts, but by the end of the tute, you only end up with a console to type commands into.

 

It occurred to me this morning that you probably can't integrate your own libraries into Lua with the Editor, without having access to the source code, as I assume you need to compile everything together. Or perhaps I don't understand it correctly?

 

Anyway it would be really nice if I could call my own C# or C++ libraries from the Lua in the LWs Editor.

Win 7 Pro 64 bit

AMD Phenom II X3 720 2.8GHz

GeForce 9800 GTX/9800 GTX+

4 GB RAM

Link to comment
Share on other sites

Thanks I found your post here.

 

Calling C++ functions from Sandbox LUA script

http://leadwerks.com/werkspace/index.php?/topic/208-calling-c-functions-from-sandbox-lua-script/

 

 

What I was not sure about, is there are a couple of flavors to chose from, so I didn't know if they would be compatible. Case in point, Josh was saying they were thinking about using Luabind here:

 

http://leadwerks.com/werkspace/index.php?/blog/1/entry-189-picking-up-speed/

 

What I'm thinking would be better in my case, is to add the third party libraries to the C# or C++ part of my engine and use something like this to get the needed data:

 

LUA GetKey, SetKey - How to use?

http://leadwerks.com/werkspace/index.php?/topic/277-lua-getkey-setkey-how-to-use/

 

The thread is pretty old now, so I don't know if it is still done this way in LWs.

Win 7 Pro 64 bit

AMD Phenom II X3 720 2.8GHz

GeForce 9800 GTX/9800 GTX+

4 GB RAM

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...