saved_progress support for scripted research triggers
saved_progress support for scripted research triggers
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.
- protocol_1903
- Filter Inserter

- Posts: 488
- Joined: Fri Sep 09, 2022 4:33 pm
- Contact:
Re: saved_progress support for scripted research triggers
+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
https://mods.factorio.com/user/protocol_1903
Buy me a coffee
Re: saved_progress support for scripted research triggers
+1, i have the same usecase of having multiple entities to mine
Re: saved_progress support for scripted research triggers
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.
- protocol_1903
- Filter Inserter

- Posts: 488
- Joined: Fri Sep 09, 2022 4:33 pm
- Contact:
Re: saved_progress support for scripted research triggers
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
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
https://mods.factorio.com/user/protocol_1903
Buy me a coffee
Re: saved_progress support for scripted research triggers
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.
