You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
script.on_event(defines.events.on_player_created, function(event)
-- Enable map editor for the playerlocalplayer=game.get_player(event.player_index) ---@castplayer-nilplayer.toggle_map_editor()
end)
Problem: defines.events.on_player_created has a squiggly, complains about
"Cannot assign integer|defines.events.on_player_created to parameter string|defines.events|defines.events[].Lua Diagnostics.(param-type-mismatch)"
More info:
Version 3.5.3 of sumneko.lua
Version 1.1.22 of justarandomgeek.factoriomod-debug
Latest master of JanSharp/FactorioSumnekoLuaPlugin (JanSharp/FactorioSumnekoLuaPlugin@82c4053)
Factorio version 1.1.65 (self generated docs on 754f85d)
The type of event.player_index seems to work, it is EventData.on_player_created|on_player_created.player_index: uint.
It is not clear to me whether the problem is with the plugin or with the generated types by the debugger. According to the plugin readme, it should not touch the first on_event function argument, so I am reporting the issue here for now.
The text was updated successfully, but these errors were encountered:
Duh, found the issue. The old runtime-api.lua from previous debugger version was still in my Lua.workspace.library setting. Seems like the debugger added a bunch of junk to that setting too, without any notification.
Edit: Created #72 and #73 regarding the junk that was added to the workspace library setting.
Code in control.lua:
Problem:
defines.events.on_player_created
has a squiggly, complains about"Cannot assign
integer|defines.events.on_player_created
to parameterstring|defines.events|defines.events[]
.Lua Diagnostics.(param-type-mismatch)"More info:
Version 3.5.3 of sumneko.lua
Version 1.1.22 of justarandomgeek.factoriomod-debug
Latest master of JanSharp/FactorioSumnekoLuaPlugin (JanSharp/FactorioSumnekoLuaPlugin@82c4053)
Factorio version 1.1.65 (self generated docs on
754f85d
)The type of event.player_index seems to work, it is
EventData.on_player_created|on_player_created.player_index: uint
.It is not clear to me whether the problem is with the plugin or with the generated types by the debugger. According to the plugin readme, it should not touch the first on_event function argument, so I am reporting the issue here for now.
The text was updated successfully, but these errors were encountered: