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

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

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

happykoala
Posts: 65
Joined: Sun, 11. Apr 04, 15:06
x2

Post by happykoala » Sun, 5. Sep 04, 06:41

Cool.

Reason I ask about the inside transport is that I notice my ships seems to be hanging around waiting for their turn to dock at a station. Which is usually not a bad thing for a normal output factory.

In theory(I have yet to test it out, my factories are a mess), my SPP supplying to 9 of my own factories will have lots of traffic. So the 9 consumers may notice that the SPP has a ship going to it and decide to buy from outside.

One solution is to reduce the buying price of E-cells so they don't buy from outside or that if they do they buy at the same price as my own SPP.

Another is to turn it off for insiders, which may make it less efficient if you have more than 1 supplier factory.

happykoala
Posts: 65
Joined: Sun, 11. Apr 04, 15:06
x2

Post by happykoala » Sun, 5. Sep 04, 10:01

Game keeps hanging after I installed new version. :cry:

Is the infinite loop log still activated?

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

Post by adam00 » Sun, 5. Sep 04, 13:08

My "collisions detection" is not about "crashing ships" while docking (this thing is normal behaviour of game). It is about preventing players ships from pointless flying to same station, when the second one moust probably get nothing.
happykoala wrote:Game keeps hanging after I installed new version. :cry:

Is the infinite loop log still activated?
Yes, the "infinite loop detection" is still enabled, the game shouldn't hangs because any of commands from AS.Complex.

Are you absolutely sure that you installed the newer version? If you open file "AS.Complex.Sell.xml" (double click it, the html browser should open) you should have in top of file text: "Version: 5".

happykoala
Posts: 65
Joined: Sun, 11. Apr 04, 15:06
x2

Post by happykoala » Sun, 5. Sep 04, 15:48

adam00 wrote:My "collisions detection" is not about "crashing ships" while docking (this thing is normal behaviour of game). It is about preventing players ships from pointless flying to same station, when the second one moust probably get nothing.
As stated above, the reason was not because of crashing ships. Its because of my supplying SPP which will have problems supplying to large numbers of my stations as my ships will be avoiding the SPP, instead they will go to computer SPPs if it is targeted by another one of my own ships.

It is not a problem for other factories as they usually supply on a 1 to 1 basis. But the SPP can be on a 1 to 9 and that causes a traffic jam.
adam00 wrote:Yes, the "infinite loop detection" is still enabled, the game shouldn't hangs because any of commands from AS.Complex.

Are you absolutely sure that you installed the newer version? If you open file "AS.Complex.Sell.xml" (double click it, the html browser should open) you should have in top of file text: "Version: 5".
Yes it says version 5, the ships are buying for complexes with zero $.

It has never hung before, rarely I get a CTD at most. But now it hangs with a few minutes, once less than a minute since 1.3. Also loaded a game without factories and there was no hang.

Reinstalled 1.2 and it doesn't hang. Could it be the factories zero $?

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

Post by adam00 » Sun, 5. Sep 04, 17:02

If yours ships will buy energy under 12 cr. it will be good for you :)

About this crashes, are you using any other scripts?

I will duble check this 0 money thing. To have correct selling bug, copy just: AS.Complex.Sell.xml from new version.

happykoala
Posts: 65
Joined: Sun, 11. Apr 04, 15:06
x2

Post by happykoala » Mon, 6. Sep 04, 09:47

adam00 wrote:If yours ships will buy energy under 12 cr. it will be good for you :)

About this crashes, are you using any other scripts?

I will duble check this 0 money thing. To have correct selling bug, copy just: AS.Complex.Sell.xml from new version.
Well ships in complex won't buy from my SPP unless price is 12 or lower. Is it possible to let them buy without checking the price of the supplier?

If SPP price is 12, 2 problems

1) If I also want to sell to outsiders.
2) My other factories from outside the complex will happily target it and cause a shortage for those in the complex.

If buyers don't check the price of supplier, I can set SPP to 22, buying to 9

1)can sell to outside.
2)No one else will buy from the SPP.
************************************************************
For the hanging.

I use your scripts(Guard, Buy Rare Goods, Turret Guard), Bounty Hunter(already turned off for a while), Xai Fleet Support, Fight Command MK III, Engine Mk1, MK III Trader AKA ST/UT.


I tried installing only the selling script. It hung 15 seconds into the game. I turned off UT logging. It still hanged.
I check my active scripts and found a AS. Buy Rare goods ships targeting one of my factories and I switched it to idle. After 5 reloading games of 2 hours in game SETA it hasn't crashed yet.
I reloaded and let the ship buy the rare goods, it hangs 3/4 times within a few minutes.

Maybe there is conflict or its just coincidence. I'm worried about letting my buy raregoods buying from my own factories now.

Also got a couple of infinite loop errors but its rarer now.

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

Post by adam00 » Mon, 6. Sep 04, 13:05

If the SPP is part of the Complex or specified as supplyer it is prefered source of Energy, the price doesn't matter. The difference is if you use command "Outside supply of complex and transport..." - there is no money transfer. For command "Outside only supply of complex..." there is always money transfer. If your SPP is not part of the Complex (and not specifed as supplyer) it is treated as any other SPP, the price does matter.

For the hanging:
It could be the case of "AS.BuyRareGoods" - I will check this script and publish version with enabled "infinite loop detection".

Do you think that AS.BuyRareGoods shouldn't buy from players factories? I could make it this way, but I am not sure if it is best option.

happykoala
Posts: 65
Joined: Sun, 11. Apr 04, 15:06
x2

Post by happykoala » Mon, 6. Sep 04, 18:08

adam00 wrote:If the SPP is part of the Complex or specified as supplyer it is prefered source of Energy, the price doesn't matter. The difference is if you use command "Outside supply of complex and transport..." - there is no money transfer. For command "Outside only supply of complex..." there is always money transfer. If your SPP is not part of the Complex (and not specifed as supplyer) it is treated as any other SPP, the price does matter.
I tested it under 1.2. The ships didn't buy when selling price is higher than buying price. Either I made a mistake or its because of the factory money problem.

Currently under my test in 1.3,
with the command "Outside supply of complex and transport..." whether supplier is either a "supplier" or "factory" of complex...

or a "supplier" of command "Outside only supply of complex..."...

Price doesn't matter, all my factories now have auto transfer of zero $ and they all transport with no problems.

adam00 wrote: For the hanging:
It could be the case of "AS.BuyRareGoods" - I will check this script and publish version with enabled "infinite loop detection".

Do you think that AS.BuyRareGoods shouldn't buy from players factories? I could make it this way, but I am not sure if it is best option.
It goes for the lowest price right? Setting a high price may solve it.

What I use AS.buyRareGoods for so far
1) buying weapons/shields for big ships
If I want to use my own stock I can easily get it without script. If I buy from outside its more profitable as I can sell it for more. It is also seldom used. There is also a AS collect products command which collects your weapons and shields.

2) Buying stuff to help start my loops/BBs missions or refueling(Xai Fleet Support doesn't jump)

I prefer to get from outside as it upsets my loops and may start those annoying yellow flashing stations.

Also all of the infinite loop report is coming from my lone selling SPP.
I have 3 selling ships in a complex of 4 at first with the SPP inside.
I then reduce it to only an SPP with 2 sellers.

So far all the errors are coming from the 2 SPP ships. Which is the only station/complex with 2 sellers. (Interesting, I'll start merging my sellers)

Still the errors doesn't seem to affect anything, they still continue doing their business but they get stranded sometimes.

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

Post by adam00 » Mon, 6. Sep 04, 21:01

New version of script AS.BuyRareGoods v1.02 - fixed bug which could hang game.

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

Post by creidiki » Mon, 6. Sep 04, 21:21

Aaaah! :D
I come back from a holiday to spain (brought my laptop and played x2 @ night :lol: ) to find some updated scripts! nice one!

---------------

Ive been using AS.Guard, AS.TurretGuard and As.MantainQuantity extensilvely while i was gone, and i'm very very happy with them :)

2 Questions:
1) will the command "refuel guard" work on an m2 as well? in this new game im playing (old one got corrupted last month) i'm not rich enough for an m2
2) will as.maintain_quantity work on an M1 as well? it would be VERY useful.

---------------

About your new AS.Deliver_Rare_Goods script:

I'm still using the old B.A.S.S. v0.9 (must be 6 months old now) for that, because for every request i can specify WHERE to deliver it.

IF it can dock it will dock with the target (station or Big.Ship), otherwise it will find the nearest jumpgate (using the XaiCorp libraries) and meet it Head-On, transferring the goods with the transporter device.

Even tho its old its still functionally superior to your script :o - though i'm sure that wont be for long :D

---------------

A Suggestion for a new script. :idea:

A Satellite Layer and Replacer.

for this purpose im still using BASS... however its quite a crude system (always starts @ kingdom end, south and east limits definable... maybe there's a better script out there?).

SO: 4 commands:

2 in General:
AS.Do_Satellite_Stuff (makes the ship take care of the sat network... make it add all existing sats on initialisation?)
AS.Sat_Add_System (Makes the ship add a sat to the system you point it to)

And then 2 more just for satellites (maybe you can use the new "Ship commands" slots?)
AS.Remove_This_Sat
AS.Add_This_Sat

So you can add and remove the satellites individually (and if you use the new ship comammnds it wont use one the few "free" slots in the main groups.)

The hardest part of this would be the Database, but since youve already got one in AS.Complex... you've already got the hard part out of the way.

As always, this is just an idea i had while i was seta-ing.

---------------

I'm going to go play with the new AS.Complex now.

keep up the good work! :)
I am not as think as you drunk I am.

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

Post by adam00 » Mon, 6. Sep 04, 22:00

2 Questions:
1) will the command "refuel guard" work on an m2 as well? in this new game im playing (old one got corrupted last month) i'm not rich enough for an m2
2) will as.maintain_quantity work on an M1 as well? it would be VERY useful.
1) and 2) - It will work for any big ship.

--> AS.BuyRareGoods - I didn't find this B.A.S.S script, if I did maybe I didn't write my own :) - my script will return to its homebase after completed task, it could be big ship too. I wasn't planing it to be "delivering" script, just buying things which player need from time to time.

--> Suggestions

Well, it could be usefull, I think about it but I can't promise I will do it :)

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

Post by creidiki » Mon, 6. Sep 04, 23:13

adam00 wrote: 1) and 2) - It will work for any big ship.
Nice one. :D
adam00 wrote: --> AS.BuyRareGoods - I didn't find this B.A.S.S script, if I did maybe I didn't write my own :) - my script will return to its homebase after completed task, it could be big ship too. I wasn't planing it to be "delivering" script, just buying things which player need from time to time.
the commander's space station

I remember when it first came out.. it was about the same time as ASEWS and SDMPNet (the first sat-activated travelling m6 patrol script i know of)

These days i only use it for 2 of its 4 functions (i disabled the other 2 in the init): Sat Deployement & Replacement, and equipment delivery.

It seems silly but the ablitity to set ships to deliver equipment to other ships is nice. Buy a new centaur for AS.Guard? I set a ship to get GHEPTs and one to get 125Mw while the patrol travels to the Terracorp HQs. Time it gets to the closest boron EQ dock for the Triplex Scanner it's all outfitted.

...Yes i'm THAT lazy :D ...

However the logic is a bit skewed. Since the lib to put the objects into the ships is the same as it uses for the command to resupply transports with fighter drones, it aims @ setting a certain amount of product in-ship. Which mean that if a M2 ship has.. say 2x Ion-Ds and you deliver another 4, the M2 ship ends up with 4 and the transport with 2. :?

I was thinking of changing that but if i can get someone to do the script for me... :roll:

I should probably just set the script to use the Xai libs for the ship transfers and quit whining :oops:
adam00 wrote: --> Suggestions

Well, it could be usefull, I think about it but I can't promise I will do it :)
I mentioned it 'cause i was thinking of tackling it myself, but since you've already got a DB etc. etc. :)
I am not as think as you drunk I am.

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

Post by adam00 » Mon, 6. Sep 04, 23:26

I mentioned it 'cause i was thinking of tackling it myself, but since you've already got a DB etc. etc. Smile
If you want, you can use parts of may scripts, there is some interesting "lib" things :D

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

Post by creidiki » Tue, 7. Sep 04, 00:42

adam00 wrote: If you want, you can use parts of may scripts, there is some interesting "lib" things :D
W00t! :D
I am not as think as you drunk I am.

happykoala
Posts: 65
Joined: Sun, 11. Apr 04, 15:06
x2

Post by happykoala » Tue, 7. Sep 04, 08:31

Heres how I do a closed loop with complex.

If I have in a Boron Sector,

1 SPP feeding 10
2 Cystal fabs(sellers without ship)
2 Bio gas facts
2 Bofu facts
1 Silicon mine with yield 50+ (counts as 2)
1 Soyery(seller with ship to neighbouring Paranid sector)
1 Soy farm

9 Demeters
1 Scorpion

1a)
SPP buys crystals at default $ from Trading Stations.
E-cells sold at Max.
Jump at 2 or 3.
Other races not allowed
Auto-accountant at $0.
1b)
Scorpion adds SPP as factory. Selects either "Outside supply of complex and transport..." or "Outside only supply of complex..." to supply SPP with crystals

Now I have choice of splitting up the rest of the factories or making one huge complex. One huge complex is more efficient but is more time consuming to add factories as the factories will be build in stages. I'll do a single complex

2) The supplying factories "Bio Gas, Bofu, Soyfarm and Silicon Mine" set
Max selling price possible
Min buying price
Jump zero
No other races allowed

3) The sellers "Cystal fabs"
Max selling price possible
Min buying price
Jump zero
Auto accountant $0.

3) The seller "Soyery"
Max selling price possible
Min buying price
Jump 1
Auto accountant $0

4) 8 Demeters add factories
2 Cystal fabs
2 Bio gas facts
2 Bofu facts
1 Silicon mine
1 Soyery
1 Soy farm
add supplier
1 SPP

Select "Outside supply of complex and transport..." they will now supply those factories within the complex.

Note: The first factory added must not be a supplying factory as the first factory added will not supply their products unless they are also added as supplier. So choose either Crystal fabs or Soyery first.

5) 1 Demeter add Soyery as factory.
Select "Sell from complex of factories..."

Finish!
:P

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

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: 475
Joined: Thu, 15. Apr 04, 16:58
xr

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: 475
Joined: Thu, 15. Apr 04, 16:58
xr

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
x4

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: 475
Joined: Thu, 15. Apr 04, 16:58
xr

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.

Post Reply

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