saved_progress support for scripted research triggers

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
Quezler
Filter Inserter
Filter Inserter
Posts: 326
Joined: Fri Mar 25, 2016 6:37 pm
Contact:

saved_progress support for scripted research triggers

Post by Quezler »

if the trigger for a technology is "scripted" you seem to be unable to set saved_progress on it in order to indicate it to the user, for example when there are multiple entities a player can mine and not just one so you can count it in your script and just update the saved progress and once its ready to hit 100% then you call script_trigger_research() instead.
User avatar
protocol_1903
Filter Inserter
Filter Inserter
Posts: 488
Joined: Fri Sep 09, 2022 4:33 pm
Contact:

Re: saved_progress support for scripted research triggers

Post by protocol_1903 »

+1
pY and pYblock developer, wielder of fluid networks and subtick events in arbitrary ways. I make mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903

Buy me a coffee
User avatar
Osmo
Filter Inserter
Filter Inserter
Posts: 271
Joined: Wed Oct 23, 2024 12:08 pm
Contact:

Re: saved_progress support for scripted research triggers

Post by Osmo »

+1, i have the same usecase of having multiple entities to mine
Rseding91
Factorio Staff
Factorio Staff
Posts: 16754
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: saved_progress support for scripted research triggers

Post by Rseding91 »

Part of the issue is how saved progress is stored/used by the engine. It is a value between 0 and num-research-units. So when a technology does not *have* research units there's no context for what percentage the number represents (there is no max-value).
If you want to get ahold of me I'm almost always on Discord.
User avatar
protocol_1903
Filter Inserter
Filter Inserter
Posts: 488
Joined: Fri Sep 09, 2022 4:33 pm
Contact:

Re: saved_progress support for scripted research triggers

Post by protocol_1903 »

Perhaps you could have a count property like some of the other TechnologyTriggers so there is a maximum to reference to?

That might also be better served by converting LuaTechnology::saved_progress to a uint of the units researched/'used' by script, relative to num-research-units
pY and pYblock developer, wielder of fluid networks and subtick events in arbitrary ways. I make mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903

Buy me a coffee
User avatar
Quezler
Filter Inserter
Filter Inserter
Posts: 326
Joined: Fri Mar 25, 2016 6:37 pm
Contact:

Re: saved_progress support for scripted research triggers

Post by Quezler »

I feel like it would make more sense as a 0-1 fraction, like if you research 50 units out of a tech that has 100 and a later mod update bumps it to 200 it feels fair that the 50% progress gets preserved than it falling back to 25% progress.
Post Reply

Return to “Modding interface requests”