[SCRIPT] Missile Boat: shield prediction, fighter drone support, and more (8/30/2007)

The place to discuss scripting and game modifications for X³: Reunion.

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

is this script usefull to you?

yes
9
90%
no (Please specify why, if you have the time to do so)
1
10%
 
Total votes: 10

ouch
Posts: 461
Joined: Wed, 6. Nov 02, 20:31
x3tc

[SCRIPT] Missile Boat: shield prediction, fighter drone support, and more (8/30/2007)

Post by ouch »

This script is installed as an additional ship command the only requirements currently is both fight softwares. It will gather a list of all ships in the sector within the range of your desired missile. it will then cycle through those ships and sort out the good guys from the bad based on the preferences of the ship it's being run on. It will then calculate how many missiles it needs to kill that ship, fire them, then move on to the next ship. If that ship has turrets this script will also fire a user defined amount of a second missile type (or fighter drones if you prefer) for every turret it finds. The results can be quite astonishingly devestating...

parameter descriptions:

Select primary missile: this is the missile that will be doing all the damage. The script calculates how many missiles it needs to kill the enemy off of this missile. It now also calculates how much the enemy shields will recharge from now till the targets death and fire enough missiles to cover the regained shield hit points. The range of the missile is also used to see if you can even reach the target. If you can't then the script picks something else to shoot at. Also, if you havn't seen it you can't shoot at it reguardless of the missiles range.

Select secondary missile: This missile will be used for primary missile screening. This missile will be fired for every turret it finds on the enemy ship. The range is also checked independantly from the primary missile so you don't waste precious missiles. You can now also select fighter drones for this command. The drones will be launched with orders to attack the current target in the enemy list.

Note: while any missiles can be used, keep in mind the script does not check which direction your faceing, as such, dumbfire missiles have limited use in this script.

(added 8/30/2007) Primary missiles per turret: This is how many primary missiles that will be fired PER TURRET found on the enemy ship. if you would not like to fire any extra missiles you may enter a zero here. Because even the most efficiant missile screening in universe will eventually have a primary missile shot down due to turrets. This is your chance to cover those losses so that you still get that kill your looking for.

Secondary missiles per turret: This is how many secondary missiles that will be fired PER TURRET found on the enemy ship. if you would not like to fire any you may enter a zero here. But instead I recommend selecting the primary missile for the secondary missile so the damage is increased a bit for heaver ships equipped with turrets.

(removed for simplicity sake 8/30/2007) Secondary missile launch pattern: Ok, this one needs some explaining...

primary missiles that come out of a ship designated for a certain target do so in a single stream. This stream or Salvo if you prefer will be inturupted this many times to fire secondary missiles. As a rule, if the number greater than one there will be at least one secondary missile fired before the salvo and one fired after the salvo is finished. So here are some examples. P = primary missile, S = secondary missile the number is the number entered for this parameter. and 6 primary and secondary missiles have been calculated to be needed to kill the target:

1
SSSSSSPPPPPP
2
SSSPPPPPPSSS
3
SSPPPSSPPPSS
4
SSPPSSPPSSPPSS (6 / 4 = 1.5 this gets rounded up to 2 makeing 8 Secondary missiles launched in this case)
5
SPPSPPSPPSPPS (6 / 5 = 1.2 This gets rounded down and only 5 Secondary missiles but for the primary missile grouping is always one less than the number entered so it's 6 / 4 again which gets rounded to 2 So extra primary missiles get sent)
6
SPSPSPSPSPS (Primary is 6 / 5 which gets rounded to 1 so one less than needed gets sent out)
7
SPSPSPSPSPS (it's the same as 6 because you need fewer missiles than the pattern demands. the script simply reduces the pattern number for this particular salvo)
8
SPSPSPSPSPS
9
SPSPSPSPSPS
etc...

It's all in your preference of what to enter here. I usually use 3 myself.


Missiles per 10 sec (10-20): This defines the rate of which missiles are launched in a single salvo. Yes this command has changed quite a bit. it was necissary for the new shield prediction alograthim. Unfortunately there is now a min of 1 and a max of 10000. I'm terribly sorry for this but there really was no other way. also take note that the rate of fire is defined per every 10 seconds, and not 1 second.

Salvo fire rate 5-9: This is the rate at which individual salvos are fired. Again, These Numbers are merely starting point suggestions. you may enter ANY number you desire as per the voteing that was held. This command is now defined to be in seconds, and no longer milliseconds as before.

All targets attacked 20-70: Once all ships have been scanned and fired upon it waits this long till it scans for survivors and new targets again. And yes, these numbers are merely starting point suggestions. you may enter ANY number you desire as per the voteing that was held. This command is now defined to be in seconds, and no longer milliseconds as before.

This script now includes my utility script which makes use of the following hardware if installed on the ship:

mineral scanner: any identified buildable astroids within 10km will be scanned.

frieght scanner: any ship passing within 4km will be scanned. This will only occur if you have the police liscence for the owner of the sector the ship is in. (you might be surprised with the amount of pirates your missing out on wasteing without this simple feature)

video enhancement goggles: These will enhance your ships standard, duplex, and triplex scanners to identify squash mines.

Note: squash mines are considered to be ships according to the game engine. This means any turret with orders to attack all enemys, or ships with orders to kill all enemys will fire upon the identified mines if they are enemies. (missile boats too folks!) this is both good and bad. Good, in that yes the threat of the mine will be gone, but bad in that it could destroy what the mines were protecting... Faster ships with orders to kill all enemys will often blow themselfs up makeing a straffing run on the mine field as well. So do take care with what ships you upgrade with goggles...

docking computer: Any time the ship has orders to dock and it's within 5km of the docking ship/station it will "warp" into the docking bay just as if you activated the docking computer yourself.

Note: this causes a host of problems if your flying the ship and it does this. as such this feature is disabled when your flying the ship. Also the ships orders are cleared when this activates. I'm sorry but dispite all my efforts (like 1-2 days of testing) the built in scripts by egosoft have a oversight/bug that doesn't allow this to work properly. This is mainly provided for carrier/fighter combos than automated traders. and dispite this problem it's extremely handy for those types of ships.

Transporter Device: will allow the ship to warp fighter drones with no orders, or orders to follow a ship. (NOT protect a ship) into the cargobay. this costs 2 energy cells per drone. (one to warp it from open space, another to charge it back up)

So there you have it.

Things I might add:

variable fire rate depending on your ships health.

Countering shield recharge rates: finished! And highly accurate I might add... ;)

individual ship class handleing. So you don't fire hornets at m5's, or mosquitoes at m1's.

Notes and observations on the 8/30/2007 release:
I spent many hours trying to find high accuracy with all the target types shields. the shield prediction is more complex than I would of liked but it is very accurate. down to the last missile with fighters and in my tests only around 10 extra silkworms per capital ship will be launched. that sounds like a lot but keep in mind it takes hundreds of silkworms to kill a capital ship. The fighter drone addition makes for some additional stratagy... Do you go for the drones reuseability, or an missiles extra damage potential. Keep in mind that the utility script will make recovering even 1000's of drones hassle free as long as you have the Energy Cells to do it. But drones are also slower than missiles meaning they will get taken out faster as well.

The script is now MUCH easier and faster to set up. So much so, you can do it in the middle of combat and live to tell about it. ;)

I also made the script a bit more responsive by reduceing the amount of ships it scans, this means it's more responsive in busy sectors.

Overall I think you will greatly enjoy the results of this new version. :)

The vote that was held:

http://forum.egosoft.com/viewtopic.php?t=186940

download:

http://www.geocities.com/ouch67/missileboat.zip

you will also need the floating point library made by Euclid:

http://forum3.egosoft.com/viewtopic.php?t=159598

I've tested the script pretty heavily, (oh, all those poor xenon... ;) ) but let me know if you find any bugs.

oh, and this script uses ship command slot 63:

<t id="1263">COMMAND_TYPE_SHIP_63</t>
Last edited by ouch on Sat, 1. Sep 07, 21:43, edited 5 times in total.
Madw0lf
Posts: 323
Joined: Fri, 24. Dec 04, 01:53
x3

Post by Madw0lf »

Hmmm this looks really cool. Couplea questions...

I assume your fire rates are in milliseconds? Also do you have to go through the whole setup each time you start a new attack?

Finally any idea if this will conflict with XTM at all?

Either way, Ill be giving this scipt a try tonight, see what it can do with wasps/typhoons... :twisted:
ouch
Posts: 461
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by ouch »

Madw0lf wrote:Hmmm this looks really cool. Couplea questions...

I assume your fire rates are in milliseconds? Also do you have to go through the whole setup each time you start a new attack?

Finally any idea if this will conflict with XTM at all?

Either way, Ill be giving this scipt a try tonight, see what it can do with wasps/typhoons... :twisted:
yes fire rates should be in milliseconds they just supply a number to wait commands in the script editor.

and once setup, you don't need to enter any of this in ever again. the script keeps looping, trying to find something that your ship doesn't like and asking it nicely to go away... :)

and no, there are no conflicts with XTM, because I actually made it while XTM was installed. ;) It should work with any or no mods actually. it just adds a single command and uses the 63rd slot to do that.
Please fix the AI Egosoft! I'm sick of losing ships(doesn't matter what class) when they fly into what they are attacking! This occurs even if the object is stationary and doesn't have any protrusions.(Like a pirate base) It's just sad, and it totally ruins the entire concept of the series!
FlameGlow
Posts: 10
Joined: Mon, 6. Aug 07, 19:09
x4

Post by FlameGlow »

Can you make it auto-calculate launch pattern based on range to enemy to make primary and secondary missiles impact at roughly the same time? :roll:
ouch
Posts: 461
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by ouch »

not easily no... there is no command to get the speed of missiles. So that means I would have to keep a manually updated list of missile speeds, which would make the script incomapatible with any mods that add missiles or changes the speeds.

plus the turrets would shoot the slower primary missiles before the secondary missiles got there anyway.

You would then need to find the longest range weapon in the targets turrets and try to get the missiles at the distance between your ship and the targets Plus the range of that weapon. which would probably work relatively well. Except for the fact that while your ship is waiting for the missiles to arrive in thwe sweetspot, it got killed by the rest of the enemy fleet...

Still it's an intriguing option, I'll look into it.
Please fix the AI Egosoft! I'm sick of losing ships(doesn't matter what class) when they fly into what they are attacking! This occurs even if the object is stationary and doesn't have any protrusions.(Like a pirate base) It's just sad, and it totally ruins the entire concept of the series!
User avatar
ninjitsumonk
Posts: 1874
Joined: Thu, 1. Mar 07, 09:21
x3

Post by ninjitsumonk »

Just a suggestion, maybe add a variation of the command to attack the current ship's target [ONLY]. I don't like the idea of missiles galavanting around all over the place, unless I've misunderstood of course :P
mwalk10
Posts: 3
Joined: Fri, 6. Jul 07, 04:24
x3

Post by mwalk10 »

One thing I've noticed is that it doesn't seem to check if theres a path to the target. I went into LooManckstrat's Legacy to test it out, and it seemed to work great, except all the missiles ended up slamming into an asteroid. :shock:
rujikin
Posts: 397
Joined: Fri, 22. Jul 05, 09:46
x3tc

Post by rujikin »

If the name of it is really missile boat you need to be fed to the khaak. It should be Missile Frigate or anything better <_<..
ouch
Posts: 461
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by ouch »

sorry folks I've been busy with birthdays and weddings... sigh...

anyway a target only option will probably be included when I impliment the hotkey version of the script

and unfortunately, there is isn't a single command to check for line of sight in the script editor. infact you might notice the stock ai shoots roids with lasers trying to hit something as well. there isn't much I can do about this I'm affraid.

I'm currently trying to come up with a reliable way to predict shield recharging. but unfortunately it seems every shield item has it's own recharge rate in addition to the ships shield power generator rates, and it's throwing my calculations off.

I'll figure out something though. (I hope ;) )
Please fix the AI Egosoft! I'm sick of losing ships(doesn't matter what class) when they fly into what they are attacking! This occurs even if the object is stationary and doesn't have any protrusions.(Like a pirate base) It's just sad, and it totally ruins the entire concept of the series!
ouch
Posts: 461
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by ouch »

New version!

Added an accurate shield prediction alograthim.
My utility script addon now works with it.
code revisions to make the script more responsive has been added.
MUCH easier and faster to set up.
added primary missile per turret argument.
removed launch pattern command for simplicity sake. (the script auto uses the number of turrets found for this now)
You can now use fighter drones as secondary "missiles"

I also changed the missile selection arguments to display only items in the ships cargo hold.

and a few other tweaks here and there.

it's a huge update, Let me know what you think about it!
Please fix the AI Egosoft! I'm sick of losing ships(doesn't matter what class) when they fly into what they are attacking! This occurs even if the object is stationary and doesn't have any protrusions.(Like a pirate base) It's just sad, and it totally ruins the entire concept of the series!
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22438
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

just thought ill tell u, u have the date wrong ;)

its august, not september.

08/30/2007, not 09/30/2007
ouch
Posts: 461
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by ouch »

yep, fixed. wrote this post around 2:30 AM heh...
Please fix the AI Egosoft! I'm sick of losing ships(doesn't matter what class) when they fly into what they are attacking! This occurs even if the object is stationary and doesn't have any protrusions.(Like a pirate base) It's just sad, and it totally ruins the entire concept of the series!
ouch
Posts: 461
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by ouch »

just giving you folks a heads up... Since no one has replied yet I assume everyone apparently thinks the script is perfect at the moment. So I'll be adding ship/type specific missile launching for the next update if anyone cares.
Please fix the AI Egosoft! I'm sick of losing ships(doesn't matter what class) when they fly into what they are attacking! This occurs even if the object is stationary and doesn't have any protrusions.(Like a pirate base) It's just sad, and it totally ruins the entire concept of the series!
Buck_Rogers
Posts: 1521
Joined: Mon, 20. Dec 04, 23:23
x3

Post by Buck_Rogers »

OK. Really sorry for digging this old script up. BUT I do have a question for someone to answer.

Would this be able work on a group of ships? I would like to make some kind of torpedo/bomber squad with this. Also did the suggestion regarding attacking a single target ever get implemented?
Buck Rogers

Vice Admiral of Shadows Haven Alliance (SHA) visit us at:
SHA Forum
Feel free to join my DID
Too often we lose sight of life's simple pleasures. Remember, when someone annoys you, it takes 42 muscles in your face to frown. But only 4 to extend your arm and slap the bugger!
Deathwalker1701
Posts: 77
Joined: Sun, 15. Oct 06, 19:37
x3

Post by Deathwalker1701 »

Will give this a go looks great :)
Galdaroth
Posts: 26
Joined: Mon, 17. Sep 07, 09:38
x4

Post by Galdaroth »

Firstly, I think this script is fantastic! :) I had an elephant in an unknown sector (X3 Reunion + XTM) with around 180 silkworms and it cleared the sector of pirates. (several M6s and loads of M3s).

Secondly, do you intend to port it to Terran Conflict? :roll:

Thanks again for a great script.
Buck_Rogers
Posts: 1521
Joined: Mon, 20. Dec 04, 23:23
x3

Post by Buck_Rogers »

Ok. Another apology for digging up an old post. :D

Can someone please provide another link to download this script.

pretty please! :lol:
Buck Rogers

Vice Admiral of Shadows Haven Alliance (SHA) visit us at:
SHA Forum
Feel free to join my DID
Too often we lose sight of life's simple pleasures. Remember, when someone annoys you, it takes 42 muscles in your face to frown. But only 4 to extend your arm and slap the bugger!
TomRobinson
Posts: 279
Joined: Thu, 7. Feb 08, 22:07
x4

Post by TomRobinson »

Seconded this looks fun
Buck_Rogers
Posts: 1521
Joined: Mon, 20. Dec 04, 23:23
x3

Post by Buck_Rogers »

Managed to obtain a copy of the .spk file for this to. :D So once again, if no one objects. I shall make it available for download.

Missile Boat

Please note: I am not taking any credit for this script. Just making it available to everyone.
Buck Rogers

Vice Admiral of Shadows Haven Alliance (SHA) visit us at:
SHA Forum
Feel free to join my DID
Too often we lose sight of life's simple pleasures. Remember, when someone annoys you, it takes 42 muscles in your face to frown. But only 4 to extend your arm and slap the bugger!
TomRobinson
Posts: 279
Joined: Thu, 7. Feb 08, 22:07
x4

Post by TomRobinson »

Thanks dude

Return to “X³: Reunion - Scripts and Modding”