Page 1 of 1

TechnologyPrototypeFilters for researched/not researched

Posted: Mon May 25, 2020 2:58 pm
by ixu
I want to build a GUI where a technology can be selected. I tried to use the "choose-elem-button". But I cannot find how to filter researched or not researched technologies. The documentation seems to accept only a few options, but I want to have more.
https://lua-api.factorio.com/latest/Con ... ypeFilters
Or do I misunderstand the things here. Or are there other options (except programming it by myself). Utility-mods are also welcome.

Re: TechnologyPrototypeFilters for researched/not researched

Posted: Tue May 26, 2020 8:40 pm
by darkfrei
ixu wrote: Mon May 25, 2020 2:58 pm I want to build a GUI where a technology can be selected. I tried to use the "choose-elem-button". But I cannot find how to filter researched or not researched technologies.
See LuaForce
https://lua-api.factorio.com/latest/LuaForce.html
https://lua-api.factorio.com/latest/Lua ... chnologies #LuaForce.technologies

Re: TechnologyPrototypeFilters for researched/not researched

Posted: Tue May 26, 2020 11:16 pm
by ixu
I don't got your point.
Here you see a code sample:

Code: Select all

local button = frame.add {
	type = 'choose-elem-button',
	name = "Technology",
	elem_type = "technology",
	elem_filters = filter,
}
Would you mind changing this so that the selection panel will show only researched technologies?

Re: TechnologyPrototypeFilters for researched/not researched

Posted: Tue May 26, 2020 11:22 pm
by Rseding91
It's not possible. That button type does not work with technologies but technology prototypes. It's force-less and just shows 'technology prototypes'.

Re: TechnologyPrototypeFilters for researched/not researched

Posted: Wed May 27, 2020 11:51 am
by darkfrei
ixu wrote: Tue May 26, 2020 11:16 pm Would you mind changing this so that the selection panel will show only researched technologies?
Researched technologies by some force, but not the whole game.
If you add new force, it has no researched technologies, but the first force keeps the same researched technologies.

https://lua-api.factorio.com/latest/Lua ... eate_force #LuaGameScript.create_force

You can always make new force (up to 64 forces) and switch your force with:

Code: Select all

/c game.player.force = game.create_force("new_force")