AI freighters supplying my factory loop:
My goal was to build a self-sustaining factory loop that did things on its own. Factory loops are like complexes. This means that I could produce products ONLY using player-stations as consumables. Each loop consists of atleast: Solar power plant, Silicon Mine, BoGas factory, Bofu factory, Crystal factory. In my case, I wanted a vegetarian-based loop, so I had to create a boron crystal factory that was for sale in kingdoms end. This loop configuration requires 8 trade runs. In my scripts, a single ship could only be given one trade run, and this rule still stands today. I haven't had the time to go back and add more runs. This means that you have to buy 8 ships to have a fully functioning basic factory loop - it will produce energy cells and you'll get full profits each time you sell them. You don't have to do anything as the ships will move the goods around as you ordered them to.
Locking down the sector and automatically reissuing pse orders:
After getting the scripts to function satisfactorily, I had to confront another problem - unknown enemy ships. It was much too slow to order each of my ships back to base, and then to re-issue the pse orders once the unknown ships were out of range or destroyed. So I added a lockdown command. This would essentially, in a script, automatically order all of my ships to the nearest non-hostile base. If you issue the lockdown order again, it'll remove the lockdown and the ships will be automatically reassigned their previous pse orders. This means that the lockdown command is a toggle and should only used when there're enemy ships in range - or not.
Automatic lockdowns via a Sector Administrator script:
After I had accrued a sizeable income, I made my second factory loop. This was where I bumped into another problem: how to watch two systems at once? Naturally, I also liked to do missions with my private m5. I simply couldn't stay on top of things - the unknown enemy ships would pop up sporadically and surprise me. I realized I needed an automatic test for this in each sector, and when this test condition was true, it would automatically lockdown the appropriate sector. Thus I set out to create Sector Administrators. You'd assign a sector administrator to a non-hostile base in the sector, and the SA would automatically issue the lockdown toggle dependent on whether there's an enemy threat or not. This took a while, but eventually it worked and I could do whatever I wanted in my m5. Furthermore, it allowed me to accelerate time without having to worry about issuing lockdown orders manually.
Cross-sector pse freighters:
After I had played a while, as naturally as the sun will rise, I found myself confronted by another problem. I wanted to be able to move sillicon wafers from one system to a system 2 sectors away where the new factory loop was being built. The problem is that my script was made for single-sector ships. So I had to embark on a quest to create a transport ship that can travel in more than one system. This took me a while, but eventually I got it working. However, I later found a bug where the ship would blow itself up at a gate. Again, after a bit of digging I managed to fix this and it seems to work. There're still limits in it. For example, it's possible that there'll be an enemy ship in the destination sector next to the gate that has NOT been seen by the sector administrator - so the cross-sector transport ship will not know about it because it only checks to see if there's a lockdown or not. This and other constraints I haven't got around to fixing because it takes a lot of time and I'm not up to it.
.................
All of these scripts have been combined into a mod I call the Player Station Exchange. It can be simpliified further to Pl Station Exchange. PSE is an acronym for Player Station Exchange.
These are the commands player-ships have available to them in the command console:
1. Ship->Trade->Pl Station Exchange: Execute Transport Route...
2. Additional Ship Commands->Pl Station Exchange: Assign Sector Administrator To Station...
3. Additional Ship Commands->Pl Station Exchange: Access PSE Command Network...
4. Additional Ship Commands->Pl Station Exchange: Sector Lockdown...
Ship->Trade->Pl Station Exchange: Execute Transport Route...
Code: Select all
This command will assign a ship to a trading route. The requirements are that it must have a player-station homebase, and that the supply station you set is also a player-station. It will also perform miscellaneous checks b4 confirming the command - for example, it'll make sure there's enough cargo room. It will change the name of the ship to reflect the orders - Ex: "12! s2 - 661 Energy Cells for TnG SiliconM 3". "s2" means the ship has a speed of 200-300m. This ship would be working for TnG SiliconM 3 (that's its homebase). It would be transporting 661 Energy Cells from a supplier station to TnG SiliconM 3. "12!" means that this is version 12 of the setroute.std script (this can be removed via a global variable, it's just used for developer purposes).
Arguments:
Supply Station - This is the station which will supply the homebase with a specific product.
Product - This is the product you want the ship to collect for its homebase.
Per Run Amount - This is the number of product you want the ship to deliver on each run. If you enter 0, it'll load as much as will fit in its cargo bay.
Code: Select all
This command allows you to hire and assing a SA. Only 1 Sector Administrator can be assigned per sector. They will automatically issue or disable lockdowns when necessary. You may move a sector administrator to a different station by reissuing this command. If the station the SA is located on is destroyed, the sector administrator is removed from duty.
Arguments:
Station - This is the station where you want the SA to conduct his or her operations. When SA's check for an enemy threat, they look look at all pse player stations and pse player ships to see if the enemy is within range.
Code: Select all
This command gains you access to PSE commands not listed on your ship command list. It uses a text interface via the "Incoming Commands..." routine. You select menu items by entering a number as the input. There're menues within menues that contain the commands. As yet, there's no quickmenu command or favorite command list - this would be a good extra. This was added to reduce the number of commands used by the standard ship command list - there's a limit of about 32 per category. It was primarily done to reduce the likliehood of a command conflict. Ideally, ALL of the commands would be accessed here, but it's a slow interface and unless you have a printout of the menues, it's a pain in the ****.
Arguments:
Argument Type - There're many options, but the most common is to select Number.
Argument Value - This will correspond to the argument type. If you selected a number, then you enter a number.
Code: Select all
This command locks a sector so that all player ships executing the pse transport command are ordered to dock at the nearest non-hostile base. If you re-issue it, ships that were previously docked or ordered to dock will resume their previous orders. (It essentially toggles the lockdown status of a sector.)
Arguments:
Sector - This is the sector which will have its lockdown status toggled.
PSE Command Network Menu(s):
.......... This is the order of the menues and commands that're showed when you use the Pl Station Exchange: Access PSE Command Network... command. Menu items are selected by entering a number when you use this command - instructions are given in "Incoming Message...". Each menu item is followed by its global nav id in paranthesis, which can be entered at any time to access that menu item. Menu items that're menues, not commands, will have "-->" and "..." attached to them. These aren't centered, but the actual menues shown in "Incoming Message..." are centered:
Main Menu:
1 --> Sector Administrator... (n.1)
2 --> Reports... (n.2)
3 --> Settings... (n.3)
Sector Administrator:
1 --> Change Threat Level List... (n.1.1)
2 Toggle Duty Status. (n.1.2)
3 Dismiss. (n.1.3)
Change Threat Level List:
1 Add Race To List. (n.1.1.1)
2 Remove Race From List. (n.1.1.2)
3 Unlisted Races, Current Threat Level: 4. (n.1.1.3)
4 Khaak, Current Threat Level: 2. (n.1.1.4)
5 Xenon, Current Threat Level: 2. (n.1.1.5)
Reports:
1 List Sector Administrators. (n.2.1)
2 List Locked Sectors. (n.2.2)
Settings:
1 Toggle Help Information, Status: ON/OFF. (n.3.1)
Sector Administrator->Change Threat Level List->Add Race To List...
Code: Select all
If you select a ship, this command will add the race associated with the ship to the threat level list with a default threat level of 4.
Arguments:
Ship - The owner race is the race you're going to add.
Code: Select all
If you enter the list number or the name of the race, it'll remove it from the threat level list.
Arguments:
Number or String - The number is the threat level list number. Alternatively, you can enter the name of the race as a string.
Code: Select all
This will show an input command menu. If you enter a number between 1 and 4, this will change the threat level to this new value. 1 is the highest threat level. 4 is the lowest.
Arguments:
Number - This is the threat level. Must be between 1 and 4.
Code: Select all
If you select a sector, this command will toggle the duty status of the SA for that sector. If the SA is currently active, then the SA will be off-duty. If the SA is off-duty, thne the SA will be on-duty.
Arguments:
Sector - This is the sector where the SA is stationed.
Code: Select all
If you select a sector, this command will dismiss a SA. This means you're "firing" the sector administrator. (They will be removed from employment.)
Arguments:
Sector - This is the sector where the SA is stationed.
Code: Select all
This lists all of the Sector Administrators you've assigned in the x2 universe. It tells you where they're located. It also lists their duty status.
Code: Select all
This lists all of the locked sectors in the x2 universe. It also lists how many ships are locked down in each sector - doesn't include cross-sector ships yet.
Code: Select all
This will enable or disable the accompanying help information that's underneath the menu items.
Testing:
I have tested it extensively - relatively speaking from my own perspective. I have 4 factory loops at this point, and 42 ships performing trade runs for them. Most of the ships are single-sector traders, but 2 of them are cross-sector (they work for a silicon mine). The cross-sector scripts are a bit more processor-intensive, but I haven't noticed any major problems.
.................
Future Thoughts:
Quality Control Specialist:
I also wanted to add this. Originally, I wanted the sector administrator to travel between stations and make checkups on your factories. The intent was to have the SA level up and to not only lock the sector when necessary, but also to improve factory efficiency as a result of quality control and oversight. Haven't got this far, nor have I given SA's a salary yet. I could easily justify a salary, but haven't had the interest.
Assign ship to PSE Sector Patrols:
I haven't got around to scripting them. Originally, I had planned on adding PSE Sector Patrols, but it would probably take a month to finish it - so it's something I'm not likely to ever do.
Assign ship to PSE Navcom Duty:
These ships would automatically position a satillite in the sector in a certain position. If the satillite is destroyed, it would automatically reperform the procedure, assuming it has a satillite in its cargohold. It's annoying to have to do this everytime the khaak destroy a satillite.
Assign ship to Cargopod Retreival:
Automatically retrieve cargo in the sector. This could probably be remedied by finding a script somewhere else online instead of doing it myself.
.................
Now, my question. Would anyone be interested to attaining these scripts?
If enough people are interested, I need to know where to put them. I have no experience in distributing mods - in fact, i've never made a mod for a game. I could use some advice. I know that x3 is very popular at this point, and I'm not likely to find any interest, but I had to try. I know that I might have found them usefull, but knowing me, I probably would have tried to code it myself because I hate figuring out other peoples work. But since I'm likely to move on to other things at some point, this might be your only chance to try them out. I know there're a lot of non-programmers out there who don't have the luxury that I do or others do, so there's got to be interest somewhere!
To sum it up... using the scripts is easy. You just copy the scripts into the /scripts folder and copy the template files into the /t folder. The scripts that run on a continual basis will update properly if a new version is made. It's really easy if you've done it b4. I haven't changed any of the data files. The only thing that is really CHANGED is the fact that the setup.vegetarian script will add a boron crystal factory to the boron shipyard in kingdom end. If your universe does not have the kingdom end sector, it will not work and you may not be able to feed your workforce a vegetarian diet - as vegetarian as the boron are anyway.
.................
Here's a list of the applicable pse scripts that're needed, organized by the date that I uploaded them. This is almost like a changelog history:
5/13/09
Code: Select all
15,282 02-20-09 7:38a pse.report.sctradmn.list.xml
24,809 01-16-09 11:07p misc.time.get.curdate.xml
25,807 05-13-09 8:49a pse.glbl.racethreatlvl.add.xml
18,732 05-10-09 5:05a pse.glbl.racethreatlvl.set.xml
18,988 02-20-09 7:44a pse.glbl.sctradmn.add.xml
11,633 02-20-09 8:41a pse.glbl.sctradmn.del.xml
8,536 02-20-09 7:47a pse.glbl.sctradmn.get.xml
5,673 01-22-09 3:13a pse.glbl.sctradmn.set.xml
8,663 05-07-09 9:25a pse.glbl.sys.menu.get.curr.xml
10,211 05-07-09 9:39a pse.glbl.sys.menu.get.xml
7,919 02-11-09 9:07a pse.lib.restart.xml
119,451 05-10-09 5:06a pse.loop.sctradmn.xml
63,038 04-24-09 1:53a pse.loop.transportroute.ext.xml
42,287 04-18-09 5:59a pse.loop.transportroute.xml
10,302 01-11-09 3:22a pse.misc.sort.insertion.d0.xml
12,968 01-11-09 3:38a pse.misc.sort.insertion.d1.xml
9,185 01-11-09 3:14a pse.misc.sort.insertion.xml
12,100 02-20-09 7:39a pse.report.lockdown.list.xml
13,260 01-16-09 11:22p misc.time.get.curdate.string.xml
52,527 02-20-09 1:44p pse.ship.cmd.lockdown.xml
18,609 04-23-09 8:47p pse.ship.cmd.setroute.std.pre.xml
70,518 04-24-09 1:36a pse.ship.cmd.setroute.std.xml
2,314 12-26-08 4:53p pse.ship.cmd.setroute.xml
141,100 05-13-09 12:36p pse.ship.cmd.sys.menu.xml
35,323 04-24-09 1:17a pse.ship.signal.lockdown.pre.xml
45,145 04-24-09 1:18a pse.ship.signal.lockdown.xml
20,043 02-10-09 12:41p pse.station.cmd.assign.admin.xml
7,119 01-30-09 12:46a pse.station.signal.killed.xml
102,869 05-13-09 11:56a setup.pse.xml
12,341 12-31-08 11:00p setup.vegetarian.xml
30 file(s) 946,752 bytes
Code: Select all
PSEMIS~1 XML 10,302 01-11-09 3:22a pse.misc.sort.insertion.d0.xml
24,809 01-16-09 11:07p misc.time.get.curdate.xml
18,988 02-20-09 7:44a pse.glbl.sctradmn.add.xml
11,633 02-20-09 8:41a pse.glbl.sctradmn.del.xml
8,536 02-20-09 7:47a pse.glbl.sctradmn.get.xml
5,673 01-22-09 3:13a pse.glbl.sctradmn.set.xml
8,653 01-28-09 4:12a pse.glbl.sys.menu.get.xml
7,919 02-11-09 9:07a pse.lib.restart.xml
88,141 02-20-09 8:44a pse.loop.sctradmn.xml
56,795 02-20-09 4:43p pse.loop.transportroute.ext.xml
42,287 02-16-09 5:14p pse.loop.transportroute.xml
13,260 01-16-09 11:22p misc.time.get.curdate.string.xml
12,968 01-11-09 3:38a pse.misc.sort.insertion.d1.xml
9,185 01-11-09 3:14a pse.misc.sort.insertion.xml
12,100 02-20-09 7:39a pse.report.lockdown.list.xml
15,282 02-20-09 7:38a pse.report.sctradmn.list.xml
52,527 02-20-09 1:44p pse.ship.cmd.lockdown.xml
18,063 02-20-09 4:38p pse.ship.cmd.setroute.std.pre.xml
64,309 02-20-09 11:24a pse.ship.cmd.setroute.std.xml
2,314 12-26-08 4:53p pse.ship.cmd.setroute.xml
64,839 01-31-09 5:03a pse.ship.cmd.sys.menu.xml
33,422 02-20-09 5:37p pse.ship.signal.lockdown.pre.xml
36,396 02-19-09 10:37a pse.ship.signal.lockdown.xml
20,043 02-10-09 12:41p pse.station.cmd.assign.admin.xml
7,119 01-30-09 12:46a pse.station.signal.killed.xml
52,795 02-21-09 12:04p setup.pse.xml
12,341 12-31-08 11:00p setup.vegetarian.xml
(27 file(s) 710,699 bytes)
.................
Here is a review of PSE features (or problems):
1. Ships are limited to a single trade run that they'll do indeffinately
3. Sector Administrators can automatically dock ships if there's a threat
4. Sector Administrators will automatically reissue commands after a threat is removed or cleared
5. Ships can perform trade-runs that're cross sector - more than one sector
6. Ships do not have jump functionality
7. Ships do not check for enemies on their own - need a SA (possible problem)
8. If a lockdown is issued, ships will not use gates, even if they're closer, they will instead dock at the nearest base (problem)
9. Enemy threats are based on the original x2 - there is no ability to change enemy threats at this point in time (like if you add a new race). This means the SA might not issue a lockdown if the enemy is not an original race. (problem) - FIXED
10. Sector Administrators do not check gates for enemy threats, yet. This means that cross-sector ships can potentially gate into a sector and get eaten up by nearby enemies - like khaak. (problem)
Thanks for visiting.