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
HeartlesJosh
Posts: 17
Joined: Fri, 13. Feb 15, 14:23
x3ap

Post by HeartlesJosh » Sat, 14. Feb 15, 20:24

Might look into that mod.

Still need help with two things. One being the missiles, two being the drones unable to reacquire targets. I know they can do it, I've seen them switch targets. They just don't feel like it most the time. I have drone range set to 25km to keep it well inside scanner range but they just destroy their intended target then float around in space being turrets until the fight is over, then they dock as normal.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Sat, 14. Feb 15, 20:29

If the drones do not perform their attack commands when "close enough" to their targets, then it must be something else causing that behavior. You could experiment with the range. I will look into it for the next version. In the meantime, you can command them the usual way.

I'm not sure what to add to what I have already said about missiles. Are you using X-Studio so that you can see how the code works? It is extremely readable code... for someone who is accustomed to reading code. If you are not, then you need more practice. I don't have a magic wand that I can wave to give you that; sorry. :)

HeartlesJosh
Posts: 17
Joined: Fri, 13. Feb 15, 14:23
x3ap

Post by HeartlesJosh » Sat, 14. Feb 15, 21:20

So I can use DCS where drones have difficulty picking new targets after a kill, or I can use ADS which seems to cause abrupt crashes.


And I still can't find the part that loads up the drones with missiles. I've found the "Restock missiles from Weapons Depot" but that would imply that if I don't have a depot designated or the requisite missiles, then the drones will not resupply at their carrier. And the wording "Restock" also implies that this doesn't spawn drones with a bay of missiles to use. Further down I find the "AddMissile" section of the script but again, it all implies that it draws from the Depot or does nothing at all. I am not adept at reading XML, but here's what I understand of the AddMissile section.

Check drone to see if it's full of missiles. The missile in question has been defined earlier in the script, get the name from there. (Presumably, the missile is the first one found to be compatible with the drone). If running low on missiles and missile in question is Hammerheads, Wraiths or Phantoms, transform Firestorms or Tomahawks into missiles. Otherwise, use missile in question.

Have I understood that correctly? The next part deals in getting the typical price of the missile in question, presumably to charge the player for spawning enough in to resupply the drone.

But all this is moot, because the drones just aren't getting any missiles. All the way up there at the top, $tomahawk correctly refers to the tomahawk. The Quasar was my choice of bomber to change from the Falcon. It is defined in 8562-L044 on id312. There they are, stored aboard the Halcyon alongside Chimeras, my chosen interceptors. They can wield Tomahawks. They have a Large capacity and Tomahawks are Large missiles. I can't see the issue, myself. It looks like it should all work. But it doesn't.


EDIT:
Urgh. I can't work it out. If drone can use tomahawk, go to AddMissile. If drone has less than 3 tomahawks, check weapon depot for tomahawks and add tomahawks till 3 tomahawks. Get price of tomahawks, charge player for tomahawks. Refund player according to tomahawks used from weapon depot. I can't imagine that M3Bs having turrets is a problem. Would changing the designated bomber to an M8 work? Only problem I foresee there is a Daedalus with a carry capacity for 50 fighters carrying 50 M8s when it reasonably only carries 3 of them. Though if your script checks for that, then it should be fine. Build 3 missile corvettes and fill the hangar with fighters.

DOUBLE EDIT:
Changed designated drone to the Norn hoping that compatibility with a completely different missile (the Phantom) would fix it. Nope. Also, in your language file, the Norn is id 684, not 683 as is stated. 683 refers to the Oedipus, a Paranid M1+.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Sun, 15. Feb 15, 13:34

Are you using X-Studio?

HeartlesJosh
Posts: 17
Joined: Fri, 13. Feb 15, 14:23
x3ap

Post by HeartlesJosh » Sun, 15. Feb 15, 15:12

HeartlesJosh wrote: Fiddled script...
^ Yes.


Help me troubleshoot this? You know your own code better than I do. "AddMissile" looks all well and good. It should work, but it doesn't. Perhaps XRM's shuffling of things is making things point to the wrong places. Are there files I can provide that would help?
Inside that drone.task script, I can't see where things are pointed wrong. $tomahawk points to tomahawks. $phantom points to phantoms. $missile points to either of these two depending on which is usable by a bomber. AddMissile then loads three of these missiles onto a bomber. I tried removing that hard cap, that didn't work. I repointed the $missilenamehere constants at the top of the script to their appropriate missiles again from in-game, just in case something like what had happened with the AddWeapon script in carrier.task, missiles all being jumbled around.

Using the good old fashioned transfer freight command, I can give a bomber 20 phantoms (as they're now Norns) and the bomber will gladly use them. I don't fancy going through as many as 50 bombers after every fight with a Xenon capital and shoving 20 missiles in them. Then again, maybe I just haven't found the vanilla command that constantly resupplies a ship-class I choose each with a certain number of a ware I choose every time it docks to an individual ship I choose. If such a vanilla command even exists.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Mon, 16. Feb 15, 05:45

As I said earlier, drones don't launch with missiles (carrier task).

They are supplied in the drone task.

HeartlesJosh
Posts: 17
Joined: Fri, 13. Feb 15, 14:23
x3ap

Post by HeartlesJosh » Mon, 16. Feb 15, 08:31

There seems to be some fault in communication here.
I said that I had double checked all the missiles to make sure that something like what I had found earlier in the carrier task, with commonwealth bombers reduced to PBGs and ships like the Spitfyre being completely devoid of weapons due to discrepancies in the constants at the top of the carrier task pointing to the wrong weapons or ships being incompatible with weapons they could use in vanilla.. I was not looking for the equipping of missiles in the carrier task.

Everything in the AddMissile section of the drone task looks like it should work but it's not, so either I can't see the problem in AddMissile, or it's going wrong earlier in the script. You are familiar with your own scripting so I'm asking for your aid in troubleshooting because you will undoubtedly be able to find where the script is hanging faster than I.

I'm a guy with no XML coding experience beyond digging into the files of another game nary a month ago to find out the exact science of how an element in said game works to give that info to other players of the game and it took me a couple hours to get familiar enough with your code to feel confident in making even just a few relatively minor changes (racial weapons in the carrier task, as noted a few posts back). In fact, looking at the edits I did, I need to add a check for whether a drone is a Boron drone or not and if it is, fit Ion weapons, otherwise skip over the fitting of Ion weapons if it is not. The heavier Argon fighters introduced by XRM can fit Ion weapons and thus, get a full rack of them which was not my intention.

My completely newbie impression is that we're just not getting as far as the equipping of fighters so AddMissile is not being called and never comes into play. Even setting the homebase of the drones as their weapon depot and filling the cargo bay with the appropriate missiles, they're not being fitted regardless, which is why I get the feeling the script isn't getting as far as AddMissile. I don't know if there any tools that can monitor a script whenever it's used and see just how much of it is used but those would probably help greatly.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Mon, 16. Feb 15, 23:58

In the drone task, Torpedoes are only added to ships that have the $drone.is.bomber flag set.

That flag is set in the carrier task in sub DroneType:. Look at lines 990-1002.

It is possible that the flag $drone.is.bomber is not set correctly before line 990, which would cause selection of XRM types from the text file to not work.

Since nobody has reported that problem, including you... well, I don't know why are you not getting torpedoes in XRM.

The simple solution is to stop using XRM. ;)

In the future, I will allow more flexible arming options that should be compatible with any mod.

For now, you can supply the missiles yourself. Set the ship to pull missiles from the carrier. ('g' key).

* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If the $drone.is.bomber is the culprit, then MAYBE you might be able to work around it by adding your torpedoes to the "else" part of the "if $drone.is.bomber" statement in the drone task at around line 426.

MAYBE.
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


Beyond that, you are on your own. I don't play XRM and have no good way to test it. I do know that many XRM players use DCS2. That's all I know, really.

HeartlesJosh
Posts: 17
Joined: Fri, 13. Feb 15, 14:23
x3ap

Post by HeartlesJosh » Tue, 17. Feb 15, 20:20

That still didn't manage to alleviate the issue. I set the types for each of the racial M3Bs to no avail. Drones are just really allergic to missiles. So one last request for assistance, is it possible to comment out drone bomber production? Maybe change the assigned bomber types in the language file to a ship that doesn't exist?

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Tue, 17. Feb 15, 20:33

Change the bomber type to an interceptor (non-bomber).

HeartlesJosh
Posts: 17
Joined: Fri, 13. Feb 15, 14:23
x3ap

Post by HeartlesJosh » Tue, 17. Feb 15, 23:34

Mm, good enough. Was hoping for the ability to turn them off entirely instead of having a Split carrier with Split fighters and Terran "bombers" from playing an earlier save as Terrans.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Tue, 17. Feb 15, 23:58

You can assign the same ship type to both your custom interceptors and to your "bombers". You just won't get any real bombers, that's all.

HeartlesJosh
Posts: 17
Joined: Fri, 13. Feb 15, 14:23
x3ap

Post by HeartlesJosh » Wed, 18. Feb 15, 02:24

Yes, but if I wanted to play a different save, I would then have to go dig into the language file again and change the bomber appropriately otherwise I would have the fighters of another race being built. As I said, I would end up in scenarios such as flying a Split carrier with Split interceptors but Terran bombers unless I went and changed the designated bomber ship to also be a Split ship. And then go back in and change it once more if I wanted to hop back on the Terran save. Repeat for all races.

This is why I was asking for a way to turn off bomber production entirely and be left with only the interceptors I select in-game as the ships being built.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Wed, 18. Feb 15, 03:40

It takes less than a minute to change a t file.

Changes take place immediately, in-game.

HeartlesJosh
Posts: 17
Joined: Fri, 13. Feb 15, 14:23
x3ap

Post by HeartlesJosh » Wed, 18. Feb 15, 08:16

Is it not possible to disable bomber production?

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Wed, 18. Feb 15, 08:22

About line 931 in the carrier task, you can try adding:

$rnd = random value between 1 and 7

(Just before "if $rnd < 7 AND $Interceptor.Type")

That should force sub DroneType: to always build interceptors.

HeartlesJosh
Posts: 17
Joined: Fri, 13. Feb 15, 14:23
x3ap

Post by HeartlesJosh » Wed, 18. Feb 15, 10:03

Hasn't worked. Scrapped all the drones to rebuild a fresh carrier's worth and got about half and half bombers and interceptors regardless.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Wed, 18. Feb 15, 21:11

well, I have given you several viable options to choose from.

Pick one and be happy.

redagent
Posts: 41
Joined: Fri, 20. Feb 15, 05:29

Post by redagent » Thu, 26. Feb 15, 22:02

Just installed DSC2. After a lot of reading didn't catch few things. So please help me.
In options menu "ADS -Active/Not Active" - What does it mean?

Enable Producing drones, didn't touch anything else and get 49 drones on my Xenon J. It is ok. But I do not understand two things - why there is Bombers M3 (which is unknown object from the first post) and WHY there interceptors M4 with Mass Drivers and EBC - My carrier has no MD, MD-ammo, EBC and EBC-ammo. It is kind a test version of producing and I have to choose exact type of Interceptors? Or mayby it is a special division for enemy harassment?
I didn't touch Weapon Depot option.

One more question - when I gave an order "follow me" to the carrier with active Drone production and Engage enemy he remained standing on the spot. Is it intended?

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Thu, 26. Feb 15, 22:27

redagent wrote:In options menu "ADS -Active/Not Active" - What does it mean?
ADS = Anarkis Defense System.

CODEA and ADS are optional carrier-AI scripts. They are not required. However, if you use them, then there are options on the menu to make DCS2 compatible with them. Mostly the options turn off some DCS2 features that CODEA or ADS replace.

redagent wrote:why there is Bombers M3?
The default drone interceptors are light M4's. They could never kill a large ship. So DCS2 creates a few robust bombers for that job. If DCS2 detects an enemy capital ship nearby, then it will create more bombers and fewer interceptors.

After some time, the number of bombers will reduce back to "peacetime" numbers.


redagent wrote:WHY there interceptors M4 with Mass Drivers and EBC?
Most interceptors have very small laser generators. EBCG and MD use much less energy than other lasers, so they are preferred (IF the ship can mount them).

Ammunition is manufactured automatically by the DCS2 carrier onboard droids. It is supplied to the drones via prototype long-range transporter technology.

redagent wrote:when I gave an order "follow me" to the carrier with active Drone production and Engage enemy he remained standing on the spot. Is it intended?
Not intended.

The carrier may avoid enemies automatically because carriers are expensive and vulnerable; they should not normally get involved in combat. There is a setting in the menu to turn off that feature if you wish.

Other than avoiding enemies, the carrier should accept any order that you give it.

Post Reply

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