Lua API global Variable Viewer (gvv)

by Ritn

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
12 days ago
1.0 - 2.0
3.24K

i Is it possible to get rid of metatable feature.

3 years ago

I encountered desync recently. I read the docs about the "global"variable again. The metatable feature of lua might cause this. I removed all the metatable in my code just now. But I found it in gvv.
I'm curious whether the desync is gone if all the metatables are gone.
I'll keep working on this. No idea if I can eventually find the solution.

3 years ago

Still I can't catch any clue of what can cause desync while using metatable in my code...
There are possibility of desync when seeing structure of target mod depending on how target mod written. Reason why is that gvv GUI & "global" elements are broadcasted along clients and syncronisity is reviewed by server and client. So a desync can be caused when gvv touches "almost forgotten and non-wellwritten" part of target mod.
Or, loading ability of "_G" of gvv mod also can cause desync if target mod is not designed _G part to be synced. Reason why is that gvv pulls submerged "_G" part of target mod to revealed surface and forces it to be checked syncronisity via GUI and own global table of gvv.

2 years ago

Hello,
The variables in "_G" must never change state because they change in the player who is going to use your mod but not in the others. This is what causes desynchronization.
Variables in "_G" are either constants or functions that will be called. (So it's not really variables I know)
Thank you.

New response