Ah, ok, that's of course a bit different from what I thought. To my defense, what threw me was this:Ophiuchus wrote:@Vezzra I think you misunderstood what I am trying to achieve and how I do it.
Which I read as "each turn the target industry meter gets increased by another 5 points" (essentially shoving 5 points from the stockpile to the target industry meter each turn). What's actually happening is that you increase the target and current industry meter when the stockpile gets created, and maintain that level until the stockpile is exhausted, at which point you decrease target and current industry by 5 back to their original value. What gets modified each turn actually is only the stockpile, which gets decreased by 5 each turn.Ophiuchus wrote:* Every turn the special increases the target industry by 5 and decreases the stockpile capacity by 5.
Which means, you solved the problem by capping the extra PP at 5, and then simply manipulate the industry meters and the stockpile in "steps of 5". At which point I wonder however if that still works once the stockpile has a value that's not divisible by 5. I didn't test it myself, but looking at your scripts it seems that if there is more than one colony with a beacon in a system, the payload of your supply ships gets evenly divided among those colonies.
What happens if a stockpile gets reduced to, lets say, 3? How do you handle that case? That would mean, on the turn when the last remaining points of the stockpile get "transferred", the stockpile doesn't get reduced by 5, but only by 3, and to reflect that only 3 and not 5 points have been left in the stockpile, on that turn target and current industry need to get reduced by 2, so the colony won't produce 5, but only 3 extra PP. And on the turn after that target and current industry must not be decreased by 5, but only by 3 of course (otherwise they would drop below their original value). I only took a quick glance at your scripts, and I didn't see anything that looked like handling that case, but of course I might have missed it.