[MOD] Complex Cleaner v4.09 / Modular Complexes (TC 3.2 / AP 1.1)

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
GlassDeviant
Posts: 291
Joined: Sun, 4. Nov 12, 12:06
x3tc

Post by GlassDeviant » Mon, 13. Apr 15, 14:39

What I do is drag a few asteroids in from other sectors (Asteroid Relocator), combine them into a single one of each type (Asteroid Fusion) (don't go over 300 or you really start losing yield big time), and then install a single silicon mine and one ore mine.

Whether you include them in the crunch or not is a matter of aesthetics, I don't mind the big asteroid blob sticking out of the Complex Cleaner cube, it's as if the complex was built around and incorporating part of the asteroid, very "high sci-fi" in my book.

You can't really fix the calculations because the game code itself for asteroids is a bit wonky, you'd have to change it in the source code and recompile the X3AP.EXE or X3TX.EXE file. At least that's what I understand from my reading. Just make sure the yield is bigger than you really need and sell off the excess.
bibo ergo sum

link87
Posts: 7
Joined: Sat, 28. Mar 15, 23:08

Post by link87 » Mon, 13. Apr 15, 16:20

It's not really possible to fix the mine problem. It's not actually a bug but rather an artifact of how mines work compared to other factory type. The first page actually links to http://forum.egosoft.com/viewtopic.php? ... 02#2470402 to explain this.

I worked out some calculations to figure out what the necessary asteroid yield was pre-crunch to get the effective amount post-crunch. Then I decided it wasn't worth it and just leave the mines uncrunched. I recommend using the asteroid fusion mod as well either way because it will either allow you to more easily create the excess yields or reduce the number of mines you need in the end. Do note that asteroid fusion suffers a similar problem. Although accurate amounts for the yield will be produced, you do effectively lose some possible production that two or more mines would produce on the separate asteroids.

I forgot to mention there actually is a bug with other factory types. See my first post on here for details. That is only a problem in X3:AP I think, and should only result in additional resources being used/created, not less.

Grape
Posts: 78
Joined: Wed, 15. May 13, 11:26
x3ap

Post by Grape » Mon, 13. Apr 15, 16:45

Thanks for the head's up with regard's to the calculations folk's, I had actually read the linked post (read skimmed) so it didn't really sink in, my bad. I do also use the Asteroid Fusion Mod and again it's one that goes into every game though not the Relocator as I don't mind doing the little tow jobs, adds something for me to get it inch perfect :D

A quick question though, will the ignore function still work on the mines that are attached to a crunched complex when I at a later stage wish to crunch more stations into the already existing Modules?

GlassDeviant
Posts: 291
Joined: Sun, 4. Nov 12, 12:06
x3tc

Post by GlassDeviant » Mon, 13. Apr 15, 17:19

The thing about Asteroid Relocator is that you can move them to another system. Otherwise you only need Asteroid Fusion and Complex Cleaner. I personally move the two largest Silicon asteroids from Herron's Nebula to Antigone Memorial to give me a final single Ore asteriod of yield 232 and Silicon asteroid of yield 272 once I run Asteroid Fusion. Then I use Grax Remove Rocks to vanish the leftover pebbles.

The ignore function should work fine, but I try to plan my complexes such that I never need to alter them once completed. For example my Antigone Memorial complex has 60+ stations/factories/mines merged into a box so large I has to put it way out beyond the range of a triplex scanner. Anything more that I need can be built in a different sector, probably far enough away as to not interfere with the CLS/CAG traders attached to the first complex.
bibo ergo sum

GlassDeviant
Posts: 291
Joined: Sun, 4. Nov 12, 12:06
x3tc

Post by GlassDeviant » Mon, 20. Apr 15, 10:12

I'm hoping this is not a problem with Complex Cleaner, I can't see how it would be since nobody else seems to be having this problem. Has anyone seen anything like this before?

http://forum.egosoft.com/viewtopic.php?t=379633
bibo ergo sum

link87
Posts: 7
Joined: Sat, 28. Mar 15, 23:08

Post by link87 » Sat, 25. Apr 15, 03:47

Does anyone have complex cleaner installed in X3:TC that can confirm for me what their production count and cycle time is for crunched silicon and ore mines? I believe I have found a bug in X3:AP that causes an additional loss of 3.9% for ore/ice mines and 2% for silicon mines. These are losses beyond the expected loss due to fractional production values in a mine and are a bug in the scripts. I want to see if these numbers hold true for X3:TC as well.

Selected
Posts: 4
Joined: Thu, 11. Feb 10, 19:12
xr

Post by Selected » Mon, 4. May 15, 13:18

This script and litcubes universe would be a dream come true. I just love this script..

CassCE
Posts: 29
Joined: Tue, 11. Mar 14, 15:20
x3ap

Post by CassCE » Mon, 23. Nov 15, 21:57

Gonna go ahead and also note the same bug others have mentioned: crunched 1x factories aren't calculated properly.

I crunched three chip plants, along with various other facilities, and ended up with a 2x chip plant that's operating appropriately, and a 1x plant that's operating at 5x.

Obviously I was quite fine with 4 free chip plants; thankfully I had spare overhead to run them. My Silicon Wafers are running a small deficit because of it, so I'm having to use CLS to truck in extras. It will make for a rude surprise for people making tightly-tuned complexes, though.

Edit: Also, I've run across mentions of a "dump" or "uncrunch" command, but haven't seen it in the actual documentation. I have another complex that will be receiving major additions, so what's the actual command and usage? I gather you're supposed to shut down and empty the complex, destroy the hub, then use whatever the command is on the module?

tangostorm
Posts: 1
Joined: Sat, 26. Dec 15, 01:38

Post by tangostorm » Sat, 26. Dec 15, 01:44

I am sorry to say that, but I have never seen such terrible "documentation" on how to use a mod. It is not clear at all. Just a mini tutorial would be enough. It a real pain the beginning with this mod

SirNukes
Posts: 546
Joined: Sat, 31. Mar 07, 23:44
x4

Post by SirNukes » Fri, 22. Jan 16, 06:38

I too ran into the overproducing 1x factory bug. After some digging into X3 modding, I narrowed down the problem. My apologies if someone already revealed this earlier in the thread; I only read the last few pages. In short, the Tfactories file in this mod needs updating/debugging for the current version of AP.

Interestingly, the two downloads in the top post (Zip for manual install, and the packed version for plugin manager) have different versions of Tfactories, and both are problematic in different ways. The 'manual install' version appears to have just copied the TC version of Tfactories into the AP addon folder, and does not have the new AP Terran factories. The plugin manager version, which I was using and experienced the 1x bug with, was updated for the newer AP factories but has a mistake.

Specifically, CC for TC inserts its template modules (1x to 200x) on lines 455-464 of Tfactories, following a series of placeholder entries on lines 440-454 to act as a buffer against changes. The current AP base Tfactories includes entries all the way up to 455. In the plugin manager download of CC, the new AP factories appears to have just been pasted over top of the TC version of Tfactories. However, there wasn't enough buffer space to support this, and the smallest CC module (1x) on line 455 was overwritten with a Terran large ice mine.

Whenever CC crunches factories and tries to add a new 1x module, it actually uses the large (5x) ice mine as the template, creating an overproducing module. You can see evidence of this in the naming of the 1x factories in game, which use MI (mine) where the the other CC modules use TE (tech). To complicate matters further, the faulty 1x factories are treated as 5x for subsequently generating larger modules; for example, three Medium factories will get crunched into one 5x and one faulty 1x, which get immediately re-crunched into one 10x.

If you are using a mod which changes Tfactories, incorporates the CC modules, and is up to date for AP, then you probably aren't seeing this bug. Otherwise, you will need to fix the Tfactories file and update your savegame. After some hours sorting things out, here is the procedure I ended up using on my game:

1. (Optional) Back up your savegame.

2. (Optional) Start AP, load the save. CC will end up deleting your hubs connected to CC modules and then recrunching automatically, so in systems that have module containers you will want to set Ignore on the factories you want to leave untouched. If such a factory is already connected to a hub with other crunched modules, you may need to self-destruct the hub to be able to select the factory to ignore. For example, if you have a crunched complex to which you added un-crunched mines (for aesthetic or practical reasons), you need to break the hub and set ignore on the mines, otherwise they will get auto-crunched later. To set ignore, you have to travel to the system, target the factory, and use the ignore command (the popup selection prompt appears to do nothing).

3. Resave and quit AP.

4. Extract Tfactrories.pck found in 03.cat in the addon/types folder using X3 Editor 2 or some similar program, to obtain a ~458 line text file (the editor may add a couple comment lines). You can see that its last line is for the Terran large ice mine, SS_FAC_TR_ICE_PL_1.

2. Open the Tfactories in the CC cat file with the text viewer, scroll to the bottom, copy the ~38 lines for the CC modules and placeholders (they all have GAZZ in their name), and paste them to the bottom of the Tfactories from step 1. For the plugin manager version, use Tfactories from /types and not addon/types, since the latter is missing CC factory entries. For the manual install version, Tfactories from either .cat should work.

3. At the top of your Tfactories, adjust the number of factories appropriately (eg. from 455 to 493), as described in the top post of this thread.

4. Save your new Tfactories back into the CC .cat file into addon/types, compressing it back into a .pck file.

5. Open setup.plugin.gz.CmpClean.xml in your addon/scripts folder using a text editor, scroll down to line 339, and change the version number from 409 to 410. This is required to trigger an in-game update, which will load in your fixed Tfactories correctly to the CC data tables stored in your save game. After conversion, you can change the version back to 409 if you like.

5. Load up AP and your save game and wait.


What to expect:

After a few seconds, a message should popup indicating CC was installed/updated successfully. This message will include the last line number in Tfactories where a CC module was found. Before the changes, this line was ~477. After changes, the line should be ~492.

Some seconds later, a series of crunch reports will appear for your systems with CC modules. The hubs attached to these modules will be gone. Resources that were in the hubs are distributed across the modules, money in the hubs is returned to the player account, and docked ships should have been undocked. Unfortunately, you will need to reconnect the modules and set your complexes back up.

Existing faulty 1x modules (produced at 5x) will have been replaced with the fixed 1x modules (produce at 1x). You may also notice that the 1x factories now use TE in the name instead of MI.

This will not fix any larger modules that were the result of crunching the faulty 1x factories, such at the three mediums to 10x example from earlier. However, any crunches on the new, fixed 1x factories should work correctly.


I know this thread is getting a little older, but hopefully those still playing will find this post helpful. Except for the bug, I love this mod.

Baldamundo
Posts: 99
Joined: Sat, 21. Jun 08, 18:46
x4

Post by Baldamundo » Sat, 9. Apr 16, 18:43

Is there any way of restoring the tubes?

Marco Nero
Posts: 236
Joined: Tue, 19. May 09, 09:25
x3

Post by Marco Nero » Fri, 7. Oct 16, 13:03

Hi all guys i have a little problem here. AP 3.1+XRM.

In the main forum Instructions, there is writed exactly: "for major mods, make a manual install: put "Script" and "T" folder into "Addon" folder, then put the .CAT/.DAT files to a lower number then XRM." Ok.

After downloaded the Complex Cleaner 4.09 Repacked for Plugin Manager for TC and AP 3.x , i opened the .txt instruction, and there is writed: "for major mods, make a manual install: put "Script" and "T" folder into "Addon" folder, and DO NOT put .CAT/.DAT files.


Which is the right thing to do with major mods like XRM?

I tried putting .CAT/.DAT files at lower number then XRM, but when i crunched them i see the Jonferco Showrooms disappearing from the map :) I eliminated the .cat/.dat files and used only script and t folder of the repacked version, but when i click on "crunch" i do not see any big complex, just a little squadre :) I think the installation has been corrupted by a wrong installation of the mod, so i'm asking how to procede in the right way :) Thankyou guys

Marco Nero
Posts: 236
Joined: Tue, 19. May 09, 09:25
x3

Post by Marco Nero » Fri, 7. Oct 16, 17:30

Ok i found solution i will post here so maybe can help someone else.

I downloaded "Complex Cleaner 4.09 Repacked for Plugin Manager for TC and AP 3.x" not repack for XRM couse the download link is no more available.

You HAVE to do a manual installation, if you install it with plugin manager it will place .CAT/.DAT files at the last position. I just tried it so i can sure you it's so.

Put "Script" and "T" folder in your "ADDON" folder (the folder of Albion Prelude), then, yes, you HAVE to install the .CAT/.DAT too and in the lowest number of XRM.

Watch out couse in the installation .txt there is writed "do not use .cat/.dat files for major mods, just install the scripts and t".

Enjoy you all :)

BlackArchon
Posts: 1016
Joined: Wed, 4. Feb 04, 17:37
xr

Post by BlackArchon » Fri, 7. Oct 16, 18:22

This is also described in the XRM FAQs, it's the third post in the XRM thread.

Marco Nero
Posts: 236
Joined: Tue, 19. May 09, 09:25
x3

Post by Marco Nero » Fri, 7. Oct 16, 23:59

You are absolutelly right, but when go to download the script/mod you can see that the XRM scipt/download is not more available for download and you have to download the tc+ap 3.x. inside of that there are 4 files: "scipt", "t" , .cat/.dat/ files and an instruction .txt that explain how to install. In this .txt there is writed "if you are using major mods like XRM do not install .CAT/.DAT files, just make a manual installation and do not put .CAT/.DAT.

For make CC on AP+XRM working again i had to install "Script" +"T" + .Cat/.Dat" files togheter and my problem was solved.

I do not know why other times (other gameplays, before i re-started the game) i had no problem simply installying manually "Script" and "T" without placing .CAT/DAT (like in the video with my 250 stations crunched without problems and withous .CAT/Da. but this time i had to install Cat/.Dat too, there is something i dont understand, I readed on this post "i think if you are running XRM you do not need .Cat/.Dat files" but i had problem this time, and i solved using .Cat/.Dat files,. Maybe i forget something but i did the same installation process :)

biliskner25
Posts: 11
Joined: Thu, 17. Apr 08, 00:57
x4

Post by biliskner25 » Wed, 3. May 17, 15:55

Grape wrote: I do dream that at some point this mod will be revisited and the calculations for Mine output get a going over - ah well :)
Although a very old post, I have actually done just this :wink:

I haven't been able to figure out what numbers Gazz used to come up with the formula for calculating mine sizes but I realised that the numbers used actually killed about 11% of silicon before even crunching. That means a L mine on a 40 yield, technically equal to a Fact 5 would always yield 2 x Fact 2.

Changing the calculations to be based off a 40 yield asteroid for ore and silicon fixed it nicely, you will still lose anything less than a size S station but you shouldn't lose it from calculation errors.

Edit: also adjusted Tfactories

bounty_hunter66
Posts: 550
Joined: Tue, 15. Aug 06, 13:36
x4

Post by bounty_hunter66 » Sat, 13. May 17, 06:46

Does this work for AP 3.2?

XIII8
Posts: 316
Joined: Sat, 24. Feb 07, 07:59
x3

Post by XIII8 » Fri, 14. Jul 17, 03:42

So, first of all note this: I got no frikkin clue about modding in X3, and this is my first and only attempt at doing something. If it corrupts your saves, blows your PC or tommorow you get a visit from stalin, mao and hitler, don't blame me!

If what I'm sharing isn't allowed, or I did it incorrectly, or the modder doesn't wish me to do that, please tell and it's gone.

------------------------------------------------------------------------------------------------------

Anyway, it annoyed me that this mod technically worked, but caused a whole load of issues. Bunch of factories like spectre/mam-ammo factories were missing in shipyards, no prototype mam factories in aldrin, that kind of stuff. The placeholder factories in yards were kinda annoying too.

It's not that the mod just overrode old factories, the tfactories list itself was just completely outdated and missed a whole bunch of stuff. Either there was some massive expansion of the T-list in 1.1, or it was just taken from TC. I imagine the former, considering we're talking about an experienced modder here.

So I think I fixed it. Tested it for a few hours and everything seemed fixed, products were back, and shipyard catalogues fine again. Basically, I grabbed the tfactories from Albion Prelude and compared it too the CC one. Now the vanilla file ends at number 455, and my CC file started at 456. So I basically just grabbed the vanilla list, copied the CC entries into it, and packaged it into the CC cat.

I thought I might share it as well; just make sure to create a copy of your save folder beforehand. If you don't know where to find them, check PCG wiki. Also, replacing that file will remove the complex center, you'll still keep the FACT's and their ressources though. If they start crashing against each other, make a crunch order one or two time while being in sector.


EDIT:Fixed a small visual bug, complex boxes were invisible. Incorrect numbering.
https://www.file-upload.net/download-12 ... 2.zip.html

HongoBLAST
Posts: 3
Joined: Tue, 24. Oct 17, 11:36

Post by HongoBLAST » Tue, 24. Oct 17, 11:55

SirNukes wrote:I too ran into the overproducing 1x factory bug. After some digging into X3 modding, I narrowed down the problem. My apologies if someone already revealed this earlier in the thread; I only read the last few pages. In short, the Tfactories file in this mod needs updating/debugging for the current version of AP.

Interestingly, the two downloads in the top post (Zip for manual install, and the packed version for plugin manager) have different versions of Tfactories, and both are problematic in different ways. The 'manual install' version appears to have just copied the TC version of Tfactories into the AP addon folder, and does not have the new AP Terran factories. The plugin manager version, which I was using and experienced the 1x bug with, was updated for the newer AP factories but has a mistake.

Specifically, CC for TC inserts its template modules (1x to 200x) on lines 455-464 of Tfactories, following a series of placeholder entries on lines 440-454 to act as a buffer against changes. The current AP base Tfactories includes entries all the way up to 455. In the plugin manager download of CC, the new AP factories appears to have just been pasted over top of the TC version of Tfactories. However, there wasn't enough buffer space to support this, and the smallest CC module (1x) on line 455 was overwritten with a Terran large ice mine.

Whenever CC crunches factories and tries to add a new 1x module, it actually uses the large (5x) ice mine as the template, creating an overproducing module. You can see evidence of this in the naming of the 1x factories in game, which use MI (mine) where the the other CC modules use TE (tech). To complicate matters further, the faulty 1x factories are treated as 5x for subsequently generating larger modules; for example, three Medium factories will get crunched into one 5x and one faulty 1x, which get immediately re-crunched into one 10x.

If you are using a mod which changes Tfactories, incorporates the CC modules, and is up to date for AP, then you probably aren't seeing this bug. Otherwise, you will need to fix the Tfactories file and update your savegame. After some hours sorting things out, here is the procedure I ended up using on my game:

1. (Optional) Back up your savegame.

2. (Optional) Start AP, load the save. CC will end up deleting your hubs connected to CC modules and then recrunching automatically, so in systems that have module containers you will want to set Ignore on the factories you want to leave untouched. If such a factory is already connected to a hub with other crunched modules, you may need to self-destruct the hub to be able to select the factory to ignore. For example, if you have a crunched complex to which you added un-crunched mines (for aesthetic or practical reasons), you need to break the hub and set ignore on the mines, otherwise they will get auto-crunched later. To set ignore, you have to travel to the system, target the factory, and use the ignore command (the popup selection prompt appears to do nothing).

3. Resave and quit AP.

4. Extract Tfactrories.pck found in 03.cat in the addon/types folder using X3 Editor 2 or some similar program, to obtain a ~458 line text file (the editor may add a couple comment lines). You can see that its last line is for the Terran large ice mine, SS_FAC_TR_ICE_PL_1.

2. Open the Tfactories in the CC cat file with the text viewer, scroll to the bottom, copy the ~38 lines for the CC modules and placeholders (they all have GAZZ in their name), and paste them to the bottom of the Tfactories from step 1. For the plugin manager version, use Tfactories from /types and not addon/types, since the latter is missing CC factory entries. For the manual install version, Tfactories from either .cat should work.

3. At the top of your Tfactories, adjust the number of factories appropriately (eg. from 455 to 493), as described in the top post of this thread.

4. Save your new Tfactories back into the CC .cat file into addon/types, compressing it back into a .pck file.

5. Open setup.plugin.gz.CmpClean.xml in your addon/scripts folder using a text editor, scroll down to line 339, and change the version number from 409 to 410. This is required to trigger an in-game update, which will load in your fixed Tfactories correctly to the CC data tables stored in your save game. After conversion, you can change the version back to 409 if you like.

5. Load up AP and your save game and wait.


What to expect:

After a few seconds, a message should popup indicating CC was installed/updated successfully. This message will include the last line number in Tfactories where a CC module was found. Before the changes, this line was ~477. After changes, the line should be ~492.

Some seconds later, a series of crunch reports will appear for your systems with CC modules. The hubs attached to these modules will be gone. Resources that were in the hubs are distributed across the modules, money in the hubs is returned to the player account, and docked ships should have been undocked. Unfortunately, you will need to reconnect the modules and set your complexes back up.

Existing faulty 1x modules (produced at 5x) will have been replaced with the fixed 1x modules (produce at 1x). You may also notice that the 1x factories now use TE in the name instead of MI.

This will not fix any larger modules that were the result of crunching the faulty 1x factories, such at the three mediums to 10x example from earlier. However, any crunches on the new, fixed 1x factories should work correctly.


I know this thread is getting a little older, but hopefully those still playing will find this post helpful. Except for the bug, I love this mod.
I had the same problem and although you explained it in a great way it cost me to make it work due to my lack of experience, but in the end I succeed!

In case someone has the same problem I uploaded the files with the corresponding fixes that you described previously: No more Ice Mine!

ztd74
Posts: 5
Joined: Wed, 23. Jul 14, 21:25
x3

Post by ztd74 » Sun, 21. Jan 18, 06:14

For XIII8

Hi. I use AP + XRM with complex cleaner. So where do I have to copy your .cat/.dat files? I replace the original Complex Cleaner .cat/.dat or add after them? In TC folder or AP (addon) folder? As lower numbers or higher numbers than the XRM ones? Please states it clearly. Thanks for helping sort this out.

For HongoBLAST

Hi. Again I use AP + XRM with complex cleaner. So where do I have to copy the files in your .zip? extract directly into addon (AP) folder maintaining directory structure (I mean same files in same directories overwriting existing versions)? What about original .cat/.dat files? Thanks you too for the help.[b][/b]

Post Reply

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