Add more information to on_research_moved

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
PennyJim
Fast Inserter
Fast Inserter
Posts: 171
Joined: Wed Jan 18, 2023 3:49 am
Contact:

Add more information to on_research_moved

Post by PennyJim »

I recently went to use the on_research_moved event for the first time, and was surprised to find practically no useful information in the event data.

A touch of testing seems to prove that it fires once for every technology that is moved in the queue, so I'm shocked it doesn't, at a minimum, contain what technology was moved.
On top of that I request the index it came from and its destination index.

If it's possible for multiple technologies to be moved with one event, I would like an array of that same information. Though I can understand the specific indexes being less reasonable. I mostly just want to know if they moved forwards or backwards to match the in-game chat messages.

Theoretically I could figure that information out by tracking the research queue myself, but I'd rather this specific code to be stateless.
Rseding91
Factorio Staff
Factorio Staff
Posts: 16834
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Add more information to on_research_moved

Post by Rseding91 »

Why? The state before is irrelevant. The active research is the active one, the order is what it currently is, and any saved progress is readable on anything with saved progress.
If you want to get ahold of me I'm almost always on Discord.
User avatar
PennyJim
Fast Inserter
Fast Inserter
Posts: 171
Joined: Wed Jan 18, 2023 3:49 am
Contact:

Re: Add more information to on_research_moved

Post by PennyJim »

To recreate the messages in the chat log that report that a user has moved a research.

Besides my janky recreation of chat, I can see it being nice for server logging tools. If someone repeatedly moves a specific (useful) research to the back of the queue, that can be considered trolling.
Post Reply

Return to “Modding interface requests”