Help with Lua scripts not loading

KyubeyD3

Chieftain
Joined
Oct 6, 2019
Messages
17
When I tested the mod I'm making, none of the Lua-based mechanics were working; I checked Lua.log and sure enough, there were errors:

Code:
[372622.484] InGame: Loading MOD InGameUIAddin
    __________________________________________________________________________________________   
    Civ - The Sertão (Antônio Conselheiro)    Lua/ua_combat.lua   
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
[372622.484] Syntax Error: [filepath]/ua_combat.lua:1: unexpected symbol near 'ï'
[372622.484] Runtime Error: Error loading [filepath]/ua_combat.lua.
[372622.484] InGame: Loading MOD InGameUIAddin
    __________________________________________________________________________________________   
    Civ - The Sertão (Antônio Conselheiro)    Lua/ua_warbonuses.lua   
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
[372622.484] Syntax Error: [filepath]/ua_warbonuses.lua:1: unexpected symbol near 'ï'
[372622.484] Runtime Error: Error loading [filepath]/ua_warbonuses.lua.
[372622.484] InGame: Loading MOD InGameUIAddin
    __________________________________________________________________________________________   
    Civ - The Sertão (Antônio Conselheiro)    Lua/ub_prod.lua   
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
[372622.484] Syntax Error: [filepath]/ub_prod.lua:1: unexpected symbol near 'ï'
[372622.484] Runtime Error: Error loading [filepath]/ub_prod.lua.

I have no clue what any of this means, and how to fix it. What do you mean "unexpected symbol near 'ï'"???
Can I get some help here?
The Lua files are in the zip file.
 

Attachments

  • Lua.rar
    2.1 KB · Views: 162
I'd avoid using special characters (Ã, ï, `, etc.) in your file, folder, and project names, they seem to be messing things up.
Civ - The Sertão (Antônio Conselheiro)
 
Fixed the folder/project names, still not working.
Are _ and - also buggy special characters or something?
Code:
[425903.515] Syntax Error: C:\Users\username\Documents\My Games\Sid Meier's Civilization 5\MODS\Civ - The Sertao (Antonio Conselheiro) (v 6)\Lua/ua_combat.lua:1: unexpected symbol near 'ï'
[425903.515] Runtime Error: Error loading C:\Users\username\Documents\My Games\Sid Meier's Civilization 5\MODS\Civ - The Sertao (Antonio Conselheiro) (v 6)\Lua/ua_combat.lua.
[425903.515] Syntax Error: C:\Users\username\Documents\My Games\Sid Meier's Civilization 5\MODS\Civ - The Sertao (Antonio Conselheiro) (v 6)\Lua/ua_warbonuses.lua:1: unexpected symbol near 'ï'
[425903.515] Runtime Error: Error loading C:\Users\username\Documents\My Games\Sid Meier's Civilization 5\MODS\Civ - The Sertao (Antonio Conselheiro) (v 6)\Lua/ua_warbonuses.lua.
[425903.515] Syntax Error: C:\Users\username\Documents\My Games\Sid Meier's Civilization 5\MODS\Civ - The Sertao (Antonio Conselheiro) (v 6)\Lua/ub_prod.lua:1: unexpected symbol near 'ï'
[425903.515] Runtime Error: Error loading C:\Users\username\Documents\My Games\Sid Meier's Civilization 5\MODS\Civ - The Sertao (Antonio Conselheiro) (v 6)\Lua/ub_prod.lua.
 
Fixed the folder/project names, still not working.
Are _ and - also buggy special characters or something?
Those should be fine.

No clue what's actually causing the issue (I've never seen that error message before). Can you try removing and re-adding the relevant Lua files? If that doesn't work, you can try creating an entirely new project.
It's also handy if you could attach a copy of your mod (as it is in your MODS folder) in this thread if the problem persists.
 
Here's a copy of the mod.
 

Attachments

  • Civ - The Sertao (Antonio Conselheiro) (v 7).rar
    17.4 MB · Views: 219
The errors are pointing to an illegal symbol (ie, character) on the very first line of each of the lua files. But there is no such character on line 1 of any of the files in the mod you attached. Get rid of any non-English characters contained anywhere within the mod properties page (ie, the teaser, description, etc.) and hope this cures the issue.

My supposition though is that the files have been corrupted with hidden characters that are not allowing the file to be read.

Copy the contents of the lua files into a text-only text editor such as Notepad or Notepad++ and see what if anything "extra" shows as being part of the lua code from the text of the files.

You may need to completely delete the original files and re-create them. But if this is what you attempt, do not copy the files themselves and then re-add them to the mod. Copy the contents of the lua files into a text-only editor and save them as a text only format. You should then be able to re-create a new blank lua file in modbuddy and then copy/paste this content back into the new files.
 
Copy the contents of the lua files into a text-only editor and save them as a text only format. You should then be able to re-create a new blank lua file in modbuddy and then copy/paste this content back into the new files.

I did this and it worked, thanks!
 
Top Bottom