Lua
実行時にスクリプトをプロジェクトにロードしようとしています。ただし、そうしようとすると、ファイルのロード時に次のエラーが表示されます。
Items\food.lua:1: unexpected symbol near '・
ファイル自体は十分に単純ですが、この原因はわかりません:
config = {
itemtype = 2,
name = "Food",
basevalue = 1,
inventorytexture = 0,
red = 255,
green = 255,
blue = 255,
inventorywidth = 1,
inventoryheight = 1
}
C#
これが何か関係がある場合に備えて、これを で実行するために使用しているコードは次のとおりです。
// In main initialisation
public void ItemSetup()
{
itemTemplates.Add(new ItemTemplate("Items\\food.lua"));
}
// constructor for ItemTemplate class
Lua LuaLoader = new Lua();
public ItemTemplate(string filename)
{
LuaLoader.DoFile(filename); // here is where the error comes up
}
ファイル自体の設定を変更しようとしましたが、どれも役に立たないようです。このファイルの設定は次のとおりです。
Build Action: None
Copy to Output Directory: Copy of newer
Custom Tool: <blank>
Custom Tool Namespace: <blank>
File Name: food.lua
Full Path: [...]\Items\food.lua