[MOD 0.12.12+] Research queue 1.2.6

Topics and discussion about specific mods
MrDoomah
Fast Inserter
Fast Inserter
Posts: 196
Joined: Mon Jun 01, 2015 1:11 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.5

Post by MrDoomah »

Xillian112 wrote:This mod cause lags if i queue something ...
Sorry for bad english =(
What kind of lag? A slight stutter when you add an item to the queue or a real lagspike (1 second or longer)? The first one is normal when there is a (long) queue and you add an item with many prerequisites.

Xillian112
Burner Inserter
Burner Inserter
Posts: 12
Joined: Mon Apr 18, 2016 6:36 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.5

Post by Xillian112 »

MrDoomah wrote:
Xillian112 wrote:This mod cause lags if i queue something ...
Sorry for bad english =(
What kind of lag? A slight stutter when you add an item to the queue or a real lagspike (1 second or longer)? The first one is normal when there is a (long) queue and you add an item with many prerequisites.
~5 Seconds no lag, 1 second or 2 seconnds lag, 5seconds no lag, 1 or 2 seconds lag .............. it goes untill all researchs completed.

MrDoomah
Fast Inserter
Fast Inserter
Posts: 196
Joined: Mon Jun 01, 2015 1:11 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.5

Post by MrDoomah »

Are you using any other mods?

Xillian112
Burner Inserter
Burner Inserter
Posts: 12
Joined: Mon Apr 18, 2016 6:36 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.5

Post by Xillian112 »

MrDoomah wrote:Are you using any other mods?
"name": "base",
"name": "Aircraft",
"name": "autofill",
"name": "bobassembly",
"name": "bobconfig",
"name": "bobelectronics",
"name": "bobenemies",
"name": "boblibrary",
"name": "boblocale",
"name": "boblogistics",
"name": "bobmining",
"name": "bobmodules",
"name": "bobores",
"name": "bobplates",
"name": "bobpower",
"name": "bobtech",
"name": "bobwarfare",
"name": "clock",
"name": "crafting-equipment",
"name": "DeepMining",
"name": "EvoGUI",
"name": "FactorioBasics-Core",
"name": "FactorioBasics-Equipment",
"name": "FactorioBasics-Logistics",
"name": "FactorioBasics-Machines",
"name": "FactorioBasics-Power",
"name": "FactorioBasics-Transport",
"name": "FactorioBasics-Weaponry",
"name": "FARL",
"name": "InitialScan",
"name": "K&L-Inserters",
"name": "Landfill",
"name": "LogisticsMining",
"name": "Logistics Railway",
"name": "long-reach",
"name": "RailTanker",
"name": "reverse-factory",
"name": "rso-mod",
"name": "RSORadar",
"name": "SmartTrains",
"name": "Treefarm-Lite",
"name": "WaiTex",
"name": "Warehousing",
"name": "YARM",

Sworn
Fast Inserter
Fast Inserter
Posts: 167
Joined: Sun Apr 03, 2016 8:10 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.5

Post by Sworn »

hay dude, nice work, i like it and i'm using :) !!

here are something that can make things better, for my point of view.
  • 1 - When you click on the button " \/ " at the RQ menu at left, to go down your research list, its change to " /\ " then you click again and it goes up instead of down, would be better if the " /\ " up button appears at right side instead of push the down button to the right, same thing on the bottom buttons.

    2 - Would be nice to have on RQ menu an checkbox like "Don't show RP GUI when research finishes"

    3 - Would be nice to have an Close button on RQ GUI instead of clicking on the RQ icon

judos
Filter Inserter
Filter Inserter
Posts: 266
Joined: Mon Dec 08, 2014 11:17 am
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.5

Post by judos »

Hi there,

Great mod! :)

However Roktaal just found an error by using robotMiningSite mod of mine together with research queue.
Image

The problem seems to be that the method find_entity was renamed to find_entities in your initialise.lua but is still used with the old name in control.lua:

Code: Select all

script.on_event(defines.events.on_force_created, function(event)
	if global.researchQ == nil then init() end
	if global.researchQ[event.force.name] == nil then global.researchQ[event.force.name] = {} end
	if global.labs[event.force.name] == nil then global.labs[event.force.name] = find_entity({type = "lab", force = event.force}) end
end)
Can you update your mod with this small fix? Thanks a lot :)

MrDoomah
Fast Inserter
Fast Inserter
Posts: 196
Joined: Mon Jun 01, 2015 1:11 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.5

Post by MrDoomah »

Xillian112 wrote:
MrDoomah wrote:Are you using any other mods?
list
This sound normal, it shouldn't lag. Can you provide me with a zip of your mod folder?

User avatar
ZombieMooose
Filter Inserter
Filter Inserter
Posts: 289
Joined: Mon Feb 09, 2015 7:23 am
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.5

Post by ZombieMooose »

hello, I have a problem - the size of the menu keeps changing to the point where I can't click the button to close it (I have to save, then load to get it down)

is there a way to stop the change in window size?
"men will literally learn everything about ancient Rome instead of going to therapy"

Smoovious
Long Handed Inserter
Long Handed Inserter
Posts: 99
Joined: Sun Jan 31, 2016 12:14 am
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.5

Post by Smoovious »

Sworn wrote:2 - Would be nice to have on RQ menu an checkbox like "Don't show RP GUI when research finishes"
^ ^ THIS ^ ^

-- Smoov

scherzeking
Burner Inserter
Burner Inserter
Posts: 10
Joined: Sat May 07, 2016 10:00 am
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.5

Post by scherzeking »

I get laggs too in every 2 - 3 seconds for a like 1/4 sec. when I queue too much... (like more then 10- 20+)

creekz
Burner Inserter
Burner Inserter
Posts: 15
Joined: Wed May 11, 2016 3:49 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.5

Post by creekz »

Smoovious wrote:
Sworn wrote:2 - Would be nice to have on RQ menu an checkbox like "Don't show RP GUI when research finishes"
^ ^ THIS ^ ^

-- Smoov
viewtopic.php?f=92&t=17219&start=50#p147694

sparr
Smart Inserter
Smart Inserter
Posts: 1327
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.5

Post by sparr »

Feature request: Add a category filter to hide researches that don't have any item unlocks in themselves or their children. I don't care to research all the damage upgrades and speed bonuses and such, but I do want to research other things with "2" and "3" indicators that actually unlock stuff.

sparr
Smart Inserter
Smart Inserter
Posts: 1327
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.5

Post by sparr »

Bug report: If the Q window gets too big it can cover up the RQ button, leaving no (obvious?) way to close the window. I had to do `/c game.player.gui.center.Q.destroy()` from the console.

Biffelbob
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sat May 28, 2016 8:39 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.5

Post by Biffelbob »

Bug Report: Conflict with "Robot Mining Site" (viewtopic.php?f=92&t=23521)

Posted on Github for Robot Mining Site:
https://github.com/judos/robotMiningSite/issues/6

Error when finishing Automation 1 with both mods enabled.

MrDoomah
Fast Inserter
Fast Inserter
Posts: 196
Joined: Mon Jun 01, 2015 1:11 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.5

Post by MrDoomah »

Biffelbob wrote:Bug Report: Conflict with "Robot Mining Site" (viewtopic.php?f=92&t=23521)

Posted on Github for Robot Mining Site:
https://github.com/judos/robotMiningSite/issues/6

Error when finishing Automation 1 with both mods enabled.
whoopsie, my bad. I somewhere renamed a function, but didn't rename the function call. Fixed now: download/file.php?id=11722

sparr
Smart Inserter
Smart Inserter
Posts: 1327
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.6

Post by sparr »

Here's a patch so that filtering out certain science colors will also check tech prerequisites:

Code: Select all

diff --git a/functions/draw_grid.lua b/functions/draw_grid.lua
index f248b77..8f2d008 100644
--- a/functions/draw_grid.lua
+++ b/functions/draw_grid.lua
@@ -46,16 +46,40 @@ function technologies(player)
 	if global.showIcon[player.index] then colSpan = set_colspan else colSpan = math.floor(set_colspan / 3) end --create a smaller table if text is displayed.
 	local rq_table = player.gui.center.Q.add2q.add{type = "table", name = "add2q_table", style = "rq-table1", colspan = colSpan}
 	local count = 0
+
+	local banned_sciences = {} -- create a table of research ingredients that the research may not have.
+	for item, science in pairs(global.science) do
+		if not science[player.index] then table.insert(banned_sciences, item) end
+	end
+
 	for name, tech in pairs(player.force.technologies) do
-		if tech.enabled and (not tech.researched or global.showResearched[player.index]) then --checks if the research is enabled and either not completed or if it should show completed.
-			if (global.showExtended[player.index] or not tech.upgrade or not any(tech.prerequisites, "upgrade") or any(tech.prerequisites, "researched") or matches(tech.prerequisites, "name", global.researchQ[player.force.name])) then
-			-- ^checks if the research is an upgrade technology and whether or not to show it.
-				local t = {} -- create a table of research ingredients that the research may not have.
-				for item, science in pairs(global.science) do
-					if not science[player.index] then table.insert(t, item) end
-				end
+
+		if tech.enabled and -- only show researchable tech
+		(not tech.researched or global.showResearched[player.index]) then -- optionally show researched tech
+
+			if global.showExtended[player.index] or -- optionally show all reachable techs
+				not tech.upgrade or -- don't show upgrades by default
+				not any(tech.prerequisites, "upgrade") or -- don't show techs with upgrade prereqs by default
+				all(tech.prerequisites, "researched") or -- do show techs with researched pre-requisites
+				matches(tech.prerequisites, "name", global.researchQ[player.force.name]) -- do show already queued techs
+			then
 				
-				if not matches(tech.research_unit_ingredients, "name", t) then --checks if any on the research ingredients match the banned list
+				-- check if any of the research ingredients match the banned list, including pre-requisites
+				banned_science = false
+				techs_to_check = {tech}
+				while #techs_to_check > 0 do
+					local t = techs_to_check[#techs_to_check]
+					if matches(t.research_unit_ingredients, "name", banned_sciences) then
+						banned_science = true
+						break
+					end
+					table.remove(techs_to_check,#techs_to_check)
+					for _,new_t in pairs(t.prerequisites) do
+						techs_to_check[#techs_to_check+1] = new_t
+					end
+				end
+
+				if not banned_science then
 					local background1, background2 = nil, nil --select the right (color) of background depending on the status of the technology (done/available or in queue)
 					if tech.researched then 
 						background1 = "rq-done-frame"
This fixes the problem where you've got blue tech hidden, and you queue a green tech just to discover that it auto-queues some blue prereqs.

sparr
Smart Inserter
Smart Inserter
Posts: 1327
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.6

Post by sparr »

Here's a patch that lets you filter out techs that don't unlock any recipes.

Code: Select all

diff --git a/control.lua b/control.lua
index de7ee8c..b5889ca 100644
--- a/control.lua
+++ b/control.lua
@@ -5,6 +5,12 @@ require("functions.draw_grid")
 require("functions.initialise")
 
 script.on_configuration_changed(function(event)
+
+	-- mini-Migration
+	if global.showRecipesOnly == nil then 
+		global.showRecipesOnly = {}
+	end
+	
 	if event.mod_changes ~= nil and event.mod_changes["research-queue"] ~= nil then
 		init()
 		for index, _ in pairs(game.players) do
@@ -86,6 +92,10 @@ script.on_event(defines.events.on_gui_click, function(event)
 		global.showResearched[player.index] = not global.showResearched[player.index]
 		drawGrid(force)
 		
+	elseif event.element.name == "rq-showrecipesonly" then
+		global.showRecipesOnly[player.index] = not global.showRecipesOnly[player.index]
+		drawGrid(force)
+		
 	elseif event.element.name == "rqextend-button" then
 		global.showExtended[player.index] = not global.showExtended[player.index]
 		if not global.showExtended[player.index] then global.offset_tech[player.index] = 0 end
diff --git a/functions/draw_grid.lua b/functions/draw_grid.lua
index 8f2d008..aa7190c 100644
--- a/functions/draw_grid.lua
+++ b/functions/draw_grid.lua
@@ -29,6 +29,8 @@ function options(player)
 	
 	options.add{type = "checkbox", name = "rqscience", style = "rq-scienceDone-checkbox", state = not global.showResearched[player.index]}
 	
+	options.add{type = "checkbox", name = "rq-showrecipesonly", style = "rq-showrecipesonly-checkbox", state = global.showRecipesOnly[player.index]}
+	
 	for name, science in pairs(global.science) do
 		if global.showExtended[player.index] or not (global.bobsmodules[name] or global.bobsaliens[name]) then
 			options.add{type = "checkbox", name = "rq-science"..name, style = "rq-tool"..name, state = not science[player.index]}
@@ -40,6 +42,15 @@ function options(player)
 	end
 end
 
+function techHasRecipes(tech)
+	for k,v in pairs(tech.effects) do
+		if v.type=="unlock-recipe" then
+			return true
+		end
+	end
+	return false
+end
+
 function technologies(player)
 	local caption = player.gui.center.Q.add2q.add{type = "label", name = "add2q_caption", caption = "List of technologies"} 
 	caption.style.minimal_width = set_colspan * 68
@@ -55,7 +66,8 @@ function technologies(player)
 	for name, tech in pairs(player.force.technologies) do
 
 		if tech.enabled and -- only show researchable tech
-		(not tech.researched or global.showResearched[player.index]) then -- optionally show researched tech
+		(not tech.researched or global.showResearched[player.index]) and -- optionally show researched tech
+		(techHasRecipes(tech) or not global.showRecipesOnly[player.index]) then
 
 			if global.showExtended[player.index] or -- optionally show all reachable techs
 				not tech.upgrade or -- don't show upgrades by default
diff --git a/functions/initialise.lua b/functions/initialise.lua
index 2463faf..7b59ea0 100644
--- a/functions/initialise.lua
+++ b/functions/initialise.lua
@@ -10,6 +10,7 @@ function init()
 	end
 	if global.showIcon == nil then global.showIcon = {} end
 	if global.showResearched == nil then global.showResearched = {} end
+	if global.showRecipesOnly == nil then global.showRecipesOnly = {} end
 	if global.offset_queue == nil then global.offset_queue = {} end
 	if global.offset_tech == nil then global.offset_tech = {} end
 	if global.showExtended == nil then global.showExtended = {} end
@@ -47,6 +48,7 @@ function player_init(player_index)
 	if not game.players[player_index].gui.top.research_Q then game.players[player_index].gui.top.add{type = "button", name = "research_Q", caption = "RQ", style = "rq-top-button"} end
 	global.showIcon[player_index] = true
 	global.showResearched[player_index] = false
+	global.showRecipesOnly[player_index] = false
 	global.offset_queue[player_index] = 0
 	global.offset_tech[player_index] = 0
 	global.showExtended[player_index] = false
diff --git a/prototypes/gui.lua b/prototypes/gui.lua
index 36a8d5c..7f32e3c 100644
--- a/prototypes/gui.lua
+++ b/prototypes/gui.lua
@@ -1051,6 +1051,61 @@ data.raw["gui-style"].default["rq-scienceDone-checkbox"] =
 	}
 }
 
+data.raw["gui-style"].default["rq-showrecipesonly-checkbox"] = 
+{
+	type = "checkbox_style", 
+	top_padding = 0, 
+	right_padding = 0, 
+	bottom_padding = 0, 
+	left_padding = 0, 
+	width = 32, 
+	height = 32, 
+	scalable = false, 		
+	left_click_sound = 
+	{
+		{
+		filename = "__core__/sound/gui-click.ogg", 
+		volume = 1
+		}
+	}, 
+	default_background = 
+	{
+		filename = "__research-queue__/graphics/gui_elements.png", 
+		priority = "extra-high-no-scale", 
+		width = 32, 
+		height = 32, 
+		x = 32, 
+		y = 32
+	}, 
+	hovered_background = 
+	{
+		filename = "__research-queue__/graphics/gui_elements.png", 
+		priority = "extra-high-no-scale", 
+		width = 32, 
+		height = 32, 
+		x = 32, 
+		y = 32
+	}, 
+	clicked_background = 
+	{
+		filename = "__research-queue__/graphics/gui_elements.png", 
+		priority = "extra-high-no-scale", 
+		width = 32, 
+		height = 32, 
+		x = 32, 
+		y = 32
+	}, 
+	checked = 
+	{
+		filename = "__research-queue__/graphics/gui_elements.png", 
+		priority = "extra-high-no-scale", 
+		width = 32, 
+		height = 32, 
+		x = 96, 
+		y = 64
+	}
+}
+
 data.raw["gui-style"].default["rq-table1"] = 
 {
 	type = "table_style", 
I originally added this so that I could choose to ignore weapon/turret/robot upgrades, but it has the nice side effect of also filtering out techs that don't do anything at all other than unlock other techs (and those techs already show up on their own, anyway).

I didn't make any new art, just re-used one of the existing sprites.

Shrooblord
Long Handed Inserter
Long Handed Inserter
Posts: 54
Joined: Thu May 12, 2016 12:57 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.6

Post by Shrooblord »

There seems to be a conflict with using the Test Mode mod's "Unlock all Tech" button when Research Queue is also installed:
crash

sparr
Smart Inserter
Smart Inserter
Posts: 1327
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.6

Post by sparr »

Can you post which version of TM and RQ you're using?

MrDoomah
Fast Inserter
Fast Inserter
Posts: 196
Joined: Mon Jun 01, 2015 1:11 pm
Contact:

Re: [MOD 0.12.12+] Research queue 1.2.6

Post by MrDoomah »

Shrooblord wrote:There seems to be a conflict with using the Test Mode mod's "Unlock all Tech" button when Research Queue is also installed:
crash
That's not a problem with test-mode and this mod's combatability. That's an issue with this mod and whatever mod adds the "data-dummy-basic-mining-drill" research. What other mods do you have?

Post Reply

Return to “Mods”