• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

AlexP80

Recruit
Apr 12, 2014
9
0
First of all, I'm a professional programmer but I've never modded a game, so I'm a bit lost...

My goal is to implement a new storage building (done) with the following logic:

If the stored goods goes below a certain amount (the best would be if configurable in the ui, but a fixed amount will do for the first implementation) it generates an active demand, so drones and shuttle will fill it until it reach a second value. After that the demand is suppressed until the storage goes below the threshold again.

Anyone can point me out in the right direction? Exist some mysterious function GenerateDemandOfResource which I can use? Or I have to extend drones/shuttles logic? (and how?)

Any suggestion will be greatly appreciated
 
I know you didn't ask for anyones opinion and this sounds sort of cool, but if you place one storage pile on each side of a drone hub the hub equalizes the piles anyway. Wouldn't it be easier just to have one main storage pile of a large value then have smaller piles of smaller values then just let the game equalize them? Your solution would obviously be a bit speedier for construction though, but I think would inherently carry a lot of issues along with it. For example, how would you force resources on one side of the map to move to the other side of the map? Running a check on the priority of the storage centers within the range of each drone hub, then allow the hubs to communicate with eachother to set a path for movement of goods? I don't know, sounds complicated.

Anyway, I'm pretty sure you'd have to extend their logic. Should be able to do it by rewriting the relevant lua files. Someone unpacked all of the games lua, if I find it I'll throw it at the bottom of this post - or maybe someone will link the resource in another post.
 
You had a good point here, I think I'll need a bit more of analysis on this. But the issue still remains: shuttles triggers only when there is an active demand. So they refill storages too late in case of any emergency
 
Yes this is a persistent problem for example: When your Wind Turbines are not next to a dome that produces Machine Parts, the extra downtime for when the Turbines request maintenance to when the local stockpile gets a Machine Part is irritating.
ResourcePile.lua and _TaskRequest.lua (From the decompiled lua files you can get on the modding discord) Are probably your best starting points for this.