-
February 12th, 2019, 18:25 #1
Extension error loading lua script
Having an error trying to load a script thru an extension. I keep getting this error message in the console during loading: Script Error: [string "scripts/gmw.lua"]:1: '=' expected near '»'
I have stripped this extension down to bare minimum and I'm stuck. It's time for a new set of eyes to point out my stupid mistake. lol
Thanks and here's the .ext for debugging.
-
February 12th, 2019, 18:55 #2
function onInit()
Debug.console("here")
End
Should be:
function onInit()
Debug.console("here")
end
There is no keyword in lua that matches what's in the code 'End', the keyword you want is 'end', all non-capital letters.Extension writer, FGU Backer, Ultimate License holder.
5E Enhancer (development and support on hold for now)
Combat Enhancer 5E Classic (no longer officially supported, community support only)
ps. Do not send PM's for support for the extensions I write, I will not not be able to respond there. Use the relevant forum threads instead so the community can benefit from the replies, thank you.
-
February 12th, 2019, 18:59 #3
Let me recommend the following sources for lua:
https://docs.coronalabs.com/guide/st...Lua/index.html
https://www.tutorialspoint.com/lua/lua_overview.htm
Good luck with your coding.Extension writer, FGU Backer, Ultimate License holder.
5E Enhancer (development and support on hold for now)
Combat Enhancer 5E Classic (no longer officially supported, community support only)
ps. Do not send PM's for support for the extensions I write, I will not not be able to respond there. Use the relevant forum threads instead so the community can benefit from the replies, thank you.
-
February 12th, 2019, 19:03 #4
You also have the file encoding set to UTF-8 BOM. Set it to just UTF-8. Its the file encoding thats throwing that weird error you mentioned.
For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e
-
February 12th, 2019, 19:07 #5
If you are using an editor like notepad++ you can change the file encoding using the Encoding menu at the top.
For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e
-
February 12th, 2019, 19:15 #6
- Join Date
- Jun 2013
- Location
- Isanti, MN
- Posts
- 2,922
You had some kind of weird encoding on the scripts/gmw.lua file:
$ file gmw1.lua
gmw1.lua: UTF-8 Unicode (with BOM) text, with CRLF line terminators
scripts
$ cat -t gmw.lua
M-oM-;M-?function onInit()^M
Debug.console("here")^M
End
scripts
-
February 12th, 2019, 20:09 #7
I opened it in Visual Studio Code and it must have stripped out the encoding issues.
A good code editor will make your life much easier as well, add in extensions as needed to get keyword highlighting and such things etc.Extension writer, FGU Backer, Ultimate License holder.
5E Enhancer (development and support on hold for now)
Combat Enhancer 5E Classic (no longer officially supported, community support only)
ps. Do not send PM's for support for the extensions I write, I will not not be able to respond there. Use the relevant forum threads instead so the community can benefit from the replies, thank you.
-
February 12th, 2019, 20:46 #8
I agree about the code editors. I was using visual studio to create the script that created the file. The VS editor rocks. i can't believe I never thought to check the encoding. Changing it to UTF-8 instead of UTF-8 BOM worked like a charm.
Thanks everyone
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks