Drone Carrier Software 2 (DCS2) v2.07a

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
Diggz
Posts: 38
Joined: Fri, 2. Apr 10, 21:57
x4

Post by Diggz » Wed, 15. Mar 17, 04:19

Has anyone tried this with litcubes universe?
I have yet to figure out the non-terran equivalent of a Point Singularity Projector...

User avatar
soulmata
Posts: 154
Joined: Thu, 15. Nov 12, 10:34
x4

Post by soulmata » Fri, 23. Jun 17, 12:55

What an absolutely badass idea.

I remember when I first saw the M7C class, I thought back to Starcraft's Protoss Carriers. Boy was I disappointed when I forked over 17M for a Macanna and it was basically an easier to shoot at TM.

I have a question. I'm in the process of building my personal maximum-immersion X3 game, and I want to do two things with this script:

1) Make the software installed by default on M7C

2) Make it available *only* to M7C

3) Bonus: Consume hull plating instead of or in addition to credits

Could I do that by modifying TShips and including this as a default ware? Like how cargo lifesupport is default on a TP? #2 I'm not so sure how to do at all, since it generally seems that any ship can have virtually any software installed.

I really want to give M7C a unique edge, and this is the perfect way to do it. I already am happy with TM (pocket carrier utility boats) and M1. I mean, I can always just force myself to follow that rule, but ...

User avatar
soulmata
Posts: 154
Joined: Thu, 15. Nov 12, 10:34
x4

Post by soulmata » Sat, 24. Jun 17, 04:07

I don't think you are updating this script anymore, but it is also worth noting that if my credit balance is very low, the carrier continues to manufacture drones and just doesn't charge me! I have 0 credits, and it is still pumping out drones no problem.

User avatar
soulmata
Posts: 154
Joined: Thu, 15. Nov 12, 10:34
x4

Post by soulmata » Sat, 24. Jun 17, 06:30

I found where the bug is.

In the function that builds drones inside plugin.bw.dcs2.carrier.task, the drone is built before the player's money is determined. Then, on line ~874, there is an if statement that checks to see if the player has >1 Million credits. If they do, it takes the money. If they don't, it just continues on.

So I think it will be easy to fix - at the start of the script, right after it checks to see if it needs to build a drone, check the money first there, and exit if there is not enough.

I have never used the script editor before, but it looks like I can fix this pretty easy.

User avatar
soulmata
Posts: 154
Joined: Thu, 15. Nov 12, 10:34
x4

Post by soulmata » Sat, 24. Jun 17, 08:03

I fixed it!

I have to say, I have a lot more respect for all the X3 modders after using the script editor. It has to be the most terrible IDE I've used in a long time. And I say that with a lot of respect to Egosoft, because I really love X3, but man, that was an awful experience!

All it took to fix it was inserting this at line 714, just after the conditional where it exits if it doesn't need to build drones:

714 $player.money = get player money
715 if $player.money < 1000 * 1000 ...
716 goto label MD.Exit
717 end

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24949
Joined: Sun, 2. Apr 06, 16:38
x4

Post by X2-Illuminatus » Sat, 24. Jun 17, 10:37

@soultmata
In future please use the edit button (in the top right corner of your posts) instead of creating multiple posts in a short timeframe directly after each other.

With regards to a proper IDE for writing/editing MSCI scripts, there's mr.bear's X-Studio external Script Editor.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten

Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)

Neuauflage der fünf X-Romane als Taschenbuch

The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!

unforged
Posts: 5
Joined: Wed, 30. Aug 17, 18:49

Post by unforged » Wed, 30. Aug 17, 19:03

To anyone who is having trouble getting the right bomber model to appear playing XRM:

I kept getting the Teladi Falcon Hauler as my drone bomber even though I had not changed any of the default settings in the t file, but I am playing as Terran so I wanted the ATF M3B. I messed around with the file a lot and realized that the game was reading the ship IDs as

Code: Select all

ID - 1
, so in order to get the ATF Norns as my bomber model I had to set the ID in the t file to 684, not 683. I discovered this by trying to set my bomber model to the ATF Fenrir (ID 203) and getting the Thor instead (202). DCS2 was correctly identifying 182 as not an M3, and defaulting me to the Falcon, which I think is some kind of failsafe for the script?

Since then I've been enjoying the mod a lot, but I do wish the user had finer control over the percentage of bombers that are made etc. (it seems that they have a fixed chance of being built in the first place regardless of max. peacetime bomber % ). Would also be cool to be able to have more than just interceptors and bombers, maybe attack fighters and scouts (to make use of M3+ and M5), with the ability to select proportions - this would increase harmony with stuff like CODEA. You can sort of work around this by having support carriers in your battlegroup that build different interceptors for different CODEA jobs.

I'll also note that if I try to use the DCS2 (or even ADS) fighter AI alongside Lucike's SRS the fighters are deployed in combat but do nothing (no order) until it's over and they are told to dock. I don't know if that is because I set homebase to "yes" in the t file for CODEA. Merging the drone building with CODEA carriers has been really nice though, just need to load up spare meatbags (pilots) in the hold for when fighters die.[/code]

With the advent of X4 it's probably a pipe dream that this will ever get updated but I'll be interested to see if and how this stuff makes its way into X4.

KruniacZio
Posts: 14
Joined: Sat, 2. Jan 16, 12:32
x3ap

Post by KruniacZio » Fri, 17. Aug 18, 19:20

My drones don't work at all. They get built, I set them to Active in ADS, I make sure that Attack and whatnot is disabled in the Drone Carrier menu, but as soon as I give them an order to launch, they get sucked right back into my TL.

I have an M3 that isn't a part of the drone group, and it launches and works fine with ADS.

ADS doesn't seem to count my drones as "owned", just "docked". No clue what that means or if that's the problem.

Any one have any insight into why this might be happening? Again, my drones will undock and TRY to attack, but within two seconds, they get "sucked" back into the TL and are docked again.

*Update*

I jumped into a sector with some reds. My drones (set to Active in ADS) immediately deployed and moved toward the enemy.

They got about 13 km away from me, started to engage the enemy, then TELEPORTED back to my TL, and started another attack run.

I moved toward the fight, watched my drones battle for a while, and they again TELEPORTED back to my TL and lauched another attack.

What is causing this teleporting behavior?

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

Post by Freenan » Fri, 17. Aug 18, 22:58

KruniacZio wrote:
What is causing this teleporting behavior?
Well i can imagine, that they´re reloading maybe?! That would make sense to me, However, I have not yet used the script myself, but I have in mind soon.

by the way: is this Script LU compatible?

KruniacZio
Posts: 14
Joined: Sat, 2. Jan 16, 12:32
x3ap

Post by KruniacZio » Sat, 18. Aug 18, 01:08

Can confirm after extensive testing that this mod barely works for me.

It produces "drones" just fine - random M4s fully geared at a credit cost.

It IGNORES my selection of what to produce, and keeps spamming random M4s.

With or without ADS, the drones will not attack any enemies, regardless of the situation. With Attack Enemies turned on, the drones simply sit in my TL and do nothing. When I give a direct attack order, they sit in my TL and do nothing. With ADS, they try to fly out of my TL, then automatically get teleported back in.

The Homebase setting also repeatedly switches from my TL to None, and I'm guessing this is why ADS isn't working with the drones.

Really is a shame - this mod is exactly what carrier/TL players need to avoid tedious micromanagement, but it's totally borked for now.

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”