Drone Carrier Software 2 (DCS2) v2.07a

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

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

Post Reply
Freenan
Posts: 110
Joined: Tue, 5. Aug 08, 18:46
x4

Re:

Post by Freenan » Sun, 24. May 20, 21:53

Freenan wrote:
Fri, 17. Aug 18, 22:58

by the way: is this Script LU compatible?
anyone knows?

lkn240
Posts: 8
Joined: Fri, 5. Mar 21, 15:48

Re: Drone Carrier Software 2 (DCS2) v2.07a

Post by lkn240 » Fri, 2. Apr 21, 15:30

This is a great script.... I found and fixed a bug with the refund if anyone is interested.

I noticed that I was being charged money both when I turned on DCS2 AND when I turned it off.

There's a line in the Carrier task that is:

$drone.refund = -1 * $drone.price.

Either remove that -1 or change it to a 1. Otherwise you'll have a negative amount of money added to your account as your "refund".

I also changed the max number of drones to the hangar max so that ships I don't fly can fill all the way up (I manually change the value for ships that I do fly myself to be 1 less).

Just remove the -1 (or change it to a zero) in this line:

$drones.max = $hangars.max - 1


For whatever reason in my game the ammo resupply is not working..... trying to figure that out now. I doubt it's a mod conflict as I don't have that many installed (just a few things like bounce and MARS beyond the bonus pack).

Worst case I'll just change the weapon priority order so that HEPTS and PACs are used instead.....although I still have to figure out the bombers.

Edit. I tried reinstalling the mod via the plugin manager and still no joy on ammo or missiles. I think something is not working in the drone task. Everything else does seem to work which is nice. I may just disable the bombers and use DCS to manufacture and equip fighters instead of purchasing them. I'll see if I can figure out what's wrong with the drone task first though

lkn240
Posts: 8
Joined: Fri, 5. Mar 21, 15:48

Re: Drone Carrier Software 2 (DCS2) v2.07a

Post by lkn240 » Fri, 2. Apr 21, 21:08

Ok, I don't know how to fix the ammo/missile reload (yet at least... I just started on x3 scripting today lol). However, I've already got a solution that works for me (If I can figure out how to package all this up I'll post it). I disabled bombers (which is easy to do), fixed the naming so that player chosen fighter names are there for M4s too and most importantly put in code to set the ammo and missile resupply automatically

For ammo just modify the ebcg and mass driver sections like this (you'll get 25% of your cargo bay seat to resupply with ammo with a cap of 40)

Code: Select all

else if $drone-> fits laser $ebcg into turret $DE.j
$ware = $ebcg
$max.ammo = $drone-> get max amount of ware $ebcg.ammo that can be stored in cargo bay
$max.ammo = $max.ammo/4
if $max.ammo > 40
$max.ammo = 40
end
FWIW, I moved PRG way down the list because while it's effective it's not really usable in friendly sectors. This won't actually put ammo in the ships (although that would be easy to do... give them an initial loadout... maybe I'll add that), but it's trivial to supply carriers with ammo/missiles via CLS.

For missiles I added this section right above the laser section (which is where the code above goes)....it will set resupply to commonly used missiles that work for the AI (if you prefer tempest to thunderbolt you could easily switch that)

Code: Select all

if $drone->can missile $typhoon be installed
$max.missile = $drone-> get max amount of ware $typhoon that can be stored in cargo bay
$max.missile = $max.missile/2
$drone->set missile resupply: missile=$typhoon amount=$max.missile
else if $drone->can missile $thunderbolt be installed
$max.missile = $drone-> get max amount of ware $thunderbolt that can be stored in cargo bay
$max.missile = $max.missile/2
$drone->set missile resupply: missile=$thunderbolt amount=$max.missile
else if $drone->can missile $spectre be installed
$max.missile = $drone-> get max amount of ware $spectre that can be stored in cargo bay
$max.missile = $max.missile/2
$drone->set missile resupply: missile=$spectre amount=$max.missile
else if $drone->can missile $silkworm be installed
$max.missile = $drone-> get max amount of ware $silkworm that can be stored in cargo bay
$max.missile = $max.missile/2
$drone->set missile resupply: missile=$silkworm amount=$max.missile
else if $drone->can missile $poltergeist be installed
$max.missile = $drone-> get max amount of ware $poltergeist that can be stored in cargo bay
$max.missile = $max.missile/2
$drone->set missile resupply: missile=$poltergeist amount=$max.missile
end

lkn240
Posts: 8
Joined: Fri, 5. Mar 21, 15:48

Re: Drone Carrier Software 2 (DCS2) v2.07a

Post by lkn240 » Sat, 3. Apr 21, 01:37

One last post.... If I can figure out how to package this stuff up I'll upload all my changes. I changed/fixed a ton of stuff.

You can now choose to use ammo based weapons, use missiles and use mosquito missiles defense (with 10 Mosquitos loaded) on a per carrier basis (so the settings apply to the fighters of that carrier)

If you set the initial load variable to True (the default) it will purchase a initial load of ammo/missiles for your fighters when they are built. It also sets the correct resupply amounts for missiles, ammo and mosquitos. You can keep your fighters resupplied easily by using CLS to keep your carriers resupplied.


I ended up disabling bombers since the existing auto missile supply didn't work. I also disabled having it start sector defense when you turn it on (although it would be easy to make that a setting). I also disabled the turbo.

lkn240
Posts: 8
Joined: Fri, 5. Mar 21, 15:48

Re: Drone Carrier Software 2 (DCS2) v2.07a

Post by lkn240 » Sat, 3. Apr 21, 23:43

I made a ton of modifications, fixes (and disabling of stuff that doesn't work) and I this working nicely for carrier management now. Awesome work by OP to build this in the first place.

I didn't test the drones much, but I tested using this to build fighters extensively. it makes carrier management soooooo much easier (but it can be expensive.... I went into a Xenon sector to test and had capitals to fight and ended up spending almost 100 million in my last test! Eclipses aren't cheap!)

When you use this now you should turn it on and not change the fighter being built to start. It will default to the (cheap) drones... once you have all your settings how you like them select the fighter you want and then turn it off and turn it back on. It will destroy the drones, refund what you spend on them and then start building your fighters. There are a bunch of options. Missiles, Mosquito Missile defense, and a bunch of weapon selections.

Disabled items:
- Turbo
- Bombers
- original system for ammo/missile resupply (it doesn't appear to work anymore).


The fighter cargo bay gets filled in this order AND automatic resupply settings are configured to match what gets put in the cargo bay. Each fighter gets an initial load of ammo and missiles by default (you have to pay if they aren't available in your depot). Automatic resupply settings are configured for ammo, mosquitos and whatever missiles are mounted so having your fighters resupply is easily done by simply having CLS keep your carrier stocked up.
The fighter is built and filled in this order:

Weapons are mounted. I kept Dr BWs weapon order but provided all kinds of options. You can enable/disable ammo based weapons, HEPTs, MDs (so you can mount EBCGs in the mains without having MD in the turrets on some fighters), PRG (which generally replaces PAC), HEPT, FBL, etc. These options (in fact almost all options) are PER CARRIER. So you can have different types of mounts/combos on different carriers.

The commonwealth weapon order goes as follows (the script does check if the fighter can mount the weapon - so the best weapon that fits is picked from the list). (terran is easy - EMPC then PMAML)
- PBG (disabled by default)
- EBCG (enabled by default)
- HEPT (enabled by default)
- MD (enabled by default)
- FBL (disabled by default)
- PRG (disabled by default)
- PAC (enabled by default)
- IRE (enabled by default)

As an example, if you change "Use PRG" to Active then generally PRGs will be mounted instead of PACs. Note that fighters aren't changed once they are built (other than missile probability)... so you have to turn DCS off for that carrier and turn it back on to change the loadout.

Next if MDM is turned on 10 mosquito missiles are added and MDM is enabled.

Finally whatever space left is filled with missiles if missiles are enabled (rounded to the nearest 5 to match auto resupply settings).

Typhoons are mounted if possible (which is very rare) then Thunderbolts (most fighters) then Silkworms if the fighter can mount those, but not thunderbolts. There's a per carrier option to mount tempests instead of Thunderbolts.

For Terrans it's Specters then Poltergeists


Missile probability is 70 by default (it's kind of high, but your fighters will wreck stuff :-)). You can change it on a per carrier basis at any time.

There's probably some other stuff I forgot, but that's the meat of it. I had never written any X3 code before yesterday, but I *think* everything is working properly (not sure about the auto-repair - I need to look at that)

Screens:

https://imgur.com/a/eIiQcwB

Files:

https://www.mediafire.com/file/l8wyzjhf ... S.zip/file

Edit: Fixed a few more things and added a couple of things. Screenshots are slightly out of date now, but pretty similar. Weapon priority in the script is the same as it appears in the menu now.

lkn240
Posts: 8
Joined: Fri, 5. Mar 21, 15:48

Re: Drone Carrier Software 2 (DCS2) v2.07a

Post by lkn240 » Wed, 7. Apr 21, 04:31

Another update. Changed the wing option so that the fighters on the playership are always added to blue wing (so you want to keep blue wing empty). It dynamically changes the wing assignment as you change ships.

https://www.mediafire.com/file/e2bw52fs ... 1.zip/file

Post Reply

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