Expanded research events

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
Xemrox
Manual Inserter
Manual Inserter
Posts: 4
Joined: Fri Nov 18, 2016 3:18 pm
Contact:

Expanded research events

Post by Xemrox »

As stated in the API there are currently only two events related to research.
  • on_research_started
  • on_research_finished
Combined with the new research queue it is very hard to keep track of canceled research as there is no on_research_canceled event and on_research_finished does not fire.
Current workaround is to check on each tick for every force if they changed their research.
If it swims like a dolphin, walks like a duck and moo's like a cow it is an Enterprise System!

Boodals
Fast Inserter
Fast Inserter
Posts: 129
Joined: Sun Feb 11, 2018 7:10 pm
Contact:

Re: Expanded research events

Post by Boodals »

What is your use case?

User avatar
CDarklock
Filter Inserter
Filter Inserter
Posts: 342
Joined: Sun Dec 03, 2017 2:17 am
Contact:

Re: Expanded research events

Post by CDarklock »

Boodals wrote:
Sat Mar 02, 2019 4:43 pm
What is your use case?
I would imagine something like:

- Tell player to research technology X
- Get event that they started research
- Tell them to wait for research to complete
- Get event they finished research
- Tell them what to do next

But if they cancel the research, you're just telling them to wait for research forever, when you would prefer to change your message to "Resume researching technology X"

User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2633
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: Expanded research events

Post by steinio »

- Look for "your" research started
- Look for research changed, if "yours" is last_research or "yours" is not finished demand to change back
- Look for "yours" to be finished.

Edit: uuh well is canceling a thing now?
then reserach_canceled should also be a new event
Image

Transport Belt Repair Man

View unread Posts

User avatar
CDarklock
Filter Inserter
Filter Inserter
Posts: 342
Joined: Sun Dec 03, 2017 2:17 am
Contact:

Re: Expanded research events

Post by CDarklock »

steinio wrote:
Sat Mar 02, 2019 6:45 pm
Edit: uuh well is canceling a thing now?
then reserach_canceled should also be a new event
Yeah. The issue here is cancelling research without starting a new one.

Otherwise you would get research_started on some other technology before you got research_finished, which I expect was the old solution.

Post Reply

Return to “Modding interface requests”