uLua Asset Store Page Lua + LuaJIT + LuaInterface Supported Platforms: iOS, Android, Windows, Mac, Linux Want Lua support in your project? This package comes with everything you need, ready to go on all of the major platforms. Features: - Lua 5.1.4 for all supported platforms - Amazing Lua performance thanks to LuaJIT - LuaInterface based for powerful C# integration - Additional LuaInterface features: Lua Coroutines, Unity error handling, more Lua API functions - Prebuilt Lua plugin See readme for usage. ulua-support@polynationgames.com E-mail us for support if anything is not working. We'll try our best to help! We can add more examples on request.
Nice! I remember there being another plugin a while back when I was looking into this (kopilua). I suppose this solves most of the issues surrounding integration. I guess you took the dll route (hence LuaInterface) so definitely can't use this for browser runtime. Also one of the main reason I took interest in using Lua in Unity is to allow scripting during runtime and be able to execute it. I'm guessing this plugin allows for that?
The LuaInterface DLL works fine in browsers/web player. The Dialogue System for Unity uses George Foot's KopiLuaInterface, which you can see in action in all the browser demo scenes here: http://www.pixelcrushers.com/dialogue-system-demos/ I don't see why uLua would be any different.
You might need to check Unity's usage guidelines for their logo, not sure you're allowed to make it blue etc.
@topherr "Unity does not support Native Plugins for the WebPlayer, so uLua will never work until they change that policy due to using a C library for the Lua runtime." Is there a way to make this package work with WebPlayer like KopiLuaInterface from George Foot ? Pixel Crusher got KopiLuaInterface working in the Dialogue System. Cheers.
You just need to play the demos to see proof. ;-) It uses KopiLua, which is a pure C# implementation of Lua, so no issues with C libraries. Sorry, I didn't mean to sidetrack this thread. Since virror wrote "LuaInterface based for powerful C# integration," I figured uLua would be the same, which is the only reason why I mentioned it.
I spoke to topherr and he's using a C-runtime (probably of the JIT). It's also probably faster than the C# runtime version (not sure how much faster). Perhaps Topherr could provide more info. Cheers.
@TonyLi, In the case that uLua is much faster than KopiLua, would it be possible for your Dialogue System to add support for uLua in addition to KopiLua.
I'm kind of interested in a Lua add-on for unity, but there's not a lot of info about this and what it's capable of. The lack of replies from the author is a bit discerning.
I've been emailing the author and he's answering right away. Perhaps he's not getting notifications from the forum.. I did inform him that people are using the forum. @Virror, Videos and example documentations would really help potential buyers appreciate the power and flexibility of uLua. Cheers.
I haven't done any benchmarking, but I can't imagine that the C implementation would be significantly faster than the C# implementation in most cases. They're both written in native, compiled languages. I'd be curious to see if there was any performance difference in benchmarks. Even if there were, for the Dialogue System it wouldn't make any difference in performance for the player because of where Lua is used in it. However, if you really wanted to swap out KopiLuaInterface, as I mentioned earlier on the Dialogue System thread there's a bridge class between the Dialogue System and whatever Lua implementation is underneath. You could always replace that bridge class with one that references a different Lua implementation.
Hey guys, I got rocki's e-mail and it seems my notifications weren't working, but I'll keep an eye on it and get some answers for people. Additionally currently looking into WP8 version, and C# interpreters to cover the WebPlayer but it will lose the performance of LuaJIT.
Yes it does, additionally it provides a means to DLC game logic (missions, scripted abilities etc) which you otherwise cannot do in Unity at the moment.
What info would you like? Generally I'm also working on our game that we put uLua together for, so I've not had time to put up a website.
I can't comment on existing C# implementations at the moment but uLua uses LuaJIT which when compared to the standard Lua runtime has -huge- performance improvements. Check here for benchmarks comparing LuaJIT with http://luajit.org/performance_x86.html
Sorry, the JIT support slipped my mind when I was replying. Yes, I won't argue at all that this will make it faster than KopiLuaInterface. For the purposes of the Dialogue System, it won't make any noticeable difference, but I can imagine uses where it would make a big difference.
It's simply that I'm not sure what you can do with it, how it ties into unity, how to use it, etc. I'm sure you have that covered in the documentation, but since the documentation is not public, it's hard to judge before I make a purchase.
Some working code examples of how uLua is integrated with Unity in a game scenario would be really nice to have.
I'm going to see about getting the documentation public first, then look into covering some examples of uLua usage in a game scenario. Not sure how long this will take, as we're working on a game as well. Initially I only imagined uLua being used by people already in need of Lua in their game and aware of where they will use it. It seems people are interested in how they might use it, curious at least, so I can see the need to explain uLua much more. Suggestions on what people would like to see would be appreciated!
I'm guessing that many people would like to see examples that allow the player to write and run scripts during runtime. If you're only writing code at design time, you might as well use the built-in C#, UnityScript, or Boo.
Some ideas: 1. Use Lua to create mini games that can be dynamically loaded into unity. 2. Use Lua to create game UI's, create events and handle events for the generated GUI. 3. Use Lua to to create and communicate with Unity's GameObjects, Components, Scripts, etc. Edit: This is what I asked in Dialogue System forum, I thought I would also ask it here. I'm wondering if it's possible to do all of the following in Lua without having to writing any preparatory C# code. 1. Define an onPowerUp event. 2. Create a button that fires the onPowerUp event. 2. Create a cube using Lua. 3. Create a listener function 4. Attach listener to cube. So when the user clicks the button, the onPowerUp event fires, the cube then fires the listener function. Edit: I found this posting hegallis.blogspot.in/2009/02/lua-in-net.html Is there a way to define event delegates so that they can be totally generic so that lua can create its own custom events.
http://gfootweb.webspace.virginmedia.com/LuaDemo/ I ran into this interesting lua integration demo a while back. Can uLua make calls directly to c# similar to that code example or does it only allow usage of declared interfaces in code?
@topherr Is there a trial version that we can test out the package. Would like to know that it works well on the various supported platforms. Cheers.
So, how do i use this? : p How do i aff my own stuff to this, as an example if i want to have lua functions for creating GUI or for calling my own C# functions?
fastest lua binding for unity3d, 10x-100x faster than ulua. you can use slua https://github.com/pangweiwei/slua, feature: static code generating, no reflection, no extra gc alloc, very fast above 90% UnityEngine interface exported ( remove flash, platform dependented interface ) 100% UnityEngine.UI interface ( require Unity4.6+ ) support UnityEvent/UnityAction for event callback via lua function support delegate via lua function support custom class exported export enum as integer return array as lua table using raw lua 5.3, can be replaced with luajit/lua5.1.