Litcube's Missile Boat Add-On (Turret:V0.92b / Supply:V0.93b)

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

Post Reply
User avatar
Litcube
Posts: 4245
Joined: Fri, 20. Oct 06, 19:02
xr

Litcube's Missile Boat Add-On (Turret:V0.92b / Supply:V0.93b)

Post by Litcube » Tue, 19. Apr 11, 20:08

Litcube's Missile Boat Add-On (Turret:V0.92b / Supply:V0.93b)

Enables Missile Boats to do their thing

Download Missile Boat Turret Overwrite:
Image

Download Military Suppliers Job Script:
Image


What is this?

Videos from builder680:
BEFORE your !turret.missileattack and Lib.Cmd.Turret.Barrage
VIDEO (CLICK)
AFTER your !turret.missileattack and Lib.Cmd.Turret.Barrage
VIDEO (CLICK)

Missile Boat Turret Overwrite:

In the stock game, missile boats are close to useless. They fire missiles using the same frequency as other ships would (FLY's-> get missile fire probability). This changes that by running a turret script on a missile boat's missile turret. Note that the missiles are not hardcoded.


New rules as of V0.9
- A volley is defined as missile launches between respected missile ROF + ship's assigned Missile Fire Probability Delay.
- The Missile Fire Probability Delay is equal to 11.5 seconds - (ship's assigned Missile Fire Probability * 100).
- Missile Fire Probability is set in the ship's command console (delay examples: %5: 10 sec, 100%: 0.5 sec)
- By default, AI ship's have a 5% Missile Fire Probability.
- Turrets can fire at only one target per volley.
- To mitigate overkill and waste, not all pods are used in a volley, depending on target "hit points"
- Multiple turrets can attack a single target, if the expected damage output is appropriate per "hit points"

Missile selection:

- Highest damage missile that is 20% faster than the target's speed
- If target range is more than 90% of missile range, the missile is skipped for fire
- If no missile is found that meets speed requirements, pick fastest missile
- If no missile is found that meets range requirement, NO missile is returned (thus barrage will not fire)

Loops are all "waited", and scripts do not run OOS, performance is not an issue. Once installed, AI ships will use this script automatically. Player ships are not effected unless you run the "Attack Enemies" command on the missile turrets, at which point they will run this script.

[NOTE:] All the scripts included in this package include versioning checks, and will auto-update themselves in terms of running status if a newer version is supplanted.

Military Suppliers Job Script:

M7s and M8s don't resupply themselves properly, so I wrote a job script for it. Ships running this job will search for their own races missile boats that are low on missiles (<12). Once they find a ship, they'll jump to a military outpost to supply (supply is faked, but ship *is* loaded with actual missile wares), and then fly to the target ship within transporter range, and finally use the transporter to resupply.

The job is very heavily "waited", so much so, that if a missile boat is out of missiles, it could be five to ten minutes before the military supply ship picks up the operation. This is intentional to ensure good performance.

The Military Suppliers Job script will not automatically be implemented in your game. you will have to add a job to run this script. I've added 4 for each commonwealth race and 3 per ATF/Terran. I set them to TS ships, and named them Military Supply Transports.

Note that it is not necessary to implement the Military Suppliers Job for the Missile Boat Turret Overwrite script to function. However, you will notice AI missile boats frequently running out of ordinance if you don't.




Install

Missile Boat Turret Overwrite:

This will overwrite your !turret.missileattack.pck in your scripts directory. Back it up if you want the option to revert later.

Military Suppliers Job Script:

Copy !job.missilesupply.xml to scripts directory. Make a job that runs this script (if you're using vkerinav's xtra jobs, it's done for you). Note that a job's script field does not include "!job", so yours will look like this: "missilesupply".


Missile Boat Turret Overwrite Versions

0.92b:
- Compressed the !turret.missileattack.xml to a .pck for easier installation.

0.91b:
- Packing issue. Forgot a file. Very important.

0.9b:
- Near total rewrite

0.7b:
- Added two checks to ensure missile was present and enemy still existed before firing.

0.6b:
- Fixed packing issue. The old version didn't work with ATF/Terran ships, as I had hardcoded values. Proper version included now.

0.5b:
- Initial release


Military Suppliers Job Script Versions

0.93b:
- Bug where military suppliers were all running for the same ship to supply. This has been fixed. Only one military supplier will supply a single missile boat with missiles at one time.

0.92b:
- Job scripts fun fact! If you don't set a command on the ship, the job engine will re-run the script on the spawned ship ever time its spawn timer comes up. This doesn't cause a problem unless your spawn time is lower than the ship's initial wait, in which case it'll never do anything. Added a set command COMMAND_SUPPLY_WARE. Problem solved.

0.8b:
- Packing issue

0.7b:
- Sets the "it's ok guys, I got this one" flag on a target ship to null if an outpost can't be found, allowing others to take over if an outpost becomes available.

0.6b:
- Suppliers were loading too many energy cells, leaving little room for missiles. Has been fixed. No restart required, just replace files.

0.5b:
- Initial release
Last edited by Litcube on Fri, 11. May 12, 23:06, edited 23 times in total.

User avatar
Mizuchi
Posts: 803
Joined: Thu, 10. Feb 11, 06:48

Post by Mizuchi » Tue, 19. Apr 11, 20:13

Suddenly, Station Insurance Premiums sky-rocketed across the universe, while sales of large red buttons and "do not push" signs were met with huge demand.

Coincidence?!

Also:
Litcube wrote:However, you will notice AI missile boats frequently running out of ordinance if you don't.
If you've just found your fighter wings have been replaced with numerous fireworks, and your hull condition is in the single digits, this might not be such a bad thing. :3

User avatar
Litcube
Posts: 4245
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube » Tue, 19. Apr 11, 20:20

Mizuchi wrote:Suddenly, Station Insurance Premiums sky-rocketed across the universe, while sales of large red buttons and "do not push" signs were met with huge demand.

Coincidence?!
Also:
Litcube wrote:However, you will notice AI missile boats frequently running out of ordinance if you don't.
If you've just found your fighter wings have been replaced with numerous fireworks, and your hull condition is in the single digits, this might not be such a bad thing. :3
Yeah, don't say I didn't warn you. I would strongly recommend nerfing the boat missiles by half. Once the boat has spent its missiles, enemies can breathe a sigh of relief until a military supply transport jumps in; at which point, it's probably a primary target.

User avatar
Mizuchi
Posts: 803
Joined: Thu, 10. Feb 11, 06:48

Post by Mizuchi » Tue, 19. Apr 11, 20:33

"So," said Litcube, "I heard you like... explosions..." :twisted:

Anyhow, again, thanks for this one.

User avatar
Roger L.S. Griffiths
Posts: 9913
Joined: Fri, 12. Mar 04, 20:47
x4

Post by Roger L.S. Griffiths » Tue, 19. Apr 11, 20:34

Litcube wrote:
Mizuchi wrote:Suddenly, Station Insurance Premiums sky-rocketed across the universe, while sales of large red buttons and "do not push" signs were met with huge demand.

Coincidence?!
Also:
Litcube wrote:However, you will notice AI missile boats frequently running out of ordinance if you don't.
If you've just found your fighter wings have been replaced with numerous fireworks, and your hull condition is in the single digits, this might not be such a bad thing. :3
Yeah, don't say I didn't warn you. I would strongly recommend nerfing the boat missiles by half. Once the boat has spent its missiles, enemies can breathe a sigh of relief until a military supply transport jumps in; at which point, it's probably a primary target.
How about having the missile boats themselves RTB for reload?
Roger (aka [SRK] Mr^Rabbit)

"Understanding is a three edged sword... your side, their side... and the Truth!" - J.J. Sheriden, Babylon 5 S4E6 T28:55

"May god stand between you and harm in all the dark places you must walk." - Ancient Egyption Proverb

"When eating an elephant take one bite at a time" - Creighton Abrams

User avatar
Litcube
Posts: 4245
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube » Tue, 19. Apr 11, 21:00

Roger L.S. Griffiths wrote:How about having the missile boats themselves RTB for reload?
That's a better idea. It'd take them out of the action when they're useless.


I'll work on it. It would require either a new job, which would mean M7Ms and M8s have to be specifically assigned as a shiptype, or a job overwrite, including code for missile boats to fly to the nearest military outpost for resupply.

I think there's already code in there for that, I'll take a look.

Sn4kemaster
Posts: 996
Joined: Wed, 17. Jun 09, 18:29
x3tc

Post by Sn4kemaster » Tue, 19. Apr 11, 21:09

Wayhay.......... finally, this should make things a little more interesting out there in space!:twisted:

I agree that the M7M and M8 should equipe themselves.

Can this be put into the EES (as well as a standalone script)

User avatar
mr.WHO
Posts: 4584
Joined: Thu, 12. Oct 06, 17:19
x4

Post by mr.WHO » Tue, 19. Apr 11, 21:12

How it fare with IR script (IR use some missile ships as blockade ships that fire barrages)?

User avatar
Mizuchi
Posts: 803
Joined: Thu, 10. Feb 11, 06:48

Post by Mizuchi » Tue, 19. Apr 11, 21:16

Only one way to find out. :twisted:

vkerinav
Posts: 622
Joined: Sun, 11. Apr 10, 21:38
x3ap

Post by vkerinav » Wed, 20. Apr 11, 01:10

What I mean to say is, I'll add this to SRM/Xtra Jobs shortly.

User avatar
Litcube
Posts: 4245
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube » Wed, 20. Apr 11, 01:27

vkerinav wrote:What I mean to say is, I'll add this to SRM/Xtra Jobs shortly.
Hah. I caught your original post. ;)


As for editing the jobs to make the missile boats return to base, I've decided against it, despite me originally thinking it's a better idea. Here's why:


The solution as it stands, the military supply transporter, is a more elegant solution for a few reasons.

The missile boat turret overwrite is only a turret script, not a main control script. You can't (or shouldn't) write task 0 controlling code in a turret script to make it fly back to base. And to do that, we'd have to edit all existing jobs for any ship that uses a possible M7M or M8.

Not only that, there's going to be custom job files for different mods making this somewhat incompatible. Some jobs even contain flags for M7s OR M7Ms, making all non-missile-boat M7s fly back to base. I realize you can put a check in there, but it's not as streamlined.

FUTHERMORE, some scripts packages, nevermind just jobs, also spawn missile boats. The military supply transporter can tend them as well.

Adding a job, such as the military supply transporter, ensures that it's cross-mod compatible and is the least intrusive fix. Besides: it works, and it adds a neat little function for race TS ships aside from lobbing useless wares, shedding a little more life in the Universe.



[NOTE:] All the scripts included in this package include versioning checks, and will auto-update themselves in terms of running status if a newer version is supplanted.

vkerinav
Posts: 622
Joined: Sun, 11. Apr 10, 21:38
x3ap

Post by vkerinav » Wed, 20. Apr 11, 01:47

Litcube wrote:
vkerinav wrote:What I mean to say is, I'll add this to SRM/Xtra Jobs shortly.
Hah. I caught your original post. ;)


As for editing the jobs to make the missile boats return to base, I've decided against it, despite me originally thinking it's a better idea.
I was apparently so caught up thinking that someone should do it, I forgot to check if someone did.

I agree with your reasoning. It seems to me that freighter resupply is a more elegant, and 'realistic' approach. Perhaps it could be expanded to include ammunition? And would it work for the Yaki/Pirate/Xenon, who, at least in SRM, have their own missile frigates?

User avatar
Litcube
Posts: 4245
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube » Wed, 20. Apr 11, 01:51

vkerinav wrote: I agree with your reasoning. It seems to me that freighter resupply is a more elegant, and 'realistic' approach. Perhaps it could be expanded to include ammunition? And would it work for the Yaki/Pirate/Xenon, who, at least in SRM, have their own missile frigates?

If you add a job where the ship owner is of Yaki, for example, it'll stock Yaki missile boats.


This could be expanded to do ammo. I've discarded ammo from my own game on account of the 0/ms bug it causes, but it's easy enough to modify the script supply it.

builder680
Posts: 1028
Joined: Mon, 14. Feb 11, 04:58
x3tc

Post by builder680 » Wed, 20. Apr 11, 02:00

Lots of technical speak.

If all of this stuff has the end result of making M7M's shoot their missiles at *me,* not just the AI, I will be one happy son of a biscuit eater.

I *want* to be scared to death of the enemy, and to be forced to deal with major attrition, or even outright defeat, in battles with the AI.

Best of luck, and thank you for looking at this, Litcube. :)

User avatar
Litcube
Posts: 4245
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube » Wed, 20. Apr 11, 02:01

If the M7 sees you as an enemy, it will target you.

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”