[SCRIPT] IFTSOS - Install Factory to Station or Ship

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

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

MJALowe
Posts: 461
Joined: Fri, 5. Jan 07, 06:27
x3

[SCRIPT] IFTSOS - Install Factory to Station or Ship

Post by MJALowe » Thu, 3. May 07, 06:39

IFTSOS v2 BETA
note: this is a zip file, not an installer file, simply place all the files in the script folder and 448117.xml in the t folder
note2: most of what this does i know works...what i dont know if it is working are the banking functions and the script control
note3: there is a discription of what is different about halfway down the 6th page - to paraphrase...EVERYTHING, its menu driven on ship general commands slot 50, you can research (installing blueprints to IFTSOS, and in some cases to the pHQ - this includes ships factories weapons and more), you can generate reports on IFTSOS itself, there is a banking option, offers control of CAG CLS EST (not tested), and ofcoarse you can install factories and in some cases (where factories aren't available for that item) produce items in a maner similar to the way the pHQ originally did - same resource calculations and requirements, there is also the option of makeing a ship into a Mobile pHQ with this - untested but should work just fine, I've included in the menu system as many comments as i felt were needed, most of the options should be self explanatory

remember this version is a BETA please report all problems in this thread with as much details as possible, and if you went ahead and fixed the problem tell me how so i can incorporate it in future uploads

edit: and before you ask YES this "should" work with all mods and scripts (presuming they dont use command slot 50)
edit2: oh ya...read the post near the bottom of page 6, there are required scripts plus this requires the MD to be active(which requires the script editor to be active)


Original Thread:

Well, at long last I've completed this script and its ready to be tested by others (passes my tests)

IFTSOS v1

Anyways, what it is is an AL plugin that when a factory is in the cargo of your pHQ (only player owned pHQ btw) it will "function" ive taken out the error message for out of resources, but all other messages are enabled. It wont charge you money, atleast at this stage, though it really easy to enable that. all it will do is remove the resources required (if you have them) and create the product (if you have the space, if not it ques the production for later)

to stop this plugin without removing the factory from the stations cargo just disable the plugin in the game settings for artificial life

if a factory isnt present during the 1 min check it resets the production for that factory type (with loss of resources), evil me...if you have 5 adv. sat. factories, and take 1 away....reset, with loss of resources for 5 factories...basically it turns the product into unsuable garbage and dumps it in the station reactor (dispears)

anyways, being that i seem to be rambling, please post feedback here
to enable this plugin on M1 or TL just un comment the line in al.iftsos.eventhandler

this mod is only in english atm, and uses text file 8117, no other resources (didnt want to use any commands cause there arent really enough)

edit: oh yea, this only uses the default factories...
edit2: it would be appreciated if a pro scripter read through this and looked for any problems, im far from a pro though i do understand programing somewhat (duh)
edit3: also would be recommended to mod the hq.xml file for a larger cargo... 500,000 might not be enough for this

edit4: well, numerous testing has been done and everything seem to be working, only thing note worthy is that if you enable this on TLs, you should probably disable this on PHQs...some people have had a problem with this (there will be an update when i figure out how to fix that, the update will also remove mines from the list of factories)
Last edited by MJALowe on Sun, 31. Aug 08, 08:41, edited 8 times in total.

User avatar
Shovinus
Posts: 563
Joined: Sat, 9. Dec 06, 19:19
x3

Post by Shovinus » Fri, 4. May 07, 10:03

Wow thats f***ing clever, wont half cut down on loss of fps. I want to have a look at this.

EDIT: OMG I have just looked at his script, he has manually set the production values for 216 different station types, that aint just clever its mad genius, how on earth did you manage the patience to do that? Where did you get your figures from? 216 different settings? each containing 10 individual setings, that means he has done 2,160 individual, that is amazing.

MJALowe
Posts: 461
Joined: Fri, 5. Jan 07, 06:27
x3

Post by MJALowe » Sat, 5. May 07, 05:43

http://forum2.egosoft.com/viewtopic.php?t=165330

Here is where i got my figures from (the ones that i wasnt making up myself anyways...ive got it set up so they can have upto 20 each and 300 total...there are 6000 entries in that data array(it means i can add factories just by creating a new purchaseable item)

Rhelok
Posts: 23
Joined: Sat, 5. May 07, 06:38
x3ap

Post by Rhelok » Sat, 5. May 07, 06:46

Could you please release the TL/M1 version of al.iftsos? I removed the <comment></comment> tags, but after skimming the MSCI handbook the code still doesn't seem to make sense to me with only those tags removed. There's still a "*" symbol in the code and I'm pretty sure that is also not supposed to be there since it's used directly to show comments in C++ and I've used it in VB. I'm just asking for a clean version that I know will work, rather than me mucking with code I don't fully grasp. Thanks.

Heretic666
Posts: 463
Joined: Fri, 20. Feb 04, 17:30
x3tc

Post by Heretic666 » Sat, 5. May 07, 06:57

Well sounds like you did something wrong, there are no '[comment][/comment]' tags in the script editor.

Open up the script editor ingame, open the script 'al.iftsos', then on those 2 lines, press ',' (comma).

It will uncomment them and should then have the functionality you want ;)


[EDIT]The script you want is 'al.iftsos.eventhandler', and lines 027 and 028.
Station Freight Transporter
B-O'F: Enjoy whatever you are doing, if you decide to try real scripting one day..

MJALowe
Posts: 461
Joined: Fri, 5. Jan 07, 06:27
x3

Post by MJALowe » Sat, 5. May 07, 08:08

*nod* heretic got it right...and as a note...it is likly to cause ALOT of lag if its enabled for ships...atleast if you got alot of TL/M1 ...

i believe you can make it do a specific class of ship as well (for instance, only a fortress ship)...working on that option (reading through the options that might work)

Rhelok
Posts: 23
Joined: Sat, 5. May 07, 06:38
x3ap

Post by Rhelok » Sat, 5. May 07, 08:20

I know which script it is. I was opening it via a basic text editor. I'm not only asking for the altered file for myself but also for people that pop in this forum and bask in the glow of scripts and mods without having to know a programming language. I'm quite happy you made this a .spk without me or someone else having to ask for it. The script manager is something I will use for a long time to come.

If I hadn't just now been told to enter in a comma, I wouldn't have know where to begin in the script editor.

Personally, I don't use many TL's. TL's are what I think of when I'm thinking factories. 1 TL jumping around the universe laying factories. I don't think of an M1 in the factory laying scheme. That would cut down the lag considerably.

User avatar
Shovinus
Posts: 563
Joined: Sat, 9. Dec 06, 19:19
x3

Post by Shovinus » Sat, 5. May 07, 08:44

MJALowe, can I suggest something to you? I was wondering if it would be better if you could could add stations that were in the HQ to a list through an option, much like my reverse engineer script, thus allowing you greater space with the HQ, you could set a maximum amount of stations allowable, and you can make it possible to give the stations back to the HQ, the AL plugin would be used to stop or start production

MJALowe
Posts: 461
Joined: Fri, 5. Jan 07, 06:27
x3

Post by MJALowe » Sat, 5. May 07, 09:00

@ rhelok - um...if you "enable" TL then the TLs ARE the factory...

@shovinus
*scratches head* kinda confused
um...having to put the stations in the cargo hold of the HQ is how im limiting the number you can have...and they are in a list...its just the list is "updated" every minute based on whats in the HQs cargo - i did it this way so i wouldnt have to add a command option or two to the script...we are running out of un used commands

@all
to edit the cargo space of the HQ (in case you want more room for factories and stock)
a) open up 09.cat/dat with the X3 modmanager
b) extract types\hq.pck to a temporary space
c) edit the line in the new file (hq.xml) in notepad (should be line 4)

Code: Select all

<upgrade index="0" typename="SS_DOCK_P_HQ" storage="500000">
to read

Code: Select all

<upgrade index="0" typename="SS_DOCK_P_HQ" storage="5000000">
d) save the file, exit notepade, drag'n'drop the file back to the modmanager and tell it it put it in the types folder and overwrite

any NEW pHQs you build will now have 5million cargo instead of 500,000

User avatar
Shovinus
Posts: 563
Joined: Sat, 9. Dec 06, 19:19
x3

Post by Shovinus » Sat, 5. May 07, 09:03

Yeh, but if you remove just 1 station you have stored doesn't it lose the resources at the rest aswell? Ok I understand

MJALowe
Posts: 461
Joined: Fri, 5. Jan 07, 06:27
x3

Post by MJALowe » Sat, 5. May 07, 09:06

*nod* loss of resources intentional to stop people from "cheating" thier production using this method...oh, i got 2 pHQs, ill start a long production, remove the factories and place them in the other HQ, now im producing 2 long production...oh wait...i just lost all those resources and only one pHQ is producing...drat :twisted:

User avatar
KanineLupus
Posts: 591
Joined: Tue, 8. Mar 05, 07:47
x2

Post by KanineLupus » Sat, 5. May 07, 09:24

OK - maybe I'm going blonde from tooooo many long hours spent on my own project at the moment, but can I just confirm that this does what I think it does. By 'installing' station, is this basically enabling one to transfer a station to the PHQ in order to reverse-engineer and start producing ones-self??

Am I reading this right or have I completely misunderstood what this script package actually does??

User avatar
Shovinus
Posts: 563
Joined: Sat, 9. Dec 06, 19:19
x3

Post by Shovinus » Sat, 5. May 07, 09:34

No the script basically lets you use any stations that are in your HQ to act as though they were unpacked and working, it takes resources from the HQ and gives out the product.

MJALowe
Posts: 461
Joined: Fri, 5. Jan 07, 06:27
x3

Post by MJALowe » Sat, 5. May 07, 09:35

completly miss understood...

it makes it so that if you put a purchased factory in the cargo of the pHQ (rather than deploying it) it will start doing its factory job

meaning...if you put an argon adavanced statalite factory in the cargo of your pHQ and you have the resources need it will start producing advanced statalites, and consuming resources, at what i presume is the exact same rate for the actual factory as if it had been deployed

B-O'F
Posts: 724
Joined: Sat, 21. Feb 04, 02:15
x3tc

Post by B-O'F » Sat, 5. May 07, 16:52

Hi MJALowe,

I downloaded this script when it first came out, but have been unable to test it until now - been checking other scripts...

I had already increased the cargo capacity of my HQ to 2 billion (I like to store things, and leave a bit of spare room for future developments).

I think that Shovinus got it right in his first post - it is f'ing clever, and you must be either mad or inspired to put in all those entries..

I have added a Solar Plant XL (I already have a few thousand Crystals and Silicon Wafers), Cattle Ranch L, Cahoona Bakery L, and a Chip Plant. I waited until the stocks had built up before adding each station...

And it just works - no problems..

I wonder what a mine looks like inside a PHQ.......

I already use Gazz's complex Cleaner, and the Tubeless Complex Connectors in other sectors, but it may now be better to use HQ's with installed factories (an HQ is only ~195 million to buy) as it might give better frame rates, and it certainly can give much larger stock storage space - can then service NPCs with the required 20,000 Soja Beans instead of just 2,000 at a time... more profit.. Or a TL Hauler (larger cargo bay) to wander around supplying stations as needed - shame thay can't have funds.

I have had a quick look at the scripts, and produced the log to get the station details - that was a LOT of work you did..

Thank you, this could be just what we need, and it is clever.

Boron - Ol Fh'art
Public Service announcement

Growing old is not a disease - it is a delayed symptom of birth trauma.

User avatar
KanineLupus
Posts: 591
Joined: Tue, 8. Mar 05, 07:47
x2

Post by KanineLupus » Sat, 5. May 07, 19:09

OK, I get you now - actually might be just the sollution for tagging with my own project.

Am basically working one a massive Millitary Instalation, but am having to make it a 'pseudo-station' (listed through TShips) in order to add working turrets. Using along with this script package, one would be able to have much more of a meld btwn ship and station (minus BBS of course).

Absolutely awesome idea - well f*cking done :D

*ADD*

Just out of curiosity, are there any frame-rate issues running this off a big-ship as compared to installed in th HQ or similar?? OH, and does this only add factories or docks (EQ, Trading Stations etc) as well??

User avatar
Shovinus
Posts: 563
Joined: Sat, 9. Dec 06, 19:19
x3

Post by Shovinus » Sat, 5. May 07, 19:43

Only factories, and it doesn't add them so much as simulate their production tasks.

Lancefighter
Posts: 3144
Joined: Sun, 19. Dec 04, 02:41
x4

Post by Lancefighter » Sat, 5. May 07, 20:10

I wonder... could the a FSUP or whatever be used to supply such a TL/M1 with a factory in its cargo? If so... mobile ammo fab ftw :)

Rhelok
Posts: 23
Joined: Sat, 5. May 07, 06:38
x3ap

Post by Rhelok » Sat, 5. May 07, 21:06

In order to ease the lag if you did have lots of ships and pHQ's, would it be possible to stagger the searches? What I mean is have the script check every 3 minutes, but make it check the HQ the first minute, TL's the 2nd minute, and M1's at the third minute? If that isn't possible then do some basic math and have the checks on numbers that aren't divisible by each other and won't overlap often. 3, 5, 7, 11 Was there a reason behind making the check every minute?

MJALowe
Posts: 461
Joined: Fri, 5. Jan 07, 06:27
x3

Post by MJALowe » Sun, 6. May 07, 00:50

the more ships/stations you have the greater the lag will be...if there is any...not sure, cause atm it runs so fast that i dont noticing anything on my system...most you would get is what other scripts sometimes do....a little hiccup or some such every minute

what it does in "vanila" form is create an array of all the player owned pHQs, then it runs a loop on these checking for each factory, updating as nessecarry - and runing a production cycle afterwards

it could be changed to run at any reasonable interval, but longer intervals will have a down side...more robust production checks will be needed for running those fast producing factories (you know, the ones that produce every 60 seconds)...the time on those factories is why i made the descision to use 60 second intervals....

incidentaly, even when enabled the TLs and M1s shouldnt be running simultaneously...even if they are it shouldnt cause lag...but might...it takes about 80 seconds to run 1000 pHQs....8 seconds to run 100 (or less time i might add...original clock was at 10-80ms per pHQ...or per ship)


and ya, you can put a mine in a pHQ...it acts as a 25 yield mine, figured that was about right...thinking of taking mines out

ya...the TL/M1 would be a mobile facotry...make a custom ship with lots of cargo... :twisted:

i didnt enable TL/M1 by default simply because players probably have alot more of those than they do HQs, and because there arent many that would be trully useful...i also havent tested what it would do if the TL/M1 was docked....it might work right...it might not...

anyways, if you enable on TLs/M1s (or any other ship/station) just remember to keep the total number you have of those down...

how many TLs/M1s is a player likly to ever have? pHQs?
until the total number is up to about 100 i dont think the lag if any will be noticable (if it was it would be down right anoying...imagine every minute the whole game going...skip...skip...skip...back to normal)

edit: i dont think FSUP would work...you would have to be able to tell it what you want and how much...and have it on an infinite loop

Post Reply

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