More specifically the full error is
../../Scripts/LuaTest.lua:1: unexpected symbol near 'ï'
I have checked the LuaTest.lua
file with different editors to include Notepad++ and can not find any extra/hidden characters. I'm at a loss to what could be causing this.
Side note, I'm following this guide: Godpatterns: Scripting with Lua in C#
Here is the main code block:
class Program
{
static void Main(string[] args)
{
Lua lua = new Lua();
Program program = new Program();
// register our C# functions
lua.RegisterFunction("DanSays", program, program.GetType().GetMethod("DanSays"));
lua.RegisterFunction("ThorSays", program, program.GetType().GetMethod("ThorSays"));
lua.DoFile("../../Scripts/LuaTest.lua");
Console.ReadLine();
}
public void DanSays(string s)
{
Console.WriteLine("Dan Says > " + s);
}
public void ThorSays(string s)
{
Console.WriteLine("Thor says > " + s);
}
}
Additionally, here is LuaTest.lua
DanSays("Hey, Thor!");
ThorSays("Hi Dan! You know Thursdays . . . ");
DanSays("*sigh* yeah, Thor, I know Thursdays.");
ThorSays("Named after me you know!");
DanSays("Yeah, I know.");