I will just have another question then: How I make something run on the economy setup phase of sector generation?
Hmm. Set the initialStepsToRun to 0 in your economy.json, and then you can update stuff in
ModPlugin.onNewGameAfterEconomyLoad
But the economy would still run through one cycle during the new-game-time-pass (before waiting for a million days, or whatever large value you'd set economyIntervalnGameDays to). So if you did that, you'd have to snapshot and restore the state of your economy.
Personally, I'd just run it all in, like, the 3rd or 4th day of the new-game-time-pass. After the base economy is done updating for good - which it will be quickly, if you set economyMinFramesPerSecond to something... ehh, wait, I've been thinking about this backwards. economyMinFramesPerSecond needs to be set super-low for the base economy to advance in a low number of frames.
If you set it to 1 / (economyIntervalnGameDays * 10) then that should ensure the base economy runs a full interval in one frame and then doesn't run anymore until economyIntervalnGameDays is over (which, if that's set to a million or so, will not happen in any reasonable timeframe.) Note: this one frame would take a long time, so the you'd see the progress bar stick for a while on the first day of sector generation, and then zip through the rest.
Hope this makes sense.
... made a note to add a flag to turn the economy off
And how much the economy updates in sector generation? (I assume it updates in the same speed as in-game, thus in vanilla during "Stabilization" it updates 33 times).
It updates 2 month's worth, whatever that means based on the configured values. By default, that's roughly two full passes over every market. Not sure where the 33 comes from?