Ok i think i tracked the bug down: .....
I should (and I will) modify code of this "parallel" commands, they are self-modifing its configuration, they shouldn't. However it is consequence of how this commands work.
Parallel supply/transport command can work only for "parallel" factories, such factories have to be same kind (and race), main factory of Complex is very important, factories of its kind will be handled, other can be only suppliers (even if added as normal factory), if factory can't supply main factory then will be removed.
How you should configure your complex:
Ship 1:
F: Crystal Fab Alpha, Beta, Gamma
S: Silicon Mine Alpha, Cahoona Alpha, SPP Alpha
Ship 2:
F: Cahoona Alpha, Beta, Gamma
S: Cattle Alpha, SPP Alpha
Ship 3:
F: Cattle Alpha, Beta, Gamma
S: SPP Alpha
Ship 4:
F: Silicon Mine Alpha, Beta, Gamma
S: SPP Alpha
Ship 5:
F: SPP Alpha, Beta
Products of each level will be concentrated in "Alfa" factories. Concentration of Energy in SPPs is not necessary, but then you have to specify both SPPs as suppliers for each level.
The command for each ship should be "Transport and supply for parallel factories...". The "Crystal Fab" level may need second ship, but then with command: "Supply and transport for parallel factories...". You may need second ships to some other levels (Silicon maybe) if distances to travel are long.
For SPPs you will need one "Outside only supply of complex..." ship to buy Crystals. For selling: enable selling only in "Crystal Fab Alpha".
This way you can run 14 factories with only 6 ship
(Well, maybe 7-8 with bad winds).
Perhaps then the threat assesment code should be able to call for 2 M6s if it detects a large threat and there are no M2s available?
... Is this doable from your side? it seems that you aim to make your scripts as flexible as possible (and its great) and this would certainly make it more flexible.
This kind of cooperation will be hard to do, but who knows, maybe I try to do it
If you tell me how to identify when a Guard is not in combat.....
There is special global variable named: "ASGuardBusySectors", if Guard is in fight it is in this array, for details you can look in "AS.Guard.BS...." scripts. But after 5 minutes the ship can be removed from this array, as second check you can check if "$Guard -> get attack target" return null, if it is null ship probably is not fighting. Well, of course I can add to script "AS.Guard.clean.sector" setting some local variable to [TRUE], for example "FighintNow", of course this variable will be valid only if "$Guard -> get command" returns COMMAND_AS_GUARD.
Can i use your array sorting code in that satellite RePlaceNET script i was musing about before? It'd certainly make my life simpler - once i figure out how it works.
Yes you can
How it works (part of "AS.find.buyers" script):
building array which will be sorted - "row" is made of 4 "fields"
Code: Select all
99 loop ....
....
103 append $Station to array $FoundArray
104 append $Price to array $FoundArray
105 append $enough to array $FoundArray
106 append $jumps to array $FoundArray
.....
112 end
building comparing description array - size have to be size of "row"
Code: Select all
116 $CmpArray = array alloc: size=4
117 $CmpArray[0] = 0
118 $CmpArray[1] = -1
119 $CmpArray[2] = -1
120 $CmpArray[3] = 1
121 @ = [THIS] -> call script 'AS.ArrayQSort' : Array=$FoundArray CmpArray=$CmpArray
mining of parameters:
0 - no sorted: just some data
1 - sort order ascending
-1 - sort order descending
sorting order of "field" in row is defined by its "position": 0 - first, 1 - second, etc.