AS.Scripts (23/04/2005 13:27)

The place to discuss scripting and game modifications for X²: The Threat.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

adam00
Posts: 333
Joined: Sun, 9. May 04, 12:03

Post by adam00 » Tue, 7. Sep 04, 11:52

Well done :D

I think that you do not realy need as much as 8 TS for inside transport, if factories are close, 4-5 should do the job.

Using commands from AS.Complex (but moustly parallel transport/supply) I have created Mega-Complexes in "Ore Belt" (using moust of asteroid resources) and "Roncor's Clouds" (using all risonable (yield >25) asteroids).

In different sectors I have small loops producing Crystals (without SPP - energy for outside), and many different products too (weapons for example).

Thanks to this scripts I have much less ships than factories :D Well, and I don't realy lose them to Khaaks (AS.Guard :) ).

creidiki
Posts: 472
Joined: Thu, 15. Apr 04, 16:58

Post by creidiki » Tue, 7. Sep 04, 19:48

Just passing through, a couple of quick notes on AS.Guard:

1) Perhaps a bit of fine-tuning on the threat-detection? I have 2 Centaurs and a Ray serving the Ore Belt area (one of the Centaurs is centered on Ore Belt).

Yesterday I saw a lone Centaur (stationed in Argon Prime) go up against a Large Khaak Cluster - with predictable results. it died - while the other Centaur and the Ray hung around my SPPs filling up. :?

... Either the code didnt value an LKC as dangerous enough, or you should make the code wait for the ships to assemble before sending them into battle, i've already lost 2 Centaurs this way :cry:

----------

2) hrm... err... ok... like, maybe... you could... make the script think all sectors in patrolling area with stations are primary sectors?

As it is you have to split up your forces to cover a few bases properly... but if it considered all station-sectors to be primary, i could have all the ships stationed in Argon Prime and serving ALL my stations in the main Argon Quadrant.

At the moment i can't do it or i'll find my ship from Power Circle (my BPH training facility) fighting in Seizewell :lol:

Do you think this is a good idea?

----------

Anyhoo, as always, great script, and keep up the good work! :D

leo

PS: AS.Complex .03 just ran through a 12hr 10xSETA session... and I halved my ship count from my SDS setups! :D However i'd still kill for an 'inside transport only mode'... :cry: maybe i'm just wierd :roll:
I am not as think as you drunk I am.

creidiki
Posts: 472
Joined: Thu, 15. Apr 04, 16:58

Post by creidiki » Wed, 8. Sep 04, 04:19

Found a few bugs in AS.Complex 1.03
  1. TP ships will still try to transport/sell XL size goods (i saw it happen with silicon)... they go to the station, find out they cant move it, try again..etc. waste time. :x
  2. [Balance Selling Depots] appears with just TradeCommandMK1
  3. Still trying to hunt down a bug where the complex configuration gets corrupted (cut down to only a few fabs, like 5 out of 12)
now to do what ive been meaning to do all along...sleep

leo
I am not as think as you drunk I am.

adam00
Posts: 333
Joined: Sun, 9. May 04, 12:03

Post by adam00 » Wed, 8. Sep 04, 08:37

Just passing through, a couple of quick notes on AS.Guard:

1) Perhaps a bit of fine-tuning on the threat-detection? I have 2 Centaurs and a Ray serving the Ore Belt area (one of the Centaurs is centered on Ore Belt).

Yesterday I saw a lone Centaur (stationed in Argon Prime) go up against a Large Khaak Cluster - with predictable results. it died - while the other Centaur and the Ray hung around my SPPs filling up.

... Either the code didnt value an LKC as dangerous enough, or you should make the code wait for the ships to assemble before sending them into battle, i've already lost 2 Centaurs this way
Well, the Guards especialy don't fight in same sector, unless it is homesector or 5 min passed. If your Centaurs get killed, well maybe they should fly in pairs, the problem is that the one set to protect the Guard will not refuell automaticly, solving this in "AS.Guard" code is big thing to do. But I think there is a way, on this forum was described some "delivery" script for TS, this script can deliver to your ships flying in space things like energy or missiles.
2) hrm... err... ok... like, maybe... you could... make the script think all sectors in patrolling area with stations are primary sectors?

As it is you have to split up your forces to cover a few bases properly... but if it considered all station-sectors to be primary, i could have all the ships stationed in Argon Prime and serving ALL my stations in the main Argon Quadrant.

At the moment i can't do it or i'll find my ship from Power Circle (my BPH training facility) fighting in Seizewell

Do you think this is a good idea?
I think I could change the way of scaning, split it to 3 stages: a) only sector with factories, b) sector with flying player ships, c) rest of sectors.
PS: AS.Complex .03 just ran through a 12hr 10xSETA session... and I halved my ship count from my SDS setups! However i'd still kill for an 'inside transport only mode'... maybe i'm just wierd
There is some kind of "inside only transport": the transport and supply commands for parallel factories, check it out.
Found a few bugs in AS.Complex 1.03

1. TP ships will still try to transport/sell XL size goods (i saw it happen with silicon)... they go to the station, find out they cant move it, try again..etc. waste time.
2. [Balance Selling Depots] appears with just TradeCommandMK1
3. Still trying to hunt down a bug where the complex configuration gets corrupted (cut down to only a few fabs, like 5 out of 12)
1) Well, I will fix this.
2) Strange :) - you should need MK1 + MK2 + Jumpdrive - I have to check it.
3) I will try to find it too.

creidiki
Posts: 472
Joined: Thu, 15. Apr 04, 16:58

Post by creidiki » Wed, 8. Sep 04, 21:33

Ok i think i tracked the bug down:

I set up AS.Complex ships to service a 2-3 power loop (150% sun so you need 3 crystal fabs for 2 SPPs for full output)

Factories:
SPP Alpha, Beta
Cattle Alpha, Beta, Gamma
Cahoona Alpha, Beta, Gamma
Silicon Mine Alpha, Beta, Gamma
Crystal Fab Alpha, Beta, Gamma

Supplyers
SPP Alpha, Beta

Once i set it to (transport and supply for parallel factories)

Once the ships reach the homebase (SPP Alpha) the configuration for all of them (there's 9) becomes:

Factories:
SPP Alpha, Beta

Supplyers:
Crystall Fab Alpha, Beta, Gamma

... the ships transfer the crystals, let the rest of the complex go to the rats and the whole thing grinds to a halt.

Am I doing something wrong? (if so add it to the readme).

----------

1.03 and already it's quite impressive as far as functions and stability.. i'm very impressed :D ... bugs like this are to be expected considering the complexity and the flexibility of the script... i hope you werent expecting to get a "stable" version anytime soon tho :P

*bows to king adam00*

----------
adam00 wrote:I think I could change the way of scaning, split it to 3 stages: a) only sector with factories, b) sector with flying player ships, c) rest of sectors.
That would do the trick perfectly.

----------
adam00 wrote:Well, the Guards especialy don't fight in same sector, unless it is homesector or 5 min passed.
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.

----------

If you tell me how to identify when a Guard is not in combat, i'll make this companion script that's been rolling around my head all night (so much i couldnt sleep enough :o )

It's based on the combat-drone delivery for Transport script i use, but it will deliver wasp (or dragonfly) missiles to guards.

Of course knowing when the guard is not in combat isnt necessary, but since it would have to get within 5km to beam the missiles over if it did it during combat it would a have a very low ship-half-life :(

----------

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.

leo - wondering how much time he can spend scripting when he gets back home.
I am not as think as you drunk I am.

adam00
Posts: 333
Joined: Sun, 9. May 04, 12:03

Post by adam00 » Wed, 8. Sep 04, 23:19

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 :D (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 :D

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.

creidiki
Posts: 472
Joined: Thu, 15. Apr 04, 16:58

Post by creidiki » Thu, 9. Sep 04, 00:27

adam00 wrote: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.

[...]

This way you can run 14 factories with only 6 ship (Well, maybe 7-8 with bad winds).
Aaaahhh.... ok, now i get it! *smacks forehead* so its kind of like.. an SDS on steroids.

Add it to the readme, cause it ain't clear @ all.
:lol:

----------
adam00 wrote:This kind of cooperation will be hard to do, but who knows, maybe I try to do it. :)
That's all i can ask. I'm certainly not confortable enough with the scripting language to even understand the problem from a programming side. maybe in a while.

----------
adam00 wrote:[...]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.
Yeah... that would make it a LOT easier. in fact, it would make it straightforward:

[LOOP]
01 Find Guards low on missiles
02 If no guards low on missilies, fill bay of supplyer with missiles, keep scanning guards (1nce every 30 seconds)
03 ELSE
04 If the Guard is NOT Fighting, jump/move TO Guard
05 -> WHILE Moving check (every 30 seconds a good delay you think?) if guard starts fighting, IF so break
06 IF Supplyer is low on missiles refill
07 wait (30 seconds again?)
[/LOOP]

6 steps. shouldnt really be more complicated than that structurally. 8)

explain to me how you use your collision detection thingummys, that way if you have more than 1 supplier they wont all go for the same guard.

----------

[lots of blah blah blah about the array code]

..errr... damn. it late and i have a long flight tomorrow. but ill take a look @ it when im back in edinburgh and ive got my whole setup in front of me, playing on a laptop sitting on a bed aint the most confortable way to play X2, or script. :cry:

think ill get the missile supplier out of the way first so my centaurs will get killed less. :wink:

leo - being eaten alive by venice's mosquitoes :shock:
I am not as think as you drunk I am.

hst
Posts: 178
Joined: Mon, 26. Apr 04, 11:32

Post by hst » Thu, 9. Sep 04, 11:56

AS.BuyRareGoods is just what I was looking for.

Thanks and great job. :D

adam00
Posts: 333
Joined: Sun, 9. May 04, 12:03

Post by adam00 » Fri, 15. Apr 05, 01:01

New script: AS.Antymissiles v1.00

Details and link do download in first post.

Galaxy613
Posts: 2517
Joined: Tue, 28. Dec 04, 03:19

Post by Galaxy613 » Fri, 15. Apr 05, 02:10

:O This is a old topic... like old old. So old I don't know you, old. What brings you back to X2? Or do you really reside in a different langage forum?
10,000 Lightyears of awesomeness

adam00
Posts: 333
Joined: Sun, 9. May 04, 12:03

Post by adam00 » Fri, 15. Apr 05, 07:59

Well, sentiment and need for fun :)

AdmiralTigerclaw
Posts: 2068
Joined: Mon, 27. Dec 04, 12:49

Post by AdmiralTigerclaw » Fri, 15. Apr 05, 08:35

Well, I can say you came to the right place. Some of my favorite station managing scripts are the AS complex commands. Although I think it would be good if they could support more than one kind of downstream factory. (You can have multiple SPPs, or multiple ORE mines, or multiple fabs on the down stream, but only ONE of those types... Not multiple SPPs and maybe a mine over here...)

Ah... a day in universe building.
Fleet Command
Galaxy Command Fleet Authority
Image
"Escalating a war was NOT how I envisioned this vacation..."

adam00
Posts: 333
Joined: Sun, 9. May 04, 12:03

Post by adam00 » Fri, 15. Apr 05, 08:49

AdmiralTigerclaw wrote:Although I think it would be good if they could support more than one kind of downstream factory. (You can have multiple SPPs, or multiple ORE mines, or multiple fabs on the down stream, but only ONE of those types... Not multiple SPPs and maybe a mine over here...)
I am not soure exactly which command from AS.Complex do you mean? You can now organise transport in many diffrent ways.

I should rework this script soon, it may not work properly with moded fabs. And it really nead "auto-restart after update" feature.

AdmiralTigerclaw
Posts: 2068
Joined: Mon, 27. Dec 04, 12:49

Post by AdmiralTigerclaw » Fri, 15. Apr 05, 09:03

Add factory to Complex command. I can only add one 'type' of fab to the complex. If I attempt to add say, a Cahoona bakery to a 'complex' running with argnue cattle ranch as the 'product' side... it will ignore it... where as I can add as many cattle ranches as I so desire.

Add supplier works just fine.

I remember what I was doing now.

Trying to assign one ship to ferry E-Cells from a SPP to all the fabs in the sector. Since I had ORE mines and Silicon Mines, I had to set up two express ships for each set. *Since power was easily ferried, I wanted to use as few ships as possible to keep the fabs up and running. And just use a few power runners to ferry power to any factory in the sector that needed it.*
Fleet Command
Galaxy Command Fleet Authority
Image
"Escalating a war was NOT how I envisioned this vacation..."

adam00
Posts: 333
Joined: Sun, 9. May 04, 12:03

Post by adam00 » Fri, 15. Apr 05, 13:15

>>AdmiralTigerclaw

After adding factories using "Complex - add factory" command and supplier SPP using "Complex - add supplier" you should start "Outside supply of complex and transport..." if you set "Supply and transport for parallel factories..." or "Transport and supply for parallel factories..." it is for different purposes, it will supplay set of same factories and cumulate production in main factory.

Post Reply

Return to “X²: The Threat - Scripts and Modding”