General Question: Why Lua?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
snarlynarwhal
Posts: 4
Joined: Tue Sep 25, 2018 11:55 am

General Question: Why Lua?

Post by snarlynarwhal »

I do not know much about integrating scripting languages and hence became curious about why the Dialogue System uses Lua both in general and as supposed to say C#. A couple of specific questions:
  • Without third-party support, C# used JIT which takes time making it unfavorable as a scripting language, right?
  • What about third-party C# script execution engines like CS-Script?
  • If CS-Script is a feasibly alternative, does it have any notable pros and cons in comparison to Lua?
  • For example, does Lua's dynamic capabilities offer more functionality or flexibility than C#'s dynamic capabilities?
Thanks ahead for any explanations! Just looking to satisfy my curiosity about scripting engine integrations. Any information or links to articles where I can learn more would also be much appreciated.

Thanks!
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: General Question: Why Lua?

Post by Tony Li »

Hi,

The Dialogue System started life as a Unity front-end for a third party authoring tool called Chat Mapper. Chat Mapper uses Lua because:

1. It's a popular language that's familiar to many modders and game developers, and is one of the easier languages to learn, and

2. It's easy to integrate into existing engines.

When Chat Mapper was designed, Lua was the de facto standard for this type of scripting interface. It's still widely used and in fact might still be the most commonly-used modding language.

So when the Dialogue System was designed, there was really no choice. In order to support Chat Mapper, it had to support Lua. Some devs use the Dialogue System's Lua environment very extensively, even exposing it as an in-game dev console and as a player modding interface that ties into their own C# code. Most, however, never touch a single character of Lua and instead just use the Dialogue System's dropdown to automatically generate Lua statements.
snarlynarwhal
Posts: 4
Joined: Tue Sep 25, 2018 11:55 am

Re: General Question: Why Lua?

Post by snarlynarwhal »

Thanks for the thorough reply! I love the Lua scripting integration and the visual tools you created for it btw, really excited to integrate this into my game.
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: General Question: Why Lua?

Post by Tony Li »

Thanks! Have fun with it. If any questions come up, you know where to post. :-)
Post Reply