Lua API global Variable Viewer (gvv)

by x2605

This is a debugging tool. This mod adds commands /gvv and others and a hotkey(Ctrl+Shift+V) to allow you to check _G and global table of map or each mods. Only admins can use command if it is multiplay game. You have to input some code for temporary accessibility or have to edit "control.lua" of other mod or map to access global table of the mod or map. See "Helper" tab for instructions.

Utilities
2 years ago
1.0 - 1.1
2.71K

b ["<ERROR>"] Can't copy object of type function

2 years ago

Hello,
I believe there is the same issue in the "global" part when saving class/metadata in it.
When I save objects in global and this error appears :

Can't copy object of type function stack traceback: [C]: in ? [C]: in function 'call' __gvv__/modules/tree.lua:504: in function 'get_tree_value' __gvv__/modules/tracking.lua:70: in function <__gvv__/modules/tracking.lua:68> [C]: in function 'pcall' __gvv__/modules/tracking.lua:87: in function 'refresh_value' __gvv__/modules/tracking.lua:106: in function <__gvv__/modules/tracking.lua:96>

Thanks.

2 years ago

Hello,
I believe there is the same issue in the "global" part when saving class/metadata in it.
When I save objects in global and this error appears :

Can't copy object of type function stack traceback:
[C]: in ?
[C]: in function 'call'
__gvv__/modules/tree.lua:504: in function 'get_tree_value'
__gvv__/modules/tracking.lua:70: in function <__gvv__/modules/tracking.lua:68>
[C]: in function 'pcall'
__gvv__/modules/tracking.lua:87: in function 'refresh_value'
__gvv__/modules/tracking.lua:106: in function <__gvv__/modules/tracking.lua:96>

Thanks.

2 years ago
(updated 2 years ago)

Hello Ritn. Can you provide name & version of the mod causing problem?
I need some example to reproduce problem.

2 years ago

I just sent you a private message on the factorio forum to send you the mod which is not published yet.
It is under development.

2 years ago
(updated 2 years ago)

Have you ever tried

/c remote.call("__RitnTeleportation2__gvv","global")

console command? "global" remote function simply calls global table and returns global table itself to gvv, which is causing simple copy of global table, unlike "_G" function which gvv provides.

Error "Can't copy object of type function" is coming from remote.call() function which is standard factorio lua api function. https://lua-api.factorio.com/next/LuaRemote.html
Source of error is that remote.call() cannot handle some kinds of modification of data such as making table index into nil or child table into metatable of parent table(self looping). I tested gvv's trouble shooter(which locates source of error) and then factorio freezes, so I guess it is coming from presense of "self" child table which causing infinite folding.

I didn't expected such situations, therefore I decided to make trouble shooter better(to make it detect looping structure) near future.
And if possible, I will make "global" bringer similar to "_G" bringer, making it to filter out items which never can be handled in normal ways, in further future.

Thank you for reporting.

2 years ago

Hi again Ritn. Not much time passed since I replied :) haha.

I tried something and updated 0.5.0. Take a trial and inform me if you find something abnormal. Thank you.

2 years ago

Hi again x2605.
I saw the update indeed and for the moment everything is correct, thank you for this correction besides it will greatly help me now.
I'll let you know as soon as I see a few things.
Thanks.

New response