Error : '}' expected

Place to get help with not working mods / modding interface.
Paulquicode
Manual Inserter
Manual Inserter
Posts: 3
Joined: Tue Feb 06, 2024 8:45 am
Contact:

Error : '}' expected

Post by Paulquicode »

Hi, I'm new to modding, and have this error when loading my mod :
Failed to load mods: __Legotorio__/data-final-fixes.lua:1: __Legotorio__/config.lua:10: '}' expected (to close '{' at line 9) near '='
stack traceback:
[C]: in function 'require'
__Legotorio__/data-final-fixes.lua:1: in main chunk

Here is the content of config.lua :

Code: Select all

return {
	-- lower case resource pack name, same of mod folder name (exclusing version) and "name" in info.json; no double underscores ("__")!
	resource_pack_name = "Legotorio",

	-- let the mod know what you will be retexturing
	data = {
			base = {
				graphics = {
					entity = {
						small-lamp = { 
						["lamp.png"] = { },
						["lamp-light.png"] = { },
						},
					},
				},
			},
		}
	}
Could you help me, please ?
meifray
Fast Inserter
Fast Inserter
Posts: 130
Joined: Sat May 29, 2021 6:12 pm
Contact:

Re: Error : '}' expected

Post by meifray »

You used ";" instead of ",".
It is all inside a teble so you should just use ","
Paulquicode
Manual Inserter
Manual Inserter
Posts: 3
Joined: Tue Feb 06, 2024 8:45 am
Contact:

Re: Error : '}' expected

Post by Paulquicode »

I don't see where I made the mistake, can you tell me where is it, please ?
Kyralessa
Filter Inserter
Filter Inserter
Posts: 797
Joined: Thu Sep 29, 2016 5:58 pm
Contact:

Re: Error : '}' expected

Post by Kyralessa »

I don't know Lua, so I could be wrong, but...

https://www.lua.org/manual/5.1/manual.html#2.1
Names (also called identifiers) in Lua can be any string of letters, digits, and underscores, not beginning with a digit.
You appear to be using small-lamp as an identifier, but hyphens - aren't allowed in identifiers.
Paulquicode
Manual Inserter
Manual Inserter
Posts: 3
Joined: Tue Feb 06, 2024 8:45 am
Contact:

Re: Error : '}' expected

Post by Paulquicode »

I resolved my bug by replacing "small-lamp" with ["small-lamp"] ! Thanks you very much !
Post Reply

Return to “Modding help”