Page 1 of 1

Expanded research events

Posted: Sat Mar 02, 2019 3:33 pm
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.

Re: Expanded research events

Posted: Sat Mar 02, 2019 4:43 pm
by Boodals
What is your use case?

Re: Expanded research events

Posted: Sat Mar 02, 2019 4:47 pm
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"

Re: Expanded research events

Posted: Sat Mar 02, 2019 6:45 pm
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

Re: Expanded research events

Posted: Sat Mar 02, 2019 6:59 pm
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.