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

Post by HeartlesJosh » Fri, 13. Feb 15, 14:43

This is a lovely mod but I am having a few issues. One was that my bombers appeared to be built as Teladi Falcons but I went into the settings and changed those into Argon Quasars. However, they're still launching without any missiles equipped and only a couple PRGs. At the moment, I'm thinking I'll just change them to be Notuses (Notii? Notuseses? :?) like my Interceptors and go full on space superiority. Not sure how to fix it though I'm gonna scroll a few pages back to see what others might have said on the topic.

A minor bug, I started my game with the OTAS start from XRM, spawned and put myself in an Argon M1, added the carrier software and was able to produce fighters and bombers with a measly 30k in the bank. However, scrapping the fighters/bombers before any were produced seemed to refund me the money and then some, pushing me up to a cool mil or so for nothing. I think of it as a pretty mild bug because typically, by the time you can grab yourself a carrier, the expenses for these fighters are a drop in the ocean.

I also haven't figured out what's causing it, but I'm getting crashes when I enter Hatikvah's Faith (a couple jumps from Legend's Home, I believe it to be part of "Pirate Alley") and hang around for a bit. Not sure what is causing it, I have XRM, ADS, DCS and MARS. It's a great place to go to rack up credits on bounties being placed by the nearby Argon sectors but 5-10 minutes in the area with my fighters buzzing around like wasps and the game locks up to never recover. It could be an Out-Of-Memory error or one of the mods I have are fumbling. I suspect it to be Out-Of-Memory as it stops at about 2.7GB of RAM usage and never passes that once it's crashed. I have 8GB available and sit at about 70% in use by the time the game crashes.

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

Post by DrBullwinkle » Fri, 13. Feb 15, 16:05

Yeah, missiles and lasers need to be configurable, as the ships are. XRM changes too many things from the vanilla game.

It is easy to change in the code if you use the script editor (carrier task). The subroutines are well-marked so that it should be easy to spot the right place.

Next version will support more configuration options for all mods.

Refunds are a feature , Josh, not a bug. Drones are recycled when you turn off DCS2. You get a refund for their costs. In some cases, depending on discounts used during manufacture, the refund may be greater than the original cost. However, I doubt that you will be happy operating a carrier without a lot of credits. Carriers are for wealthy players. :)

Crashes to desktop are most often caused by sound card problems. See the stickies at the top of the Tech Support forum for that, and other, crash tips. Crashes are rarely script related, except when you *remove* a script that left a signal still hooked. If you suspect a script, then look for scripts that you have recently removed. Re-installing the offending script will usually stop the crash. You can Uninstall again when you start a new game.

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

Post by HeartlesJosh » Sat, 14. Feb 15, 03:35

Oh I know that refunds were a feature, I just wasn't sure if going from 30k to 1m from selling.... half of one engine of the first fighter was intended. The drones don't seem perturbed by a lack of credits anyway. They just drain my credits to nothing then build for free until the carrier is full and then any profits made after the production of a full load of fighters and bombers is drained back to 0 when I refund. Using MARS' Loot Goblins to clean up loot from the sector, transferring it into a freighter docked with my carrier then sending that freighter to a trading post and looking for some merchants to sell missiles to has worked well enough to not have my credits tank like that anymore though.

I will try and fiddle with the carrier task though would it be better to look at it from in-game (assuming you mean bw.dcs2.carrier.task)? A cursory look at it from Notepad++ is a wall of information. I assume I just need to find a part resembling "give drone bombers these missiles for use" and change to the appropriate missile, the tomahawk (only usable missile for M3Bs according to the front page post of XRM).

As for crashes, er, a sound card issue? I also don't get CTDs, just the game locking up to never recover and needing a kill with task manager. Never would have expected that to be the source of the problem. I don't hear any wacky noises or sounds cutting off, besides various efforts at comm chatter being cut off by newer comm chatter starting up "I'll spread your as- You've got the flying skills of a large asteroid! Of course, once the game actually crashes, it just loops the last few seconds of sound ad infinitum till I close it with task manager. There's no warning for it. Just be flying along letting turrets and fighters fire at leisure unitl the game seizes. A cursory look in the Support FAQ yielded nothing (it just tells me to go post?) though that thread about menu stuttering could be real handy for me. This is the first time I've been able to play on a non-toaster laptop and having endured 70 hours avoiding SPPs like the plague, the past couple days have been great though scrolling through menu options (especially with arrow keys or a controller) really tanks the framerate. Doesn't do it when I can't trade, so if I look at a military outpost remotely to check the wares they sell, I scroll just fine. If I'm docked and do the same thing, hrrrrghrghghhgrh. Ah, teething problems.


EDIT:
Looking at the script in-game, I'm gonna guess this messy weapon designation bit is the fault of XRM shuffling weapons around? EBCGs are PRGs, EMPCs are EMRs, PMAMLs are FBCs (Terran capital beam weapons...). Gonna sit here and fix that so that the right weapons are used. Hopefully that'll fix my Cutlasses using EM Repeaters instead of EM Plasma Cannons. The missiles all seem correct, though. Beyond that point, I can't comprehend what I'm reading with a quick look. Too many things referring to other things. Although, scrolling a little further down, there is mention of getting the prices of a couple missile types. I assume these would be the correct missiles for an M3B in vanilla, right? There's no mention of the tomahawk which is the only missile M3Bs can use. Should I copy-paste some of this code (is that even possible?) right under this lot, replace the copy-pasted missile with the tomahawk? Then I'd just need to find the "give bombers these missiles" bit deeper in the script and add the tomahawk in there, right? Job'sa good'un?

DOUBLE EDIT:
Bugger. I noticed my carrier's fighters were all deployed without a job and my carrier itself wasn't autopiloting to a new sector, autopilot appeared to have stopped sideways to the gate. Checked the sector map and found a couple hostile M/AM mines, thought it was weird, me flying a terran carrier, that terran mines would be hostile. Can't seem to target them, tell autopilot to atta-dead game. I guess I shouldn't autoattack mines. I hope my edits to the script saved...

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

Post by DrBullwinkle » Sat, 14. Feb 15, 06:25

HeartlesJosh wrote: (assuming you mean bw.dcs2.carrier.task)?
Yes.


HeartlesJosh wrote: A cursory look at it from Notepad++
You MUST use an editor made for X3 scripts, such as the in-game Script Editor. A normal text/xml editor will not work. If you want an external editor then use X-Studio Script Editor (I use v1.07). The human-readable portion of X3's script files is just "documentation". The real code is the array of numbers at the bottom.

Notepad++ is fine for other files in the game -- only scripts require a special editor.


HeartlesJosh wrote: I also don't get CTDs, just the game locking up [with looping sound]
That is a "lockup"; not a "crash". Lockups are usually caused by scripts. I am not aware of any lockups in any of my scripts.


HeartlesJosh wrote: if I look at a military outpost remotely to check the wares they sell, I scroll just fine. If I'm docked and do the same thing, hrrrrghrghghhgrh.
Sorry, I have no clue what would cause lag while docked. Perhaps an AL pileup? In the Script Editor, look at the global tasks. If you see many duplicates of the same script, then it may be caused by an incorrectly-made Artificial Life Plugin. The only way to fix it when it happens is to delete the duplicates manually. Be careful not to delete global tasks that are not duplicated.


HeartlesJosh wrote: I'm gonna guess this messy weapon designation bit is the fault of XRM shuffling weapons around?
Those are just the constants that you are looking at. They are definitions. They are in alphabetical order (mostly) and are quite tidy, thank you very much. ;)

The real work is farther down in the script; in the subroutines. For example, the subroutine for equipping drones is named so that you will spot it quickly.

It is easier to read scripts in XStudio because it color-codes the text for you. (Comments and subroutines stand out, for example).



Yes, you can add Tomahawks by copying another missile and changing the ware type.


HeartlesJosh wrote: I noticed my carrier's fighters were all deployed without a job
I believe that is a bug in the vanilla fight scripts; they simply quit if the enemy is too far away. So DCS2 detects the enemy with its extended-range sensors, launches the drones, then the drones forget what to do as soon as the vanilla fight scripts kick in. Solution is to reduce the DCS2 scanner range to ~30km, or command the ships yourself.


HeartlesJosh wrote: my carrier itself wasn't autopiloting to a new sector
Presumably you gave it a command to move to a new sector? DCS2 should not interfere with vanilla commands.

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

Post by HeartlesJosh » Sat, 14. Feb 15, 08:15

DrBullwinkle wrote:
HeartlesJosh wrote: A cursory look at it from Notepad++
You MUST use an editor made for X3 scripts, such as the in-game Script Editor. A normal text/xml editor will not work. If you want an external editor then use X-Studio Script Editor (I use v1.07). The human-readable portion of X3's script files is just "documentation". The real code is the array of numbers at the bottom.

Notepad++ is fine for other files in the game -- only scripts require a special editor.
I noticed that, I've been looking at it all in-game after being unable to read it in Notepad.

DrBullwinkle wrote:
HeartlesJosh wrote: I also don't get CTDs, just the game locking up [with looping sound]
That is a "lockup"; not a "crash". Lockups are usually caused by scripts. I am not aware of any lockups in any of my scripts.
I didn't think it would be in your scripts, the only thing I have DCS doing is making drones. ADS is handling the carrier warfare.
DrBullwinkle wrote:
HeartlesJosh wrote: if I look at a military outpost remotely to check the wares they sell, I scroll just fine. If I'm docked and do the same thing, hrrrrghrghghhgrh.
Sorry, I have no clue what would cause lag while docked. Perhaps an AL pileup? In the Script Editor, look at the global tasks. If you see many duplicates of the same script, then it may be caused by an incorrectly-made Artificial Life Plugin. The only way to fix it when it happens is to delete the duplicates manually. Be careful not to delete global tasks that are not duplicated.
The stutter fix thread seemed to have fixed it. Isolating X3 to an unused core has eliminated the stuttering from scrolling through menus.
DrBullwinkle wrote:
HeartlesJosh wrote: I'm gonna guess this messy weapon designation bit is the fault of XRM shuffling weapons around?
Those are just the constants that you are looking at. They are definitions. They are in alphabetical order (mostly) and are quite tidy, thank you very much. ;)
I was referring to how few of the weapons actually line up with the initials which, unless intentional, would mean the wrong weapons are used, right? If a drone was built and the weapon under $EMPC was used, the drone would be fitted with EMRs instead because that is what $EMPC said the weapon was. I fiddled with all that so the initials after the $ match the initials of the weapon. $massdriver points Mass Drivers instead of Plasma Burst Generators. $psp points to Point Singularity Projectors (PSP) instead of Phased Array Laser Cannons (PALC)
DrBullwinkle wrote: The real work is farther down in the script; in the subroutines. For example, the subroutine for equipping drones is named so that you will spot it quickly.

It is easier to read scripts in XStudio because it color-codes the text for you. (Comments and subroutines stand out, for example).
I found the part that equips drones around about line 1100 but I didn't see anything about who gets what missiles aside from a few lines about missile fire probability. If it's in the middle area, I'm still not sure what goes on there other than "it does stuff and that stuff makes drones work".
DrBullwinkle wrote:
HeartlesJosh wrote: I noticed my carrier's fighters were all deployed without a job
I believe that is a bug in the vanilla fight scripts; they simply quit if the enemy is too far away. So DCS2 detects the enemy with its extended-range sensors, launches the drones, then the drones forget what to do as soon as the vanilla fight scripts kick in. Solution is to reduce the DCS2 scanner range to ~30km, or command the ships yourself.
HeartlesJosh wrote: my carrier itself wasn't autopiloting to a new sector
Presumably you gave it a command to move to a new sector? DCS2 should not interfere with vanilla commands.
I was just rambling at this point. My ship was acting up, ADS seemed to have noticed a threat and deployed the fighters but had not given them a job or assigned them wings. It was just a sector full of "[ADS] Cutlass" and "[ADS] Quasar". Ship was just parked right next to the gate despite the order to fly through. I then crashed upon trying to autoattack mines so eh.... As said earlier, DCS is just building drones and isn't set to engage enemies, so I can't imagine it's messing with anything. My assumption is that ADS found the mines to be a threat, deployed fighters but then give orders for the fighters to attack the mines. As for my ship, I've no idea what it was doing. Let it run in SETA for a while and all it did was turn 90 degrees and stop. Maybe it was trying to avoid the mines like it does with stations and was stuck between the boundaries of the gate and mines. I've been playing and getting into the game for the past 30 hours, having dived off the deep end with XRM on the recommendation of a friend because being a peacekeeper was not particularly rewarding when a couple fighters matched the standing bounty of a capital. Let alone if Terran, in which case it's not rewarding at all. I then added Bounce, ADS and DCS because my early experience with carriers was most of my total worth in fighters smashing into the side of my little M7C in their attempts to dock.



On another DCS related note, I read on the front page that one can "improve production and costs by buying or building wares". I keep an array of weapons in my carrier's cargobay because MARs switches between them on the fly, will my drones run off with unused weapons? I'll have to keep an eye on my EMPCs to see if drones are nicking them and leaving me with only the starburst for the lighter turrets. My own carrier is the Weapons Depot so they ARE allowed to take things from the ship but my intention was so that they load up on missiles they find aboard from MARS' goblins looting them.

TL:DR
I need some help finding the part in the script that tells Interceptors to load light missiles and Bombers to viciously abuse ships with Tomahawks. And also to change the Bomber turret command to Attack Target as that is what allows all missile ships to fire their missiles in XRM. And if ADS changes turret commands on the M3Bs then I'll probably need to do it there as well.

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

Post by DrBullwinkle » Sat, 14. Feb 15, 09:37

HeartlesJosh wrote:EMRs instead [of] $EMPC ... Mass Drivers instead of Plasma Burst Generators. Point Singularity Projectors (PSP) instead of Phased Array Laser Cannons (PALC)
I see. If XRM changes the index numbers (positions) of lasers then, yes, that would cause the trouble that you describe. Your solution is correct.


HeartlesJosh wrote:I read on the front page that one can "improve production and costs by buying or building wares". ... will my drones run off with unused weapons [on my carrier]?
No. Not unless you assign the carrier as your Weapon Supply Depot.


HeartlesJosh wrote:I need some help finding the part in the script that tells Interceptors to load light missiles and Bombers to viciously abuse ships with Tomahawks.
Missile choice is done in the drone task. Check that the missiles are correct there as you did with lasers in the carrier task.


HeartlesJosh wrote:change the Bomber turret command to Attack Target
Turret commands are in the section titled "Set Turret Scripts" in sub DroneEquip: (around line 1180).

Change:

Code: Select all

if $drone.class == [M8]
$drone-> begin task $DE.i with script '!turret.killenemies.std' and priority 99: arg1=$DE.i arg2=null arg3=null arg4=null arg5=null


to:

Code: Select all

if $drone.class == [M8]
$drone-> begin task $DE.i with script '!turret.killenemies.std' and priority 99: arg1=$DE.i arg2=null arg3=null arg4=null arg5=null
else if $drone-> is of type {whatever your m3B is}
$drone-> begin task $DE.i with script '!turret.killenemies.std' and priority 99: arg1=$DE.i arg2=null arg3=null arg4=null arg5=null

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

Post by HeartlesJosh » Sat, 14. Feb 15, 13:13

DrBullwinkle wrote:
HeartlesJosh wrote:I read on the front page that one can "improve production and costs by buying or building wares". ... will my drones run off with unused weapons [on my carrier]?
No. Not unless you assign the carrier as your Weapon Supply Depot.
I mentioned in the post that I did have my carrier set as the depot hoping that it would mean supplying bombers with scavenged missiles when they're built. And my choice of interceptor did run off with the EMPCs but that's fine, MARS barely made use of them.
DrBullwinkle wrote:
HeartlesJosh wrote:I need some help finding the part in the script that tells Interceptors to load light missiles and Bombers to viciously abuse ships with Tomahawks.
Missile choice is done in the drone task. Check that the missiles are correct there as you did with lasers in the carrier task.
Is it? I can't seem to find the part that'd let the drones spawn correctly with a selection of missiles. The missiles are all correctly named in the in-game editor so it looks all good there. From what I can gather in this script, they're meant to have tomahawks and then an alternative missile? Making that assumption on the basis that tomahawks are specifically set apart from generic missiles. I also notice that a fair few missiles go unmentioned. Tau, Delta, Sigma, etc. These are probably XRM missiles. It looks as though this script turns missiles of a similar nature into something more appropriate for the drones, so I'd like a little help on finding the part that says which missiles are given to drones on construction. Then I can add the XRM missiles of similar yield to tomahawks to the list of transformable missiles and let drones use the right missiles for their jobs.

DrBullwinkle wrote:
HeartlesJosh wrote:change the Bomber turret command to Attack Target
Turret commands are in the section titled "Set Turret Scripts" in sub DroneEquip: (around line 1180).

Change:

Code: Select all

if $drone.class == [M8]
$drone-> begin task $DE.i with script '!turret.killenemies.std' and priority 99: arg1=$DE.i arg2=null arg3=null arg4=null arg5=null


to:

Code: Select all

if $drone.class == [M8]
$drone-> begin task $DE.i with script '!turret.killenemies.std' and priority 99: arg1=$DE.i arg2=null arg3=null arg4=null arg5=null
else if $drone-> is of type {whatever your m3B is}
$drone-> begin task $DE.i with script '!turret.killenemies.std' and priority 99: arg1=$DE.i arg2=null arg3=null arg4=null arg5=null
Helpful but unnecessary. ADS overrides turret commands when it deploys ships, but there are options to give ships a turret command other than Missile Defense. Changing it to Attack Enemies should allow M3Bs to fire missiles at ships but not stations.


EDIT:

Hey, the bit in the carrier task that outfits drones with lasers, it just loads them up with the first compatible laser, right? XRM racializes the weapons so pretty much all Commonwealth ships used as drones end up just getting a rack of PACs. Not the worst choice. They could all be fitted with IREs. Or Mass Drivers. I was thinking I'd go in, add the heaviest racial weapons to that list of constants you have at the top of the script and do the same at the bottom where drones are equipped, in order of weapon size. So a Boron drone will get Ion weapons. Split drones get PBEs. Kha'ak, Kyon Emitters. Aldrin Terran, Experimental EMPCs (spitfyres currently use no weapon). So on, so forth. If you're okay with it, I'll put the altered script up for the other dozen XRM users.

I'm also tempted to just not use ADS, I'm sure it's what's causing my game to lock up. I'll just keep it in for the marine hull repair utility.

DOUBLE EDIT:

Fiddled script... Racial weapons are a go. Any weapon smaller than, and including, large has been included. Should enable proper drone construction of anything up to an M6 I believe. Though if one should feel tempted to make their interceptors out of M2s then don't expect them to be fitted well. Now to just fix the missiles and we're golden.

TREEPL:
Gonna just make full use of DCS2 and use it for carrier warfare instead of ADS. That code you posted earlier for the changing of turret commands. Could I just change "whatever your M3B is" to "[M3]" like the one for M8s? XRM M3Bs are still classed as M3s in-game.

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

Post by DrBullwinkle » Sat, 14. Feb 15, 18:54

You don't need ADS just for marines. Use Marine Repairs and Training for that.

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

Post by HeartlesJosh » Sat, 14. Feb 15, 19:10

Perhaps. Though I do quite like ADS' command to "sell wares". Can just pick all the toot I'm accruing in the cargo hold, give it to the fighters and sell it all off to the highest bidder if a station takes the wares in question. Less clicks than going into each fighter, transferring some freight, then docking them, trying to sell stuff, then order them all back. Sell Wares > sell all tradable goods > sell all missiles > remove fighter drones from shopping list > Away with ye.

Still need some assistance on giving drones a proper load of missiles to use.

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

Post by DrBullwinkle » Sat, 14. Feb 15, 19:12

I use Mk3 Improvement to sell junk. Load up a TS and set it on its way.

Mk3 Improvement has improved "rest ware" selling, which means that it will sell junk in its cargo hold.

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).

Post Reply

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