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

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

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

Post by adam00 » Fri, 20. Aug 04, 19:22

This is my scripts for different purposes, enjoy :)

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

(23/04/2005 13:27)

- New version of script: AS.Antymissiles v1.01

(15/04/2005 00:48)

- New script: AS.Antymissiles v1.00

(06/09/2004 20:46)

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

(04/09/2004 23:44)

- New version of script AS.Complex v1.03 - fixed bug which could hang game

(01/09/2004 22:39)

- New version of script AS.Complex v1.02

-------------------------------------------------------------------------------------
Compatible with:

Massive War Mod 1.8
Xai Corp Advanced Combat Project 1.58
Xai Corp Automining 2.0
Xai Corp Fleet Support Ship Software 1.2
Xai Corp Jumpdrive Commands 4.1
Xai Corp Personal Alarm Clock 1.0
Xai Corp Trade Command Software MK1 v1.1a(fixed)
Xai Corp Xtc2 v1.0
Marks Patrol And Formation Commands 4.1.6
Fight command Software mk3 v1.2
zz Adv Salesman v1.1
SEWDatalink
KriMe SDS Command v02-fixed
IFS Trade Commands V2.1

Official scripts (signed by Egosoft).

-------------------------------------------------------------------------------------
Available on: http://adam00x2.webpark.pl (polish language only but direct link to files is given) and http://www.x2source.com

AS.Antymissiles v1.01
http://adam00x2.webpark.pl/as.antymissiles_v101.zip

X2Scripts/Combat

This command protect ship against incomming missiles using antymissiles, precisely: Mosquito Missiles. To operate command need presence of this missiles in ship cargo, but it doesn't need to be active missiles. If you are out of Mosquito Missiles in ship driven by you, you will hear message "No Missiles" and you will see appropriate text in subtitle area of screen in the bottom (of course if you didn't turn off subtitles).
Script make decision if comming missile is real threat taking into account type of missile and current shields.

This script is capable of restarting itself after upgrade, you don't need to do it manualy.

History:

Version 1.01:
- different licence levels for different ships - for M5 and M4 it is cheaper
Version 1.00:
- first publication

AS.Complex v1.03
http://adam00x2.webpark.pl/as.complex_v103.zip

X2Scripts/Trading

This set of commands can help in organizing factories in many ways:
- loops,
- parallel factories (producing same ware),
- supplying many independent factories,
- active selling from many factories,
- optimising passive selling - balance selling depots,
- collecting production from hi-tech factories with tendency to filling up.

History:

Version 1.03:
- buying commands will work on money-less Complex correctly (sorry :-))
- fixed bug in selling command which could cause hanging of game
Version 1.02:
- adaptation of improvements in 1.4 version of game (with version 1.3 will work in old way):
-- now this scripts will work with mods adding non standard factories (using resoures unpresent in orginal game)
-- collision detection algoritms use local variables instead of global
- buying commands can use players money when Complex is out of cash
- in all commands is enabled "infinite loop detection", I have never problem with this commands but I have signal that this commands can hang game, if problem appear you will receive message to players log, I will be glad if you will send me detailed info about this error.

AS.BuyRareGoods v1.02
http://adam00x2.webpark.pl/as.buyraregoods_v102.zip

X2Scripts/Trading

With this script your ship can buy for you any ware you don't want to look for, especially: weapons, shields, drones, satellites. No more endless flying from sector to sector and checking equipment stations and actories.
Just give your ship an order, specify ware and wonted amount, and after a while your humble servant will bring goods to you, well, to be exact, to its homebase, or if it has not any, to one of your factories. After that you will receive message describing finished task and station the ship is docking at. If order can not be finished (no enough ware on market), you will receive proper message (with "docked at" station of course), and ship will wait until ware will be available, and then will continue. For jampdrive
ship will buy energy by itself.

History:

Version 1.02:
- fixed bug which could cause hanging of game
- ship now will not get goods from players factories
- adaptation of improvements in 1.4 version of game (with version 1.3 will work in old way) - collision detection algoritms use local variables instead of global
- enabled "infinite loop detection" - just in case :-) if problem appear you will receive message to players log, I will be glad if you will send me detailed info about this error,

AS.Guard v1.11
http://adam00x2.webpark.pl/as.guard_v111.zip

X2Scripts/Combat

With this script you can protect home sector and area of sectors around, area is defined by range of jumps from home sector. Guarding ship don't fly to sectors just to scan them, instead it use navigation satellites and advanced satellites (differ in scan range).
This script is desigend for M6 or M2 ship but could work for fighter too (but there is no wingman commands there, well, I prefer M6 for protection of sectors). With help of docked ship Guard can buy energy for jumpdrive (it can buy energy by itself too if there is no docked ship but on standard map there is only one source of energy for M6), if there is available energy from players SPP or factories this source is prefered and energy is just loaded (without money transfer).

AS.turret.Guard v1.10
http://adam00x2.webpark.pl/as.turret.guard_v110.zip

X2Scripts/Combat

Enhanced version of default Missile Defence command for turrets. Quit fireing when enemy leave his ship. Priority of targets:
1) missiles (abandon lower priority targets when missile came in range)
2) target of ship/player (abandon lower priority targets when object came in range)
3) ship attacking you (if in range)
4) any enemy in range

AS.JumpingTrading v1.05
http://adam00x2.webpark.pl/as.jumpingtrading_v105.zip

X2Scripts/Trading

This is yet another buy/sell commands which use jumpdrive. The first difference is that this one can buy energy for jumps when the ship have more the one-sector jump to destination and no "fuel" left (normaly it get energy from its homebase for way to buyer/seller and back, but sometimes there is no energy available or ship will miss transaction and has to jump to another station). The second difference, the bigger one, is that player ships do not "collide" with each other, when one ship is flying to some station the other will not fly to the same to buy/sell same thing. No more waste runs for crystals, no more messed prices while selling energy :)

AS.Cashier v1.01
http://adam00x2.webpark.pl/as.cashier_v101.zip

X2Scripts/Trading

Well, this is yet another account menager, but with this script you can configure individually money limits for any number of factories. It is not some script running somewhere in backgroud, it is a cashier, ship which travels from factory to factory and collect/refill money. This ship obviously travels to factories in which it has something to do. I think it should be fast but cheap ship, some M5 will be good. If factories is scattered in distant sectors jumpdrive will be useful, in bigger ship of course, or you can use many ships taking care of different areas. For jumpdrive energy will be taken from your factories. Cashier make statistic of cashflow from last 6 hours.

AS.Maintain.Quantity v1.02
http://adam00x2.webpark.pl/as.maintain. ... y_v102.zip

X2Scripts/Trading

Well, this is yet another maintain quantity command, it is enhanced version of tutorial script published on this page:
http://www.egosoft.com/x2/forum/viewtopic.php?t=21585
I hope the Reven don't mind that I published something based on his work, but however my enhancement are simple I think what it is worth sharing with others.
Lets go to the point, this pair of scripts can maintain quantity of any ware in station (not only product) or in cargo of big ship which can dock other ships. This scripts do not quit after overflow, so can be used for mass-production stations or storing jump-energy in TLs. Ships with this commands work nicely in cooperation. If ship is outside of its homebase/mother-ship, it fly there and then start its job.

AS.TravelingTrader v1.01
http://adam00x2.webpark.pl/as.travelingtrader_v101.zip

X2Scripts/Trading

This small fix can make "Sector Trader" less pissing off. I was tired of sending my "Sector Trader" to another and another sector just because it can not find in given sector nothing more to trade. With this command you can specify the road on which the trader will travel. But watch out, there are Xenon sectors on map :-)
Last edited by adam00 on Sat, 23. Apr 05, 13:30, edited 11 times in total.

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

Post by happykoala » Fri, 27. Aug 04, 13:04

The AS turret guard fires on non-hostile pirates. It does not obey the friend or foe setting.

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

Post by adam00 » Fri, 27. Aug 04, 20:49

happykoala wrote:The AS turret guard fires on non-hostile pirates. It does not obey the friend or foe setting.
Well, I have tested it just now and it is not true. My script is not using nothing special, just normal enemy detection commands, just like "Missile Defence" and "Attack Enemy" standard commands.

If you didn't turn off "treat as enemy if I am treated as enemy" swich it may be the case.

User avatar
Damar Stiehl
Posts: 861
Joined: Mon, 3. May 04, 02:54
x3

Post by Damar Stiehl » Fri, 27. Aug 04, 20:54

The Polish Hammer strikes again :)

Nice job Adam, I'm luvin' your Turret Guard script, it kicks ass for M2s. And I somehow missed Buy Rare Goods, lookin forward to giving it a crack today.

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

Post by happykoala » Sat, 28. Aug 04, 05:42

adam00 wrote:
happykoala wrote:The AS turret guard fires on non-hostile pirates. It does not obey the friend or foe setting.
Well, I have tested it just now and it is not true. My script is not using nothing special, just normal enemy detection commands, just like "Missile Defence" and "Attack Enemy" standard commands.

If you didn't turn off "treat as enemy if I am treated as enemy" switch it may be the case.
Hmm missile defence doesn't fire on non-hostile pirates ships when "treat as enemy if I am treated as enemy" is on, unlike other commands. Though it starts firing when they attack. Guess its the missile defence that got me confused, since I only use that command.

Guess I'll turn it off when I don't want to pick a fight, I prefer to have leave it on otherwise. Thanks. :oops:

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

Post by adam00 » Sat, 28. Aug 04, 12:43

Interesting thing is that standard "Missile Defence" act differently in ship which is flyed by player himself and in ships flyed by autopilot. In second case turret will shot to any enemy in range if autopilot command is some sort of "KILL ENEMYS..." or if it is under attack.

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

Post by creidiki » Tue, 31. Aug 04, 23:04

I've been trying the AS.Complex for a little bit.. here is my results:

------------------
BUGS:

1) When the Station Complex runs out of money any Supply-Only traders stop moving until you:
A) Add money
AND
B) Restart the command manually
Since there is no out-of-funds warning, this is a problem. :roll:

2) In a standard SPP+Crystal+Cahoona+Cattle+Silicon loop, you cannot use AS.Complex Sell Product to sell the extra power cells produced.
This is because the selling ships empty the power plant coimpletely; when this happends the supply ships ignore it and purchase energy from AI supplyers @ cost, defeating the point of running the loop with AS.Complex. :x

3) AS.Complex Sell Product makes my computer crash hard (have to restart with power button) after 1/2 hr. cause unknown. :evil:

------------------
SUGGESTIONS :idea:

1) Add in the readme that to supply a power-loop with the energy it produces, the power station has to be added as supplier. (i'm not sure about this but it seems to be this way)

2) Either fix the sell tresholds, or add a AS_COMPLEX_TRANSPORT_ONLY command.

3) Add warnings for out-of-cash, or make the script use player cash as a last resort.

4) Make the script able to restart itself once there is cash once again.

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

Considering it's version 1.01 i say its REALLY close to a finished product. some fine-tuning, bugfixing and polishing and you'll have the ultimate loop management software here. In the meanwhile im going back to SDS+IFS though. I'll be happy to try out any new versions that come out.

Keep up the good work! :D

leo

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

Post by adam00 » Wed, 1. Sep 04, 09:01

BUGS 1) I have never noticed it becouse I am using my AS.Cashier, it supply money to factories. But you are right, using players money when factory have not enough is good way.

BUGS 2) Any selling script will empty the SPP in this kind of loop. But I think there is a way to fix it, I try to "set the selling amount" for factory (player can specify it individualy for factories), production will be sold if it is above this amount.

BUGS 3) I never have such behaviour, I will look at script code, maybe I will find the BUG.

SUGGESTIONS 1) It is the right way to "fix" it, and you are right, I should write about it. It is because you specified SPP as main factory of complex, production od main factory IS NOT SUPPLYED to other factories. it is usually PRODUCT of complex and shoudn't be used by complex itself. Your "standard loops" shoudn't product just Energy for selling, self-supplying of Crystals is not optimal, you shoud passively sell it in max price and buy it in trading stations in average price.

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

Post by happykoala » Wed, 1. Sep 04, 13:22

Those leaking loops are a problem. Esp for SPPs and mines.

How about setting a minimum amount of wares to be left in a factory as well. That way there will always be enough to feed your loops.

If I copy the complex from one ship to another, would it be possible to select those ships in stations as well?

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

Post by adam00 » Wed, 1. Sep 04, 16:18

happykoala wrote:If I copy the complex from one ship to another, would it be possible to select those ships in stations as well?
I am not sure, but if you wont to select as target for "assigning" configuration command ship which is docked somewhere, it is not possible. It is limitation of game.

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

Post by adam00 » Wed, 1. Sep 04, 22:43

New version of script AS.Complex v1.02

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

Post by happykoala » Sat, 4. Sep 04, 18:18

For complex buying according to the readme

"2) find supplier of ware in defined suppliers or factories of complex
3) if there is no "inside" supplier will search for outside supplier using parameters of gived factory (max price, jump range), searching algorithm with detection of collisions - players ships will not fly to same station for same purpose"

Will there be detection of collisions for inside factories or only outside suppliers?

Also I reduce all my factories $ to zero and my transports stop buying stuff. What am I doing wrong with the using personal $ instead of station $?

User avatar
Bléral
Posts: 697
Joined: Wed, 31. Mar 04, 00:37
x2

Post by Bléral » Sat, 4. Sep 04, 21:06

Great job, thank you Adam00, I'll use some of those... and maybe try to learn more of the SE by re-building those scripts and making my game crashing... :D
L'hypertrophie de louveteau se palpe.
Tiens, mais ne serait-ce pas une fonction de Recherche ?

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

Post by adam00 » Sat, 4. Sep 04, 22:04

happykoala wrote:For complex buying according to the readme

"2) find supplier of ware in defined suppliers or factories of complex
3) if there is no "inside" supplier will search for outside supplier using parameters of gived factory (max price, jump range), searching algorithm with detection of collisions - players ships will not fly to same station for same purpose"

Will there be detection of collisions for inside factories or only outside suppliers?

Also I reduce all my factories $ to zero and my transports stop buying stuff. What am I doing wrong with the using personal $ instead of station $?
a) "Collisions detection" work for inside factories as well.
b) I fixed "buying algorithm" but main loop choosing what to buy still checks money of complex and of course decide not to buy anything, my mistake :oops: I will fix it soon.

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

Post by adam00 » Sat, 4. Sep 04, 23:29

New version of script AS.Complex v1.03 - fixed bug which could hang game.

If you use my AS.Complex - Sell... command you have to update this script.

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.

Post Reply

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