simple_streetlights mod issue: attempt to index global 'ilights' (a nil value) [SOLVED]

Post Reply
JGoffredo
Member
Posts: 16
Joined: Wed Mar 31, 2021 17:50
In-game: JGoffredo

simple_streetlights mod issue: attempt to index global 'ilights' (a nil value) [SOLVED]

by JGoffredo » Post

I was testing simple_streetlights mod and had this error starting the game.
2022-11-26 03:45:39: WARNING[Main]: Undeclared global variable "ilights" accessed at ...minetest12/.minetest/mods/simple_streetlights/simple.lua:5
2022-11-26 03:45:39: ERROR[Main]: ModError: Failed to load and run script from /home2/minetest12/.minetest/mods/simple_streetlights/init.lua:
2022-11-26 03:45:39: ERROR[Main]: ...minetest12/.minetest/mods/simple_streetlights/simple.lua:5: attempt to index global 'ilights' (a nil value)
2022-11-26 03:45:39: ERROR[Main]: stack traceback:
2022-11-26 03:45:39: ERROR[Main]: ...minetest12/.minetest/mods/simple_streetlights/simple.lua:5: in main chunk
2022-11-26 03:45:39: ERROR[Main]: [C]: in function 'dofile'
2022-11-26 03:45:39: ERROR[Main]: ...2/minetest12/.minetest/mods/simple_streetlights/init.lua:13: in main chunk
2022-11-26 03:45:39: ERROR[Main]: Check debug.txt for details.
2022-11-26 03:45:39: ACTION[Main]: Server: Shutting down
The error happens in this line:
ilights.player_channels = {} -- last light source channel name that was set by a given player
After some study, and looking other mods (I am still learning Lua.) I placed this line before the line shown above:
ilights = {}
And worked fine.

User avatar
Blockhead
Member
Posts: 1602
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: simple_streetlights mod issue: attempt to index global 'ilights' (a nil value) [SOLVED]

by Blockhead » Post

You should open an issue and/or a pull request over at the mod's GitHub so this can be fixed easily for everyone in an update.
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

wsor4035
Member
Posts: 182
Joined: Sun Aug 11, 2019 21:23
GitHub: wsor4035
IRC: wsor
In-game: wsor

Re: simple_streetlights mod issue: attempt to index global 'ilights' (a nil value) [SOLVED]

by wsor4035 » Post

not actually a proper fix, should use https://github.com/mt-mods/ilights
j5uBLfc6NxgersvVj5D5dIsiKDkoQb0o

wsor4035
Member
Posts: 182
Joined: Sun Aug 11, 2019 21:23
GitHub: wsor4035
IRC: wsor
In-game: wsor

Re: simple_streetlights mod issue: attempt to index global 'ilights' (a nil value) [SOLVED]

by wsor4035 » Post

j5uBLfc6NxgersvVj5D5dIsiKDkoQb0o

JGoffredo
Member
Posts: 16
Joined: Wed Mar 31, 2021 17:50
In-game: JGoffredo

Re: simple_streetlights mod issue: attempt to index global 'ilights' (a nil value) [SOLVED]

by JGoffredo » Post

Thanks. I tested here and worked fine after installing ilights.

"basic_materials" is duplicated in optional dependency list.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests