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
8 days ago
1.0 - 2.0
3.14K

i Plz add tile prototype viewer feature into your mod.

4 years ago

I've just made this:
https://mods.factorio.com/mod/TilePrototypeViewer
Plz add this feature into gvv. Thanks.

4 years ago
(updated 4 years ago)

Sorry. This is a global variable viewer, not prototype explorer.
Reason why this mod have a function to show prototypes is that "game" is a global variable.

Factorio already have a built-in prototype explorer. I think default hotkey to open prototype explorer is Ctrl+Shift+E.
There is a section for tile prototypes in that explorer.

4 years ago

OK, it doesn't matter.

4 years ago

But, it looks not so difficult and not requires big changes, so i implemented it from 0.3.5

4 years ago

The reason I came to mention this, is that, both your tool and vanilla tool don't have a way to show how the tiles look when they are on ground.
By the way, I don't know how to code static text. I tried a slow way. It works, but it's never the best way. Any idea?

4 years ago
(updated 4 years ago)

https://github.com/x2605/gvv/blob/v0.3.6/modules/sprite.lua
This may be an example for you. My source code to get image from prototypes.
If given object is LuaTilePrototype and its name is "dirt-1" then
Sprite.img(object) will return a string "[img=tile/dirt-1]".

You can print image on screen using a richtext format.
https://wiki.factorio.com/Rich_text

4 years ago

https://github.com/x2605/gvv/blob/v0.3.6/modules/sprite.lua
This may be an example for you. My source code to get image from prototypes.
If given object is LuaTilePrototype and its name is "dirt-1" then
Sprite.img(object) will return a string "[img=tile/dirt-1]".

You can print image on screen using a richtext format.

Ohhh, this is great. Thank you very much.

https://wiki.factorio.com/Rich_text

New response