Selected recearch

_npo6ka_
Fast Inserter
Fast Inserter
Posts: 102
Joined: Mon Sep 26, 2016 10:29 pm
Contact:

Selected recearch

Post by _npo6ka_ »

Could you add the opportunity to open technology gui on the technology passed as an argument to the function.
Or add the ability to install the selected recearch.
For example player.selected_recearch = "assembling-machine"
daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Selected recearch

Post by daniel34 »

_npo6ka_ wrote:Or add the ability to install the selected recearch.
For example player.selected_recearch = "assembling-machine"
There already is

Code: Select all

player.force.current_research = "automation-2"
quick links: log file | graphical issues | wiki
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Selected recearch

Post by bobingabout »

Yes, research is force specific, not player specific.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
_npo6ka_
Fast Inserter
Fast Inserter
Posts: 102
Joined: Mon Sep 26, 2016 10:29 pm
Contact:

Re: Selected recearch

Post by _npo6ka_ »

bobingabout wrote:Yes, research is force specific, not player specific.
daniel34 wrote:
_npo6ka_ wrote:Or add the ability to install the selected recearch.
For example player.selected_recearch = "assembling-machine"
There already is

Code: Select all

player.force.current_research = "automation-2"
current_research refers to player.force, but I would suggest adding saving the last selected item in the technology tree. Then the next time the player opens the technology tree, he will see the last research shown.
This research is unique for each player.
I would just like to open a technology tree on a certain technology.

My old topic: viewtopic.php?f=25&t=49599
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Selected recearch

Post by eradicator »

The research screen always opens on the currently researched technology. You could thus try faking what you want by:

1) store current technology
2) set player.force.current_research to the tech you want to open the gui for
3) open the gui
4) set player.force.current_research back to 1)

This ofc assumes that you can actually force open the technology gui. And probably that the tech you want to open has all prerequisites fullfilled because otherwise you can't set it in 2) D:.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
_npo6ka_
Fast Inserter
Fast Inserter
Posts: 102
Joined: Mon Sep 26, 2016 10:29 pm
Contact:

Re: Selected recearch

Post by _npo6ka_ »

eradicator wrote:The research screen always opens on the currently researched technology. You could thus try faking what you want by:

1) store current technology
2) set player.force.current_research to the tech you want to open the gui for
3) open the gui
4) set player.force.current_research back to 1)

This ofc assumes that you can actually force open the technology gui. And probably that the tech you want to open has all prerequisites fullfilled because otherwise you can't set it in 2) D:.
This works much harder than you described.
player.force.current_research installs on the study one of the open technologies needed for the specified in the parameter.
That is, if the technology does not have open the prerequest, it can not be set in current_research.

For example:
Image
I'm trying to install player.force.current_research = "research 2", the game mechanic sets the player.force.current_research to "research 1"

P.S. I already found a bad way to solve this problem, I would like to draw the attention of developers to this problem.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Selected recearch

Post by eradicator »

_npo6ka_ wrote: This works much harder than you described.
player.force.current_research installs on the study one of the open technologies needed for the specified in the parameter.
That is, if the technology does not have open the prerequest, it can not be set in current_research.
I did mention that in the post above.
_npo6ka_ wrote: For example:
Image
I'm trying to install player.force.current_research = "research 2", the game mechanic sets the player.force.current_research to "research 1"
Not entirely true. The game will research up to "research 2" automatically, but for that it has to first finish "research 1". And there is no GUI indication of the game being in "auto-research" mode.
---------------------------------------------------------------

So i'd like to extend/second the request for:
  1. A method to open the technology GUI on a specific page. (Used for "hyperlinking" the player there from mod GUIs)
  2. An ingame indication that the game is currently auto-resolving prerequesite technologies to get to force.current_research.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
_npo6ka_
Fast Inserter
Fast Inserter
Posts: 102
Joined: Mon Sep 26, 2016 10:29 pm
Contact:

Re: Selected recearch

Post by _npo6ka_ »

Up.
Unfortunately, I did not receive any comment on my proposal :(
Bilka
Factorio Staff
Factorio Staff
Posts: 3310
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Selected recearch

Post by Bilka »

0.17 changelog wrote:Added LuaForce::previous_research read/write.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
_npo6ka_
Fast Inserter
Fast Inserter
Posts: 102
Joined: Mon Sep 26, 2016 10:29 pm
Contact:

Re: Selected recearch

Post by _npo6ka_ »

Bilka wrote:
0.17 changelog wrote:Added LuaForce::previous_research read/write.
Can you describe in more detail what will be stored in this field? Based on the name of the field, this is not exactly what started the discussion of this topic.

Task: The mod should open a technology tree for the player and establish from the variable which technology should be displayed now (not as a current research, but simply to view information about it, that is, it can be a closed technology).

Request: Add the ability to display a specific technology when opening technology gui. (This parameter is unique for each player, everyone can see their technology).
Post Reply

Return to “Implemented mod requests”