[SCR/MOD] Complex Cleaner v3.20 / Modular Complexes

The place to discuss scripting and game modifications for X³: Reunion.

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

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

Post by biliskner25 » Sat, 3. Dec 11, 12:34

jumbled wrote:Could you please explain the actual math behind crunching mines? I use the MS Excel spreadsheet "Complex Calculator", which works wonders for me to figure out what and how many of everything I need to make a balanced complex, but fails after crunching because ore/silicon mines get crunched sometimes to S size and lose fractions of their output along the way.

I'm also discovering a lot of "fuzzy math" in here which goes far off from your original estimates of 1 to 2 % loss.
etc etc..

after some extensive math and review into Gazz's code (i'm not a programmer so excuse my mistakes please) it appears the newly created Ore/Silicon factories are assumed to be Yield 13.

Each factory S therefore produces 1 ore per 43 secs (or 2 per 86secs if you want to be really pedantic)

Therefore a yield 40 L ore mine.. producing 20 ore every 60 secs (1200 per hour) should be converted to a size 14 factory (1200/3600*43)

How gazz achieved this and helped to reduce fractions was to multiply Product per cycle by 10000 and then divide it by a number (263 in the original i think) to reach his target factory size..

However.. this number is far too large.. and ends up underestimating your factory size by anywhere from 5 to 21% (in the above example you'll only get a size 12 instead of 14 factory).. and it's horrible at small yield asteroids.. i've edited the portions so that they more closely reflect the yield of the original mine.. (and also added the ability to crunch nividium mines in ashley+xtm) This could possibly be a conflict with mods or one of the mods (Ashley's XXL or XTM) changed cycle times in some way?

Edited file available on request.

Changes made plugin.gz.CmpClean.crunch:
$Mine.Fraction.Nividium added
Nividium filtering removed
Code changes to make using in game scripter easier -_-

Increased multiplier to 100000 from 10000
Ore divisor changed to 2326 instead of 263 (average of 13% increase)
Silicon divisor changed to 582 instead of 66 (another 13% increase)
Terracorp Nividium mines added to crunch list.. divisor 19

Major changes below

Code: Select all

Line 70:
$useore = $Station->uses ware {Ore} as product
  $usesil = $Station->uses ware {Silicon Wafers} as product
  $usenv = $Station->uses ware {Nividium 15_2} as product
  if $usenv OR $useore OR $usesil 
    skip if $Station->get local variable: name='GZ.FACTORY.MODULE'
      $Station->set local variable: name='GZ.CC.REAL.MINE' value=[TRUE]
  end
   
Line 294:
if $Station->get local variable: name='GZ.CC.REAL.MINE'
  gosub Find.Station.Size.Mine

Find.Station.Size.Mine:
$Dummy1 = $Station->get number of products per cycle
$Dummy2 = $Station->get production cycle time: account for secondary resources=null
* = cycle time in sec, even if out of resources
$Dummy3 = 0 
 
if $Station->uses ware {Ore} as product
  $Dummy3 = 2326 
  $Factory.size = ( $Dummy1 * 100000 ) / $Dummy2 + $Mine.Fraction.Ore 
  $Dummy1 = ( $Factory.size / $Dummy3 ) * $Dummy3 
  $Mine.Fraction.Ore = $Factory.size - $Dummy1 
  $Factory.size = $Factory.size / $Dummy3 
   
else if $Station->uses ware {Silicon Wafers} as product
  $Dummy3 = 582 
  $Factory.size = ( $Dummy1 * 100000 ) / $Dummy2 + $Mine.Fraction.Silicon 
  $Dummy1 = ( $Factory.size / $Dummy3 ) * $Dummy3 
  $Mine.Fraction.Silicon = $Factory.size - $Dummy1 
  $Factory.size = $Factory.size / $Dummy3 
   
else if $Station->uses ware {Nividium 15_2} as product
  $Dummy3 = 19 
  $Factory.size = ( $Dummy1 * 100000 ) / $Dummy2 + $Mine.Fraction.Nividium 
  $Dummy1 = ( $Factory.size / $Dummy3 ) * $Dummy3 
  $Mine.Fraction.Nividium = $Factory.size - $Dummy1 
  $Factory.size = $Factory.size / $Dummy3 
end
endsub

Kimdino
Posts: 17
Joined: Fri, 7. Dec 12, 03:45

Post by Kimdino » Thu, 24. Jan 13, 12:05

Hi folks,

Are there any experts still monitoring this thread?

I have been trying to install Gazz's mod but am having problems. I am using ver 2.5 of X3R (LGP edition) with XTM 0.7.4 installed. After several attempts at installing the mod version of CC (as detailed below) I now have the script version installed and it works perfectly. All CC variants were d/led from http://www.hentschke-keramik.de/x3scripts.php3 as I assume this page holds the latest versions?

I have tried placing the cat & dat files in /opt/x3/mods/. On doing this mod appears in the 'Mods' selection dialogue selected from the games startup window. I click on '32' (as the correct version for my setup?) on starting the game, loading my latest save, resaving, closing down, restarting and loading the new latest save there is no sign of the 'commands->Custom' button in my ship menu. I have searched through the ship menus, all reports and options are as before CC was installed. The 'Mods' dialogue did already contain an entry 'its_arg_cp_mod_v1c', might this upset things?

I then removed 3?.?at from the mods directory and tried the fake patch method. A listing of '/opt/x3/' revealed that the directory contained 01.cat & 01.dat -> 11.cat & 11.dat. So I renamed a copy each of 32.cat & 32.dat to 12.cat & 12.dat respectively. Other than the business with the 'Mod' selection dialogue I repeated the above procedure. And had the same lack of result.

I have tried the above (with a few variations) several times with no luck. I have tried both the 'zip' & 'spk' versions'.

This is when I tried the script version and everything came up properly straight off.

One thought that I had involves 'What actually are the CAT & DAT files?'. Do they hold data for the X3 programme code or are they an extension to it? If they are executable binaries, then do they make OS specific calls as this would account for the problem. Has anyone successfully installed this mod on any OS other than MS-Windows?

The script version is very useful but I have a SuperComplex in the planning stage. I would MUCH rather fly below giant refrigerators than thread my way around a mass of asteroids and pipes. Thus I would really like to be able to use the 'crunch' function'. Is anyone able to help me get the mod version working, please?

Cheers, Kimdino

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Thu, 24. Jan 13, 16:49

Kimdino wrote:I have tried placing the cat & dat files in /opt/x3/mods/. On doing this mod appears in the 'Mods' selection dialogue selected from the games startup window. I click on '32' (as the correct version for my setup?) on starting the game, loading my latest save, resaving, closing down, restarting and loading the new latest save there is no sign of the 'commands->Custom' button in my ship menu.
Got a tractor beam?
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

Kimdino
Posts: 17
Joined: Fri, 7. Dec 12, 03:45

Post by Kimdino » Mon, 28. Jan 13, 10:34

Hi Gazz,

Glad to see you're still on the case. I know a few software companies who could take a lesson in LTS from you. :thumb_up:

I kept trying and it now works. As a 'Mod' btw. Not sure what I had done differently this time so can't say what was wrong before.

I carry a tractor beam as standard equipment on all ships >= M6. Who knows, I might accidentally cap a big ship that needs towing to safety. :o

For anyone else in a like position stumbling across this thread, Yes this mod IS compatible with the linux version of X3R.

Gazz: thanks for a good mod.

Figge04
Posts: 55
Joined: Wed, 18. Dec 13, 16:59
x4

Post by Figge04 » Sat, 11. Jan 14, 19:38

Heya, great mod, does wonders for my old machine in the fps department got a few questions I can't seem to figure,

- Mines
Would it be okay to crunch alot of small mines with low yield, and they would eventual make a okay output? or should I only use the usual 30 yield mines or above?

- Modules
is it possible to actual have 2 diffrent modules in 1 sector?
like 2 independent factorys.

cheers

Kimdino
Posts: 17
Joined: Fri, 7. Dec 12, 03:45

Post by Kimdino » Sat, 11. Jan 14, 21:13

Re. Mines
I believe it would. Beware of computer load though. There seems to be a practical limit on factories per sector dependent on the power of your computer. Beyond this the game seems to start crashing a lot when you are in sector.

Re. Modules
Yes. In fact it becomes necessary when building very large factory modules. The system is limited in distance that it can connect, the workaround is to build and then join separate modules.

Figge04
Posts: 55
Joined: Wed, 18. Dec 13, 16:59
x4

Post by Figge04 » Sun, 12. Jan 14, 08:41

- Mines
Umh. not sure you understood, but I gave it a try,
crunching all the small mines togther with the big ones, it gave a bigger yield,
I was afraid that puttling like a yield 3 ore mine would reduce the number of productcs or something like that, that the crunched mine would make :) (normaly you would never put a mine on a yield 3 cause it would cost more engergy cells that it would produce ore to sell)

But it just add more factories, so from now on im going to crunch all does yield 3 - 20 mines togther :D it really increases my fps alot


- Modules

Can't figure out how to make 2 separat modules, it just seem to make 1 what ever I do, I've tried to run the Ignore command on the first module but it dosnt seem to work on it

Return to “X³: Reunion - Scripts and Modding”