[MOD] Buyable Complexes - v1.1 26/10/2007 - buy production complexes from shipyards

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

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

Complex question :)

Excellent
8
67%
Good
4
33%
No opinion
0
No votes
Not my cup of tea
0
No votes
I don't like cake!
0
No votes
 
Total votes: 12

xxbluedragonxx
Posts: 375
Joined: Wed, 29. Aug 07, 13:08

[MOD] Buyable Complexes - v1.1 26/10/2007 - buy production complexes from shipyards

Post by xxbluedragonxx »

Download:
Vanilla: plugin.bluedragon.buyablecomplexes.spk
XTM: plugin.bluedragon.buyablecomplexesXTM.spk

Tech Note:
Text file used: 7494
Page ID used: 7494
Modified: types\Tfactories.txt
(Based off Ashley's 2.3 versions. Added my own entries to the end)

Description
An AL plugin/mod by xxBlueDragonxx

[ external image ]

Have you wanted to be able to buy those Production Complexes the other races have? Well now you can! This mod will add fully functional Production Complexes which you can buy from shipyards :)

Various such complexes can be purchased around the universe for a very reasonable price. There are savings up to 10% to be had plus the bonus of not having to buy a complex construction kit.

These Production Complexes operate just like the ones the other races use, minus the secondary resource requirement.

You can even link them up to your existing complexes or to each other if you so desire. Here's a Dumbfire Missile Production complex on the left.

[ external image ]

Now it's linked to my complex :)

[ external image ]


Usage
I've provided it as a .spk file and fakepatch so you simply install it with Cycrow's Installer.

You'll get an introduction message and then the Production Complexes will become available at shipyards around the universe.

Simply buy them and deploy like normal factories.

To Uninstall be sure to turn off Buyable Complexes from the Artificial Life Settings menu. This is available by pressing Escape ingame and under the Gameplay menu. Turn Buyable Complexes to Off and this will start to remove the Production Complexes from the shipyards.

Save your game and then you can go ahead and uninstall the script from Cycrow's installer.

Any Production Complexes you've already placed will not be removed though!


Notes
* Newly bought and deployed fabs can take up to around a minute or two to start operation (in addition to normal factory startup rules!)

* Notoriety requirements apply. You need to be able to buy the highest equivalent single factory. For example to buy a PAC Complex you should have enough notoriety to buy a Beta PAC Forge. Since it includes a BPAC and an APAC factory in one :)

* Prices are based from the Factory Complex Calculator prices. I took the price of the "component" fabs and deducted 10%. This discount is reasoned because the Production Complex uses less resources to construct. It is not two seperate factories but two (or three) combined so uses less materials. Also you save having to buy the construction kit you'd need if you make the same kind of complex with two seperate factories.

* Production Complexes vary in price because if the host race has a component factory for sale it makes sense they would want to use that as part of it. For example if you buy a Flak Complex from Argon shipyards they will charge you what it costs for an Argon AFLAK plus the cheapest BFLAK factory that is available from another race.


* There is one issue I am aware of: because I use existing Production Complexes as templates there must be at least one existing such complex, no matter which race owns it. If you destroy that very last IRE Production Complex in the universe then I've no way to know what products and resources should be used. You can still buy the IRE Production Complex but when you deploy it, it will not be populated with products/resources properly. If anyone can help with this problem I'd appreciate it, since I can't find where/if the game stores factory wares lists. If I can find some way around this then it won't be a problem to implement it so any "blank" complexes which arise from this rare problem can be correctly populated.

So long as at least one NPC complex exists though you won't hit that problem!

* Production Complexes will only work on one production line at a time and not two/three at the same time. They will swap as needed. This seems to be a game limitation I'm unsure if it can be overcome.

Please post problems and feedback :) Much appreciated!


Changelog
v1.1 - 27/10/2007
Added compatibility with Ashley's XXL Fabs v2.3
Added XTM version

v1.00 - 26/10/2007
Initial release
Last edited by xxbluedragonxx on Fri, 26. Oct 07, 14:43, edited 16 times in total.
repatomonor21
Posts: 163
Joined: Mon, 17. Sep 07, 18:27

Post by repatomonor21 »

At least something usefull.... Is it compatible with ashley's XXL fabs?
fud
Posts: 9837
Joined: Wed, 25. Jan 06, 14:26
x3

Post by fud »

IF I remember corerctly, it was tried a long, long time ago, but they never worked properly, ie, they only make one product at a time. That is of course, unless you found a way around that (that nobody else could).


The problem with the pre-packaged complexes is that they only make one product, then the other, as opposed to a multi-station complex that can make them simultaneously.
xxbluedragonxx
Posts: 375
Joined: Wed, 29. Aug 07, 13:08

Post by xxbluedragonxx »

I'm not sure for certain but it should be possible to merge the two. The actual mod part adds some entries to Tfactories.pck which I presume Ashley's fabs also changes. I made it so I'm only using entries I've added so in theory it should be possible to do a merge of the .cat files

I'm hoping Cycrow will release a Factory Installer soon and when that is ready then I can release the factory changes for that which should definitely get around the problem.

As explained to me by Cycrow the highest number .cat file is used so if this is installed after Ashley's and Ashley's has also changed the Tfactories.pck those changes will not be there in my one.

If people like I can see about doing a merge as it is but that would mean keeping an eye on Ashley's work in case of changes to that Tfactories file and doing a re-merge :)

I hope that makes some sense. It took me a while to figure out :lol:
Last edited by xxbluedragonxx on Fri, 26. Oct 07, 00:34, edited 1 time in total.
RaGodofTehSun
Posts: 417
Joined: Thu, 23. Dec 04, 03:02
x3

Post by RaGodofTehSun »

Wow man, awsome work!
xxbluedragonxx
Posts: 375
Joined: Wed, 29. Aug 07, 13:08

Post by xxbluedragonxx »

fud wrote:IF I remember corerctly, it was tried a long, long time ago, but they never worked properly, ie, they only make one product at a time. That is of course, unless you found a way around that (that nobody else could).


The problem with the pre-packaged complexes is that they only make one product, then the other, as opposed to a multi-station complex that can make them simultaneously.
Yeah didn't find a way around that. It's probably something hard coded since you can spawn the stations as "blanks" like other factories and add the products and resources (which is what I did). Come to think of it I'm going to try it with a regular factory by just adding another product to it and see if that has the same effect. If I'm right you can script change ownership of the already existing NPC fabs and see how they work. I will guess they work the same way :)

Addon: OK I did the test and it is the same. If you add multiple products to any factory it only works on one production line at a time. I had a look at the existing NPC complexes and they work the same way too so it seems to be a game limitation.
killuminati-ita
Posts: 259
Joined: Mon, 28. Aug 06, 15:50

Post by killuminati-ita »

Any known issue with XTM or is there anything we need to know for the usagewith this mod?

THX! :)
E POI IL PYTHON E' SGRAVO!! ^^
xxbluedragonxx
Posts: 375
Joined: Wed, 29. Aug 07, 13:08

Post by xxbluedragonxx »

killuminati-ita wrote:Any known issue with XTM or is there anything we need to know for the usagewith this mod?

THX! :)
I only have Vanilla plus some scripts so I don't know. It depends if XTM changes Tfactories. Basically same issue with any mod that changes Tfactories I believe. Someone who understands more technically tell me if I'm wrong :)
xxbluedragonxx
Posts: 375
Joined: Wed, 29. Aug 07, 13:08

Post by xxbluedragonxx »

I forgot to mention the production complex Food resource depends on where you buy it! Just like the normal NPC ones. So if you buy a fab from a Boron shipyard it will need BoFu. This is in keeping with the rest of the game and the existing fabs.
fud
Posts: 9837
Joined: Wed, 25. Jan 06, 14:26
x3

Post by fud »

XTM does in fact add new factories, so there's some merging work to be done if you want this in that package. Likewise, Ashley made her XXL fabs compatible with XTM, but you'd still have to merge this into that to use with XTM.
xxbluedragonxx
Posts: 375
Joined: Wed, 29. Aug 07, 13:08

Post by xxbluedragonxx »

Ok if Ashley's is already XTM compatible I'll have a look there and see about merging her Tfactories file into mine. That should make this compatible with both.
Last edited by xxbluedragonxx on Fri, 26. Oct 07, 04:46, edited 1 time in total.
Saint-Ashley
Posts: 1267
Joined: Sat, 3. Dec 05, 03:40
x4

Post by Saint-Ashley »

Their is a compatible version for XTM for my fabs and also one for DDRS and another for XFP. DDRS and XFP scripts just happen to work with the same retail scripts. ;)

Now my only question is how do the production complexes work? Only one ware at a time or how did you get around that? As I have attempted them in the past and used to have them in my mod. Until I got tired of people complaining of the bugs with them of course...

I have a new version of my fabs (version 2.5) somewhat ready however I am naught sure if i want to wait for X3 2.5 or release before hand...
xxbluedragonxx
Posts: 375
Joined: Wed, 29. Aug 07, 13:08

Post by xxbluedragonxx »

Hiya, I just copied the existing Tfactory entries to the end and renamed to make a copy of the original ones. Add to shipyards and then a watcher script to populate them with products and resources from matching NPC production complexes.

The way they work seems to be the same as the NPC ones - one product line at a time and it switches between the products I think possibly based on some logic. I've not yet looked at when it might switch between the products but I guess it has something to do with current stock levels.

There seems to be only one production line which is shared between the number of products.

If you script change ownership of any existing NPC production complex you can see they all work like this. If you also create a new factory from the editor (any one will do) set it to Player race owner, then add several products to it and watch what happens. Same thing!

So I am guessing only "real" complexes work with parallel production lines and any normal "single" factory can have multiple products but only has one production line active at a time.

This does give me an idea for a more advanced mod which would create real multiple production line buyable complexes but I need to investigate that some more.
xxbluedragonxx
Posts: 375
Joined: Wed, 29. Aug 07, 13:08

Post by xxbluedragonxx »

New update. This should now work fine with Ashley's XXL Fabs mod v2.3 + vanilla

I had Ashley's mod installed and this one and things seem to be working fine.


I will add the XTM compatible version later on today!
Saint-Ashley
Posts: 1267
Joined: Sat, 3. Dec 05, 03:40
x4

Post by Saint-Ashley »

xxbluedragonxx wrote:The way they work seems to be the same as the NPC ones - one product line at a time and it switches between the products I think possibly based on some logic.

If you script change ownership of any existing NPC production complex you can see they all work like this. If you also create a new factory from the editor (any one will do) set it to Player race owner, then add several products to it and watch what happens. Same thing!
This is what everyone beleives... However im quite sure the NPC production complex's would make a APAC and a BPAC at the same time. ;) (Hint : a APAC will generate faster then a BPAC, therefore the APAC will come first but the cycle times wont be seperated far enough to appear as if a complete cycle has passed to create a BPAC after an APAC is created.)

The reason why I removed them in the past was due to they work differently when spawned without the galaxy editor (requires new game) and if their under player control as well. (Even if a normal one is stolen from a race to player.)


What I beleive the hurdle is that the game engine upon spawning the race complex's throughout the galaxy are tied to hardcodeing that controls their production cycles, instead of useing the normal method for the cycles.
xxbluedragonxx
Posts: 375
Joined: Wed, 29. Aug 07, 13:08

Post by xxbluedragonxx »

I've added the XTM version, based from Ashley's XTM tfactory file so it should be compatible with her XTM version of XXL fabs as well.

I do not have XTM installed so not tested this but since it's only a merge of the tfactory file it should work fine, unless some additional script changes are needed for XTM compatibility. If so, someone let me know :)
xxbluedragonxx
Posts: 375
Joined: Wed, 29. Aug 07, 13:08

Post by xxbluedragonxx »

Saint-Ashley wrote:The reason why I removed them in the past was due to they work differently when spawned without the galaxy editor (requires new game) and if their under player control as well. (Even if a normal one is stolen from a race to player.)

What I beleive the hurdle is that the game engine upon spawning the race complex's throughout the galaxy are tied to hardcodeing that controls their production cycles, instead of useing the normal method for the cycles.
When I get a little time I'm going to log the cycle times of a NPC controlled production complex and see what the log shows. It would be very strange design decision if the behaviour changes just because the race is player race. I've not used the galaxy editor so that also seems very strange why a station would work differently if it is spawned using the galaxy editor or not. :?
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22408
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

xxbluedragonxx wrote:
fud wrote:IF I remember corerctly, it was tried a long, long time ago, but they never worked properly, ie, they only make one product at a time. That is of course, unless you found a way around that (that nobody else could).


The problem with the pre-packaged complexes is that they only make one product, then the other, as opposed to a multi-station complex that can make them simultaneously.
Yeah didn't find a way around that. It's probably something hard coded since you can spawn the stations as "blanks" like other factories and add the products and resources (which is what I did). Come to think of it I'm going to try it with a regular factory by just adding another product to it and see if that has the same effect. If I'm right you can script change ownership of the already existing NPC fabs and see how they work. I will guess they work the same way :)

Addon: OK I did the test and it is the same. If you add multiple products to any factory it only works on one production line at a time. I had a look at the existing NPC complexes and they work the same way too so it seems to be a game limitation.
its a hardcoded limitation, there is no way around it.

best u can do is use scripts to fake it, but not exactly the best solution as u loose the stats display in the factories
xxbluedragonxx
Posts: 375
Joined: Wed, 29. Aug 07, 13:08

Post by xxbluedragonxx »

Yes that is the solution. I have it almost working! Just got to fix the bugs as I posted in the Problem with Tasks post :D

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