[2.0.73] Reading elem_tooltip for virtual signal returns invalid table

User avatar
Shemp
Burner Inserter
Burner Inserter
Posts: 16
Joined: Mon Jan 19, 2026 6:51 pm
Contact:

[2.0.73] Reading elem_tooltip for virtual signal returns invalid table

Post by Shemp »

Sorry, this is a minor annoyance and I wasn't sure how to summarise it in the title. To reproduce:

Start any Factorio game world.

Run these commands:

Code: Select all

/c x = game.player.gui.center.add{type = "frame"}; x.style.height = 100; x.style.width = 100
/c x.elem_tooltip = {type = "signal", name = "signal-A", signal_type = "virtual"}
This creates a GUI element with an element tooltip corresponding to a virtual signal.

When you try to read the elem_tooltip, perhaps to make a copy of it elsewhere, you get this:

Code: Select all

/c game.print(serpent.block(x.elem_tooltip))
elem-tooltip-read.png
elem-tooltip-read.png (133.82 KiB) Viewed 192 times

Code: Select all

{
	name = "signal-A",
	signal_type = "virtual",
	type = "virtual-signal",
}
"virtual-signal" (NOT "signal") is not a valid ElemType for creating an elem_tooltip.

EDIT: Oh, just to be really clear, I expect this output:

Code: Select all

{
	name = "signal-A",
	signal_type = "virtual",
	type = "signal",
}
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 4399
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [2.0.73] Reading elem_tooltip for virtual signal returns invalid table

Post by boskid »

Thanks for the report. Issue is now fixed for 2.1.

As a workaround when reading ElemID if you get type="virtual-signal" (incorrect value), replace it with type="signal" (correct value).
Post Reply

Return to “Fixed for 2.1”