Script request; 'payment' offered

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

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

User avatar
Momaw
Posts: 736
Joined: Mon, 4. Aug 03, 04:12
x3tc

Script request; 'payment' offered

Post by Momaw »

1. The request.

I desire a script that will automate the mineral collection process for mining operations. The script should be named "Collect Mineral Wares", and be under the Special section. The script should check to make sure that the ship you're trying to assign it to has an Ore Collector, and a homebase setting where the homebase must be a TL class ship. It should perform the following tasks:

a) Return home if it comes under attack.

b) Stay within a patrol area defined as: maximum distance of 10Km from its homebase; minimum distance of 2Km.

c) Collect all ware containers inside its patrol area that are of type Ore, Silicon, or Nividium. Ship should ignore all other ware types.

d) When the ship's cargo bay is full, it should return home, unload its cargo, then launch and continue its sweep. If it cannot unload because the TL doesn't have enough space free, it should remain landed and flash a message.

2. The payment.

I'm not really a master of CG, but I've a few things I'm proud of. Enough perhaps to tempt somebody into building this script. As fair trade for your time and talent, I will model and render a starship for you from your own sketches or descriptions. Examples of my own designs:

"Swallow" advanced atmospheric fighter
http://chapterhouse.nhvt.net/users/momaw/swallow-f1.jpg
http://chapterhouse.nhvt.net/users/momaw/swallow-f2.jpg

Arcanisi cruisers, H5 heavy and H4 standard (and a fighter, but too small to see well :D)
http://chapterhouse.nhvt.net/users/momaw/hc5-1.jpg
http://chapterhouse.nhvt.net/users/momaw/hc5-2.jpg

Once the ship it's built, it's very easy to do renders, so if you want them I'll offer up to 6 different angles.

Anybody interested? Respond below.
merle
Posts: 48
Joined: Sun, 2. Nov 03, 15:57
x3tc

Post by merle »

Hmm. I already made scripts for collecting ore, so scripts like this should be possible.

But I would suggest a few changes:

make the patrol area larger, perhaps a value you could enter when you give the ship its command or current scanner range.

Make the ship return to base, if no ore is detected within range. That way you could use the TLs jumpdrive for moving to a new sector.

The ship should check for ore within patrol range while it is docked, and launch if any is detected.

I will even throw in a bonus script for selling all that ore :D
ShadowTek
Posts: 480
Joined: Sat, 20. Dec 03, 19:05
x2

Post by ShadowTek »

Xai Corporations AutoMining is the closest script ive seen to what you want
Proud member of the PHPBB Network!
Feel free to upload or download X2 Mods!!
merle
Posts: 48
Joined: Sun, 2. Nov 03, 15:57
x3tc

Post by merle »

Done

Script uploaded at xscripting.com called OreCollect.

snip from readme

Ore Collector ver 1 by Merle

This gives 3 new commands for scavenging.
Ore Collect
Scavenge sector
Turret Roid Bust
User avatar
Momaw
Posts: 736
Joined: Mon, 4. Aug 03, 04:12
x3tc

Post by Momaw »

Merle,

I gave your script a shot, and WOW it's exactly what I wanted! :D

Only problem is, my save game dies now. Locks up solid after a bit (I do have backups naturally, don't worry that you killed my empire). I tried recalling all my ships and just sitting stil for a while, that didn't lock, but when I arrived at a new sector it locked up soon after.

Is it possible do you think that your script is causing this lock? Or is it more likely as a result of the recent v1.2 patch? If I wanted to test this, can I just delete the files from ./scripts and ./text, or will the script still be running in the game?

Oh, and have you given any thought to what sort of ship you want to see modelled? :)
merle
Posts: 48
Joined: Sun, 2. Nov 03, 15:57
x3tc

Post by merle »

DOH

My game locks up too, and I thougt it was just me :-(

If you want to stop the script from running, just give the ships another command or NONE, no need to delete it.

But I found the problem, it occurs if a ship has the collect ore command, is landed at homebase and an enemy enters the scanrange, it goes into infinite loops spending all of your CPU on checking that the enemy is still there :-(

I will make a version 2.

I will make it compatible with Xai Corporations auto miner, and make a mini version that just bust the asteroids below a selected yield without collecting.

I am working on a high tech salesman, that sells all the low tech cargo (energy excluded) in your TL at the best prices in the universe using jumpdrive and energy stored in the TL.

The output of industrial scale asteroid busting can make local prices rather low.
User avatar
Momaw
Posts: 736
Joined: Mon, 4. Aug 03, 04:12
x3tc

Post by Momaw »

I think you fixed it!

Never did answer the question though. Goods have been delivered, I must hold up my end of the bargain... :D
merle
Posts: 48
Joined: Sun, 2. Nov 03, 15:57
x3tc

Post by merle »

Its fixed allright, no hangs all night.

I am still working on a ship design idea. If you get any sketches, I can garantee they are not by my hand, my talents lies ... elsewhere.

If only you could import your Arcanisi cruiser in X2 so I could take it for a spin ... that I would consider payment in full :D


Ore Collect V2 just uploaded at xscripting.com, snip from readme:

Ore Collector ver 2 by Merle

This gives 4 new commands for scavenging.
Ore Collect
Scavenge sector
Turret Roid Bust
Auto Mine
Original idea from http://www.egosoft.com/x2/forum/viewtopic.php?t=21234

This complete RoidBuster script pack will fill your TL in no time a few Caimans on Auto mining in different parts of the sector, and some Mantas or Dolphins on Ore Collect, while you fly CAP in your favorite fighter.

In short, these scripts ROCK :-)



Changes since ver 1

Added Auto Miner
Fixed Turret Roid Bust, it will now correctly display the command for the turret
Fixed a nasty loop in Ore Collect, that would cause the game to hang if an enemy was within scanner range and the ship was parked.
Completely changed the command numbers used, to be compatible with all current Xai software, Teladi Trader, patrol script V2 and HQ mod.

............................

4. Auto Mine

Requires Mobile Drilling System and mineral scanner

Started out buy buying the Auto Miner from Xai Corporation, and added the necessary changes for mining BIG TIME.

This script takes 3 arguments

Max yield: will only mine asteroids below selected yield.
Scan range: radius in Km to look for asteroids and enemies
Center Point: the center of operation.

Its base will not have to be a TL transport, but it helps. If it is docked at a TL when this command is started, it will automatically set its homebase to that TL.

Will go from asteroid to asteroid blasting them to bits, and return to its base when finished, when landed a message will be sent.

Will hide in the TL if an enemy enters its center of operation, and only come out, when both the center and a radius around the TL is clear.

Like the original Xai software, this can sometimes have problems with big asteroids, where the ship can’t turn correctly, if this occurs, the ship will stop and signal the player. You must help destroy the asteroid or move to a different target area, the asteroids shape prevents Xai's positioning AI from working. I have had some success with putting the ships turret in RoidBust mode; it might get a lucky shot while the ship is trying to position itself.

To prevent clutter in the sector, the ship will pause if the number of fragments currently floating in the sector is greater than the selected max yield times 2, it will resume, when the Ore Collectors have catched up. Putting the turret permanently in RoidBust mode will disable this safety feature.
User avatar
Momaw
Posts: 736
Joined: Mon, 4. Aug 03, 04:12
x3tc

Post by Momaw »

merle wrote: If only you could import your Arcanisi cruiser in X2 so I could take it for a spin ... that I would consider payment in full :D
Beyond my abilities, I'm afraid, but I'm glad you like it. You can have a cuiser if I get to use a battleship :D (far left; 1,677 meters long).

http://chapterhouse.nhvt.net/users/moma ... mpare3.jpg

If you've got MS-Word, here's my fluff/background document (not done and mostly boring technical stuff, but you're welcome to it:

http://chapterhouse.nhvt.net/users/momaw/fluff.doc

As far as the scripting. I tried Xai's auto mining thing a bit ago, and discovered the ship positioning issue. It just sat there spinning in circles, not firing at the asteroid. I'm comforable with blowing up the asteroids myself, since I've got your RoidBuster turret command now! Just back up to the rock, manage your empire for a minute while it does its thing. Gonna put a mention in my Mining 101 thread about your excellent script package.
merle
Posts: 48
Joined: Sun, 2. Nov 03, 15:57
x3tc

Post by merle »

Hey I cant even afford a cruiser yet . All my money was spent on a Hercules so I could test the Ore Collectors.

But nice to have some background to go with the ships.

If you have been largely successfull with the Ore Collector V2 you will need my newest addition, the Advanced Salesman, no more settling for 504 for that silicon when we know its worth a lot more.



Just uploaded at xscripting.com:


Advanced Salesman ver 1 by Merle

This gives a new command for Selling lowtech wares.


Will sell the products of its homebase at the best prices in the universe using jumpdrive and energy stored in the homebase.

This was made for selling large amounts of minerals from a TL transport, but will work for selling the products of most stations too.

Have a Manta sitting in your TL with this command active while your fleet of miners collects ore from the sector.
User avatar
Momaw
Posts: 736
Joined: Mon, 4. Aug 03, 04:12
x3tc

Post by Momaw »

I'll give it a shot, but a question...

Does your script do the math on the cost of energy cells versus the sale price of silicon? There's really no point in sending the ship to the other end of the galaxy to sell silicon at the best price available if there's a place right next door buying for only 3 credits less. Not only that, it costs a TS/TP at least 130 credits to cross each sector, unless you've got your own solar plant somewhere.

Therefore, just to break even with the average price of 504 crdits per unit, using purchased energy, a Manta MUST sell silicon at a minimum price of...

1 sector distant = 260 credits in energy; 20 units of energy; Manta cargo bay = 1000 - 10 for 25mw shield - 20 for energy = 970 free / 5 per silicon = 194 units of silicon onboard; 504 average price * 194 units = 97,776 + 260 for energy = 98,036 / 194 units = 505.34 (506) credits per unit.

Gods above, that's ugly :D

I won't bother writing the others out by hand, that's what machines are for:

2 sectors = 506.031; 507/unit
3 sectors = 506.737; 507/unit
4 sectors = 507.457; 508/unit
5 sectors = 508.194; 509/unit
6 sectors = 508.946; 509/unit
7 sectors = 509.714; 510/unit
8 sectors = 510.500; 511/unit
9 sectors = 511.303; 512/unit
10 sectors = 512.125; 513/unit

Remember this is just the break-even point. And it's also just for silicon, and for energy bought at 13 credits per cell. Pushing some buttons here, the break-even point for ore is more generous, since it's more effecient price-per-cargo space (2XL versus 5XL).

So, anyway, just curious if you've taken the cost of energy into account for this jump drive usage. Even if you haven't, having these ships sell it for you is hella faster than lugging it around yourself (it takes a long time to unload a full cargo bay of ~1900 silicon wafers).

>> Have a Manta sitting in your TL <<
Actually I've got no less than 5 Manta's parked on my TL. Plus 2 Vultures for gathering, and 6 Novas for defense. Still got plenty of hangar space too. I love my Elephant. :D
merle
Posts: 48
Joined: Sun, 2. Nov 03, 15:57
x3tc

Post by merle »

Does your script do the math on the cost of energy cells versus the sale price of silicon?
Nope, but if you keep the universe flowing 781 will be you normal selling price. And that leaves plenty of margin for energy cells.

You can use your Vulture if you want to move a full load of 208 silicon, that makes the math slightly better. And since a full load of ore has a volume of 1666 a Vulture is perfect for moving minerals.

You even have space for 2 shields and a few fighterdrones.

The script will cross the universe for a single credit extra. Ok, thats not always a good idea, but at the rate I am mining now some automation is needed.

...............

The script was made for minerals, but works wonders on certain other products too, if you are in Paranid space, do buy a few Dolphin loads of Majaglit at 11 credits, that stuff goes for 61 credits at the right places.

The script was not made for low profitmargin high volume stuff like Meatsteaks.
...............

Comming up, The Advanced Arms Dealer another use for those idle Mantas. When most of the advanced factories are full who will use those 1900 silicon wafers ?
ZeligtheLiar
Posts: 55
Joined: Sat, 24. Jan 04, 12:21
x3

Post by ZeligtheLiar »

Hey Merle, your old V1 is still in the DL section of XScripting.com under scavengers marked NEW. I had to look in the "old" scripts section to find your new V2. You may want to prod those guys to switch them. :)

GJ btw!

*edit- NM, saw your V2a in the untested scripts section now. I guess that's why V2 is in the old. :)
merle
Posts: 48
Joined: Sun, 2. Nov 03, 15:57
x3tc

Post by merle »

Hey Merle, your old V1 is still in the DL section of XScripting.com under scavengers marked NEW.
Yes, thats very unfortunate since V1 has a nasty bug, V2/V2a has no known bugs. And the counter for downloads of V1 keeps ticking up :(

Hopefully the guys who losses hours of mining when the game hangs, has the courage to try the newer versions.
You may want to prod those guys to switch them.
I would, but the rule is the script has to be tested by the moderators to make it into any other group than untested. Mayby my less then perfect track record is causing the delay. :roll:

And since I am not ready to help them out, I dont feel I have any right to complain, the guys are doing lots of good work.

Now if only my Advanced Salesman would make it to the DL section ....
ZeligtheLiar
Posts: 55
Joined: Sat, 24. Jan 04, 12:21
x3

Post by ZeligtheLiar »

Wow, they really do work hard. Fast too. V2a is already in the DL section now, right under V1. ;)

I'm gonna check out your salesman too, though I don't use a lot of trading scripts yet. I have Mk3 installed, and I don't like the idea of using anything else that might work "better", yet doesn't cost as much. Dunno, feels like cheating. /shrug

My "morals" will probably break down eventually, when I get tired of micromanaging my trading ships. Still pretty early in the game for me.
User avatar
Momaw
Posts: 736
Joined: Mon, 4. Aug 03, 04:12
x3tc

Post by Momaw »

merle, thanks for the file drop. Gave your salesman script a trial run, and:

Excellence!

I strip-mined Siezewell in one sitting, made some serious coin. The thing works well.

The only actual complaint I have is that it's a bit irritating that the salesman script stops when the TL doesn't have any juice left. If I'm out in space working my afterburner off to help with the mining operations, then I'm not sitting on the bridge of my Elephant making sure there's enough energy. My feeling on the matter is that the salesman script should just message you, "No energy!" and wait for more energy to be delivered instead of dying.

Something that's a little odd, the salesman ship doesn't return the energy it started to load onto its ship if it aborts. I'm not sure your script checks to see how much is on the ship before it starts, but I can envision a problem where your sales fleet slowly picks up mountains of energy from aborted delivery runs, leaving the player scratching their head as to why they're selling so slowly.

Minor grammatical errors:
1) In the logbook message, there needs to be a space before the ship's name.
2) Misspelled "energy" in the logbook message.

Future possibility for expansion on the Advanced Salesman:
Player may assign ware or type of wares to distribute. The script currently seems to grab the first ware on the list that there's enough to make a run with. Which is inconvenient if you actually want to have a pile of silicon or ore in your hold. It also seems to block the sale ship from selling a 'low tech' ware, even if there's enough to sell, because some other ware comes first. In Siezewell, I was waiting for my ore-gathering team to finish up; so sent out my minions to buy Sun Flowers at a good price. My sales team completely ignored the pile of >1,800 units of Sun Flowers, because (I think) both Silicon and Ore came first on the list. Or another thought, is it because the "factory lot" of Sun Flowers is some really high number, so the script says, "Well I can't top this factory off, so I won't bother trying to sell it." That could be a logical error, as some goods have such high maximums that no ship can possibly fill the factory with one run.

Well, whatever, I'll leave it to your genius to figure out exactly why. It's a target for improvement at any rate :)

Going back to OreCollect, is there any way for ships to start at different places in the "cargo list" for lack of a better word. I've been using two gatherers, and after watching them carefully for some time, it appears that they often target the same ore at the same time; which results in wasted time as one ship scoops the ore and the other is forced to break off. Could you force a ship to start at the "bottom" of the "cargo list" and work backward so that they stay out of eachother's way? A pipe dream would be for the script to divide the list up evenly between all active scavengers, so you could have any number you wanted.

Looking back over this post it comes across as negativity, but please be assuured that overall you're doing a fantastic job! Constructive criticisms is my goal here.
merle
Posts: 48
Joined: Sun, 2. Nov 03, 15:57
x3tc

Post by merle »

My feeling on the matter is that the salesman script should just message you, "No energy!" and wait for more energy to be delivered instead of dying.
Hmm, I thought about that, but I would probably end up signaling once a minute, that would not be popular.

How about an option to let the salesman purchase energy when the TL or base is running low?

Logic would be: If there is less than 500 energy at base, buy a full load of energy in either the target sector or home sector when making a delivery.

Maybe the option should just be what price to purchase the energy at; you could specify 8 or less for no purchasing.

The issue with energy gets worse when you add in my Advanced Arms Dealer (I have a beta version going now). That script will jump all over the universe hunting equipment docks and factories.
Something that's a little odd, the salesman ship doesn't return the energy it started to load onto its ship if it aborts. I'm not sure your script checks to see how much is on the ship before it starts, but I can envision a problem where your sales fleet slowly picks up mountains of energy from aborted delivery runs, leaving the player scratching their head as to why they're selling so slowly.
Ups, yes it should drop the energy of an aborted run. (done in V1.1)

But when you restart the script it starts by unloading any energy on board, so there should be no long term negative effects.
My sales team completely ignored the pile of >1,800 units of Sun Flowers, because (I think) both Silicon and Ore came first on the list. Or another thought, is it because the "factory lot" of Sun Flowers is some really high number, so the script says
The script checks that the store on the TL should be large enough to fill up either the target station or the trading ship. If not, move on to next ware. So your flowers should be moved unless your trading ship (a Vulture perhaps) can hold more than 1800 flowers. Unless there is no buyers willing to pay more than average price.

An odd way to make the Vulture lift off is to load it with 200 units worth of any other good, the script will detect that the cargobay would now be filled by 1800 flowers.

So a Manta will make deal where a Dolphin would wait for more cargo.

I have a low tech version, which just sells whatever cargo is on board the trading vessel for getting rid of smaller amounts of cargo. I used that before I could afford a TL. Maybe I should release that too.
Minor grammatical errors:
Will fix those in next release. (Done in V1.1)
Which is inconvenient if you actually want to have a pile of silicon or ore in your hold
Hmm, that should be easy enough, maybe a blacklist of cargo, where you could specify up to 3 wares, someone might want to hold on to their crystals. :) (Done in V1.1)

V1.1 is just uploaded at xscripting.com
Going back to OreCollect, is there any way for ships to start at different places in the "cargo list" for lack of a better word. I've been using two gatherers, and after watching them carefully for some time, it appears that they often target the same ore at the same time
I have given that a lot of thought, I have the same problem. The problem gets even worse when you use 4 auto miners at a time.

The "cargo list" is made each time a collection has been made, and will always select nearest object.

I tried selecting a starting point like the auto miner, but then you would have to restart the script in every new sector.

I also tried selecting an Auto Miner as the base of operation, but then the Ore Collector might return to base with the Auto Miner and leave uncollected ore because it is now outside its scanrange.

Maybe just selecting a random fragment among the 2 nearest, that would make the script less efficient for 1 collector but better for large scale operations. The selection between 2 fragments should make a large number of Collectors fan out in different directions.

But there would be a 50% possibility of leaving the last fragment of an asteroid and head for the next field. The fragment would be collected later but time would be wasted.

Maybe a check for other Ore Collectors nearby and going to efficient operation if none exists.

Maybe a completely random fragment if starting from the base.

Maybe ..... well ideas welcome
User avatar
Momaw
Posts: 736
Joined: Mon, 4. Aug 03, 04:12
x3tc

Post by Momaw »

Seeing as merle has not replied to this topic in 2 months (and his last message on the boards is dated 10th february), do I have the forum's permission to remove his entry from my Big Book o' Debts Owed?
Patient of the Mad Goner asylum for the mentally extravagant
Howlingmad
Posts: 1252
Joined: Wed, 6. Nov 02, 20:31
x3

Post by Howlingmad »

Momaw wrote:Seeing as merle has not replied to this topic in 2 months (and his last message on the boards is dated 10th february), do I have the forum's permission to remove his entry from my Big Book o' Debts Owed?
Probably not, why not ask a friendly Mod to check to see if the account is still active. :D
What no sig or avatar. I wonder why?:(
merle
Posts: 48
Joined: Sun, 2. Nov 03, 15:57
x3tc

Post by merle »

Seeing as merle has not replied to this topic in 2 months (and his last message on the boards is dated 10th february), do I have the forum's permission to remove his entry from my Big Book o' Debts Owed?
Well I have been away for a while on some RL business, so my answers has been ......... SLOOOOW

But you can have my permission to cancel the debt :-)

/Merle

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