Page 1 of 1

saved_progress support for scripted research triggers

Posted: Mon Oct 13, 2025 5:06 pm
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.

Re: saved_progress support for scripted research triggers

Posted: Mon Oct 13, 2025 7:34 pm
by protocol_1903
+1

Re: saved_progress support for scripted research triggers

Posted: Fri Jan 09, 2026 10:43 am
by Osmo
+1, i have the same usecase of having multiple entities to mine

Re: saved_progress support for scripted research triggers

Posted: Tue Apr 28, 2026 6:47 pm
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).

Re: saved_progress support for scripted research triggers

Posted: Tue Apr 28, 2026 7:08 pm
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

Re: saved_progress support for scripted research triggers

Posted: Wed Apr 29, 2026 8:23 am
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.